How domu1206/traffic-monitoring-ai works
This is a traffic-video analysis application with a Flask interface and a separate video-processing loop. A user uploads a video; the web app saves it and starts the processing program, which tracks vehicles, estimates speed, and records overspeed violations with plate text and snapshot evidence. The loop also updates and displays a traffic heatmap. The web dashboard exposes stored violations. Helmet-model configuration and a helmet helper exist, but the sampled processing loop does not use them, so no helmet-detection workflow is shown. Source excerpts establish the main processing calls; template behavior is not sampled.
Main entry points: main.py Processing loop · app.py Flask routes · storage.py Evidence storage · videos Input video
Components 18
Web interface
- Flask routes
app.py - Video upload
app.py - Dashboard view
templates/index.html - Mode selection
templates/select.html - Violations API
app.py
Video analysis
- Input video
videos - Processing loop
main.py - Runtime settings
config.py - Vehicle tracking
utils/tracker.py - Speed estimation
utils/speed.py - Traffic heatmap
utils/heatmap.py
Violation processing
- Overspeed handling
main.py - Plate detection
main.py - Plate recognition
utils/anpr.py
Persistence
- Evidence storage
utils/storage.py - Evidence files
evidence - Violations database
Other components
- User
Connections 19
- User → Flask routes: uses
app.py - Flask routes → Mode selection: renders
app.py - User → Video upload: uploads
app.py - Video upload → Input video: saves
app.py - Video upload → Processing loop: starts
app.py - Flask routes → Dashboard view: renders
app.py - Flask routes → Violations API: serves
app.py - Violations API → Violations database: reads
app.py - Processing loop → Runtime settings: reads
main.py - Processing loop → Input video: opens
main.py - Processing loop → Vehicle tracking: calls
main.py - Processing loop → Speed estimation: calls
main.py - Processing loop → Traffic heatmap: updates
main.py - Processing loop → Overspeed handling: checks
main.py - Overspeed handling → Plate detection: runs
main.py - Plate detection → Plate recognition: recognizes
main.py - Overspeed handling → Evidence storage: saves violation
main.py - Evidence storage → Evidence files: writes snapshots
utils/storage.py - Evidence storage → Violations database: inserts
utils/storage.py