Pothole Preventer is a project that detects road damage in real time and suggests the smoothest and safest path for a vehicle to follow.
It uses YOLOv8 segmentation to detect potholes and road damage, overlays a heatmap of road conditions, and computes an optimal driving path by minimizing cumulative damage along the route.
The system works with both pre-recorded videos and live camera feeds.
- ✅ YOLOv8 segmentation for accurate pothole/damage detection
- ✅ Real-time heatmap generation showing road quality
- ✅ Dynamic path planning (minimizes total damage)
- ✅ Smoothed path rendering (no jerky swerving, suitable for real cars)
git clone https://github.com/CodeThread386/Pothole-Preventer.git
cd Pothole-PreventerInstall the required Python packages:
pip install ultralytics opencv-python numpy matplotlibpython app.pyOpen app.py and make modifications in line 11
VIDEO_SOURCE = "your video file path"VIDEO_SOURCE = 0- Segmentation – YOLOv8 detects potholes/damage and masks them.
- Tile Grid Overlay – The road is divided into tiles, each scored by damage percentage.
- Path Planning – At each frame, the algorithm chooses the next tile to minimize cumulative damage.
- Path Smoothing – The path is filtered to remove jerky swerves, producing a realistic drivable line.
- Visualization – Heatmap and the recommended driving path (yellow) are overlaid on the video.
- 📍 GPS integration for real-world navigation
- 🚗 Lane aware planning
- 🧠 Adaptive smoothing based on vehicle dynamics
- 📱 Android auto and Apple car app deployment with dashcam integration