CoolFace
Apppublic

fu4ll/Vehicle_Detection

sourceHugging Faceupdated 5mo agoView on Hugging Face
0likes
README.md81 linesDownload Raw Back to root
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