300 Questions, Not 8,400 Guesses: How a Detection Transformer Sees a Street RF-DETR 1.11, a detection transformer maintained at Roboflow, replaces the 8,400 candidate boxes and non-maximum suppression cleanup used by convolutional detectors such as YOLO11 with 300 learned queries that each answer once, the author writes. At 640 × 640 pixels, YOLO11's head predicts on three grids with strides of 8, 16 and 32 pixels, producing 80 × 80 + 40 × 40 + 20 × 20 = 8,400 candidate boxes per image, which NMS then deduplicates using a hand-tuned IoU threshold. The author, who maintains RF-DETR, cites accuracy and latency figures from the RF-DETR paper (arXiv 2511.09554) and the RF-DETR benchmarks page, measured on an NVIDIA T4 with TensorRT FP16 at batch size 1, and notes the original 2020 DETR required around 500 training epochs on COCO and struggled with small objects. Look at a photo of a street. It runs away from you toward the top right, with a zebra crossing in front. A cyclist rides across the crossing from left to right. One car approaches and stops before the crossing; another has already passed and drives away. A dog sits on the right pavement, waiting to cross. You did not consider ten thousand possible boxes and then throw most of them away. You just saw four things. Now try to build a network that answers the same way. How would you approach it? How would you design it? There are two common designs. A convolutional detector such as YOLO guesses everywhere and cleans up afterward. A detection transformer such as RF-DETR asks a fixed number of questions and is trained not to repeat itself. This post builds the second design from scratch, using this street in every picture. No prior transformer knowledge is assumed. Scope. RF-DETR 1.11 from PyPI https://pypi.org/project/rfdetr/ , object detection only. Segmentation and keypoints get their own post. Accuracy and latency numbers come from the RF-DETR paper https://arxiv.org/abs/2511.09554 and the RF-DETR benchmarks page https://rfdetr.roboflow.com/latest/learn/benchmarks/ , measured on an NVIDIA T4 with TensorRT https://developer.nvidia.com/tensorrt FP16 at batch size 1; I did not re-run them for this post. Disclosure: I maintain RF-DETR at Roboflow. A convolutional https://en.wikipedia.org/wiki/Convolutional neural network detector such as YOLO11 YOLO stands for “You Only Look Once” answers by guessing everywhere. At 640 × 640 pixels, its head predicts on three grids with strides of 8, 16, and 32 pixels. That is 80 × 80 + 40 × 40 + 20 × 20 = 8,400 candidate boxes for every image. Each grid cell says: if an object is centered near me, here is its box and class. Most cells on our street see road or buildings. A handful see the dog, and several neighboring cells see the same dog. So the photo produces a cluster of overlapping boxes around every object. Non-maximum suppression https://docs.pytorch.org/vision/main/generated/torchvision.ops.nms.html NMS then cleans up. It keeps the highest-scoring box and deletes every box that overlaps it by more than a threshold of intersection over union https://en.wikipedia.org/wiki/Jaccard index IoU, the overlap area divided by the combined area . Then it repeats. It works, and on a GPU it is fast. It also has three properties worth noticing. The IoU threshold is a hand-tuned knob, and its right value changes between datasets. Set it too low and two objects that genuinely overlap, such as two people walking side by side, can collapse into one box. Its runtime depends on how many candidates survive, so a crowded street takes longer than an empty one. Most importantly, it lives outside the network. The model is never trained to avoid duplicates; it is trained to produce them and rely on the cleanup. A detector that depends on NMS has learned to make a mess and trusts someone else to tidy it. In 2020, DETR https://arxiv.org/abs/2005.12872 DEtection TRansformer reframed detection as set prediction. The model holds a fixed set of learned queries. Each query asks: is there an object I am responsible for, and if so, where and what is it? Every query answers once. A query with nothing to report answers “no object”, written ∅. RF-DETR uses 300 queries. For our street, 4 of them should name the cyclist, the two cars, and the dog. The other 296 should say ∅. Pause and ponder. Several queries can see the dog. If only one of them is allowed to say “dog”, how does the second one know to stay quiet? It needs two things: a way to see what the other queries are doing, and a reason to back off. Keep this puzzle in mind. The decoder supplies the first half, and training supplies the second. The original DETR had two known problems. It needed around 500 training epochs on COCO https://cocodataset.org/ Common Objects in Context , and it struggled with small objects. Deformable DETR https://arxiv.org/abs/2010.04159 fixed both and reported 10 times fewer training epochs. RF-DETR inherits that fix and adds several more to reach real-time speed. Training time has kept falling since: between releases 1.9 and 1.11, one COCO epoch of RF-DETR Large went from 59 to 13 minutes on a single GPU, as I describe in Closing the training gap between DETR and YOLO https://levelup.gitconnected.com/closing-the-training-gap-between-detr-and-yolo-12-faster-from-engineering-not-a-new-architecture-1e91b84bf70e . NMS-free detection is no longer unique to transformers. YOLOv10 https://arxiv.org/abs/2405.14458 introduced a one-to-one training head that removes NMS, and Ultralytics YOLO26 https://docs.ultralytics.com/models/yolo26/ ships end-to-end without it. The idea that came from DETR has spread. What still separates the two families is what sits in front of the head, and that is where the rest of this post spends its time. Here is the whole path for RF-DETR Small. The six cards at the top are the six sections below; the animation brings each stage forward in turn. RF-DETR Small resizes the street to 512 × 512 pixels and cuts it into 16 × 16 pixel patches. That makes a 32 × 32 grid of 1,024 patches. Each patch is flattened into a vector called a token. From here on, the network never sees pixels again, only these 1,024 tokens and their positions. The four released sizes differ mainly in resolution and decoder depth. More tokens mean finer detail, which helps the small dog, at the cost of more compute. The tokens pass through a vision transformer https://en.wikipedia.org/wiki/Vision transformer ViT initialized from DINOv2 https://arxiv.org/abs/2304.07193 , a model Meta pretrained on a curated set of 142 million images with self-supervised learning https://en.wikipedia.org/wiki/Self-supervised learning , that is, without labels. Before RF-DETR has seen a single bounding box, its backbone already separates fur from metal and wheels from asphalt. The RF-DETR paper https://arxiv.org/abs/2511.09554 gives this as a reason RF-DETR adapts well to small or unusual datasets: it reports that initialising the backbone from DINOv2 “significantly improves detection accuracy on small datasets” https://arxiv.org/abs/2511.09554 . A transformer block uses attention