SafeVixAI YOLOv8n Pothole & Road Damage Detector

A custom YOLOv8 nano (yolov8n) road damage object detection model trained for the SafeVixAI civic road safety platform (IIT Madras Road Safety Hackathon 2026) and exported to both PyTorch (pothole.pt) and browser/edge-ready ONNX (pothole.onnx).


Model Details

Property Value
Base Architecture Ultralytics YOLOv8n (yolov8n.pt, Ultralytics 8.4.37)
Classes (nc: 3) 0: pothole, 1: crack, 2: manhole
Input Tensor (ONNX) images (float32, shape [1, 3, 640, 640], RGB scaled [0, 1])
Output Tensor (ONNX) output0 (float32, shape [1, 7, 8400], [cx, cy, w, h, cls0, cls1, cls2], nms=False)
Artifacts Included pothole.pt (6.2 MB PyTorch) & pothole.onnx (12.3 MB, opset=12, simplify=True)

Training Data & Procedure

  • Training Sources: Merged custom Roboflow Pothole Dataset (v3) + Kaggle RDD2022 (2,009 merged .jpg images across harmonized labels: D00/D10/D20 mapped to crack, D40 mapped to pothole, plus manhole annotations).
  • Training Hyperparameters: epochs=50, imgsz=640, batch=16, exported to ONNX (opset=12, imgsz=640, simplify=True).

Usage

Option 1: PyTorch (ultralytics)

from huggingface_hub import hf_hub_download
from ultralytics import YOLO

weights = hf_hub_download("SafeVixAI/pothole-detector-yolov8n", "pothole.pt")
model = YOLO(weights)
results = model("road_sample.jpg", conf=0.25)
results[0].show()

Option 2: Edge / Serverless ONNX (onnxruntime)

import numpy as np
import onnxruntime as ort
from huggingface_hub import hf_hub_download
from PIL import Image

onnx_path = hf_hub_download("SafeVixAI/pothole-detector-yolov8n", "pothole.onnx")
session = ort.InferenceSession(onnx_path)

img = Image.open("road_sample.jpg").convert("RGB").resize((640, 640))
inp = np.transpose(np.asarray(img, dtype=np.float32) / 255.0, (2, 0, 1))[None, ...]
outputs = session.run(None, {"images": inp})[0]  # shape: (1, 7, 8400)

Intended Use & Limitations

  • Designed for civic road-hazard triage, citizen photo pre-screening (PotholeValidator), and edge PWA/demo inference.
  • Validation caveat: In the Colab training notebook (YOLOv8_Pothole_Detector_Training), validation pointed to the training image split for fast hackathon iteration. Treat confidence scores carefully on unseen lighting/weather conditions and keep human/secondary backend review in production workflows.
  • License note: Repository artifacts are released under MIT (LICENSE); upstream Ultralytics model export metadata notes Ultralytics AGPL-3.0 for framework usage where applicable.
Downloads last month
40
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Dataset used to train SafeVixAI/pothole-detector-yolov8n

Space using SafeVixAI/pothole-detector-yolov8n 1

Collection including SafeVixAI/pothole-detector-yolov8n