Instructions to use Syahhh01/Stunting_model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- TF-Keras
How to use Syahhh01/Stunting_model with TF-Keras:
# Note: 'keras<3.x' or 'tf_keras' must be installed (legacy), and from_pretrained_keras was removed in huggingface_hub 1.0. # See https://github.com/keras-team/tf-keras for more details. # !pip install "huggingface_hub<1.0" tf_keras from huggingface_hub import from_pretrained_keras model = from_pretrained_keras("Syahhh01/Stunting_model") - Notebooks
- Google Colab
- Kaggle
File size: 381 Bytes
7fbc827 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # app.py
import tensorflow as tf
import numpy as np
from PIL import Image
model = tf.keras.models.load_model('.')
def predict(image):
# Preprocess image
image = image.resize((224, 224))
image_array = np.array(image) / 255.0
image_array = np.expand_dims(image_array, axis=0)
# Predict
predictions = model.predict(image_array)
return predictions[0] |