How pseudoxec/detection_pipeline works
This is an edge vehicle and license-plate detection pipeline for a Raspberry Pi, with RTSP and image-file inputs. The main workflow captures frames, detects and tracks vehicles, crops vehicles and plates, optionally reads plate text, records timings, then writes detection records to a SQLite hand-off buffer; an optional API hand-off and live-view branch are also present. Source excerpts show the core processing and persistence behavior; live-view modules were read in the source index but not excerpted, so their internal behavior is represented only where indexed references support it.
Main entry points: pipeline.py Frame pipeline · run.py Pipeline runner · storage.py Buffer writer · live_server.py Live server
Components 20
Runtime and configuration
- Pipeline runner
run.py - Configuration
config/config.py - Frame source
camera/camera.py
Detection and recognition
- YOLO inference
detection/detector.py - Vehicle tracking
detection/tracker.py - Box geometry
detection/geometry.py - Image enhancement
detection/image_ops.py - Plate OCR
ocr/plate_reader.py
Frame processing
- Frame pipeline
pipeline/pipeline.py - Stage timing
pipeline/timing.py - Finalize workers
pipeline/finalize_worker.py
Persistence and hand-off
- Buffer writer
storage/storage.py - SQLite buffer
- API client
api/api_client.py
Live view
- Box publisher
live/box_publisher.py - Live server
live/live_server.py - Box flow
live/box_flow.py - Snapshot view
live/snapshot.py
Other components
- Operator
- C# dashboard
Connections 23
- Operator → Pipeline runner: starts
README.md - Pipeline runner → Configuration: loads settings
run.py - Pipeline runner → Frame source: starts capture
run.py - Pipeline runner → Frame pipeline: processes frames
run.py - Pipeline runner → Buffer writer: stops writer
run.py - Frame source → Frame pipeline: supplies frames
run.py - Frame pipeline → YOLO inference: runs inference
pipeline/pipeline.py - Frame pipeline → Vehicle tracking: tracks vehicles
pipeline/pipeline.py - Frame pipeline → Box geometry: crops boxes
pipeline/pipeline.py - Frame pipeline → Image enhancement: enhances crops
pipeline/pipeline.py - Frame pipeline → Plate OCR: reads plates
- Frame pipeline → Stage timing: measures stages
pipeline/pipeline.py - Frame pipeline → Finalize workers: submits jobs
pipeline/pipeline.py - Finalize workers → Buffer writer: enqueues records
pipeline/finalize_worker.py - Buffer writer → SQLite buffer: writes batches
README.md - Buffer writer → API client: sends records
storage/storage.py - API client → C# dashboard: posts detections
api/api_client.py - Pipeline runner → Box publisher: publishes boxes
run.py - Frame pipeline → Box publisher: publishes detections
pipeline/pipeline.py - Pipeline runner → Live server: starts live view
run.py - Live server → Box flow: uses flow
live/live_server.py - Live server → Snapshot view: uses snapshots
live/live_server.py - Box publisher → Snapshot view: uses snapshots
live/box_publisher.py