@wujiaju
2021-11-21T07:45:34.000000Z
字数 3101
阅读 449
2021
PostGraduate
You can click here to get the Chinese version.
anaconda3
pytorch >= 1.0.0
torchvision
opencv-python
tensorflow (optional)
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.
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.
train PNet (Not required to complete)
cd mtcnn_experiment
python preprocessing/gen_pnet_data.py
python preprocessing/assemble_pnet_imglist.py
python training/pnet/train.py
train RNet (Not required to complete)
cd mtcnn_experiment
python preprocessing/gen_rnet_data.py
python preprocessing/assemble_rnet_imglist.py
python training/rnet/train.py
train ONet (Not required to complete)
cd mtcnn_experiment
python preprocessing/gen_landmark_48.py
python preprocessing/gen_onet_data.py
python preprocessing/assemble_onet_imglist.py
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.