Run this model with HF Jobs
Run afurkank/vit-face-expression on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/afurkank/vit-face-expression. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/afurkank/vit-face-expression on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use afurkank/vit-face-expression with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use afurkank/vit-face-expression with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="afurkank/vit-face-expression") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# pip install -U transformers accelerate # Load model directly from transformers import AutoImageProcessor, AutoModelForImageClassification processor = AutoImageProcessor.from_pretrained("afurkank/vit-face-expression") model = AutoModelForImageClassification.from_pretrained("afurkank/vit-face-expression", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Duplicate from trpakov/vit-face-expression
Browse filesCo-authored-by: Tr Pakov <trpakov@users.noreply.huggingface.co>
Files changed (9)
- .gitattributesAdded+34
- README.mdAdded+46
- config.jsonAdded+42
- model.safetensorsAdded+3
- onnx/config.jsonAdded+41
- onnx/model.onnxAdded+3
- onnx/preprocessor_config.jsonAdded+23
- preprocessor_config.jsonAdded+17
- pytorch_model.binAdded+3
12345678910111213141516171819202122232425262728293031323334*.7z filter=lfs diff=lfs merge=lfs -text*.arrow filter=lfs diff=lfs merge=lfs -text*.bin filter=lfs diff=lfs merge=lfs -text*.bz2 filter=lfs diff=lfs merge=lfs -text*.ckpt filter=lfs diff=lfs merge=lfs -text*.ftz filter=lfs diff=lfs merge=lfs -text*.gz filter=lfs diff=lfs merge=lfs -text*.h5 filter=lfs diff=lfs merge=lfs -text*.joblib filter=lfs diff=lfs merge=lfs -text*.lfs.* filter=lfs diff=lfs merge=lfs -text*.mlmodel filter=lfs diff=lfs merge=lfs -text*.model filter=lfs diff=lfs merge=lfs -text*.msgpack filter=lfs diff=lfs merge=lfs -text*.npy filter=lfs diff=lfs merge=lfs -text*.npz filter=lfs diff=lfs merge=lfs -text*.onnx filter=lfs diff=lfs merge=lfs -text*.ot filter=lfs diff=lfs merge=lfs -text*.parquet filter=lfs diff=lfs merge=lfs -text*.pb filter=lfs diff=lfs merge=lfs -text*.pickle filter=lfs diff=lfs merge=lfs -text*.pkl filter=lfs diff=lfs merge=lfs -text*.pt filter=lfs diff=lfs merge=lfs -text*.pth filter=lfs diff=lfs merge=lfs -text*.rar filter=lfs diff=lfs merge=lfs -text*.safetensors filter=lfs diff=lfs merge=lfs -textsaved_model/**/* filter=lfs diff=lfs merge=lfs -text*.tar.* filter=lfs diff=lfs merge=lfs -text*.tflite filter=lfs diff=lfs merge=lfs -text*.tgz filter=lfs diff=lfs merge=lfs -text*.wasm filter=lfs diff=lfs merge=lfs -text*.xz filter=lfs diff=lfs merge=lfs -text*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text12345678910111213141516171819202122232425262728293031323334353637383940414243444546---{}---# Vision Transformer (ViT) for Facial Expression Recognition Model Card
## Model Overview
- **Model Name:** [trpakov/vit-face-expression](https://huggingface.co/trpakov/vit-face-expression)
- **Task:** Facial Expression/Emotion Recognition
- **Dataset:** [FER2013](https://www.kaggle.com/datasets/msambare/fer2013)
- **Model Architecture:** [Vision Transformer (ViT)](https://huggingface.co/docs/transformers/model_doc/vit)
- **Finetuned from model:** [vit-base-patch16-224-in21k](https://huggingface.co/google/vit-base-patch16-224-in21k)
## Model Description
The vit-face-expression model is a Vision Transformer fine-tuned for the task of facial emotion recognition.
It is trained on the FER2013 dataset, which consists of facial images categorized into seven different emotions:- Angry- Disgust- Fear- Happy- Sad- Surprise- Neutral
## Data Preprocessing
The input images are preprocessed before being fed into the model. The preprocessing steps include:- **Resizing:** Images are resized to the specified input size.- **Normalization:** Pixel values are normalized to a specific range.- **Data Augmentation:** Random transformations such as rotations, flips, and zooms are applied to augment the training dataset.
## Evaluation Metrics
- **Validation set accuracy:** 0.7113- **Test set accuracy:** 0.7116
## Limitations
- **Data Bias:** The model's performance may be influenced by biases present in the training data.- **Generalization:** The model's ability to generalize to unseen data is subject to the diversity of the training dataset.123456789101112131415161718192021222324252627282930313233343536373839404142{ "_name_or_path": "google/vit-base-patch16-224-in21k", "architectures": [ "ViTForImageClassification" ], "attention_probs_dropout_prob": 0.0, "encoder_stride": 16, "hidden_act": "gelu", "hidden_dropout_prob": 0.0, "hidden_size": 768, "id2label": { "0": "angry", "1": "disgust", "2": "fear", "3": "happy", "4": "neutral", "5": "sad", "6": "surprise" }, "image_size": 224, "initializer_range": 0.02, "intermediate_size": 3072, "label2id": { "angry": "0", "disgust": "1", "fear": "2", "happy": "3", "neutral": "4", "sad": "5", "surprise": "6" }, "layer_norm_eps": 1e-12, "model_type": "vit", "num_attention_heads": 12, "num_channels": 3, "num_hidden_layers": 12, "patch_size": 16, "problem_type": "single_label_classification", "qkv_bias": true, "torch_dtype": "float32", "transformers_version": "4.24.0"}123version https://git-lfs.github.com/spec/v1oid sha256:48acf03b1fd90ea45c5e91eb3be2f364cee1c1342639962bd4eae1eac2ad2f93size 3432393561234567891011121314151617181920212223242526272829303132333435363738394041{ "_name_or_path": "trpakov/vit-face-expression", "architectures": [ "ViTForImageClassification" ], "attention_probs_dropout_prob": 0.0, "encoder_stride": 16, "hidden_act": "gelu", "hidden_dropout_prob": 0.0, "hidden_size": 768, "id2label": { "0": "angry", "1": "disgust", "2": "fear", "3": "happy", "4": "neutral", "5": "sad", "6": "surprise" }, "image_size": 224, "initializer_range": 0.02, "intermediate_size": 3072, "label2id": { "angry": "0", "disgust": "1", "fear": "2", "happy": "3", "neutral": "4", "sad": "5", "surprise": "6" }, "layer_norm_eps": 1e-12, "model_type": "vit", "num_attention_heads": 12, "num_channels": 3, "num_hidden_layers": 12, "patch_size": 16, "problem_type": "single_label_classification", "qkv_bias": true, "transformers_version": "4.34.0"}123version https://git-lfs.github.com/spec/v1oid sha256:e279a0eec58bba13c563598268768560c550c6e247676a2cb06bab644b39158asize 3434792771234567891011121314151617181920212223{ "do_normalize": true, "do_rescale": true, "do_resize": true, "feature_extractor_type": "ViTFeatureExtractor", "image_mean": [ 0.5, 0.5, 0.5 ], "image_processor_type": "ViTFeatureExtractor", "image_std": [ 0.5, 0.5, 0.5 ], "resample": 2, "rescale_factor": 0.00392156862745098, "size": { "height": 224, "width": 224 }}1234567891011121314151617{ "do_normalize": true, "do_resize": true, "feature_extractor_type": "ViTFeatureExtractor", "image_mean": [ 0.5, 0.5, 0.5 ], "image_std": [ 0.5, 0.5, 0.5 ], "resample": 2, "size": 224}123version https://git-lfs.github.com/spec/v1oid sha256:17268e15dabb64cd6751b63abb51ac860231374b747f68fbf12a2815c80dd9efsize 343282353.gitattributesAdded+34
README.mdAdded+46
config.jsonAdded+42
model.safetensorsAdded+3
onnx/config.jsonAdded+41
onnx/model.onnxAdded+3
onnx/preprocessor_config.jsonAdded+23
preprocessor_config.jsonAdded+17
pytorch_model.binAdded+3