object-detection · vision · WASM · ~22 MB
RT-DETR is DETR made fast enough for live video. It keeps the transformer, set-prediction idea — one forward pass, no anchor boxes — but redesigns the encoder and query selection so it emits one clean box per object directly, with no non-maximum-suppression pass. Same 80 COCO classes as classic DETR, a tenth of the model size, and quick enough to run your webcam. All on your device.
| Model | onnx-community/rtdetr_r18vd (ONNX of PekingU/rtdetr_r18vd) |
|---|---|
| Task / pipeline | object-detection |
| Architecture | ResNet-18 backbone + efficient hybrid encoder + IoU-aware query selection — an end-to-end, NMS-free real-time DETR |
| Classes | 80 COCO categories (person, car, dog, chair, bottle…) |
| Quantization | q8 (8-bit) ONNX |
| Backend | WebAssembly (runs anywhere; no WebGPU needed) |
| Download | ~22 MB, cached after first load |
| License | Apache-2.0 (Baidu RT-DETR) |
| Web APIs | WebAssembly, Web Workers, Canvas, getUserMedia, FileReader — all Baseline widely available |
Pick or drop an image and hit Detect — or start the webcam and watch it box the world in real time. RT-DETR runs once at a low floor; the score slider then filters the boxes live without re-running the model.
This device or context didn't grant camera access. The model still works on stills — pick a sample above and Detect.
RT-DETR's decoder emits a fixed set of predictions each pass — one per query — and, unlike anchor
detectors, it does not run a non-maximum-suppression pass to merge overlapping
boxes. The list below is what the model returned directly: label, softmax confidence, and box as
x, y, width, height in the image's own pixels, filtered only by your score slider.
| # | label | score | x | y | w | h |
|---|
Both find the same objects; the difference is speed and cleanliness. RT-DETR (ResNet-18, ~22 MB, NMS-free) is built for real time; the original DETR (ResNet-50, ~160 MB) is the accurate-but-heavy baseline. Run both on the current image and compare the real latencies measured on your device. Loading DETR downloads ~160 MB the first time.
Detection you can run every frame changes what you can build. RT-DETR turns "what's in this video, right now?" into a local function call — private, offline, free per call — without the accuracy tax of the tiny anchor detectors or the latency of a full DETR.
One image, labelled boxes, a threshold slider — feel real-time detection first-hand.
Live occupancy counter — track a chosen class over time with a running count and peak.
Full-frame webcam detector at the fastest loop your device sustains, with a still fallback.
RT-DETR boxes → tap one → SlimSAM returns its exact pixel mask.
Detection is a one-liner with Transformers.js — RT-DETR uses the same object-detection pipeline as DETR:
import { pipeline } from "@huggingface/transformers";
const detect = await pipeline(
"object-detection",
"onnx-community/rtdetr_r18vd",
{ dtype: "q8" }, // ~22 MB, cached after first load
);
const output = await detect(imageURL, { threshold: 0.5, percentage: false });
// → [{ label: "cat", score: 0.97, box: { xmin, ymin, xmax, ymax } }, …]
// NMS-free: the boxes are already de-duplicated — no suppression pass needed.
// percentage:false gives pixel coordinates; true gives 0–1 fractions
This page runs the model once at a low floor threshold (0.05) inside a Web Worker, caches every box, and filters the cached list as you drag the slider — so the slider is instant and never re-runs inference. The webcam loop grabs a frame, detects it, and only schedules the next after the last finishes, so it never piles up work or blocks the page.