Run this model with HF Jobs
Run Darshan764/waste-classification-v2 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/Darshan764/waste-classification-v2. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Darshan764/waste-classification-v2 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use Darshan764/waste-classification-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use Darshan764/waste-classification-v2 with Keras:
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://Darshan764/waste-classification-v2") - Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files1234567891011121314151617---library_name: keras---This model has been uploaded using the Keras library and can be used with JAX,TensorFlow, and PyTorch backends.This model card has been generated automatically and should be completed by themodel author.See [Model Cards documentation](https://huggingface.co/docs/hub/model-cards) formore information.For more details about the model architecture, check out[config.json](./config.json).12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273---language: enlicense: apache-2.0library_name: kerastags:- image-classification- waste-classification- tensorflow- keras- efficientnetdatasets:- alistairking/recyclable-and-household-waste-classificationmetrics:- accuracy---# Waste Classification V2 (EfficientNet)30-class waste image classifier built with EfficientNet transfer learning.## Model Details- **Architecture:** EfficientNetB0 + custom classification head- **Input size:** 224 x 224 x 3- **Framework:** TensorFlow / Keras- **Author:** Darshan764## Performance- **Validation Accuracy:** 87.3%- **Validation set:** 3,000 images (20% held-out)- **Number of classes:** 30## Classesaerosol_cans, aluminum_food_cans, aluminum_soda_cans, cardboard_boxes,cardboard_packaging, clothing, coffee_grounds, disposable_plastic_cutlery,eggshells, food_waste, glass_beverage_bottles, glass_cosmetic_containers,glass_food_jars, magazines, newspaper, office_paper, paper_cups,plastic_cup_lids, plastic_detergent_bottles, plastic_food_containers,plastic_shopping_bags, plastic_soda_bottles, plastic_straws,plastic_trash_bags, plastic_water_bottles, shoes, steel_food_cans,styrofoam_cups, styrofoam_food_containers, tea_bags## Dataset[Recyclable and Household Waste Classification](https://www.kaggle.com/datasets/alistairking/recyclable-and-household-waste-classification)- 15,000 images total (250 per class)- 80/20 train/validation split (seed=42)## Training- Optimizer: Adam- Loss: sparse_categorical_crossentropy- Batch size: 32- Callbacks: EarlyStopping, ReduceLROnPlateau, ModelCheckpoint## How to Use```pythonimport tensorflow as tfimport numpy as npfrom tensorflow.keras.utils import load_img, img_to_arraymodel = tf.keras.models.load_model("hf://Darshan764/waste-classification-v2")img = load_img("waste.jpg", target_size=(224, 224))arr = np.expand_dims(img_to_array(img), axis=0)pred = model.predict(arr, verbose=0)idx = int(np.argmax(pred[0]))print(f"Class index: {idx}")print(f"Confidence: {pred[0][idx]*100:.2f}%")```## Limitations- Trained only on the Kaggle dataset above; may not generalize to very different lighting/backgrounds.- Not intended for production waste-sorting systems without further validation.
README.md+66-10