📷 Retail / Logistics / Accessibility

Live Object Detection

Point your phone camera at anything — Workers AI detects objects at the edge, near-real-time. Two models, one endpoint: fast fixed-class detection or open-vocabulary 'find my red mug'.

The Problem

""We want visual inventory checks, shelf monitoring, or accessibility scene description — but running our own vision model means GPUs, a model server, and per-region latency.""

The Outcome

2

Workers AI vision models, zero GPU to provision. Fast mode (DETR) for fixed classes, Smart mode (Moondream) for open-vocabulary detection.

Live demo below
📷

Live Object Detection

Workers AI · edge vision

📱

Point your phone camera at objects — Workers AI detects them at the edge, near-real-time.

Productionising this

What changes when you ship this for real

Frame rate vs cost

The 1.2s poll interval balances responsiveness against Workers AI cost. Fast mode is cheap enough to poll faster (every 500-800ms); Smart mode should stay slower given the ~100x cost difference per call.

Camera permission UX

Browsers require HTTPS for getUserMedia() and show a permission prompt on first use. Always handle NotAllowedError gracefully — users deny camera access more often on unfamiliar sites.

Bandwidth

Each frame is compressed to JPEG at 0.7 quality, ~640×480 — typically 15-40KB per frame. At 1.2s intervals that is roughly 1-2 MB/minute of upload bandwidth, fine on WiFi and most mobile connections.

Rate limiting

Add a KV-backed rate limiter per session/IP before this ships publicly — a malicious client could hammer the endpoint at a much faster interval than the UI enforces.

Coordinate normalisation

DETR returns absolute pixel coordinates relative to the exact image size sent. Moondream may return normalised (0-1) or pixel coordinates depending on model version — this demo defensively detects which convention was returned rather than assuming one.

True video streaming

For genuinely continuous video analysis (not periodic snapshots), pair this with Cloudflare Stream or Realtime SFU to pipe a live feed to a server-side decoder — a materially bigger architecture than the client-side capture loop used here.

OCR JSON reliability

The model is prompted to return JSON but nothing enforces that contract — this demo parses defensively and falls back to the raw string with a parseError flag if JSON.parse() fails. More importantly: never trust extracted totals, amounts, or dates without human verification for anything transaction-critical (invoicing, payments, tax filings) — vision-language models can hallucinate digits that look plausible but are wrong.