Principle:Tencent Ncnn Non Maximum Suppression
| Knowledge Sources | |
|---|---|
| Domains | Computer_Vision, Object_Detection |
| Last Updated | 2026-02-09 00:00 GMT |
Overview
Algorithm for eliminating redundant overlapping detections by iteratively selecting the highest-confidence prediction and removing all other predictions with high spatial overlap.
Description
Non-Maximum Suppression (NMS) is a critical post-processing step in object detection pipelines. Detection networks produce many candidate bounding boxes with varying confidence scores, often with multiple detections for the same object. NMS filters these redundant detections by: (1) sorting candidates by confidence score in descending order, (2) selecting the highest-scoring detection, (3) computing Intersection over Union (IoU) between it and all remaining candidates, and (4) removing candidates whose IoU exceeds a threshold. This process repeats until no candidates remain.
NMS can be applied class-agnostically (all classes together) or per-class (separate suppression for each class category).
Usage
Use NMS as the final filtering step after bounding box decoding in any object detection pipeline. The IoU threshold (typically 0.45) controls how aggressively overlapping detections are suppressed.
Theoretical Basis
IoU (Intersection over Union):
NMS algorithm:
// Abstract NMS algorithm
sort(detections, by=confidence, descending)
picked = []
while detections not empty:
best = detections.pop_front()
picked.append(best)
detections.remove_if(iou(det, best) > nms_threshold)
return picked