This repository provides the 3D 68 Keypoints from the synthetic dataset published by Microsoft Fake It Till You Make It: Face analysis in the wild using synthetic data alone.
Note: This code is tested on Windows machine.
conda create -n synthetic python=3.6 -y
conda activate synthetic
To install PyTorch along with CUDA run the following script
pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html
To install packages remaining packages, run the following script.
pip install -r .\requirements.txt
If you are getting the following error
app = FaceAnalysis()
TypeError: __init__() missing 1 required positional argument: 'name'
run the following script
pip install -U insightface
Download Face Synthetics dataset
from https://github.com/microsoft/FaceSynthetics and put it somewhere.
Then use prepare_dataset.py for training data preparation.
python train.py
which uses resnet50d
as backbone by default, please check the code for detail.
I have trained the network for 1000 epochs. The pre-trained model can be obtained from google drive ResNet50d. Place the pretrained model on [models][models] directory. Run test.py for the restuls.
Please check test.py for detail.
The base code is borrowed from insightface.