ποΈ Trash Sorter AI
Classifies waste as Organic or Recyclable with 93.37% accuracy.
Quick Start
# 1. Install
!pip install tensorflow
# 2. Load model
from huggingface_hub import hf_hub_download
from tensorflow import keras
model_path = hf_hub_download(
repo_id="tahazyan/trash-sorter-ai",
filename="trash_sorter.keras"
)
model = keras.models.load_model(model_path)
# 3. Use
import cv2
import numpy as np
def classify_waste(image_path):
img = cv2.imread(image_path)
img = cv2.resize(img, (224, 224))
img = img / 255.0
img = np.expand_dims(img, axis=0)
prediction = model.predict(img)[0]
classes = ["Organic", "Recyclable"]
return classes[np.argmax(prediction)]
Model Details
Architecture: MobileNetV2 + Custom layers
Input: 224Γ224 RGB images
Output: 2 classes (Organic, Recyclable)
Accuracy: 93.37% on validation set
Training data: 22,564 images
Training time: ~6 hours on Colab GPU
Example Results
| Organic Waste | Recyclable Waste |
|---|---|
| Food scraps | Plastic bottles |
| Yard waste | Glass jars |
| Paper towels | Aluminum cans |
About the Creator
This model was created as part of an AI waste management project to help reduce improper waste disposal.
License
Apache 2.0 - Free for personal and commercial use.
- Downloads last month
- 16