Instructions to use nico9ga/fruits-Classification-Model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use nico9ga/fruits-Classification-Model 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://nico9ga/fruits-Classification-Model") - Notebooks
- Google Colab
- Kaggle
Download main.py from nico9ga/fruits-Classification-Model: direct link, hf CLI and curl.
- Browser
- Download file 336 Bytes
-
https://huggingface.co/nico9ga/fruits-Classification-Model/resolve/main/main.py
- Command line
-
hf download hf://nico9ga/fruits-Classification-Model/main.py
-
curl -L -o main.py https://huggingface.co/nico9ga/fruits-Classification-Model/resolve/main/main.py
336 Bytes
| from prediction import predict_class | |
| import tensorflow as tf | |
| # Cargar el modelo | |
| new_model = tf.keras.models.load_model('fruits_detection.keras') | |
| # Función para manejar la solicitud de predicción | |
| def predict_image(image_path): | |
| predicted_class = predict_class(new_model, image_path) | |
| return {"predicted_class": predicted_class} |