How unloosedfiend/ai-traffic-management works
This repository is an edge-traffic-management demo: camera imagery is analyzed for vehicles and emergency vehicles, traffic logic selects a lane and green duration, and commands can be sent to a Raspberry Pi signal controller. The graph includes the desktop controller, standalone inference entry points, dashboard, and Pi-side inference/control. The README provides only a title, and several modules are unsampled; edges are limited to relationships visible in excerpts or the source index.
Main entry points: app.py Traffic controller · pi_client.py Signal client · dashboard.py Dashboard service · traffic_logic.py Lane selection
Components 15
Desktop control
- Traffic controller
src/app.py - Runtime settings
src/config.py - Camera capture
src/cameras/camera_manager.py - YOLO detection
src/vision/yolo_detector.py - Lane selection
src/logic/traffic_logic.py - Signal client
src/comms/pi_client.py
Inference entry points
- Multi-camera inference
scripts/run_multi_camera_inference.py - Single-camera inference
scripts/run_realtime_inference.py - Web launcher
scripts/web_launcher.py
Monitoring dashboard
- Dashboard service
src/web/dashboard.py
Raspberry Pi
- Signal and camera API
src/pi/app.py - TFLite detection
src/pi/detect_tflite.py - Signal server variant
src/pi/signal_server_v2.py
Other components
- Operator
- Dashboard user
Connections 17
- Operator → Traffic controller: starts
src/app.py - Traffic controller → Runtime settings: reads settings
src/app.py - Traffic controller → Camera capture: starts cameras
src/app.py - Traffic controller → YOLO detection: runs detection
src/app.py - Traffic controller → Lane selection: selects lane
src/app.py - Traffic controller → Signal client: sends command
src/app.py - Multi-camera inference → Signal client: sends commands
scripts/run_multi_camera_inference.py - Single-camera inference → Signal client: sends commands
scripts/run_realtime_inference.py - Web launcher → Lane selection: uses decisions
scripts/web_launcher.py - Web launcher → Signal client: sends commands
scripts/web_launcher.py - Operator → Dashboard service: views status
src/web/dashboard.py - Dashboard service → Camera capture: starts cameras
src/web/dashboard.py - Dashboard service → YOLO detection: runs detection
src/web/dashboard.py - Dashboard service → Lane selection: uses decisions
src/web/dashboard.py - Dashboard service → Signal client: sends commands
src/web/dashboard.py - Signal client → Signal and camera API: posts signal request
src/comms/pi_client.py - Signal and camera API → TFLite detection: uses detector
src/pi/app.py