Topic · Mechanisms

Non-maximum suppression

Everything on this site about non-maximum suppression, in the order to read it: a page is listed after the pages it builds on. The figures below are the ones those pages use to explain it; each is live: move a slider and it recomputes.

In reading order

The figures these pages use

Pulled from the pages above. Move a slider and the figure recomputes, exactly as on its page.

From RT-DETR — DETRs Beat YOLOs, Encoder by Encoder

1 / 5 · v11 / 8 · whole pipeline
One pipeline, five versions. The RT-DETR pipeline for a 640 × 640 image, block by block. Step through the stages to see each block's output shape; switch the version to see which blocks it changes (rust outline), and switch to training to see the dashed parts that exist only while the model learns and are removed at inference.

From RT-DETR — DETRs Beat YOLOs, Encoder by Encoder › 1. What NMS Costs

1 / 6 · 0.0013 / 4 · 0.7
How many boxes NMS has to sort. Boxes that survive the confidence threshold on one image and go into NMS. The lower the threshold, the more boxes, the more time, and the better the AP. The last bar is RT-DETR, which has no NMS stage at all.

From RT-DETR — DETRs Beat YOLOs, Encoder by Encoder › 2. Why DETRs Were Slow

6406 / 6 · E
Where the encoder spends its attention. Counts: how many attention scores one encoder layer computes as the input grows, if every token of the three maps attended to every other, if each map attended only to itself, or if only the 20 × 20 map did (AIFI); the rust line is what a deformable encoder samples instead. These are counts, not time. Measured: the paper's own walk from variant A to E, AP against latency.

From RT-DETR — DETRs Beat YOLOs, Encoder by Encoder › 4. Query Selection: 300 Hands Up

0.80.752
Toy: picking the top K
060
A class score that knows how good its box is. The training target: for a matched position the loss is lowest when the class score p equals the IoU q of its box (left); for every other class it is pushed toward 0, gently near 0 (right). Picking the top K, a toy: made-up positions, picked by score; the more the score tracks the IoU, the more of the picks have good boxes.

From RT-DETR — DETRs Beat YOLOs, Encoder by Encoder › 5. The Decoder

(0.42, 0.5)0.30.362 / 3 · S4 · 40 × 400
Where one query reads. One query's box and the 32 points its 8 heads read on one map, where they start before training: four per head, from the centre out to the box's edge. Drag the centre, resize the box, switch the map: the points move with the box, and the shaded cells are the only ones this query reads. The layer slider refines the box toward a toy target with made-up offsets.

From RT-DETR — DETRs Beat YOLOs, Encoder by Encoder › 5. The Decoder

3 / 7 · R50, 6 layers6
Dropping decoder layers at inference. Train once with k decoder layers, then read the boxes after an earlier layer and skip the rest. Left: AP for the layer you stop at; right: latency. The scaled models are separate networks from the paper's appendix.

Tags that go with it

Object detection 2Efficient attention 1Loss functions 1Set prediction 1