-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Support for IOS Matching Metric. Introduced the mask_non_max_merge
function for handling non-maximum merging of masks
#1774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
- Added the `match_metric` parameter to the `with_nms` and `with_nmm` methods in the `Detections` class. - Modified the `box_non_max_suppression` and `box_non_max_merge` functions to support IOS calculation. - Introduced the `mask_non_max_merge` function for handling non-maximum merging of masks. - Updated the `box_iou_batch` and `mask_iou_batch` functions to support both IOU and IOS calculations. - Enhanced the `InferenceSlicer` class to accommodate the IOS matching metric. ### Notes - IOS (Intersection over Smaller): A variation of IOU that compares intersection over the smaller area, useful in scenarios with varying object sizes. - Refinements: Improved terminology for clarity and consistency, ensuring technical accuracy.
- Added the `match_metric` parameter to the `with_nms` and `with_nmm` methods in the `Detections` class. - Modified the `box_non_max_suppression` and `box_non_max_merge` functions to support IOS calculation. - Introduced the `mask_non_max_merge` function for handling non-maximum merging of masks. - Updated the `box_iou_batch` and `mask_iou_batch` functions to support both IOU and IOS calculations. - Enhanced the `InferenceSlicer` class to accommodate the IOS matching metric. Notes - IOS (Intersection over Smaller): A variation of IOU that compares intersection over the smaller area, useful in scenarios with varying object sizes. - Refinements: Improved terminology for clarity and consistency, ensuring technical accuracy.
Hi @SunHao-AI 👋🏻 thank you so much for your interest in supervision. This looks like a useful feature. I will try to get back to you with a PR review as soon as possible. |
暂时注释掉创建 GitHub App token 的步骤,可能是因为该步骤不再需要或出现了问题。这个修改不影响其他功能,只是减少了工作流中的一个步骤。
取消注释了 publish-docs.yml 文件中的 Create GitHub App token (mkdocs) 步骤。这个步骤现在将作为工作流程的一部分正常运行,不再被跳过。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @SunHao-AI, thanks for the PR!
I found a bug in your implementation, can you please apply the fix and add some unit tests?
- 移除 merge_inner_detections_objects 函数中的 threshold 和 match_metric 参数 - 新增 merge_inner_detections_objects_without_iou 函数,用于合并检测对象 - 优化非最大值抑制(NMM)的逻辑,提高效率 - 调整 mask_iou_batch 函数的实现,简化代码
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Description
When I used the yolo11-seg model for slice inference, I found that the merging did not work well. After analysis, it is found that for slender objects, its mask area only accounts for a small part, and the box area may be very large, so it is necessary to use mask for iou calculation.


When I implemented the mask_non_max_merge function, I found that the merge effect was still not satisfactory, as shown in the figure:
I found that the sahi library implemented the non-maximum merge algorithm of the IOS version, so I made changes to the code.
Type of change
Please delete options that are not relevant.
How has this change been tested, please provide a testcase or example of how you tested the change?
Any specific deployment considerations
For example, documentation changes, usability, usage/costs, secrets, etc.
Docs