Skip to content

Commit e2168fe

Browse files
committed
first version
0 parents  commit e2168fe

29 files changed

+1669
-0
lines changed

.DS_Store

6 KB
Binary file not shown.

.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
# Distribution / packaging
9+
.Python
10+
build/
11+
develop-eggs/
12+
dist/
13+
downloads/
14+
eggs/
15+
.eggs/
16+
lib/
17+
lib64/
18+
parts/
19+
sdist/
20+
var/
21+
wheels/
22+
share/python-wheels/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
MANIFEST
27+
28+
29+
/site
30+
31+
32+
headpose_estimation/face_detector/.DS_Store

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include headpose_estimation/WHENet.h5

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
WHENet: Real-time Fine-Grained Estimation for Wide Range Head Pose
2+
===
3+
**Yijun Zhou and James Gregson - BMVC2020**
4+
5+
6+
**Abstract:** We present an end-to-end head-pose estimation network designed to predict Euler
7+
angles through the full range head yaws from a single RGB image. Existing methods
8+
perform well for frontal views but few target head pose from all viewpoints. This has
9+
applications in autonomous driving and retail. Our network builds on multi-loss approaches
10+
with changes to loss functions and training strategies adapted to wide range
11+
estimation. Additionally, we extract ground truth labelings of anterior views from a
12+
current panoptic dataset for the first time. The resulting Wide Headpose Estimation Network
13+
(WHENet) is the first fine-grained modern method applicable to the full-range of
14+
head yaws (hence wide) yet also meets or beats state-of-the-art methods for frontal head
15+
pose estimation. Our network is compact and efficient for mobile devices and applications. [**ArXiv**](https://arxiv.org/abs/2005.10353)
16+
17+
## Demo
18+
We provided two use case of the WHENet, image input and video input in this repo. Please make sure you installed all the requirments before running the demo code by `pip install -r requirements.txt`. Additionally, please download the [YOLOv3](https://drive.google.com/file/d/1wGrwu_5etcpuu_sLIXl9Nu0dwNc8YXIH/view?usp=sharing) model for head detection and put it under `yolo_v3/data`.
19+
20+
<img src=readme_imgs/video.gif height="220"/> <img src=readme_imgs/turn.JPG height="220"/>
21+
22+
## Image demo
23+
To run WHENet with image input, please put images and bbox.txt under one folder (E.g. Sample/) and just run `python demo.py`.
24+
25+
Format of bbox.txt are showed below:
26+
```
27+
image_name,x_min y_min x_max y_max
28+
mov_001_007585.jpeg,240 0 304 83
29+
```
30+
31+
## Video/Webcam demo
32+
We used [YOLO_v3](https://github.com/qqwweee/keras-yolo3) in the video demo to get the cropped head image.
33+
In order to customize some of the functions we have put the yolo implementation and the pre-trained model in the repo.
34+
[Hollywood head](https://www.di.ens.fr/willow/research/headdetection/) and [Crowdhuman](https://www.crowdhuman.org/) are used to train the head detection YOLO model.
35+
````
36+
demo_video.py [--video INPUT_VIDEO_PATH] [--snapshot WHENET_MODEL] [--display DISPLAY_OPTION]
37+
[--score YOLO_CONFIDENCE_THRESHOLD] [--iou IOU_THRESHOLD] [--gpu GPU#] [--output OUTPUT_VIDEO_PATH]
38+
````
39+
Please set `--video ''` for webcam input.
40+
41+
## Dependncies
42+
* EfficientNet https://github.com/qubvel/efficientnet
43+
* Yolo_v3 https://github.com/qqwweee/keras-yolo3

headpose_estimation/.DS_Store

6 KB
Binary file not shown.

headpose_estimation/LICENSE.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Copyright (c) 2020. Huawei Technologies Co., Ltd.
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5+
6+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7+
8+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9+
10+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11+
12+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

headpose_estimation/WHENet.h5

17.2 MB
Binary file not shown.

headpose_estimation/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from headpose_estimation.headpose import Headpose

headpose_estimation/face_detector/__init__.py

Whitespace-only changes.

headpose_estimation/face_detector/commons/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)