Skip to content

karimda/Object-detection-yolo-api

Repository files navigation

Object Detection API (YOLOv3 + Flask + Docker)

This project provides a REST API for object detection using a pre-trained YOLOv3 model. It is implemented with Flask, OpenCV DNN, and fully Dockerized.


✨ Features

  • ✅ YOLOv3 pre-trained model (no training required)
  • ✅ Non-Max Suppression (NMS)
  • ✅ Annotated image output
  • ✅ REST API (Flask)
  • ✅ Docker-ready deployment

📂 Project Structure

Panneaux/ │ ├── app.py ├── Dockerfile ├── requirements.txt │ ├── yolo/ │ ├── yolov3.cfg │ ├── yolov3.weights │ └── coco.names │ ├── test_images/ │ └── test.jpg │ └── outputs/


⚙️ Installation (Local)

python -m venv venv
source venv/Scripts/activate
pip install -r requirements.txt
python app.py

API runs on:
http://localhost:5000


🐳 Docker Deployment
Build image
docker build -t panneaux-api .

Run container
docker run -p 5000:5000 panneaux-api

🧪 API Usage
Endpoint
POST /predict

Request (curl)

curl -X POST http://localhost:5000/predict \
  -F "image=@test_images/test.jpg" \
  --output result.png


Response
Annotated image (PNG)
Bounding boxes + labels + confidence


🧠 Model Details

Model: YOLOv3

Framework: OpenCV DNN

Dataset: COCO

Input size: 416×416

⚠️ Notes

.weights file is not included due to GitHub size limits.

Download YOLOv3 weights from:
https://pjreddie.com/darknet/yolo/

👤 Author

Karim Dab
Artificial Intelligence & Computer Vision

📜 License

This project is for academic and educational use.


---

## 🎯 Tu as maintenant :
✅ YOLO + NMS  
✅ Image annotée  
✅ Docker prêt  
✅ README professionnel  

Si tu veux, prochaine étape possible :
- Swagger / OpenAPI  
- Déploiement cloud (Render / Railway / AWS)  
- YOLOv8 (Ultralytics)  
- API retournant **JSON + image**

## YOLO Weights

Due to GitHub file size limits, the YOLOv3 weights are not included.

Download them from:
https://pjreddie.com/media/files/yolov3.weights

Place the file here:
yolo/yolov3.weights

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages