[关闭]
@wujiaju 2021-11-21T07:45:34.000000Z 字数 3101 阅读 449

exp1: Face Detection Based on Neural Network

2021 PostGraduate


You can click here to get the Chinese version.

Motivation

  1. Understand the basic theory of face detection using neural network.
  2. Understand the processes of MTCNN and use it in practice.

Dataset for Training

  1. When training PNet and Rnet, we use WiderFace for face classification and face bounding box regression.
  2. When training ONet, we use FacePoint for face classification and face bounding box regression, and use set Training Dataset for face feature point regression.

Environment for Experiment

anaconda3
pytorch >= 1.0.0
torchvision
opencv-python
tensorflow (optional)

Experiment Steps

1. get the codes

The complete codes for this experiment is given in MTCNN_pytorch, you can download it directly or using git clone command.

git clone https://github.com/xiezheng-cs/mtcnn_pytorch.git

2. install the environment
1. download anaconda3 for your computer;
2. use pip or conda to install pytorch 1.0.0 and torchvision
3. use pip or conda to install opencv-python;

conda install pytorch=1.0
conda install torchvision
pip install opencv-python

3. training
NOTE: You should check whether the path of the training dataset is consistent with the path in the code. If not, you must modify the path in the code before you start training.
Considering that the students may not have enough computing power (powerful GPUs), students only needs to use their personal computers to start the training and experience the training process. It is not required to complete the whole training steps.

  1. train PNet (Not required to complete)

    1. cd mtcnn_experiment
    2. python preprocessing/gen_pnet_data.py
    3. python preprocessing/assemble_pnet_imglist.py
    4. python training/pnet/train.py
  2. train RNet (Not required to complete)

    1. cd mtcnn_experiment
    2. python preprocessing/gen_rnet_data.py
    3. python preprocessing/assemble_rnet_imglist.py
    4. python training/rnet/train.py
  3. train ONet (Not required to complete)

    1. cd mtcnn_experiment
    2. python preprocessing/gen_landmark_48.py
    3. python preprocessing/gen_onet_data.py
    4. python preprocessing/assemble_onet_imglist.py
    5. python training/onet/train.py

    After finishing training, you can find three trained models in mtcnn_pytorch/results/.

4. test the trained models
Use the given test dataset, which is in mtcnn_pytorch/data/test_images/ and contains 64 pictures, to test the model you trained (or we have trained). Run the commands below and then get the results in mtcnn_pytorch/data/you_result/.

if test the model we have trained:

cd mtcnn_pytorch/
python test_image.py

if test the model you trained (NOTE: You should check whether the actual path of the trained model is consistent with the path in the code. If not, you must modify the path in the code before starting testing.):

cd mtcnn_experiment/
python test_youModel_images.py

5. Finish report
Finishing experiment report according to experiment result. The template of report can be found in here.


Submission

Requirement for Submission

Deadline

P.S.

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注