yasir-13001 commited on
Commit
ed8cfa9
Β·
verified Β·
1 Parent(s): 2163ed1

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/)

Files changed (1) hide show
  1. README.md +2 -1
README.md CHANGED
@@ -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