## Description
This work is used for reproduce MTCNN,a Joint Face Detection and Alignment using Multi-task Cascaded Convolutional Networks.
## Prerequisites
1. You need CUDA-compatible GPUs to train the model.
2. You should first download [WIDER Face](http://mmlab.ie.cuhk.edu.hk/projects/WIDERFace/) and [Celeba](http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html).**WIDER Face** for face detection and **Celeba** for landmark detection(This is required by original paper.But I found some labels were wrong in Celeba. So I use [this dataset](http://mmlab.ie.cuhk.edu.hk/archive/CNN_FacePoint.htm) for landmark detection).
## Dependencies
* Tensorflow 1.2.1
* TF-Slim
* Python 2.7
* Ubuntu 16.04
* Cuda 8.0
## Prepare For Training Data
1. Download Wider Face Training part only from Official Website , unzip to replace `WIDER_train` and put it into `prepare_data` folder.
2. Download landmark training data from [here]((http://mmlab.ie.cuhk.edu.hk/archive/CNN_FacePoint.htm)),unzip and put them into `prepare_data` folder.
3. Run `prepare_data/gen_12net_data.py` to generate training data(Face Detection Part) for **PNet**.
4. Run `gen_landmark_aug_12.py` to generate training data(Face Landmark Detection Part) for **PNet**.
5. Run `gen_imglist_pnet.py` to merge two parts of training data.
6. Run `gen_PNet_tfrecords.py` to generate tfrecord for **PNet**.
7. After training **PNet**, run `gen_hard_example` to generate training data(Face Detection Part) for **RNet**.
8. Run `gen_landmark_aug_24.py` to generate training data(Face Landmark Detection Part) for **RNet**.
9. Run `gen_imglist_rnet.py` to merge two parts of training data.
10. Run `gen_RNet_tfrecords.py` to generate tfrecords for **RNet**.(**you should run this script four times to generate tfrecords of neg,pos,part and landmark respectively**)
11. After training **RNet**, run `gen_hard_example` to generate training data(Face Detection Part) for **ONet**.
12. Run `gen_landmark_aug_48.py` to generate training data(Face Landmark Detection Part) for **ONet**.
13. Run `gen_imglist_onet.py` to merge two parts of training data.
14. Run `gen_ONet_tfrecords.py` to generate tfrecords for **ONet**.(**you should run this script four times to generate tfrecords of neg,pos,part and landmark respectively**)
## Some Details
* When training **PNet**,I merge four parts of data(pos,part,landmark,neg) into one tfrecord,since their total number radio is almost 1:1:1:3.But when training **RNet** and **ONet**,I generate four tfrecords,since their total number is not balanced.During training,I read 64 samples from pos,part and landmark tfrecord and read 192 samples from neg tfrecord to construct mini-batch.
* It's important for **PNet** and **RNet** to keep high recall radio.When using well-trained **PNet** to generate training data for **RNet**,I can get 14w+ pos samples.When using well-trained **RNet** to generate training data for **ONet**,I can get 19w+ pos samples.
* Since **MTCNN** is a Multi-task Network,we should pay attention to the format of training data.The format is:
[path to image][cls_label][bbox_label][landmark_label]
For pos sample,cls_label=1,bbox_label(calculate),landmark_label=[0,0,0,0,0,0,0,0,0,0].
For part sample,cls_label=-1,bbox_label(calculate),landmark_label=[0,0,0,0,0,0,0,0,0,0].
For landmark sample,cls_label=-2,bbox_label=[0,0,0,0],landmark_label(calculate).
For neg sample,cls_label=0,bbox_label=[0,0,0,0],landmark_label=[0,0,0,0,0,0,0,0,0,0].
* Since the training data for landmark is less.I use transform,random rotate and random flip to conduct data augment(the result of landmark detection is not that good).
## Result
![result1.png](https://i.loli.net/2017/08/30/59a6b65b3f5e1.png)
![result2.png](https://i.loli.net/2017/08/30/59a6b6b4efcb1.png)
![result3.png](https://i.loli.net/2017/08/30/59a6b6f7c144d.png)
![reult4.png](https://i.loli.net/2017/08/30/59a6b72b38b09.png)
![result5.png](https://i.loli.net/2017/08/30/59a6b76445344.png)
![result6.png](https://i.loli.net/2017/08/30/59a6b79d5b9c7.png)
![result7.png](https://i.loli.net/2017/08/30/59a6b7d82b97c.png)
![result8.png](https://i.loli.net/2017/08/30/59a6b7ffad3e2.png)
![result9.png](https://i.loli.net/2017/08/30/59a6b843db715.png)
**Result on FDDB**
![result10.png](https://i.loli.net/2017/08/30/59a6b875f1792.png)
## License
MIT LICENSE
## References
1. Kaipeng Zhang, Zhanpeng Zhang, Zhifeng Li, Yu Qiao , " Joint Face Detection and Alignment using Multi-task Cascaded Convolutional Networks," IEEE Signal Processing Letter
2. [MTCNN-MXNET](https://github.com/Seanlinx/mtcnn)
3. [MTCNN-CAFFE](https://github.com/CongWeilin/mtcnn-caffe)
4. [deep-landmark](https://github.com/luoyetx/deep-landmark)
没有合适的资源?快使用搜索试试~ 我知道了~
tensorfolw训练mtcnn模型
共150个文件
pyc:47个
py:41个
png:23个
3星 · 超过75%的资源 需积分: 50 31 下载量 11 浏览量
2019-07-10
16:13:43
上传
评论 4
收藏 38.84MB ZIP 举报
温馨提示
tensorfolw训练mtcnn模型 里面有详细的指导文档 教你一步步操作
资源推荐
资源详情
资源评论
收起资源包目录
tensorfolw训练mtcnn模型 (150个子文件)
video_test.avi 2.45MB
checkpoint 187B
checkpoint 187B
checkpoint 187B
ONet-22.data-00000-of-00001 2.97MB
RNet-22.data-00000-of-00001 792KB
PNet-30.data-00000-of-00001 54KB
tensorflow训练mtcnn模型文件指导文档1.docx 622KB
prepare_data.iml 588B
MTCNN-Tensorflow.iml 576B
ONet-22.index 2KB
RNet-22.index 1KB
PNet-30.index 1KB
expe.ipynb 13KB
aaa.jpg 75KB
img_423.jpg 25KB
img_414.jpg 13KB
README.md 5KB
ONet-22.meta 246KB
RNet-22.meta 224KB
PNet-30.meta 205KB
385.png 2.44MB
31.png 2.36MB
514.png 2MB
405.png 1.56MB
65.png 1.49MB
475.png 1.46MB
611.png 1.29MB
83.png 1.25MB
417.png 1.19MB
399.png 1.17MB
421.png 1.16MB
108.png 1.15MB
35.png 1.14MB
353.png 1.11MB
218.png 1.1MB
24.png 1.09MB
195.png 1.07MB
26.png 1.06MB
17.png 1018KB
112.png 839KB
27.png 789KB
DiscROC.png 6KB
ContROC.png 6KB
MtcnnDetector.py 18KB
mtcnn_model.py 14KB
train.py 10KB
gen_24net_data.py 10KB
gen_hard_example.py 10KB
gen_48net_data.py 10KB
gen_landmark_aug_12.py 8KB
gen_landmark_aug_24.py 8KB
gen_landmark_aug_48.py 8KB
gen_12net_data.py 7KB
imdb.py 7KB
tfrecord_utils.py 7KB
model2pbFile.py 7KB
BBox_utils.py 5KB
read_tfrecord_v2.py 5KB
gen_RNet_tfrecords.py 5KB
gen_PNet_tfrecords.py 5KB
gen_ONet_tfrecords.py 4KB
data_utils.py 4KB
generate_wider_result.py 4KB
loader.py 3KB
RunOnFDDBLandmark.py 3KB
detector.py 3KB
one_image_test.py 3KB
camera_test.py 3KB
Landmark_utils.py 2KB
gen_imglist_pnet.py 2KB
fcn_detector.py 2KB
utils.py 1KB
gen_imglist_rnet.py 1KB
merge_FDDB_files.py 1KB
minibatch.py 1KB
gen_imglist_onet.py 1KB
nms.py 1KB
train_PNet.py 909B
train_RNet.py 766B
train_ONet.py 766B
MTCNN_config.py 250B
__init__.py 0B
__init__.py 0B
__init__.py 0B
MtcnnDetector.cpython-35.pyc 14KB
MtcnnDetector.pyc 13KB
MtcnnDetector.cpython-36.pyc 12KB
mtcnn_model.pyc 10KB
mtcnn_model.cpython-35.pyc 10KB
mtcnn_model.cpython-36.pyc 8KB
BBox_utils.pyc 7KB
tfrecord_utils.pyc 7KB
train.cpython-35.pyc 7KB
train.pyc 7KB
loader.pyc 6KB
tfrecord_utils.cpython-35.pyc 6KB
BBox_utils.cpython-35.pyc 6KB
loader.cpython-35.pyc 4KB
loader.cpython-36.pyc 4KB
共 150 条
- 1
- 2
资源评论
- thlb83812019-12-17凑合吧,还能接受
weixin_42713739
- 粉丝: 2w+
- 资源: 74
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功