我正在找工作。预计从10月14日开始,会依次经过杭州、厦门、广州与深圳四个城市。欢迎有工作机会的小伙伴联系!yinguobing@gmail.com
This repo shows how to estimate human head pose from videos using TensorFlow and OpenCV.
The following packages are required:
The code is tested on Ubuntu 16.04.
This repository comes with a pre-trained model for facial landmark detection. Just git clone then you are good to go.
# From your favorite development directory:
git clone https://github.com/yinguobing/head-pose-estimation.git
A video file or a webcam index should be assigned through arguments. If no source provided, the default webcam will be used.
For any video format that OpenCV supported (mp4
, avi
etc.):
python3 estimate_head_pose.py --video /path/to/video.mp4
The webcam index should be assigned:
python3 estimate_head_pose.py --cam 0
There are three major steps:
Face detection. A face detector is adopted to provide a face box containing a human face. Then the face box is expanded and transformed to a square to suit the needs of later steps.
Facial landmark detection. A custom trained facial landmark detector based on TensorFlow is responsible for output 68 facial landmarks.
Pose estimation. Once we got the 68 facial landmarks, a mutual PnP algorithms is adopted to calculate the pose.
The marks is detected frame by frame, which result in small variance between adjacent frames. This makes the pose unstable. A Kalman filter is used to solve this problem, you can draw the original pose to observe the difference.
To reproduce the facial landmark detection model, you can refer to this series of posts(in Chinese only). And the training code is also open sourced: https://github.com/yinguobing/cnn-facial-landmark
This project is licensed under the MIT License - see the LICENSE.md file for details
Yin Guobing (尹国冰) - yinguobing
The pre-trained TensorFlow model file is trained with various public data sets which have their own licenses. Please refer to them before using this code.
The 3D model of face comes from OpenFace, you can find the original file here.
The build in face detector comes from OpenCV. https://github.com/opencv/opencv/tree/master/samples/dnn/face_detector
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。