mounishvatti / pothole_detection_yolov8

Pothole Detection using Image Segmentation by using a custom dataset with over 700+ images trained on Roboflow and predicting using the latest Ultralytics YOLOv8.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

3

Image Segmentation & Pothole Detection

Firstly I'd like to thank Respected Jagan Mohan Reddy - (CM AP) for not covering up the potholes in Andhra Pradesh as most of the data was collected from that state.

Google Colab File Link (A Single Click Solution)

The google colab file link for yolov8 segmentation and tracking is provided below, you can check the implementation in Google Colab, and its a single click implementation ,you just need to select the Run Time as GPU, and click on Run All.

Google Colab File

Tech stack

Python

Object Segmentation and Tracking (ID + Trails) using YOLOv8 on Custom Data

Clone the repository

!git clone https://github.com/mounishvatti/pothole_detection_yolov8.git

Goto the cloned folder

cd pothole_detection_yolov8

Install the Dependencies

!pip install ultralytics
!pip install roboflow
!pip install fastapi kaleido python_multipart uvicorn

Importing YOLO and a roboflow workspace for Image Segmentation

from roboflow import Roboflow
rf = Roboflow(api_key="{the api key}")
project = rf.workspace("{name of workspace}").project("name-of-project")
dataset = project.version(1).download("yolov8")

Note

If you are unable to perform the commands after importing the dataset from roboflow, you can access the same dataset from the drive link provided below, download it, upload it to your personal drive and mount the drive to your Google Colab

Downloading the Datasets From The Google Drive

Pothole Detection Dataset

Downloading the Potholes on a Road Video from the Google Drive

Potholes on Road Video

My roboflow workspace containing the pothole dataset

Roboflow Workspace

Run the code with mentioned command below.

  • For training the data
!yolo task=detect mode=train model=yolov8m.pt data={dataset.location}/data.yaml epochs={number of epochs} imgsz=640
  • For yolov8 segmentation + Tracking & prediction
!yolo task=detect mode=predict model={HOME}/runs/detect/train/weights/best.pt conf=0.25 source='/content/drive/MyDrive/demo.mp4'

About

Pothole Detection using Image Segmentation by using a custom dataset with over 700+ images trained on Roboflow and predicting using the latest Ultralytics YOLOv8.

License:MIT License


Languages

Language:Jupyter Notebook 100.0%