Skip to content

Smorodov/PRNet_PyTorch_v2

Repository files navigation

  • You need install pytorch lightning

  • You need 300W_LP dataset (copy all data to all folder )

① Pre-Requirements

Before we start generat uv position map and train it. The first step is generate BFM.mat according to Basel Face Model. For simplicity, The corresponding BFM.mat has been provided here.

After download it successfully, you need to move BFM.mat to DS_generator/BFM.

② Generate uv_pos_map

YadiraF/face3d have provide scripts for generating uv_pos_map, here i wrap it for Batch processing.

You can use DS_generator/generate_posmap_300WLP.py as:

cd DS_generator
python3 generate_posmap_300WLP.py

Then `300WLP_IBUG` dataset is the proper structure for training PRNet:
- 300WLP_IBUG
 - 0/
  - IBUG_image_xxx.npy
  - original.jpg (original RGB)
  - uv_posmap.jpg (corresponding UV Position Map)
 - 1/
 - **...**
 - 100/ 

Except from download from 300WLP, I provide processed original--uv_posmap pair of IBUG here.

③ Training

After finish the above two step, you can train your own PRNet as:

run_training.cmd

You can use tensorboard to visualize the intermediate output in localhost:6006:

run_tensorboard.cmd