Run this model with HF Jobs
Run shaktibiplab/Animal-Classification on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/shaktibiplab/Animal-Classification. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/shaktibiplab/Animal-Classification on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use shaktibiplab/Animal-Classification with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use shaktibiplab/Animal-Classification 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://shaktibiplab/Animal-Classification") - Notebooks
- Google Colab
- Kaggle
Upload model_card.md
Browse files1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
# Animal Recognition Model
## Model OverviewThis model is designed to classify images of animals into predefined categories. It uses a ResNet50V2 base model and has been trained on a custom dataset.
## ClassesThe model was trained on the following classes:- cat- dog- horse- lion- tiger- elephant
## Usage1. Load the model using TensorFlow/Keras.2. Preprocess the input image to a size of 256x256 and normalize it.3. Pass the preprocessed image to the model for prediction.
```pythonfrom keras.models import load_modelimport numpy as npfrom tensorflow.keras.utils import load_img, img_to_array
def predict_image(image_path, model): img = load_img(image_path, target_size=(256, 256)) img_array = img_to_array(img) / 255.0 img_array = np.expand_dims(img_array, axis=0) prediction = model.predict(img_array) return np.argmax(prediction, axis=1)
model = load_model('best_model.weights.h5')predicted_class = predict_image('/path/to/image.jpg', model)print(f"Predicted class: {predicted_class}")```
## Training Details- **Base Model:** ResNet50V2 (pretrained on ImageNet)- **Dataset:** Custom animal dataset- **Optimizer:** Adam- **Loss Function:** Sparse Categorical Crossentropy- **Metrics:** Accuracy- **Augmentation:** Applied during training
## Model PerformanceTraining metrics and evaluation logs are available in the accompanying notebook.model_card.mdAdded+47