-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
Batched NMSBoxes #22851
Copy link
Copy link
Closed
Labels
Description
Descripe the feature and motivation
Batched NMS is especially useful for modern generic object detection postprocessing. Generic object detection has multiple classes, and it is important to perform NMS on each class to give correct results. However, the existing API for NMS in dnn module NMSBoxes does not support multiple classes.
We can use the same strategy from https://github.com/pytorch/vision/blob/main/torchvision/ops/boxes.py#L79-L95 to implement batched NMS:
- get the maximum coordinate from boxes,
- calculate the offset based on the maximum coordinate and class ids,
- add offsets to boxes,
- run
NMSBoxeswith boxes with offsets, scores and thresholds.
Although this is quite simple to implement for experienced developers, it would still be better if we put it in the dnn module as a new API (Let's call it BatchedNMSBoxes), and it can be done by calling a single API instead of wasting time implementing every time we need it.
Additional context
No response
Reactions are currently unavailable