An intelligent Pothole Detection system using YOLOv4 Tiny, capable of identifying and categorizing potholes in real-time video streams. The severity level of each pothole (Low, Medium, High) is assessed based on its area in the frame. This system provides a valuable tool for monitoring road conditions and prioritizing maintenance efforts. The repository includes Python code, YOLO model files, and sample data for easy implementation and testing.
The pothole detection system is designed to:
- Process a video stream or file input.
- Detect potholes in the video frames using YOLOv4 Tiny.
- Draw bounding boxes around detected potholes.
- Save images of detected potholes along with their coordinates.
- Display the frames per second (FPS) processed.
- Python
- OpenCV (cv2)
- Geocoder
- Ensure the necessary YOLOv4 Tiny model weights (
yolov4_tiny.weights
) and label names (obj.names
) are available.)
- Ensure that the necessary libraries are installed.
- Configure the paths to the YOLOv4 Tiny weights, configurations, and label names (
obj.names
) in the Python script. - Set the input video source (file path or camera) in the script.
- Run the Python script
pothole_detection.py
. - Press 'q' to stop the video stream and terminate the detection process.
This video file contains footage of roads with potholes, used for testing the pothole detection system.
These are the output files:
- video file contains the resulting video with detected potholes highlighted.
pothole_coordinate/
is a folder that saves the location coordinates of detected potholes.
pothole_detection.py
: Main Python script for pothole detection.obj.names
: Text file containing label names for the YOLOv4 Tiny model.yolov4_tiny.weights
: YOLOv4 Tiny pre-trained weights file.yolov4_tiny.cfg
: YOLOv4 Tiny configuration file.result.mp4
: Output video file with detected potholes.
- Adjust confidence and NMS thresholds for detection accuracy (
Conf_threshold
,NMS_threshold
). - Modify the output directory (
result_path
) for saving detected pothole images and coordinates.
- Ensure CUDA and GPU support for faster processing if using GPU-enabled OpenCV.
- Fine-tune detection parameters for better accuracy based on specific scenarios and video quality.
Contributions to optimize, improve accuracy, or add new functionalities are welcome. Feel free to open issues or pull requests.