We provide scripts for extracting 3dmm coefficients for videos by using DeepFaceRecon_pytorch.
-
Follow the instructions of their repo to build the environment of DeepFace.
-
Copy the provided scrips to the folder
Deep3DFaceRecon_pytorch
.cp scripts/face_recon_images.py ./Deep3DFaceRecon_pytorch cp scripts/face_recon_videos.py ./Deep3DFaceRecon_pytorch cp scripts/inference_options.py ./Deep3DFaceRecon_pytorch/options
-
Extract facial landmarks from videos.
python extract_kp_videos.py \ --input_dir path_to_viodes \ --output_dir path_to_keypoint \ --device_ids 0,1,2,3 \ --workers 12
-
Extract coefficients for videos
python face_recon_videos.py \ --input_dir path_to_videos \ --keypoint_dir path_to_keypoint \ --output_dir output_dir \ --inference_batch_size 100 \ --name=model_name \ --epoch=20 \ --model facerecon