Open hardikdava opened 11 months ago
@hardikdava I have yet to hear of this post-processing approach. Looks interesting. IS it better than NMS?
@SkalskiP yes, it is better in terms of accuracy but not in terms of speed. You can learn about it more and direct comparision on this blogpost: https://learnopencv.com/weighted-boxes-fusion/
@hardikdava Did you implement the WBF? Even if Supervision doesnt accept the feature, I could use it for my current project.
@hardikdava, if you have that implemented somewhere already, I'd love to see it. I know that you are probably super busy, but some of the open-source contributors may be able to add it to our codebase.
I found this: https://github.com/ZFTurbo/Weighted-Boxes-Fusion which does most of the work, we just need the detections coordinates to be as % instead of absolute pixel values. The packages also does NMS which would be a feature overlap with the existing Supervision code. I dont know how we should handle this:
My working version of Supervision has drifted quite a bit from the current release. Anything I do on my side would probably not be mergeable in main.
@AlainPilon Yes, I took reference from that project. @SkalskiP I can not contribute to open source projects due to my company policy. but I haven't started working on it. It was just an idea. But from my knowledge, it does not make effect on accuracy. The detection accuracy can boost by using SAHI.
I can not contribute to open-source projects due to my company policy.
Sad to hear it :/ We miss you!
We're reviving this one.
Some context for new contributors:
SkalskiP: The InferenceSlicer consists of two key elements: a moving window that slices the image into smaller, partially overlapping patches and a postprocessing algorithm that primarily addresses duplicate detections occurring at the edges of patches. You can see the InferenceSlicer in action in this how-to guide.
Currently, we use non-max suppression to filter out double detections, but there are other, often better, methods for handling these extra detections. NMS removes overlapping detections, but there are methods that involve merging them instead.
We are now looking at two methods to solve this:
We don't know which is better, how it compares to our current with_nms
solution, or what tradeoffs there would be. Perhaps we'd include both in the InferenceSlicer
, perhaps only one.
We'd like to test it with images, videos, also an example where no-detection is being merged with some-detections.
For testing with different models, some inspiration can be found here: https://supervision.roboflow.com/develop/how_to/detect_small_objects/
Code-wise, the implementation would result in a Detections.with_weighted_box_fusion
function inside supervision/detection/core.py
, similar to Detections.with_nms
we have now, and some files to test the results. If there's more complexity, we can add code in the detection/utils.py
.
@sharingan000, how does this sound? Would you have the time to help out? I'm here to help if needed :wink:
Search before asking
Description
Current object detection models removes overlapping boxes by
nms
which can reduce accuracy of the final results. It can be avoided byWeighted Box Fusion
which can accepts all the prediction whether from a single model or multiple models.Reference: Weighted Box Fusion Original Implementation: ensemble-boxes
Use case
Additional
Are you willing to submit a PR?