Downloads · 30 days
2
1% of all-time downloads
furkankarakuz/AnimalVision
AnimalVision is a image classification model from furkankarakuz. Use it when you need a label for an image. It is set up for keras. The card lists the license as apache-2.0.
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.
Downloads · 30 days
2
1% of all-time downloads
All-time downloads
212
Public
Repo size
14.1 MB
Likes
0
Public
Click a slice to open those files.
.keras14.1 MB · 100%
From the Hugging Face model README
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.
.keras model fileYou can download and use this model from Hugging Face with TensorFlow/Keras.
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)
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}")
Feel free to share your feedback while using the model! 🎯