A FastAPI-powered app for detecting & classifying electronic waste (e-waste) using YOLO deep learning.
Upload photos of devices and get instant detection—with bounding boxes!
Streamlit App Link(Without FastAPI):https://ewaste-fastapi-mre8zdpysgevmnnvhregdu.streamlit.app/
- ⚡ FastAPI Backend: Blazing-fast, modern API.
- 🖼 YOLO Detection: Deep learning to spot e-waste in your pics.
- 📤 Easy Upload: Drag & drop or API-ready.
- 🔲 Visual Results: Returned images are automatically annotated.
- 🗃 REST API: Connect with your own workflows.
- 📝 Swagger Docs: Instant API playground (
/docs).
Requirements
- Python 3.8+
- FastAPI, Uvicorn
- Pillow, Numpy
- Pydantic
- Ultralytics YOLO
# Get the code
git clone https://github.com/Dexter0013/ewaste-fastapi.git
cd ewaste-fastapi
# Optional: virtual environment
python -m venv venv
source venv/bin/activate
# Install reqs
pip install -r requirements.txtuvicorn main:app --host 0.0.0.0 --port 8000- Visit: http://localhost:8000/docs for interactive API docs.
- Endpoint:
POST /predict - Data:
file(image)
curl -F "file=@your-image.jpg" http://localhost:8000/predict --output detected.jpg- 🔳 Gets you: Image with e-waste items highlighted!
ewaste-fastapi/
│
├── main.py # API app & endpoints
├── Model/best.pt # Model & image helpers
├── Static # Website template
├── requirements.txt
└── README.md
- Change the YOLO model? Simply swap the weights in your project folder.
- New classes? Retrain. (Use your dataset if needed.)
Released under the MIT License.
Pull requests and feedback welcome!
Use GitHub Issues or start a thread in Discussions.