Spaces:
Sleeping
Update README.md
Browse files# π§ Trash Classifier - ResNet Trash Sorting AI
This model classifies garbage into one of six categories:
- **Cardboard**
- **Glass**
- **Metal**
- **Paper**
- **Plastic**
- **Trash**
---
## π How to Use
### π Web Interface
Upload an image to the web interface above and get a prediction instantly.
---
### π‘ API Usage
You can use the Space programmatically with a POST request:
#### π Example using `requests` in Python:
```python
import requests
api_url = "https://yasir-13001-trash-classifier.hf.space/run/predict"
image_path = "test.jpg"
with open(image_path, "rb") as f:
files = {"image": f}
response = requests.post(api_url, files=files)
print(response.json())
````
---
### π¦ Input
* **Image file** (JPG, PNG)
### π§Ύ Output
* A dictionary with category names and confidence scores, e.g.:
```json
{
"cardboard": 0.02,
"glass": 0.01,
"metal": 0.10,
"paper": 0.85,
"plastic": 0.01,
"trash": 0.01
}
```
---
## π Built With
* π§ `PyTorch` for model training
* πΌ `torchvision` for image processing
* π `Gradio` for the frontend/API
* π€ Hosted on `Hugging Face Spaces`
---
## π Documentation
* [Hugging Face Spaces Documentation](https://huggingface.co/docs/hub/spaces)
* [Gradio Docs (Interface, API)](https://www.gradio.app/docs)
* [PyTorch](https://pytorch.org/docs/)
@@ -8,6 +8,7 @@ sdk_version: 5.35.0
|
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
license: mit
|
|
|
11 |
---
|
12 |
|
13 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
license: mit
|
11 |
+
short_description: Classify trash into 6 Categories with 90 percent accuracy
|
12 |
---
|
13 |
|
14 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|