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.
Download dataset SCUT-HEAD. Unzip and put them in data directory.
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
python simpledemo.py
-
Landmark alignment in original mtcnn is removed in this repo. Here only do object classification and bounding box regression.
-
Each convolutional layer kernel number in onet has reduced for faster network inference.
pnet
rnet
onet