use case · basics Xenova/yolos-small · q8 WASM 16×16 patches + 100 [DET] tokens

Inside YOLOS-Small: 16×16 ViT Patches & 100 [DET] Tokens

Unlike CNN-backed detectors (DETR, RT-DETR, YOLO), YOLOS-Small never builds a convolutional feature pyramid and has no cross-attention decoder. Every 16×16 image patch enters one flat ViT-Small sequence alongside 100 learnable [DET] tokens — inspect the exact patch grid, token budget, threshold sweep, and duplicate-overlap behaviour live.

1 · Inspect the 16×16 patch grid & [DET] tokens

Loading a sample photo…

1 [CLS] – patches (16×16) 100 [DET] tokens – total tokens × 12 layers

Overlapping pairs highlighted by the audit appear in red.

2 · Patch-density math vs CNN / hybrid detectors

Because YOLOS uses a stride-16 patch embedding without hierarchical pooling, a 1280×854 image resized to 1199×800 enters all 12 layers at full 74×50 = 3,700 patch resolution, whereas CNN detectors downsample to stride-32 before global self-attention.

Architecture & token budget comparison (grounded in published checkpoints)
DetectorBackboneDecoderParamsq8 sizeInput / scaling

3 · Confidence threshold sweep (0.15 → 0.85)

Every row re-filters the cached 0.15-floor pass instantaneously. Click any threshold row to apply it.

Detections surviving each confidence threshold
ThresholdBoxesClassesMean scoreShare of candidates
Run the model to sweep.
Show the code — threshold sweep over cached [DET] token predictions

4 · Duplicate-overlap audit & greedy NMS inspection

YOLOS trains its 100 [DET] tokens with Hungarian bipartite matching (like DETR), pushing duplicate predictions toward the background class. In practice, lowering the threshold often surfaces residual same-class overlaps; this live audit separates true same-class duplicates from legitimate cross-class overlaps.

Boxes audited–
Same-class pairs–
Cross-class pairs–
Greedy NMS would drop–
Max same-class IoU–

Run the model to audit overlaps.

Overlapping pairs above the IoU cut-off
PairKindIoUScoresInspect
No pairs yet.
Show the code — same-class vs cross-class overlap audit with greedy NMS

5 · COCO small / medium / large object breakdown

Detections by COCO area bucket (small < 32², medium < 96², large ≥ 96² original px)
BucketCountMean scoreClasses
Run the model to break down sizes.
Show the code — COCO area-bucket aggregation