Camera Scavenger Hunt
Ready for a race? I'll give you a list of 5 things to find. Grab them and show them to your camera. A real object detector watches and ticks them off. You have 90 seconds!
Nothing you show leaves your device.
Everything Robo sees right now
Each look gives a list of guesses with how sure the detector is. Faded ones are below your “sure enough” line.
How it works
Grab a frame
Many times a second, Robo takes one still picture from your camera, like a photo.
Chop and look
The picture is cut into lots of little squares. The detector studies them all together to find where things are.
Boxes + guesses
It sends out 100 “searchers”. Each one draws a box and guesses what is inside, with a “how sure” number. Most say “nothing here”.
Tick!
If the box for your item is sure enough, a few looks in a row, it counts. Then grab the next thing, fast!
What just happened?
- You used a pretrained model: someone trained it on more than 100,000 labelled photos, so it already knew what a cup looks like.
- It doesn't just say what is in the picture. It says where, with a box. That's called object detection.
- Every guess comes with a confidence number. The slider picks the line between “sure” and “maybe”, and moving it changes what counts.
- Waiting for a few looks in a row stops one lucky (or unlucky) frame from fooling the game.
- It only knows the 80 kinds of things it was trained on. Show it a pencil and it may call it a toothbrush, or nothing at all!
For grown-ups: what's really going on
Model: Xenova/yolos-tiny, the ONNX export of hustvl/yolos-tiny (6.5 M parameters), run with Transformers.js 3.8 through the object-detection pipeline. We load the full-precision fp32 weights (≈26 MB, cached by the browser after the first visit) on WebGPU when available, otherwise on WebAssembly; the 8-bit file is only 9.7 MB but loses noticeable accuracy on small objects.
- Architecture: YOLOS (“You Only Look at One Sequence”) is a plain DeiT-Tiny Vision Transformer: the image is cut into 16×16 patches, and 100 learnable detection tokens are appended. After the encoder each detection token goes through two small MLP heads: a softmax over 91 COCO ids + “no object”, and a box
(cx, cy, w, h)in 0–1. It is trained like DETR, with Hungarian matching between the 100 predictions and the ground-truth boxes, so there is no non-maximum suppression. - Pre-processing: we draw the (mirrored) webcam frame into a 4:3 canvas already at the target size; the YOLOS processor resizes it so the short side is
shortest_edgepx (512 in the model config; the “Speedy / Balanced / Sharp” buttons set 320 / 384 / 512 by changingimage_processor.sizeat runtime), rescales to 0–1 and normalises with ImageNet mean/std. Post-processing: softmax per token, drop “no object” and anything under 0.25, convert boxes to corner form in pixels. - Game logic (in
live-scavenger-core.js, unit-tested in Node): per target, the best score of that label in each frame; a frame counts if it is ≥ the slider threshold;Nconsecutive counting frames tick it. Points = base (50–200 by difficulty) + 50 × (combo − 1); a combo continues if the next find is within 12 s. Finishing early adds 10 points per second left. - Latency: the loop never overlaps inferences: it grabs a frame, awaits the model, draws, then yields one animation frame. The on-screen badge shows an exponential moving average of model latency and resulting detection FPS. Rough guide: WebGPU laptop ≈ 15–40 ms; WebAssembly ≈ 150–600 ms at 320–384 px. The video itself is redrawn at full frame rate, the boxes update at detection rate.
- Known failure modes: COCO has 80 classes (labelled with 91 ids), so out-of-vocabulary objects get mislabelled; small or partly hidden objects, motion blur, backlighting and screens showing pictures all hurt. Phones are often called “remote” and vice versa. This is a good moment to talk about dataset bias: COCO photos are mostly from Flickr, mostly from a few countries.
- Privacy: the camera stream is processed entirely on-device; no frames are uploaded. The camera turns off when you press Stop or leave the page. Sample photos are loaded from the Transformers.js docs dataset on Hugging Face.
Further reading: Fang et al., “You Only Look at One Sequence” (2021) · Carion et al., DETR (2020) · COCO dataset.