object-detection · vision · WASM · ~9 MB
Every detector before it flooded you with thousands of overlapping boxes and leaned on a Non-Max-Suppression clean-up pass to dedupe them. YOLOv10 trains a one-to-one head that emits at most one box per object — already deduplicated — so a single forward pass returns a tidy set of detections with no NMS and lower latency. Drop an image and watch it box 80 everyday COCO classes, entirely on your device.
| Model | onnx-community/yolov10n (nano) |
|---|---|
| Task | object-detection — run via raw ONNX Runtime Web (see note below) |
| Runtime | onnxruntime-web 1.21 (transformers.js has no yolov10 class) |
| Architecture | YOLOv10-nano · consistent dual assignments · NMS-free one-to-one head |
| Output tensor | [1, 300, 6] — top-300 boxes, each x1,y1,x2,y2,score,class, score-sorted |
| Classes | 80 COCO categories (person, car, dog, chair, bottle…) |
| Quantization | fp32 ONNX (the int8 build needs a ConvInteger op the WASM backend lacks) |
| Backend | WebAssembly (runs anywhere; no WebGPU needed) |
| Download | ~9 MB, cached after first load — tiny for a detector |
| License | AGPL-3.0 (THU-MIG YOLOv10) — weights loaded from the canonical HF repo, unmodified |
| Web APIs | WebAssembly, Web Workers, OffscreenCanvas, Canvas — all Baseline widely available |
Pick or drop an image and hit Detect. YOLOv10 runs once at a low floor; the score slider then filters the (already NMS-free) boxes live without re-running the model.
This is the whole point of YOLOv10. A classic detector's raw output is a mess of near-duplicate
boxes that only becomes usable after an NMS pass throws most of them away. YOLOv10's one-to-one
head does that assignment during training, so the graph hands back a fixed
[1, 300, 6] tensor where each surviving row is already a distinct object — no
suppression step here in the browser. Below is the raw list above the current threshold: the label,
the score, and the box as x, y, width, height in the image's own pixels.
| # | label | score | x | y | w | h |
|---|
Dropping NMS isn't just academic tidiness — NMS is a serial, threshold-sensitive post-process that adds latency and can merge or drop the wrong boxes in crowded scenes. An end-to-end NMS-free head makes detection a single deterministic tensor op, which is exactly what you want when you're running it on a live camera on-device, at ~9 MB.
One image, labelled boxes, a threshold slider — feel NMS-free detection first-hand.
Inventory counter — tally objects by class from a photo, on-device.
Live webcam detector — real-time boxes with a per-frame latency readout.
YOLOv10 boxes → crop one → a ViT classifier names it more finely.
Because transformers.js has no yolov10 class, we run the ONNX graph directly and
hand-write the two steps a pipeline would normally own — letterbox in, decode the head out:
import * as ort from "onnxruntime-web";
const session = await ort.InferenceSession.create(modelBytes); // ~9 MB fp32 ONNX
// preprocess: resize longest edge → 640, pad to 640×640, /255 → Float32 [1,3,640,640]
const output = (await session.run({ images: input })).output0;
// output.dims === [1, 300, 6]; each row = [x1, y1, x2, y2, score, classId]
// already NMS-free & score-sorted — just scale the boxes back to the source image
This page runs the model once at a low floor (0.05) inside a Web Worker — letterboxing on an OffscreenCanvas and decoding the head there — caches every box, and filters the cached list as you drag the slider, so the slider is instant and never re-runs inference. The ONNX weights are fetched through Cache Storage, so a returning visit auto-initialises with no re-download.