CoolFace
Apppublic

fu4ll/Vehicle_Detection

sourceHugging Faceupdated 5mo agoView on Hugging Face
0likes
App README

Vehicle Detection API

...

vehicle-detection-api

REST API for detecting and tracking vehicles in images and videos using YOLOv8.

<img width="1258" height="860" alt="Снимок экрана 2026-04-21 в 19 34 41" src="https://github.com/user-attachments/assets/a970938e-6e3f-4430-b18c-517dd7fdb63e" />

Features

  1. 1.Detects cars, trucks, buses and motorcycles
  2. 2.Returns bounding boxes and confidence rate
  3. 3.Responses with annotated image
  4. 4.Simple web interface

Stack

  1. 1.Python
  2. 2.YOLOv8
  3. 3.FastAPI
  4. 4.OpenCV

Instalation

''' bash \ git clone https://github.com/s-dinmukhamed/vehicle-detection-api.git \ cd vehicle-detection-api \ python -m venv venv \ Mac: source venv/bin/activate Windows: venv\Scripts\activate \ pip install -r requirements.txt \ '''

Run

'''bash \ uvicorn main:app --reload \

Open http://localhost:8000


### POST /detect

Upload an image and get vehicle detections.

Request:  multipart/form-data with `file` field

Response: 
json
{
  "filename": "test.jpg",
  "total": 3,
  "detections": [
    {
      "class": "car",
      "confidence": 0.95,
      "bbox": [191, 857, 5477, 2862]
    }
  ],
  "image": ""
}

Project Structure

vehicle-detection-api/
├── main.py          # FastAPI app
├── detector.py      # YOLOv8 inference
├── static/
│   └── index.html   # Web interface
├── uploads/         # Temporary uploaded files
└── requirements.txt