All work
Applied AILive2026

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.

Traffic Camera Analysis screenshot

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

rntwx.com/cameras

Loading cameras…

03 / Architecture

  1. 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.

  2. 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.

  3. 03 →

    Vehicle detection

    YOLOX-m on the full frame plus a 2×2 grid of overlapping, enlarged tiles to catch small, distant cars.

  4. 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.

  5. 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.

  6. 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

Traffic camera pipeline benchmarks
MeasureValue
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 cap150 calls · $0.25
Frame history / hourly volume history24 h / 90 days
Measured on the production deployment. Frigate showed no measurable slowdown while sharing the GPU.

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 compared with a commercial traffic analytics API
This pipelineCommercial camera analytics
Running cost≤ $0.25/day + existing hardwarePer-camera monthly licences
CamerasAny public JPEG feedUsually vendor or partner cameras
Anomaly logicPer-camera, per-hour baselines; tunableBlack box
Data ownership90 days of hourly volume, mineVendor-hosted
AccuracyDensity index on low-res stillsTypically 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.

Built with

PythonYOLOXOpenVINOONNX RuntimeFastAPISQLiteDockerCloudflare Tunnel

Want something like this built?

I take on a few web, SEO and AI automation projects alongside full-time work, and I'm open to remote engineering roles.

More work like this

Personal · Live

Web

archive.spenc.ee

A live gigapixel archive for scanned maps and paper ephemera.

Scans Archived
64
Scans Archived
Case study Live