AnimalVision: Animal Classification Model
AnimalVision is a Convolutional Neural Network (CNN) model trained to classify 90 different animal species. The model is trained using Keras and is available on the Hugging Face platform.
π Model Details
- Model Type: Convolutional Neural Network (CNN)
- Dataset: A diverse dataset containing 90 animal classes
- Libraries: TensorFlow / Keras
- Format:
.keras
model file
π Usage
You can download and use this model from Hugging Face with TensorFlow/Keras.
1οΈβ£ Load the Model
from tensorflow import keras
import huggingface_hub
model_path = huggingface_hub.hf_hub_download("furkankarakuz/AnimalVision", "AnimalVisionModel.keras")
model = keras.models.load_model(model_path)
2οΈβ£ Make Predictions with the Model
from tensorflow import keras
from tensorflow.keras.preprocessing import image
import huggingface_hub
import numpy as np
model_path = huggingface_hub.hf_hub_download("furkankarakuz/AnimalVision", "AnimalVisionModel.keras")
model = keras.models.load_model(model_path)
def load_animal_labels():
label_path = huggingface_hub.hf_hub_download("furkankarakuz/AnimalVision", "AnimalList.txt")
with open(label_path, "r") as file:
return file.read().split("\n")
def predict_image(img_path, model):
img = image.load_img(img_path, target_size=(224, 224))
img_array = image.img_to_array(img) / 255.0
img_array = np.expand_dims(img_array, axis=0)
predictions = model.predict(img_array, verbose=0)[0]
class_index = np.argmax(predictions)
animal_classes = load_animal_labels()
animal_name = animal_classes[class_index]
return animal_name
image_path = "example.jpg"
predicted_animal = predict_image(image_path, model)
print(f"Predicted Animal: {predicted_animal}")
π Links and Resources
- π GitHub Repository: AnimalVision GitHub
- π Streamlit Demo: Streamlit App
Feel free to share your feedback while using the model! π―
- Downloads last month
- 28
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
π
Ask for provider support