Trash-Classifier / README.md
yasir-13001's picture
Update Readme
e8f3f13 verified
---
title: Trash Classifier
emoji: πŸš€
colorFrom: pink
colorTo: purple
sdk: gradio
sdk_version: 5.35.0
app_file: app.py
pinned: false
license: mit
short_description: Classify trash into 6 Categories with 90 percent accuracy
---
# 🧠 Trash Classifier - Smart Garbage Sorting AI
This model classifies waste images into one of six recyclable or non-recyclable categories:
- ♻️ Cardboard
- 🧴 Plastic
- πŸ“° Paper
- πŸͺ™ Metal
- 🍾 Glass
- πŸ—‘ Trash (non-recyclable)
---
## πŸš€ Try It Live
Upload an image of trash and the model will predict which category it belongs to.
---
## πŸ“‘ API Usage
Call this model programmatically using its REST API:
### πŸ” Python Example (`requests`):
```python
import requests
api_url = "https://yasir-13001-trash-classifier.hf.space/run/predict"
image_path = "example.jpg"
with open(image_path, "rb") as f:
files = {"image": f}
response = requests.post(api_url, files=files)
print(response.json())
````
---
### πŸ“¦ Input
* JPG or PNG image file
### 🧾 Output
A dictionary of class names and confidence scores, e.g.:
```json
{
"paper": 0.85,
"plastic": 0.03,
"trash": 0.02,
...
}
```
---
## πŸ›  Built With
* PyTorch
* TorchVision
* Gradio
* Hugging Face Spaces
---
## πŸ“š References
* [Hugging Face Spaces Documentation](https://huggingface.co/docs/hub/spaces)
* [Gradio Documentation](https://www.gradio.app/docs)
* [PyTorch Documentation](https://pytorch.org/docs)
---
## πŸ‘¨β€πŸ’» Author
Made with ❀️ by [Yasir](https://huggingface.co/yasir-13001)