garythung/trashnet
Viewer • Updated • 5.05k • 1.19k • 22
How to use Stefaron/trash-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://Stefaron/trash-classifier")
This model is a fine-tuned ResNet50 for classifying trash images into categories such as plastic, paper, glass, metal, and others.
Load the model and use it for inference:
import tensorflow as tf
model = tf.keras.models.load_model("Stefaron/trash-classifier/best_model.keras")