README.md
March 19, 2026 Β· View on GitHub
AUCanvas
Facial Action Unit Detection & Visualization Framework
Created by Awakening AI
πΈ Showcase
Example running on a RTX 3090 GPU (Avg. FPS>50):
π’ News
- π Initial release of the AUCanvas viewer code and onnx model
- π¦ Upcoming: Qt interface
π TODO
- β Release the viewer code
- β Release the pretrained model
- β Release the Qt interface
π Table of Contents
π οΈ Installation
Requirements:
- Python β₯ 3.10
- (Optional) CUDA 12.x + cuDNN 9.x for GPU inference
1. Create Environment
conda create -n au-canvas python=3.10
conda activate au-canvas
2. Install Dependencies
π Option A: GPU (Linux/Windows with CUDA)
If you have a supported NVIDIA GPU and CUDA 12.x installed:
pip install mediapipe==0.10.14 \
numpy==1.22.0 \
onnx==1.17.0 \
onnxruntime-gpu==1.22.0 \
opencv-contrib-python==4.10.0.84 \
opencv-python==4.10.0.84 \
opencv-python-headless==4.10.0.84
π Option B: CPU-only (Linux/macOS/Windows without CUDA)
For machines without GPU or on macOS:
pip install mediapipe==0.10.14 \
numpy==1.22.0 \
onnx==1.17.0 \
onnxruntime==1.22.0 \
opencv-contrib-python==4.10.0.84 \
opencv-python==4.10.0.84 \
opencv-python-headless==4.10.0.84
Downloading Models:
Download the following checkpoints and put them inside the folder './model_weights'.
π― Running
A tidy cheat-sheet of commands to run your programβoffline (video file) and online (live camera).
Offline (video file)
1) Display with panel (no saving)
python3 video_viewer.py \
--video /path/to/video.mp4 \
--onnx_au model_weights/FAU.onnx \
--mp_task model_weights/face_landmarker.task \
--proc_h 1024 \
--with_panel_display \
--offline_pacing --offline_skip_policy drop
2) Save overlay with panel, display without panel
python3 video_viewer.py \
--video /path/to/video.mp4 \
--onnx_au model_weights/FAU.onnx \
--mp_task model_weights/face_landmarker.task \
--proc_h 1024 \
--with_panel_save --save_with_overlay \
--save_video ./out_overlay_panel.mp4 \
--csv_out ./out_AUs.csv
Online (live camera)
Press q to quit the window. Replace
0with your camera index if needed.
1) Display with panel (saving raw frames)
python3 video_viewer.py \
--camera 0 \
--onnx_au model_weights/FAU.onnx \
--mp_task model_weights/face_landmarker.task \
--proc_h 1024 \
--with_panel_display \
--save_video ./cam_raw.mp4 \
--csv_out ./cam_raw_AUs.csv
2) Fast path live: display and save without panel (light striding), save overlay
python3 video_viewer.py \
--camera 0 \
--onnx_au model_weights/FAU.onnx \
--mp_task model_weights/face_landmarker.task \
--proc_h 512 \
--infer_stride 2 --ui_stride 2 --live_mp_stride 3 \
--save_with_overlay \
--save_video ./cam_overlay_panel.mp4 \
--csv_out ./cam_raw_AUs.csv
Flag quick reference
--with_panel_display/--with_panel_saveβ show/save the right info panel.--save_with_overlayβ save whatever is drawn (panel and/or muscles). Omit to save raw frames.--proc_h 512β process & draw at height 512 (keeps aspect).--infer_stride Nβ run AU model every N frames (reuse last probs between).--ui_stride Nβ rebuild visualization every N frames.--disable_mp/--live_mp_stride Nβ turn off or stride MediaPipe landmarks.--offline_pacing --offline_skip_policy dropβ smooth offline playback and drop backlog to keep up.--fast_writerβ MJPG codec (faster writes, larger files).--csv_out path.csvβ AU log file.--save_video pathβ output video file.--start secondsβ start time for offline video.
β‘ Inference Speed
| Device | Speed |
|---|---|
| RTX 3090 GPU | > 50 FPS |
| CPU only | > 5 FPS |
π§ͺ Customized Inference
(Coming soon) Guidelines for running real-time or offline inference with custom settings.
ποΈ Citation
If you find this work useful in your research, please cite:
@inproceedings{luo2022learning,
title = {Learning Multi-dimensional Edge Feature-based AU Relation Graph for Facial Action Unit Recognition},
author = {Luo, Cheng and Song, Siyang and Xie, Weicheng and Shen, Linlin and Gunes, Hatice},
booktitle = {Proceedings of the Thirty-First International Joint Conference on Artificial Intelligence, {IJCAI-22}},
pages = {1239--1246},
year = {2022}
}
π€ Acknowledgements
We gratefully acknowledge the following open-source projects: