AlirezaF138/ckplus-dataset
Viewer • Updated • 981 • 99
How to use ChristopherLi/vit-ckplus-emotion with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-classification", model="ChristopherLi/vit-ckplus-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-ckplus-emotion")
model = AutoModelForImageClassification.from_pretrained("ChristopherLi/vit-ckplus-emotion", device_map="auto")Vision Transformer fine-tuned for 7-class facial emotion recognition on CK+.
Initialized from a FER2013-tuned ViT, then fine-tuned on CK+. Best for clean, frontal, posed lab faces. Prefer the FER2013 model for webcam / in-the-wild use.
anger, contempt, disgust, fear, happy, sadness, surprise
from transformers import pipeline
clf = pipeline("image-classification", model="ChristopherLi/vit-ckplus-emotion")
print(clf("face.jpg"))
google/vit-base-patch16-224-in21k3e-5| Metric | Value |
|---|---|
| Accuracy | 98.0% |
| Macro F1 | 0.965 |
See the project README for caveats about CK+ generalization.
Base model
google/vit-base-patch16-224-in21k