Instructions to use diozhug/tensorflow-trash-classification with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use diozhug/tensorflow-trash-classification with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://diozhug/tensorflow-trash-classification") - Notebooks
- Google Colab
- Kaggle
| datasets: | |
| - garythung/trashnet | |
| language: | |
| - en | |
| metrics: | |
| - accuracy | |
| library_name: keras | |
| This repository contains a sample work to classify garbage type based on resized images on this [repository](https://huggingface.co/datasets/garythung/trashnet). | |
| There are 2 models available: | |
| - trash-classification-no-aug.keras | |
| - trash-classification-aug.keras | |
| The `trash-classification-no-aug.keras` model trained without data augmentation: | |
| ```python | |
| datagen = ImageDataGenerator( | |
| validation_split=0.2 | |
| ) | |
| ``` | |
| While the `trash-classification-aug.keras` model trained with more data augmentation works in the dataset: | |
| ```python | |
| # With data augmentation | |
| datagen = ImageDataGenerator( | |
| rescale=1./255, | |
| validation_split=0.2, | |
| width_shift_range=0.1, | |
| height_shift_range=0.1, | |
| horizontal_flip=True | |
| ) | |
| ``` | |
| The models trained with Tensorflow Functional API by using this approach: | |
| ``` | |
| Conv --> BatchNorm --> Conv --> BatchNorm --> MaxPooling (3x) | |
| ``` | |
| For the detailed description about the training process and models' performace, you can visit this Github [repository](https://github.com/dioz95/trash-classification/tree/main). |