[关闭]
@wujiaju 2021-10-15T08:35:04.000000Z 字数 2981 阅读 479

exp2: Face Detection Based on Neural Network

2020 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. test the given models
Use the model we have trained before to run on the test dataset, which is under mtcnn_pytorch/data/test_images/ and contains 64 pictures, input the command below and then go to mtcnn_pytorch/data/test_images/ to examine the result.

cd mtcnn_pytorch/
python test_image.py

4. training (optional)
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.

  1. train PNet (optional)

    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 (optional)

    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 (optional)

    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 your model (optional)
    Use the given test dataset, which is in mtcnn_pytorch/data/test_images/ and contains 64 pictures, to test your model. Run the commands below and then get the results in mtcnn_pytorch/data/you_result/.

    1. cd mtcnn_experiment/
    2. python test_youModel_images.py

    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.

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


Submission

Requirement for Submission

Deadline

P.S.

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