Instructions to use ay8112/cleancity-waste-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use ay8112/cleancity-waste-classifier with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://ay8112/cleancity-waste-classifier") - Notebooks
- Google Colab
- Kaggle
CleanCity Waste Classifier
Waste classification model for the CleanCity application.
Model Description
This is a Keras/TensorFlow model trained to classify different types of waste:
- Organic
- Plastic
- Paper
- Metal
- Glass
- Cardboard
Usage
from tensorflow import keras
import numpy as np
from PIL import Image
# Load model
model = keras.models.load_model('waste_classifier_best.h5')
# Prepare image
img = Image.open('waste_image.jpg').resize((224, 224))
img_array = np.array(img) / 255.0
img_array = np.expand_dims(img_array, axis=0)
# Predict
prediction = model.predict(img_array)
categories = ['organic', 'plastic', 'paper', 'metal', 'glass', 'cardboard']
result = categories[np.argmax(prediction)]
print(f"Predicted: {result}")
Model Details
- Framework: TensorFlow/Keras
- Input Size: 224x224
- Output: 6 classes
- Format: .h5 (Keras)
Application
This model is used in the CleanCity civic waste reporting application.
Repository: CleanCity-AI
- Downloads last month
- -