fu4ll/Vehicle_Detection
0
1---2title: Vehicle Detection API3emoji: π4colorFrom: green5colorTo: blue6sdk: docker7pinned: false8---9 10# Vehicle Detection API11...12 13# vehicle-detection-api14 15REST API for detecting and tracking vehicles in images and videos using YOLOv8.16 17<img width="1258" height="860" alt="Π‘Π½ΠΈΠΌΠΎΠΊ ΡΠΊΡΠ°Π½Π° 2026-04-21 Π² 19 34 41" src="https://github.com/user-attachments/assets/a970938e-6e3f-4430-b18c-517dd7fdb63e" />18 19 20## Features 211. Detects cars, trucks, buses and motorcycles222. Returns bounding boxes and confidence rate233. Responses with annotated image244. Simple web interface25 26## Stack 271. Python282. YOLOv8293. FastAPI304. OpenCV31 32## Instalation 33''' bash \34git clone https://github.com/s-dinmukhamed/vehicle-detection-api.git \35cd vehicle-detection-api \36python -m venv venv \37Mac: source venv/bin/activate Windows: venv\Scripts\activate \ 38pip install -r requirements.txt \39'''40 41## Run 42'''bash \43uvicorn main:app --reload \44 45Open http://localhost:800046```47 48### POST /detect49 50Upload an image and get vehicle detections.51 52Request: multipart/form-data with `file` field53 54Response: 55json56{57 "filename": "test.jpg",58 "total": 3,59 "detections": [60 {61 "class": "car",62 "confidence": 0.95,63 "bbox": [191, 857, 5477, 2862]64 }65 ],66 "image": ""67}68```69 70## Project Structure71 72```73vehicle-detection-api/74βββ main.py # FastAPI app75βββ detector.py # YOLOv8 inference76βββ static/77β βββ index.html # Web interface78βββ uploads/ # Temporary uploaded files79βββ requirements.txt80```81 