Repository navigation
Releases: lucvan/speedwatch
Release list
v0.4.1 — fix MCP 421 for non-localhost (Docker/LAN) clients
Patch over v0.4.0. The MCP server's FastMCP transport security validated the request Host header and returned 421 Misdirected Request for any client not connecting as localhost — including Hermes in Docker (host.docker.internal:8765), the LAN IP, and speedwatch.e49ta.com. Disabled FastMCP's DNS-rebinding Host check; the real auth boundary is the API-key gate. Restart the service to apply.
v0.4.0 — MCP server, council report, rule-derived evidence
v0.2.3 — Speed-distribution stats + smarter recompute
Features
Speed-distribution stats
- Dashboard: a road-wide speed-distribution chart — histogram coloured by speed band with a smoothed bell curve, and dashed lines for the median, the 85th-percentile speed (the standard road-speed benchmark), and the amber/limit thresholds.
- Vehicle page: a speed vs the road chart — this vehicle's passes overlaid as ticks on the whole-road distribution with its median line, plus its percentile rank ("faster than X% of all passes"). Each row in the pass table is tagged with its road percentile.
- Self-contained inline SVG (
app/stats.py) — no JS charting dependency. Percentiles prefer reviewer-corrected speeds where set.
Recompute now honours ANPR ignore zones
- The Recompute plate from all images tool reads only full-frame stills, so your existing ANPR ignore boxes apply correctly (closing a gap where a masked parked plate could slip back in via the car crop).
- A new 🚫 Ignore location button on each recompute candidate draws and saves an ignore box over a fixed parked/background plate in one click (
POST /api/anpr-mask/add) — no trip to/calibrateneeded.
Notes
Code-only — no database migration this release.
v0.2.2 — Manual vehicle curation
Three manual review tools for the Vehicles and Unidentified views.
Features
- Pin a vehicle thumbnail. A per-pass Set as thumbnail button lets you choose which pass's image represents a vehicle, fixing stale/wrong rep images left after manually cleaning up a mis-grouped pass. The pinned image is locked against the automatic best-plate-confidence updater. (
POST /api/vehicle/<plate>/rep-image) - No-plate vehicle records. A Group (no plate) button on the Unidentified screen groups visually-identical plateless passes into a single vehicle record with a synthetic
UNK-NNNNid, renamable later via merge/recompute. (POST /api/passes/group-unidentified) - Recompute a plate from all images. Re-runs ANPR over every still and car crop of every pass for a vehicle and combines the reads (confidence-weighted whole-string scoring + per-position character voting) to suggest a better plate, applied on confirm through the existing merge flow. (
POST /api/vehicle/<plate>/recompute-plate)
Migration
Additive, applied automatically on startup: ALTER TABLE vehicle ADD COLUMN rep_pinned.
speedwatch v0.2.1
Bug fix + Re-ID quality-of-life features.
ANPR ignore zones (bug fix)
A fixed background or parked car whose number plate falls inside passing cars' bounding-box crops was being read for every pass (often at higher OCR confidence than the moving car's own plate). On the Calibrate page you can now drag rectangular ignore zones over such plates — any plate whose detection centre lands inside a zone is discarded:
- Positional, not value-based — it also catches misreads of that plate.
- A car that genuinely drives through still reads fine elsewhere in the frame.
- Stored per camera in
<DATA_DIR>/anpr_mask/<camera>.json; takes effect on the next vehicle (no restart).
Per-pass & cluster visual similarity (Vehicle Re-ID)
- Pass / session page: each pass now lists the closest-looking existing vehicles, with one-click assign — re-allocate a single pass to a known vehicle when the plate wasn't read but you recognise the car. Reversible.
- Unidentified page: each plateless cluster now also suggests the closest existing vehicles, so you can merge a cluster into a known vehicle instead of only promoting it to a new one.
Docs
README updated with the ANPR ignore-zones workflow and the new per-pass / cluster matching.
speedwatch v0.2.0 — UI overhaul
A full pass over the web UI focused on usability and information density.
Dashboard & navigation
- New dashboard landing page: headline stats (passes today, fastest today, over-limit count, vehicles tracked, confirmed speeders), a "needs your attention" work queue (plateless passes, visual clusters to merge, low-confidence reviews), a top-vehicle leaderboard, and a recent-passes strip. The passes table now lives at
/passes. - Left sidebar navigation replaces the thin top navbar — all sections plus a Calibrate/Settings group, live pipeline status, and the app version.
Readability
- Speed banding across every view — green under the warn threshold, amber up to the limit, red over it. Configurable via
SPEED_LIMIT_MPH(default 20) andSPEED_WARN_MPH(default 16). - Passes list decluttered: dropped low-value columns, added Today/Yesterday day dividers, relative timestamps, and "over X mph" / "no plate only" filters.
- Vehicle page: fixed-size representative-image hero, banded stat tiles, and the dense grouping card split into clear "Similar plates" and "Visually similar" sections.
- Session page: entry/exit stills shown once at a consistent size with a trajectory inset (no more duplicate images at arbitrary sizes).
- Cover-fit images now crop from the top, keeping the vehicle visible when frames are scaled down.
New
- Light/dark theme toggle (persisted, no flash on load).
- Read-only /settings page showing the running configuration.
Fixes
- Invalid placeholder colour value; passes empty-state colspan.
speedwatch v0.1.0
First release of speedwatch — a standalone, self-hosted vehicle speed-detection and ANPR service for a single fixed camera. Runs as a Windows service on AMD / DirectML; no Docker.
Pipeline
- 4K RTSPS ingest with GPU decode (ffmpeg
-hwaccel d3d11va) - YOLO11 detection on onnxruntime-DirectML + ByteTrack tracking
- Real-world speed via a lens-undistorted homography (mph)
- Number-plate recognition (fast-alpr)
- Motion-gated capture; clean 30 fps clips; empty events dropped
Vehicles & enrichment
- Per-plate vehicle registry (speeds, pass counts, representative image)
- Plate grouping / OCR-variant merging (edit-distance + appearance)
- Manual assignment of plateless / mis-read passes to a vehicle
- Local AI descriptions (colour/make/model) via Ollama — optional
- Vehicle Re-ID embeddings for visual grouping + an Unidentified review queue — optional
Review & evidence
- Web UI + REST API (FastAPI, :8765), confidence scoring and review labelling
- Confirmed-speeder flagging + evidence export (ZIP of clips/stills + CSV manifest)
Calibration
- On-screen lens-distortion tuner (plumb-line) or chessboard intrinsics
- Click-to-measure zone homography
See the README for setup (bootstrap.ps1), configuration, and calibration.
License: AGPL-3.0 (inherited from the Ultralytics YOLO11 dependency).