How vamshikumar2/smartphone-based-pothole-detection-and-alert-system works
This repository combines a sensor-based pothole classifier with a browser dashboard for location, routing, and hazard alerts. The user journey is: start detection, send motion readings to the Flask prediction endpoint, publish predictions to Firebase, and show a warning when a pothole is reported; the dashboard also tracks GPS and draws routes. Separately, pothole.py contains dataset training and a Firebase-backed proximity-alert flow. The README describes additional preprocessing and dashboard features, but the excerpts do not show all their implementation details.
Main entry points: script.js Browser behavior · pothole.py Model training · app.py Prediction API · pothole_model.pkl Classifier artifact
Components 17
Detection and training
- Sensor datasets
Dataset - Model training
pothole.py - Classifier artifact
pothole_model.pkl - Prediction API
app.py
Web dashboard
- Dashboard page
templates/index.html - Browser behavior
static/script.js
Location and alerts
- Map display
static/script.js - GPS tracking
static/script.js - Place and route lookup
static/script.js - Hazard alerts
static/script.js - Proximity alert logic
pothole.py
Cloud persistence
- Firebase database
Other components
- Driver
- Phone sensors
- Geocoding service
- Route service
- OpenStreetMap tiles
Connections 19
- Driver → Browser behavior: starts detection
static/script.js - Phone sensors → Browser behavior: provide motion
static/script.js - Browser behavior → Prediction API: posts features
static/script.js - Prediction API → Classifier artifact: loads and predicts
app.py - Prediction API → Dashboard page: renders page
app.py - Sensor datasets → Model training: trains from data
README.md - Model training → Classifier artifact: exports classifier
pothole.py - Browser behavior → Firebase database: writes prediction
static/script.js - Firebase database → Hazard alerts: notifies listener
static/script.js - Hazard alerts → Firebase database: stores pothole
static/script.js - Browser behavior → GPS tracking: watches position
static/script.js - GPS tracking → Map display: moves marker
static/script.js - Browser behavior → Geocoding service: looks up places
static/script.js - Browser behavior → Route service: requests directions
static/script.js - Browser behavior → Map display: draws route
static/script.js - Map display → OpenStreetMap tiles: loads tiles
static/script.js - Model training → Firebase database: stores detections
pothole.py - Proximity alert logic → Firebase database: reads potholes
pothole.py - Proximity alert logic → Hazard alerts: raises warnings