How kaul1415/traffic-ai works
Smart Traffic System is a Flask dashboard for adaptive four-lane signals. Its main runtime flow reads lane videos, detects and confirms vehicles and ambulances, feeds lane counts to the signal controller, then presents live status and analytics in the dashboard. Uploads can replace lane clips; a separate report summarizes saved ambulance detections. The excerpts show the controller adapter and video-processing logic, but not the full route or template implementation, so dashboard wiring is based on README documentation.
Main entry points: app.py Flask runtime · index.html Live dashboard · run_video.py Single-video runner · traffic_logic.py Signal controller
Components 12
Traffic runtime
- Flask runtime
app.py - Signal controller
traffic_logic.py - Baseline detector
detector.py - Single-video runner
run_video.py
Dashboard and reporting
- Live dashboard
templates/index.html - Dashboard styling
static/style.css - Dashboard charts
static/chart.umd.js - Ambulance log
- Ambulance report
amb_report.py
Video inputs
- Video preparation
prepare_videos.py - Lane video clips
Other components
- Traffic operator
Connections 10
- Traffic operator → Flask runtime: uses dashboard
readme.md - Lane video clips → Flask runtime: feeds lanes
readme.md - Flask runtime → Signal controller: updates and ticks
app.py - Flask runtime → Video preparation: converts uploads
readme.md - Flask runtime → Live dashboard: serves dashboard
readme.md - Live dashboard → Dashboard styling: uses styles
- Live dashboard → Dashboard charts: renders charts
- Flask runtime → Ambulance log: saves detections
readme.md - Ambulance log → Ambulance report: provides records
amb_report.py - Single-video runner → Baseline detector: calls detector
run_video.py