ONNX Model Zoo

opencv/facial_expression_recognition

By opencv · ↓ 0 · ♥ 7 · Updated 2025-06-20

What's in this repo

This page lists the files in opencv/facial_expression_recognition, including facial_expression_recognition_mobilefacenet_2022july.onnx, facial_expression_recognition_mobilefacenet_2022july_int8.onnx, facial_expression_recognition_mobilefacenet_2022july_int8bq.onnx.

  • 3 ONNX models (.onnx files)
  • 12 files, including 3 .py, 3 .onnx, 1 .txt, 1 .md, 1 .cpp, 1 .jpg
  • Last updated 2025-06-20

ONNX files

File Size Download
facial_expression_recognition_mobilefacenet_2022july.onnx — Download
facial_expression_recognition_mobilefacenet_2022july_int8.onnx — Download
facial_expression_recognition_mobilefacenet_2022july_int8bq.onnx — Download

How to use

These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.

README

Progressive Teacher

Progressive Teacher: Boosting Facial Expression Recognition by A Semi-Supervised Progressive Teacher

Note:

Results of accuracy evaluation on RAF-DB.

Models Accuracy
Progressive Teacher 88.27%

Demo

NOTE: This demo uses ../face_detection_yunet as face detector, which supports 5-landmark detection for now (2021sep).

Python

Run the following command to try the demo:

# recognize the facial expression on images
python demo.py --input /path/to/image -v

C++

Install latest OpenCV and CMake >= 3.24.0 to get started with:

# A typical and default installation path of OpenCV is /usr/local
cmake -B build -D OPENCV_INSTALLATION_PATH=/path/to/opencv/installation .
cmake --build build

# detect on camera input
./build/opencv_zoo_face_expression_recognition
# detect on an image
./build/opencv_zoo_face_expression_recognition -i=/path/to/image
# get help messages
./build/opencv_zoo_face_expression_recognition -h

Example outputs

Note: Zoom in to to see the recognized facial expression in the top-left corner of each face boxes.

fer demo

License

All files in this directory are licensed under Apache 2.0 License.

Reference

  • https://ieeexplore.ieee.org/abstract/document/9629313

Model info

onnx region:us
↓ 0 ♥ 7

Created: 2025-06-09

Updated: 2025-06-20

View on Hugging Face

Files (12)

.gitattributes
.gitignore
CMakeLists.txt
README.md
demo.cpp
demo.py
example_outputs/selfie.jpg
facial_expression_recognition_mobilefacenet_2022july.onnx ONNX
facial_expression_recognition_mobilefacenet_2022july_int8.onnx ONNX
facial_expression_recognition_mobilefacenet_2022july_int8bq.onnx ONNX
facial_fer_model.py
yunet.py

Related models