At a glance
| Upstream model | Ultralytics/YOLO26 (Nano variant) |
|---|---|
| Loaded ONNX repo | onnx-community/yolo26n-ONNX |
| Pipeline task | object-detection (standard Transformers.js pipeline("object-detection")) |
| Architecture |
YOLO26 Nano wrapped via YolosForObjectDetection β NMS-free
logits [1, 300, 80] + pred_boxes [1, 300, 4] at 640Γ640
|
| Quantization & sizes |
q8: 2.85 MB (2,851,929 B, recommended WASM) Β·
fp16: 4.98 MB Β· fp32: 9.89 MB
|
| Runtime & backend | Shared lib/webai.js Transformers.js (3.7.5) Β· CPU WASM (no WebGPU required) |
| License | AGPL-3.0 (Copyleft β Ultralytics) |
| Web APIs | WebAssembly, Module Web Workers, Canvas 2D, Cache Storage, File API β Baseline Widely Available |
Run YOLO26 Nano locally
The worker runs one pass at a low floor (0.15) so adjusting the score
threshold or same-class IoU dedup filters cached boxes instantaneously without re-running
inference.
Prepare YOLO26 Nano (2.85 MB q8) above to detect COCO objects on-device.
See inside β 300-query NMS-free head & coordinate clamping
Because onnx-community/yolo26n-ONNX exports through
YolosForObjectDetection (logits [1, 300, 80],
pred_boxes [1, 300, 4]) with no NMS op and no 81st background class,
Transformers.js computes class-wise softmax across all 300 queries. Three browser-side
safeguards keep detections crisp: (1) clamping wide out-of-frame predictions like
xmin: -24 to [0, width] / [0, height], (2) same-class IoU dedup
(IoU > 0.65), and (3) a default 0.75 threshold + top-15 display
cap (sweep the slider down to 0.15 to inspect all raw queries).
| # | COCO Class | Score | Clamped Box (px) | Size (wΓh) | Clamped? |
|---|---|---|---|---|---|
| Run detection above to inspect every bounding box returned by YOLO26 Nano. | |||||
Show the code: Web Worker model loader (2.85 MB WASM q8)
Show the code: Out-of-bounds YolosForObjectDetection box clamping
Why YOLO26 Nano matters
At 2.85 MB quantized β smaller than a single uncompressed DSLR photo β YOLO26 Nano brings real-time 80-class COCO detection to every laptop and phone browser over plain WebAssembly without needing WebGPU or cloud vision APIs.
- Sub-3 MB cold start β caches once in Cache Storage and auto-initialises on return visits.
- Standard Transformers.js pipeline β runs directly via
pipeline("object-detection", "onnx-community/yolo26n-ONNX")with zero bespoke tensor decoders. - 5+ FPS CPU WASM β fast enough for client-side batch photo auditing, live zone-entry tripwires, and zero-click box seeding into EdgeTAM segmentation.
Use-case ladder
Basics
COCO 80-class detector with live threshold, IoU dedup slider, precision switcher, class filter chips, and clamped-box telemetry.
Practical
Batch photo inventory & COCO object counter across a 6-photo roll or multi-file upload with formula-safe CSV/JSON export.
Wild
Interactive zone-entry tripwire (drag rectangles or polygons on canvas) plus optional live CPU WASM webcam scanner.
Multi-model
Ultra-light instance segmentation: YOLO26 Nano (2.85 MB) detects boxes β Meta EdgeTAM decodes pixel-accurate masks.
How the API works
import { pipeline } from "https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.7.5";
const detector = await pipeline("object-detection", "onnx-community/yolo26n-ONNX", {
device: "wasm",
dtype: "q8", // 2.85 MB quantized ONNX (~151β218 ms CPU WASM)
});
const raw = await detector(image, { threshold: 0.35, percentage: false });
// Clamp coordinates to [0, width] / [0, height] and optionally dedup same-class IoU > 0.65.