2026-02-09 12:50:10 +05:30
..
ini
2026-02-09 12:50:10 +05:30
ini
2026-02-09 12:50:10 +05:30
ini
2026-02-09 12:50:10 +05:30
ini
2026-02-09 12:50:10 +05:30
ini
2026-02-09 12:50:10 +05:30
ini
2026-02-09 12:50:10 +05:30
ini
2026-02-09 12:50:10 +05:30
ini
2026-02-09 12:50:10 +05:30
ini
2026-02-09 12:50:10 +05:30
ini
2026-02-09 12:50:10 +05:30

Pothole & Road Sign Detection Backend

This project implements a Two-Stage Detection Pipeline using YOLOv8 (for detection & tracking) and CLIP (for zero-shot classification).

Setup

  1. Install Dependencies:

    pip install -r backend/requirements.txt
    
  2. Training YOLO (Crucial Step): You MUST train a YOLO model on your custom dataset (Pothole, Manhole, Traffic Signs) for this to work effectively.

    • Prepare your dataset.yaml.
    • Run the training script:
    from backend.models.train_yolo import train_yolo
    train_yolo("path/to/dataset.yaml", epochs=50)
    
    • This will generate best.pt. Move this file to backend/models/best.pt.

Running the API

Start the FastAPI server:

cd backend
python main.py

The server will start at http://0.0.0.0:8000.

API Usage

Endpoint: POST /detect/video

  • Body: multipart/form-data, key file (Video file).
  • Response: JSON summary of unique objects detected.

Configuration

  • Modify backend/pipelines/video_processor.py to change the yolo_model_path to your trained model path (e.g., backend/models/best.pt).
  • You can also adjust the CLA candidate labels in VideoProcessor.__init__.