How tarsoliyaansh/ai-based-traffic-management works
This is a web-based adaptive traffic-management system: a user uploads four intersection videos, the backend estimates vehicle counts for each, and a genetic algorithm returns recommended green-light times for the web interface. The graph follows the sampled React upload flow and Flask orchestration. The README documents the major capabilities; detection and optimization details are supported by sampled source, while model assets are shown as detector inputs.
Main entry points: yolov4.py Vehicle detection · app.py Upload endpoint · App.js Upload and results · algo.py Genetic optimizer
Components 10
Web interface
- Upload and results
frontend/src/App.js
Request orchestration
- Upload endpoint
backend/app.py - Uploaded videos
backend/app.py - Green-time recommendations
backend/algo.py
Traffic analysis
- Vehicle detection
backend/yolov4.py - Class names
backend/classes.txt - YOLO configuration
backend/yolov4-tiny.cfg - YOLO weights
backend/yolov4-tiny.weights - Genetic optimizer
backend/algo.py
Other components
- Traffic manager
Connections 13
- Traffic manager → Upload and results: selects videos
- Upload and results → Upload endpoint: posts four videos
- Upload endpoint → Uploaded videos: saves videos
- Upload endpoint → Vehicle detection: calls detection
- Vehicle detection → Uploaded videos: reads videos
- Vehicle detection → Class names: reads classes
- Vehicle detection → YOLO configuration: loads config
- Vehicle detection → YOLO weights: loads weights
- Vehicle detection → Upload endpoint: returns counts
- Upload endpoint → Genetic optimizer: calls optimization
- Genetic optimizer → Green-time recommendations: produces timings
- Upload endpoint → Upload and results: returns JSON
- Upload and results → Green-time recommendations: displays results