Cropping and obtaining camera poses guide using 3DDFA_V2.
Our cropping file recrop_images.py is based on 3DDFA_V2 and dlib. First of all, please clone the 3DDFA_V2 repo and follow all the installation instruction and make sure their demos can be run sucessfully. After building cython of 3DDFA, you can use the follow command for other necessary packages:
pip install opencv-python dlib pyyaml onnxruntime onnx
Test images used here are from test/origin/man.jpg and test/origin/woman.jpg
1. Move folder test
, recrop_images.py
, and dlib_kps.py
under this directory to the 3DDFA_V2 root dir. Also, remember to download shape_predictor_68_face_landmarks.dat
and put it under 3DDFA_V2 root dir.
cd 3DDFA_V2
3. Extract face keypoints using dlib. After this, you should have data.pkl under your 3DDFA root dir saving the keypoints.
python dlib_kps.py
python recrop_images.py -i data.pkl -j dataset.json