Interpretable Image Classification with Adaptive Prototype-based Vision Transformers
Paper
•
2410.20722
•
Published
•
1
This is a fine-tuned deit_small_patch16_224 model trained on Pinterest Face Recognition Dataset from the paper "Interpretable Image Classification with Adaptive Prototype-based Vision Transformers".
14finetuned0.8042A face recognition dataset collected from Pinterest containing 155 different identity classes Dataset link: https://www.kaggle.com/datasets/hereisburak/pins-face-recognition
from transformers import AutoImageProcessor, AutoModelForImageClassification
from PIL import Image
# Load model and processor
model = AutoModelForImageClassification.from_pretrained("Ayushnangia/protovit-deit_small_patch16_224-pins")
processor = AutoImageProcessor.from_pretrained("Ayushnangia/protovit-deit_small_patch16_224-pins")
# Prepare image
image = Image.open("path_to_your_image.jpg")
inputs = processor(images=image, return_tensors="pt")
# Make prediction
outputs = model(**inputs)
predicted_label = outputs.logits.argmax(-1).item()
Github repo by authors of the paper ![GitHub repository][https://github.com/Henrymachiyu/ProtoViT]
For more details about the implementation and training process, please visit the my fork of ProtoVit GitHub repository.