Accurate 3D Face Reconstruction with Weakly-Supervised Learning: From Single Image to Image Set
In CVPRW on AMFG, 2019 (Best Paper Award!).
We implement the 3D face reconstruction for facial images. The weights are converted from original code.
- Our method uses Basel Face Model 2009 (BFM09) to represent 3d faces. Get access to BFM09 using this link. After getting the access, download "01_MorphableModel.mat". In addition, we use an Expression Basis provided by Guo et al.. Download the Expression Basis (Exp_Pca.bin) using this link (google drive). Organize all files into the following structure:
Deep3DFaceRecon
│
└─── BFM
│
└─── 01_MorphableModel.mat
│
└─── Exp_Pca.bin
|
└─── ...
-
We provide a jittor verison of pretrained model. Download the model using this link (google drive). Then, put the weights in
.\checkpoints\
directory. -
We use dlib to align the facial images. Download the model using this link (Official website). Then, put the weights in
.\checkpoints\
directory.
Generate the reconstruction .obj
model of facial images without alignment. The recontruction model is shown by MeshLab.
python test.py --input_dir ./imgs/align --output_dir ./imgs/output
Generate the reconstruction .obj
model of facial images with alignment. The input image is aligned by dlib. The recontruction model is shown by MeshLab.
python test.py --input_dir ./imgs/no_align --output_dir ./imgs/output --align
This repository borrows partially from the torch codes and tensorflow codes repository.