This repo is only for BIOE6901 HBI3 team to store, manage backend project
IMPORTANT Please make sure execute the software in Unix environment with NVidia GPU and CUDA installed.
- Environment setup
# Clone the code locally and install required softwares
git clone https://github.com/KMarshallX/HBI_Infant_Facial_Model.git
cd HBI_Infant_Facial_Model
conda env create -f environment.yml
source activate hbi_infant
# Install Nvdiffrast library
cd nvdiffrast
pip install .
cd ..
- Load face model expressor
Download BFM09 and Expression Basis and put the files under BFM directory
HBI_Infant_Facial_Model
│
└─── BFM
│
└─── 01_MorphableModel.mat
│
└─── Exp_Pca.bin
|
└─── ...
- Load pre-trained weights Download a pretrained model from this link and put the pretrained weights in the following structure
HBI_Infant_Facial_Model
│
└─── checkpoints
│
└─── <model_name>
│
└─── epoch_20.pth
Put the images you are going to reconstruct facial model from under the root directory:
Deep3DFaceRecon_pytorch
│
└─── <folder_to_test_images>
│
└─── *.jpg/*.png
Run the script:
python test.py --name=<model_name> --epoch=20 --img_folder=<folder_to_test_images>
The results will be saved into ./checkpoints/<model_name>/results/<folder_to_test_images>
This code is based on MTCNN and Deep3DReconstruction