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
Download Model_DenseNet/app.py from Syahhh01/Stunting_model: direct link, hf CLI and curl.
- Browser
- Download file 381 Bytes
-
https://huggingface.co/Syahhh01/Stunting_model/resolve/main/Model_DenseNet/app.py
- Command line
-
hf download hf://Syahhh01/Stunting_model/Model_DenseNet/app.py
-
curl -L -o app.py https://huggingface.co/Syahhh01/Stunting_model/resolve/main/Model_DenseNet/app.py
381 Bytes
| # 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] |