SabaTariq510's picture
Upload README.md with huggingface_hub
44d80cd verified
|
Raw
History Blame Contribute Delete
2.34 kB
---
license: mit
tags:
- image-classification
- object-detection
- waste-classification
- recycling
- mobilenet
- yolov8
- tensorflow
- pytorch
---
# Smart Waste Classification Models
Is repository mein 2 trained models hain jo waste (kachra) images ko classify karne ke liye use hote hain. Dono models ek Flask/Gradio app mein integrate kiye gaye hain jahan user apni marzi se koi bhi ek model select kar sakta hai.
## Models
### 1. `best_mobilenet.keras` — MobileNetV2 (Image Classification)
- **Task:** Whole-image classification (5 classes)
- **Framework:** TensorFlow / Keras
- **Input size:** 224x224 RGB image
- **Classes:**
- cardboard
- glass
- metal
- paper
- plastic
- trash
Ye model poori image ko dekh kar batata hai ke image mein sabse zyada kis waste category ka material hai. Har class ke liye ek confidence score bhi milta hai.
### 2. `bestyolomodel.pt` — YOLOv8 (Object Detection)
- **Task:** Object detection (3 classes)
- **Framework:** Ultralytics YOLOv8 / PyTorch
- **Classes:** 3 waste categories (bounding-box ke sath localization)
Ye model image ke andar waste object ko detect karta hai aur uske around bounding box + class + confidence deta hai. MobileNet ke muqable ye batata hai ke object **kahan** hai, sirf ye nahi ke image mein kya hai.
## Recyclability Mapping
Dono models ke output ko is mapping ke zariye Recyclable / Non-Recyclable mein convert kiya jata hai:
| Class | Status |
|------------|----------------|
| cardboard | Recyclable |
| glass | Recyclable |
| metal | Recyclable |
| paper | Recyclable |
| plastic | Recyclable |
| trash | Non-Recyclable |
## Usage
```python
from huggingface_hub import hf_hub_download
from tensorflow.keras.models import load_model
from ultralytics import YOLO
REPO_ID = "SabaTariq510/waste-classification-models"
# MobileNetV2
mobilenet_path = hf_hub_download(repo_id=REPO_ID, filename="best_mobilenet.keras")
mobilenet_model = load_model(mobilenet_path)
# YOLOv8
yolo_path = hf_hub_download(repo_id=REPO_ID, filename="bestyolomodel.pt")
yolo_model = YOLO(yolo_path, task="detect")
```
## App
Ye models ek Gradio app mein deploy kiye gaye hain jahan user image upload kar ke MobileNetV2 ya YOLOv8 mein se koi bhi model select kar sakta hai prediction ke liye.