abhilash88/fer2013-enhanced
Viewer • Updated • 35.9k • 361 • 2
How to use ChristopherLi/vit-fer2013-emotion with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-classification", model="ChristopherLi/vit-fer2013-emotion")
pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png") # Load model directly
from transformers import AutoImageProcessor, AutoModelForImageClassification
processor = AutoImageProcessor.from_pretrained("ChristopherLi/vit-fer2013-emotion")
model = AutoModelForImageClassification.from_pretrained("ChristopherLi/vit-fer2013-emotion", device_map="auto")Vision Transformer fine-tuned for 7-class facial emotion recognition on the FER2013 Enhanced dataset.
Best for in-the-wild / webcam faces.
angry, disgust, fear, happy, sad, surprise, neutral
from transformers import pipeline
clf = pipeline("image-classification", model="ChristopherLi/vit-fer2013-emotion")
print(clf("face.jpg"))
Or with this project's webcam app:
python webcam_app.py --model ChristopherLi/vit-fer2013-emotion
google/vit-base-patch16-224-in21k5e-5, effective batch size 32| Metric | Value |
|---|---|
| Accuracy | 69.4% |
| Macro F1 | 0.656 |
FER2013 is a noisy benchmark (human agreement ~65%). See the project README for details.
Base model
google/vit-base-patch16-224-in21k