Instructions to use SabaTariq510/waste-classification-models with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use SabaTariq510/waste-classification-models with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://SabaTariq510/waste-classification-models") - Notebooks
- Google Colab
- Kaggle
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
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.
- Downloads last month
- 18