Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Principle:Tencent Ncnn Non Maximum Suppression

From Leeroopedia


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): IoU(A,B)=|AB||AB|=|AB||A|+|B||AB|

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

Related Pages

Implemented By

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment