Image Classification
Transformers
Safetensors
cetaceanet
biology
biodiversity
custom_code
cetacean-classifier / test_model.py
MalloryWittwerEPFL's picture
Fix broken model
b3201aa
raw
history blame contribute delete
388 Bytes
import os
import cv2
os.environ["PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION"] = "python"
from transformers import AutoModelForImageClassification
if __name__ == "__main__":
cetacean_classifier = AutoModelForImageClassification.from_pretrained("Saving-Willy/cetacean-classifier", trust_remote_code=True)
img = cv2.imread("tail.jpg")
out = cetacean_classifier(img)
print(out)