Skip to content

Latest commit

 

History

History
77 lines (53 loc) · 2.39 KB

README.md

File metadata and controls

77 lines (53 loc) · 2.39 KB

MTCNN head detection

Set up

Set up environment and copy C++ layer code to Caffe's source code tree.

$ export PYTHONPATH=/path/to/mtcnn-head-detection:$PYTHONPATH
$ export CAFFE_HOME=/path/to/caffe
$ pip install easydict
$ pip install lmdb
$ sh layers/copy.sh

Compile Caffe following its document.

Prepare data

Download dataset SCUT-HEAD. Unzip and put them in data directory.

Train

pnet

python jfda/prepare.py --net p --wider --worker 8
python jfda/train.py --net p --gpu 0 --size 128 --lr 0.05 --lrw 0.1 --lrp 5 --wd 0.0001 --epoch 25

rnet

Choose appropriate pnet caffemodel to generate prior for rnet, and edit cfg.PROPOSAL_NETS in config.py

python jfda/prepare.py --net r --gpu 0 --detect --wider --worker 4
python jfda/train.py --net r --gpu 0 --size 128 --lr 0.05 --lrw 0.1 --lrp 5 --wd 0.0001 --epoch 25

onet

Choose appropriate rnet caffemodel to generate prior for onet, and edit cfg.PROPOSAL_NETS in config.py

python jfda/prepare.py --net o --gpu 0 --detect --wider --worker 4
python jfda/train.py --net o --gpu $GPU --size 64 --lr 0.05 --lrw 0.1 --lrp 7 --wd 0.0001 --epoch 35

Test

python simpledemo.py

Note

  1. Landmark alignment in original mtcnn is removed in this repo. Here only do object classification and bounding box regression.

  2. Each convolutional layer kernel number in onet has reduced for faster network inference.

Result

pnet

pnet1

rnet

rnet1

onet

onet1

References