Skip to content

Commit d180322

Browse files
committed
2 parents 5eff30f + 44b3138 commit d180322

File tree

1 file changed

+45
-8
lines changed

1 file changed

+45
-8
lines changed

README.md

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,37 @@ This repo shows how to estimate human head pose from videos using TensorFlow and
55
![demo](https://github.com/yinguobing/head-pose-estimation/raw/master/demo.gif)
66
![demo](https://github.com/yinguobing/head-pose-estimation/raw/master/demo1.gif)
77

8-
## Dependence
9-
- TensorFlow 1.4
10-
- OpenCV 3.3
11-
- Python 3
8+
## Getting Started
9+
10+
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
11+
12+
### Prerequisites
13+
14+
- TensorFlow 1.4. It seems v1.12 also works.
15+
- OpenCV 3.3 or higher.
16+
- Python 3.5
1217

1318
The code is tested under Ubuntu 16.04.
1419

20+
### Installing
21+
22+
This repository comes with a pre-trained model for facial landmark detection. Just git clone then you are good to go.
23+
24+
```bash
25+
# From the directory where you want to put this project:
26+
git clone https://github.com/yinguobing/head-pose-estimation.git
27+
```
28+
29+
### Running
30+
The entrance file is `estimate_head_pose.py`. This will use your usb camera as the video source for demonstration.
31+
32+
```bash
33+
# From the project directory, run:
34+
python3 estimate_head_pose.py
35+
```
36+
37+
You can change the video source to any video file that OpenCV supports.
38+
1539
## How it works
1640

1741
There are three major steps:
@@ -22,17 +46,30 @@ There are three major steps:
2246

2347
3. Pose estimation. Once we got the 68 facial landmarks, a mutual PnP algorithms is adopted to calculate the pose.
2448

25-
## Miscellaneous
26-
- The marks is detected frame by frame, which result in small variance between adjacent frames. This makes the pose unstaible. A Kalman filter is used to solve this problem, you can draw the original pose to observe the difference.
49+
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.
50+
51+
## Retrain the model
52+
53+
To reproduce the facial landmark detection model, you can refer to this [series](https://yinguobing.com/deeplearning/) of posts(in Chinese only).
2754

28-
- The 3D model of face comes from OpenFace, you can find the original file [here](https://github.com/TadasBaltrusaitis/OpenFace/blob/master/lib/local/LandmarkDetector/model/pdms/In-the-wild_aligned_PDM_68.txt).
2955

3056
## License
31-
The code is licensed under the MIT license. However, 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.
57+
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
58+
59+
## Acknowledgments
60+
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.
3261

3362
- 300-W: https://ibug.doc.ic.ac.uk/resources/300-W/
3463
- 300-VW: https://ibug.doc.ic.ac.uk/resources/300-VW/
3564
- LFPW: https://neerajkumar.org/databases/lfpw/
3665
- HELEN: http://www.ifp.illinois.edu/~vuongle2/helen/
3766
- AFW: https://www.ics.uci.edu/~xzhu/face/
3867
- IBUG: https://ibug.doc.ic.ac.uk/resources/facial-point-annotations/
68+
69+
The 3D model of face comes from OpenFace, you can find the original file [here](https://github.com/TadasBaltrusaitis/OpenFace/blob/master/lib/local/LandmarkDetector/model/pdms/In-the-wild_aligned_PDM_68.txt).
70+
71+
The build in face detector comes from OpenCV.
72+
https://github.com/opencv/opencv/tree/master/samples/dnn/face_detector
73+
74+
## Finally
75+
If you are interested in Deep Learning and happened to be seeking for a job opportunity, feel free to get in touch.

0 commit comments

Comments
 (0)