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
File size: 336 Bytes
16eceb4 | 1 2 3 4 5 6 7 8 9 10 | 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} |