Realtime human head pose estimation with ONNX Runtime and OpenCV.
There are three major steps:
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
The code was tested on Ubuntu 22.04 with following frameworks:
Clone the repo:
git clone https://github.com/yinguobing/head-pose-estimation.git
Install dependencies with pip:
pip install -r requirements.txt
Pre-trained models provided in the assets
directory. Download them with Git LFS:
git lfs pull
Or, download manually from the release page.
A video file or a webcam index should be assigned through arguments. If no source provided, the built in webcam will be used by default.
For any video format that OpenCV supports (mp4
, avi
etc.):
python3 main.py --video /path/to/video.mp4
The webcam index should be provided:
python3 main.py --cam 0
Tutorials: https://yinguobing.com/deeplearning/
Training code: https://github.com/yinguobing/cnn-facial-landmark
Note: PyTorch version coming soon!
This project is licensed under the MIT License - see the LICENSE file for details.
Meanwhile:
Please refer to them for details.
Yin Guobing (尹国冰) - yinguobing
All datasets used in the training process:
The 3D face model is from OpenFace, you can find the original file here.
The build in face detector is SCRFD from InsightFace.