Downloads · 30 days
33
17% of all-time downloads
michaelgathara/vit-face-universal
vit-face-universal is a image classification model from michaelgathara. Use it when you need a label for an image. It is set up for transformers.
This model is a fine-tuned version of trpakov/vit-face-expression on a massive combined dataset including: - Zenodo (IFEED) - Mendeley (GFFD-2025) - RAF-DB - AffectNet
Downloads · 30 days
33
17% of all-time downloads
All-time downloads
195
Public
Parameters
85.8M
2.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.pt1.4 GB · 57%
From the Hugging Face model README
This model is a fine-tuned version of trpakov/vit-face-expression on a massive combined dataset including:
from transformers import ViTImageProcessor, ViTForImageClassification
from PIL import Image
import requests
url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
image = Image.open(requests.get(url, stream=True).raw)
repo_name = "michaelgathara/vit-face-universal"
processor = ViTImageProcessor.from_pretrained(repo_name)
model = ViTForImageClassification.from_pretrained(repo_name)
inputs = processor(images=image, return_tensors="pt")
outputs = model(**inputs)
logits = outputs.logits
# model predicts one of the 7 emotions
predicted_class_idx = logits.argmax(-1).item()
print("Predicted class:", model.config.id2label[predicted_class_idx])