Traffic Camera Analysis
Computer vision over 42 public traffic cameras: every new frame is cached, vehicles are counted with YOLOX on an Intel iGPU, and each camera is compared against its own history to flag jams, closures and dead feeds.

01 / Problem
A camera still is not an alert
WSDOT, King County, SDOT and the Park Service publish public camera stills around Renton. They are tiny (335×244), update roughly every 70 seconds, and sometimes arrive half-uploaded, frozen or blank. A person can glance at one and say “that's a jam”. I wanted the site to say it first, for all 42 at once, on hardware I already own and for almost no running cost.
02 / Live demo
What the counter sees right now
Live demo · Renton-area traffic cameras
Loading cameras…
03 / Architecture
01 →
Conditional polling
All 42 cameras every 30 s with If-None-Match / If-Modified-Since. Most checks are 304s; half-uploaded JPEGs are refused without saving validators.
02 →
Frame store
Every new picture kept 24 h, stamped with the camera's own Last-Modified time, so playback and “taken at” are honest.
03 →
Vehicle detection
YOLOX-m on the full frame plus a 2×2 grid of overlapping, enlarged tiles to catch small, distant cars.
04 →
Stopped share
Vehicles whose box overlaps one in the previous frame ~70 s earlier. Moving traffic has left; in a jam it's still there.
05 →
Per-camera baselines
Compared with the same camera at the same hour and day type: stopped, heavy, light (possible closure), plus stale/offline/blank.
06 →
Incident caption
A flagged frame gets a one-line description from a small vision model: once at onset, every 20 min while it lasts, max 3.
04 / Benchmarks
Cost and performance
| Measure | Value |
|---|---|
| Inference per picture (Iris Xe iGPU, OpenVINO) | ~250 ms |
| Share of the iGPU used (shared with Frigate NVR) | ~9% |
| Fallback (ONNX Runtime on CPU) | 1 frame / camera / 5 min |
| Vision-model caption cost | ~$0.00002 / call |
| Daily caption cap | 150 calls · $0.25 |
| Frame history / hourly volume history | 24 h / 90 days |
05 / Engineering decisions
A density index, not a count
At 335×244, far cars are missed. The UI calls it vehicles in view and judges change against that camera's own history, which is robust to the bias.
Edge GPU with automatic fallback
Counting runs on another machine's iGPU over Tailscale. If it stops answering, the main server counts locally on CPU at a lower rate and retries after a minute.
Baselines only from the current model
Swapping detectors silently shifts counts. History from a previous model is never mixed into today's baseline.
Warm-up instead of false alarms
A new camera reports `warming` until it has ~300 frames for a rough baseline and two days for same-hour comparisons.
06 / Comparison
Build vs. buy
| This pipeline | Commercial camera analytics | |
|---|---|---|
| Running cost | ≤ $0.25/day + existing hardware | Per-camera monthly licences |
| Cameras | Any public JPEG feed | Usually vendor or partner cameras |
| Anomaly logic | Per-camera, per-hour baselines; tunable | Black box |
| Data ownership | 90 days of hourly volume, mine | Vendor-hosted |
| Accuracy | Density index on low-res stills | Typically higher on HD feeds |
07 / API
The service exposes a small CORS-open JSON API behind Cloudflare: /v1/cams, /v1/cams/{slug}/history, /v1/cams/{slug}/volume?days=7 and /v1/events, with immutable, year-long caching on individual frames. RntWx and the live demo above are both plain clients of it.