Network cameras are set up in a web console. A vision-language model running on the device looks at each frame, use-case packs turn what it sees into traffic events, and an operator reviews them. Processing stays on the device, and nothing is enforced automatically.
Each pack works on geometry the operator draws in the Studio page over a live snapshot from the camera. Coordinates are stored normalized to the frame, so they survive a change of stream resolution.
Watches each vehicle track through the stop zone and calls it a full stop, a rolling stop or no stop from its dwell time and slowest speed in the zone.
Times a track from gate A to gate B and converts the distance the operator entered into km/h or mph. Only measured crossings produce a reading.
Counts each tracked vehicle once as it crosses the A to B line, by direction and by class: car, truck, bus, motorcycle. Hourly totals per camera.
Tracks people or other chosen classes with direction and a short descriptor, across the whole frame or inside a drawn zone.
Speed and stop sign are refused on the same camera. They need different sight lines, so the console blocks the combination instead of producing weak results for both.
One capture thread per camera writes the newest frame to a single slot.
The browser reads that slot as MJPEG at the camera's own frame rate.
Inference samples the slot every interval. vLLM, Ollama or NVIDIA NIM, switchable live.
Detections get stable track ids, then each pack bound to the camera applies its rule.
Events persist in SQLite. Flagged ones wait in Review with the frame the model saw.
The model server is not in the video path. If it stops or falls behind, the Live page keeps playing and shows "inference unavailable" instead of inventing events. An end-to-end runtime test checks exactly that.
The defaults below are read from the pack code. Every one can be changed per camera in Studio.
Screens from the running app. These captures use the built-in synthetic test feed and the mock detector, and the console labels both on screen so they are never mistaken for a real camera.
Camera passwords are encrypted at rest with a key file outside the repository. The API never returns one, and a saved password is only reused for the host and port it was saved for.
Stream URLs are masked in logs, errors, status payloads and run artifacts.
On first start the console picks a default for the hardware: Cosmos-Reason2-2B on Thor, Gemma 4 on a workstation. The operator can switch at any time.
A model container another app depends on cannot be stopped by accident. Stopping it needs an explicit, logged confirmation.
A systemd unit starts the API and console at boot and keeps a persistent log.
Packs flag, operators confirm or dismiss. Each item can carry a ground-truth note, such as "my car, full stop", so pack output can be checked against known passes.
Run with the full build of this project, which is not part of this repository. The reports, prompts and records are committed under reports/generation/. Generated footage throughout: offline test data, not live prediction, and no real-world accuracy.
A car rolling through the stop, a car running it with cross traffic, a pedestrian stepping out from behind a parked pickup. Cosmos 3 Edge drew each five-second clip from a still in 116 to 125 s at about 2.6 Wh, and the production packs scored them.
The framework's prompt upsampler turned "never stops" into "stops precisely at the STOP line". Hand-written prompts with compass directions, exclusions and timing fixed two of the three events. The third also needed the second vehicle placed in the starting frame.
Given the first second of six stop-sign scenes and a prompt that names no outcome, Cosmos 3 Edge's continuation got the same stop-sign verdict on 2 of 6, in part on 1, and the opposite on both pedestrian scenes.
On one generated clip the packs reported four vehicles and a rolling stop, which looked plausible, while the clip never showed the cross traffic it was made for. The detector cannot tell that a generated clip missed its event.
Out of scope by design: license plate reading and automated ticketing. This is operational analysis with a person in the loop.