object-detection Β· vision WASM q8 Β· 45.46 MB NMS-free Β· 300 queries Apache-2.0

RT-DETR R50vd β€” Live NMS-Free Object Detector & Diagnostics Lab

Baidu's Real-Time DEtection TRansformer with a ResNet-50-vd backbone finds the 80 COCO object classes in one end-to-end pass β€” no anchor boxes and no non-maximum suppression. Here it runs on your own device through Transformers.js (pipeline("object-detection"), CPU WASM, q8), so your photos never leave the browser.

At a glance

Upstream model PekingU/rtdetr_r50vd (Baidu RT-DETR, Zhao et al. 2023)
Browser ONNX repo onnx-community/rtdetr_r50vd β†’ onnx/model_quantized.onnx
Pipeline task object-detection (Transformers.js pipeline("object-detection", "onnx-community/rtdetr_r50vd"))
Architecture RTDetrForObjectDetection (rt_detr): ResNet-50-vd β†’ hybrid encoder (AIFI + CCFM) β†’ uncertainty-minimal query selection β†’ 6-layer decoder, 300 queries, 640Γ—640 input
Output Per query: 80 sigmoid class scores + one box; the pipeline keeps { label, score, box: { xmin, ymin, xmax, ymax } } above the threshold β€” no NMS
Quantization & size q8: 45.46 MB (fp16 87.98 MB Β· fp32 175.42 MB not used here)
Runtime & backend Shared lib/webai.js Transformers.js 3.7.5 Β· CPU WASM in a module Web Worker (no WebGPU needed)
Labels 80 COCO classes, using the checkpoint's own spellings (sofa, tvmonitor, diningtable, pottedplant, motorbike, aeroplane)
License Apache-2.0

Live object detector

One forward pass keeps every candidate scoring β‰₯ 0.15, so the confidence slider and class filters re-filter instantly without re-running the model. Click or Tab to any box to inspect it.

Loading a sample photo…

Select a box to see its exact coordinates.

Backend / dtype–
Inference–
Candidates β‰₯ 0.15–
Shown–
Classes–
Same-class dupes (IoU > 0.5)–
Non-finite outputs–
Per-class counts above the threshold
ClassGroupCountBest scoreMean score
Run the detector to fill this table.
Every box shown (pixel coordinates of the analysed frame)
#ClassScoreBox [x1, y1, x2, y2]Size
No detections yet.

See inside β€” why there is no NMS step

Classic detectors emit thousands of overlapping candidates and rely on non-maximum suppression (NMS) to delete duplicates afterwards. RT-DETR is trained with one-to-one Hungarian matching: each ground-truth object is assigned to exactly one of the 300 decoder queries, and every other query is pushed towards "no object". The model therefore learns to emit one box per object by itself. The Same-class dupes metric above re-checks that claim live: it counts same-label box pairs that overlap with IoU > 0.5 β€” the boxes an NMS pass would have deleted. Expect zero or a stray pair: on the bedroom sample at 0.40 one near-identical sofa pair (53% / 49%, IoU 0.99) survives, and lowering the threshold to 0.15 surfaces many more weak duplicates β€” the Basics rung's overlap audit explores exactly where that line sits.

The hybrid encoder applies self-attention only to the coarsest (stride-32) feature map (AIFI) and fuses scales with convolutions (CCFM), which is what makes a DETR fast enough for real time. Uncertainty-minimal query selection then picks the 300 encoder tokens whose classification and localisation agree best as the decoder's starting queries.

Show the code β€” epoch-guarded pipeline load in the Web Worker
Show the code β€” NMS-free duplicate-overlap audit

Why RT-DETR R50vd matters

Use-case ladder

How the API works

import { TRANSFORMERS_URL } from "/lib/webai.js"; // Transformers.js 3.7.5
const { pipeline } = await import(TRANSFORMERS_URL);

const detector = await pipeline("object-detection", "onnx-community/rtdetr_r50vd", {
  dtype: "q8",    // onnx/model_quantized.onnx, 45.46 MB
  device: "wasm", // CPU WebAssembly, inside a Web Worker
});

const boxes = await detector(image, { threshold: 0.15, percentage: false });
// β†’ [{ label: "chair", score: 0.54, box: { xmin, ymin, xmax, ymax } }, …] β€” no NMS required

References