How subhajitbadhuk/smarttrafficmanagement works
Smart Traffic Management accepts four lane images, lets users mark lane regions, and processes the images through a Flask/YOLO backend. The backend filters detections to each region, counts vehicles, creates annotated images, and selects the lane with the highest total for green; the live page displays the results and cycles lane signals using weighted counts. The README also describes vehicle detection, lane-wise counting, ROI selection, and future ambulance priority. Unsampled page and styling files are represented only where their role is documented; the graph focuses on relationships visible in the excerpts.
Main entry points: main.py Flask routes · live.js Live dashboard · script.js Image and ROI UI
Components 12
Traffic interface
- Image and ROI UI
frontend/script.js - Live dashboard
frontend/live.js
Image processing
- Flask routes
backend/main.py - Uploaded lane images
backend/main.py - Vehicle detection
backend/main.py - ROI filtering and counts
backend/main.py - Annotated lane images
backend/main.py - Lane results
backend/main.py
Signal management
- Green lane selection
backend/main.py - Weighted signal cycle
frontend/live.js - Ambulance priority
Other components
- Traffic operator
Connections 16
- Traffic operator → Image and ROI UI: selects lanes
README.md - Image and ROI UI → Flask routes: uploads images
frontend/script.js - Flask routes → Uploaded lane images: saves images
backend/main.py - Image and ROI UI → Flask routes: submits ROIs
frontend/script.js - Flask routes → Uploaded lane images: reads images
backend/main.py - Flask routes → Vehicle detection: runs detection
backend/main.py - Flask routes → ROI filtering and counts: filters detections
backend/main.py - ROI filtering and counts → Vehicle detection: counts vehicles
backend/main.py - Flask routes → Annotated lane images: writes images
backend/main.py - Flask routes → Lane results: returns results
backend/main.py - Flask routes → Green lane selection: selects green lane
backend/main.py - Live dashboard → Lane results: loads stored results
frontend/live.js - Live dashboard → Annotated lane images: loads images
frontend/live.js - Live dashboard → Weighted signal cycle: starts cycle
frontend/live.js - Weighted signal cycle → Traffic operator: shows lane status
frontend/live.js - Ambulance priority → Weighted signal cycle: may prioritize
README.md