takiyu / hyperface

Deep Neural Network (DNN) which predicts face/non-face, landmarks, pose and gender simultaneously with Chainer.
MIT License
176 stars 45 forks source link

Hyper Face

Hyper Face implementation which predicts face/non-face, landmarks, pose and gender simultaneously.

This is NOT official implementation.

This software is released under the MIT License, see LICENSE.txt.

Features

Testing Environments

Ubuntu 16.04

Arch Linux

Configuration

Important variables are configured by config.json.

Set gpu positive number to use GPU, port numbers of web servers and so on.

Train

Preparation

Download AFLW Dataset and AlexNet Caffe Model, expand them and set aflw_sqlite_path, aflw_imgdir_path, and alexnet_caffemodel_path in config.json

Pre-training

Pre-training with RCNN_Face model.

python ./scripts/train.py --pretrain

Open http://localhost:8888/, http://localhost:8889/ and http://localhost:8890/ with your web browser to see loss graphs, network weights and predictions. Port numbers are configured by config.json.

Main training

python ./scripts/train.py --pretrainedmodel result_pretrain/model_epoch_40

Use arbitrary epoch number instead of 40.

Test

To skip training, please use trained model from here (Do not expand as zip).

AFLW test images

python ./scripts/use_on_test.py --model model_epoch_190

Open http://localhost:8891/ to see predictions.

Your image file

Set your image file with --img argument. The dependence are less than other tests and demos.

python ./scripts/use_on_file.py --model model_epoch_190 --img sample_images/lena_face.png

Input images are contained in sample_images directory.

Demos with post-processes

Open http://localhost:8891/ to see demos.

AFLW test images

python ./scripts/demo_on_test.py --model model_epoch_190

Demo using AFLW test images

Web camera on your browser

python ./scripts/demo_live.py --model model_epoch_190

ToDo