object-detection β†’ image-classification WASM q8 Β· 45.46 MB + 88.26 MB 2 Web Workers Apache-2.0 + Apache-2.0

2-Stage Detect-then-Classify Inspector: RT-DETR R50vd β†’ ViT-B/16

Stage 1 β€” RT-DETR R50vd finds every COCO object in the photo in one NMS-free pass. Stage 2 β€” each object you pick is cropped and handed to a ViT-B/16 ImageNet classifier, which can say which dog, cat, car, or chair it is across 1,000 fine-grained classes. Both models run in separate Web Workers on your device; nothing is uploaded.

The two stages

Stage 1 Β· RT-DETR R50vd detector

onnx-community/rtdetr_r50vd Β· object-detection Β· WASM q8 Β· 45.46 MB Β· 80 COCO classes, 300 queries, no NMS.

Stage 2 Β· ViT-B/16 crop classifier

Xenova/vit-base-patch16-224 Β· image-classification Β· WASM q8 Β· 88.26 MB Β· 1,000 ImageNet classes at 224Γ—224.

Loading a sample photo…

Stage 1 β€” detect objects

Stage 1 latency–
Candidates β‰₯ 0.15–
Above threshold–
Queued crops0

Objects to classify

Stage 2 β€” classify each crop with ViT-B/16

Load both models and run Stage 1 first.

Crops classified–
Stage 2 total–
Consistent top-1–
In top-5 only–
Divergent–
No ImageNet class–

Stage 2 results appear here, one card per crop.

See inside β€” why chain a detector and a classifier?

RT-DETR's vocabulary is the 80 COCO categories: it can say dog or car and draw a tight box, but not beagle or cab. ImageNet-1k classifiers know 1,000 fine-grained classes but expect one centred subject per image. Cropping each RT-DETR box (with 8% padding) gives ViT exactly that, so the pair answers "what and where" in about 134 MB of on-device weights.

The agreement badge is a transparent heuristic, not a ground truth: it maps COCO classes to ImageNet index ranges (dogs 151–268, domestic cats 281–285, birds…) and whole-word keywords. ImageNet-1k has no "person" class, so for people ViT names clothing or context β€” that is reported as "no ImageNet class", never as an error. A divergent crop is worth a look: it is either a detector false positive or a crop dominated by its surroundings.

Show the code β€” COCO ↔ ImageNet crop agreement heuristic
Show the code β€” Stage 2 ViT crop classification in the Web Worker