Spaces:
Sleeping
Sleeping
A newer version of the Gradio SDK is available:
5.44.1
metadata
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
):
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.:
{
"paper": 0.85,
"plastic": 0.03,
"trash": 0.02,
...
}
π Built With
- PyTorch
- TorchVision
- Gradio
- Hugging Face Spaces
π References
π¨βπ» Author
Made with β€οΈ by Yasir