An efficient, economical, and AI-driven solution to improve road safety by detecting potholes in real time.
- About the Project
- Key Features
- Installation
- Usage
- Project Structure
- Dataset
- Future Enhancements
- Contributing
- License
- Acknowledgments
This project leverages YOLOv11 for pothole detection and MiDaS for depth estimation to provide a cost-effective alternative to expensive stereo camera systems used in vehicles like Tesla. The system alerts drivers to upcoming potholes and logs data about pothole dimensions for further analysis. By addressing road safety issues, this tool provides an economical way to enhance transportation infrastructure.
- High-Accuracy Detection: Utilizes YOLOv11(nano) to detect potholes with precision in real-time.
- Pothole Dimensions: Measures the height, width, and depth of potholes using MiDaS depth estimation.
- Driver Alerts: Warns drivers of approaching potholes to improve road safety.
- Cost-Effective Solution: Eliminates the need for stereo cameras, making it an affordable alternative for wider adoption.
- Data Logging: Stores pothole dimensions in a CSV file for analysis and reporting.
- Visual Demonstrations: Includes videos of pothole detection and depth estimation results.
- Python 3.8 or higher
- YOLO model weights (
best2.pt) downloaded and placed in the root directory - Required Python libraries (listed in
requirements.txt)
- Clone the repository:
git clone https://github.com/yourusername/pothole-detection.git
- Navigate to the project folder:
cd pothole-detection - Install the dependencies:
pip install -r requirements.txt
- To run pothole detection:
python main.py --input path/to/video.mp4
- To visualize depth estimation using MiDaS:
python midas_depth.py --input path/to/video.mp4
Results will be saved as videos in the project directory.
pothole-detection/
├── README.md
├── best2.pt # YOLO model weights
├── df_mean.csv # Generated dataset
├── main.py # Pothole detection script
├── pothole_detection_demo.mp4
├── midas_depth_demo.mp4
└── datasets/
└── potholes_data.csv # Final pothole dimensions dataset
The project outputs a dataset containing pothole dimensions (height, width, depth). Example structure:
| Height (pixels) | Width (pixels) | Depth (meters) |
|---|---|---|
| 50 | 120 | 0.25 |
| 45 | 115 | 0.20 |
This data can be used for further research or infrastructure planning.
- Geotagging: Integrate GPS functionality to record pothole locations.
- Real-Time Deployment: Optimize the model for edge devices like Raspberry Pi for live detection.
- Enhanced Data Collection: Add road condition analytics based on collected data.
- Automated Repair Integration: Collaborate with road repair systems for automatic pothole repairs.
We welcome contributions from the community! To contribute:
- Fork the repository.
- Create a new branch:
git checkout -b feature/new-feature
- Commit your changes:
git commit -m "Add a new feature" - Push the branch:
git push origin feature/new-feature
- Open a pull request.
This project is licensed under the MIT License. Feel free to use, modify, and distribute the code as per the terms of the license.
- YOLO for object detection.
- MiDaS for depth estimation.
- Inspiration from the open-source community for best practices and code structure.
