# MTCNN_TRAIN
MTCNN_Train Scripts with PyTorch 0.4.0
## Declaration
**The source code in this repository is mainly from [kuaikuaikim/DFace](https://github.com/kuaikuaikim/DFace).**
**I reimplemented the part of MTCNN with PyTorch 0.4.0 and made some optimizations but most remains unchanged. If you want to know more details, please go to [kuaikuaikim/DFace](https://github.com/kuaikuaikim/DFace)**
---
## Introduction
~~This project is still in progess, I will finish it in my spare time as soon as possible !~~
This project is a reimplementation version of mtcnn face detection, most of the source code is from [kuaikuaikim/DFace](https://github.com/kuaikuaikim/DFace), I restructed the source code with Pytorch 0.4.0 and made some modifications and optimizations. All the contributions I have made is listed below.
## The Contributions
1. restruct the source code with PyTorch 0.4.0.
2. avoid some unnecessary image data copy operation in training data preparation, for example, ./prepare_data/gen_Pnet_data.py and so on.
3. remove some meaningless operation in traing process, and format the output information during training.
4. fix the bug that data_loader can't load the last mini_batch when the last minibatch'size is less than the batch_size in ./tools/image_reader.py.
5. to be continue.
## How to use
For training PNet and RNet, I only use the [Widerface](http://mmlab.ie.cuhk.edu.hk/projects/WIDERFace/) for face classification and face bounding box regression. For training ONet, I use [Widerface](http://mmlab.ie.cuhk.edu.hk/projects/WIDERFace/) for face classification and face bounding box regression and use [Training Dataset](http://mmlab.ie.cuhk.edu.hk/archive/CNN_FacePoint.htm) for face landmark regression.
1. Train PNet
``` python
cd MTCNN_TRAIN
python prepare_data/gen_Pnet_train_data.py
python prepare_data/assemble_pnet_imglist.py
python train_net/train_p_net.py
```
2. Train RNet
``` python
cd MTCNN_TRAIN
python prepare_data/gen_Rnet_train_data.py
python prepare_data/assemble_rnet_imglist.py
python train_net/train_r_net.py
```
3. Train ONet
``` python
cd MTCNN_TRAIN
python prepare_data/gen_landmark_48.py
python prepare_data/gen_Onet_train_data.py
python prepare_data/assemble_onet_imglist.py
python train_net/train_o_net.py
```
4. Test Image
``` python
cd MTCNN_TRAIN
python test_image.py
```
## Results
Because I didn't use much data to train, the detection results is not at the best.
![avatar](result.png)
## Problems
There still remains a problem to solve: When starting to train each stage network, the first batch will last for a long time about 30 minutes and I don't know why.
没有合适的资源?快使用搜索试试~ 我知道了~
MTCNN_TRAIN:MTCNN_使用PyTorch 0.4.0进行面部检测的训练脚本
共38个文件
py:26个
md:3个
pt:3个
需积分: 9 1 下载量 181 浏览量
2021-04-29
20:09:25
上传
评论
收藏 3.69MB ZIP 举报
温馨提示
MTCNN_TRAIN 使用PyTorch 0.4.0的MTCNN_Train脚本 宣言 该存储库中的源代码主要来自 。 我使用PyTorch 0.4.0重新实现了MTCNN的部分,并进行了一些优化,但大多数保持不变。 如果您想了解更多详细信息,请访问 介绍 这个项目仍在进行中,我将在业余时间尽快完成它! 该项目是mtcnn人脸检测的重新实现版本,大部分源代码来自 ,我用Pytorch 0.4.0重构了源代码,并进行了一些修改和优化。 下面列出了我所做的所有贡献。 的贡献 用PyTorch 0.4.0重构源代码。 避免在训练数据准备过程中进行不必要的图像数据复制操作,例如./prepare_data/gen_Pnet_data.py等。 在训练过程中删除一些无意义的操作,并在训练过程中格式化输出信息。 修复了当最后一个minibatch的大小小于./tools/image_rea
资源详情
资源评论
资源推荐
收起资源包目录
MTCNN_TRAIN-master.zip (38个子文件)
MTCNN_TRAIN-master
test.jpg 75KB
anno_store
readme.md 315B
wider_origin_anno.txt 3.06MB
landmark_imagelist.txt 1.43MB
test_image.py 972B
model_store
rnet_model_final.pt 237KB
pnet_model_final.pt 29KB
onet_model_final.pt 879KB
tools
utils.py 3KB
vision.py 3KB
image_tools.py 1KB
detect.py 18KB
__init__.py 0B
image_reader.py 4KB
imagedb.py 4KB
train_net
train_o_net.py 5KB
models.py 7KB
__init__.py 0B
train_r_net.py 5KB
train_p_net.py 5KB
__init__.py 0B
result.png 1.04MB
.gitignore 1KB
config.py 1KB
README.md 3KB
test2.jpg 198KB
training_data
readme.md 62B
prepare_data
gen_Rnet_train_data.py 8KB
gen_landmark_24.py 5KB
gen_landmark_48.py 5KB
assemble.py 1KB
assemble_pnet_imglist.py 1KB
__init__.py 0B
assemble_onet_imglist.py 1KB
gen_landmark_12.py 5KB
gen_Onet_train_data.py 8KB
gen_Pnet_train_data.py 7KB
assemble_rnet_imglist.py 1KB
共 38 条
- 1
马福报
- 粉丝: 20
- 资源: 4570
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0