How anmolrawat990/road-hazard-detection works
Road Hazard Detection combines PHP session-based account access with a Flask video-analysis service. A signed-in user uploads a video from the dashboard; Flask saves it, processes frames with the custom YOLO weights, and exposes an MJPEG stream and current-frame detections for the dashboard to display. Users can pause and resume processing, and high-confidence detections trigger Windows audio alerts. The README also describes MySQL authentication and sample videos. Source excerpts do not show database use beyond account handling, or any persistent video/detection history.
Main entry points: dashboard.php Detection Dashboard · app.py Frame Processor · index.php Login and Signup · logout.php Session Logout
Components 17
Account Access
- Login and Signup
index.php - MySQL Accounts
db_config.php - Session Logout
logout.php
Dashboard Interface
- Detection Dashboard
dashboard.php
Video Detection
- Video Upload API
app.py - Uploaded Video
app.py - Frame Processor
app.py - OpenCV Capture
app.py - YOLO Inference
app.py - Custom YOLO Weights
best.pt - Pause Control
app.py - Audio Alerts
app.py
Live Results
- Current Frame State
app.py - MJPEG Stream
app.py - Detection Status API
app.py
Other components
- Driver
- Windows System Sound
Connections 21
- Driver → Login and Signup: signs in
README.md - Login and Signup → MySQL Accounts: queries accounts
index.php - Login and Signup → Detection Dashboard: redirects after login
index.php - Detection Dashboard → Session Logout: opens logout
dashboard.php - Session Logout → Login and Signup: redirects to
logout.php - Driver → Detection Dashboard: uploads video
README.md - Detection Dashboard → Video Upload API: posts video
dashboard.php - Video Upload API → Uploaded Video: saves upload
app.py - Video Upload API → Frame Processor: starts thread
app.py - Frame Processor → OpenCV Capture: opens video
app.py - Frame Processor → YOLO Inference: runs inference
app.py - YOLO Inference → Custom YOLO Weights: loads model
app.py - Frame Processor → Current Frame State: writes annotated frame
app.py - Frame Processor → Pause Control: waits on event
app.py - Frame Processor → Audio Alerts: triggers on confidence
app.py - Audio Alerts → Windows System Sound: plays beep
app.py - Detection Dashboard → MJPEG Stream: requests stream
dashboard.php - MJPEG Stream → Current Frame State: reads frames
app.py - Detection Dashboard → Detection Status API: polls detections
dashboard.php - Detection Status API → Current Frame State: reads detection state
app.py - Detection Dashboard → Pause Control: toggles processing
dashboard.php