Pothole Detection using YOLOv8
Overview
This project implements a pothole detection system using the YOLOv8 object detection model. The system is designed to identify potholes in road images or video streams, providing an efficient solution for road maintenance and safety monitoring.
Features
Uses YOLOv8 for real-time pothole detection.
Can process both images and video streams.
Provides bounding box annotations for detected potholes.
Supports model fine-tuning with custom datasets.
Dataset
The dataset consists of images containing potholes along with labeled annotations in YOLO format. The dataset is structured as follows:
Dataset/ βββ images/ β βββ train/ β βββ val/ β βββ test/ βββ labels/ β βββ train/ β βββ val/ β βββ test/ βββ data.yaml
Installation
Clone the repository:
git clone https://github.com/yourusername/pothole-detection-yolov8.git cd pothole-detection-yolov8
Install dependencies:
pip install ultralytics opencv-python numpy torch torchvision
Download or prepare your dataset and place it in the Dataset/ folder.
Training the Model
To train YOLOv8 on the custom pothole dataset:
!yolo task=detect mode=train model=yolov8n.pt data=Dataset/data.yaml epochs=50 imgsz=640
Running Inference
For image inference:
!yolo task=detect mode=predict model=best.pt source=images/test.jpg
For video inference:
!yolo task=detect mode=predict model=best.pt source=video.mp4
Results
The trained model will generate detection results with bounding boxes around potholes. The inference images and videos will be saved in the runs/detect/ directory.
Future Improvements
Improve model accuracy with additional training data.
Deploy the model on an edge device for real-time detection.
Integrate a reporting system for detected potholes.
License
This project is licensed under the apache 2.0 License.