This is the code repo for Facial Details Synthesis From Single Input Image. [Paper] [Supplemental Material]
This repository consists of 5 individual parts: DFDN, emotionNet, landmarkDetector, proxyEstimator and faceRender.
- DFDN is used to estimate displacement map, and its network architecture is based on junyanz's pix2pix
- For landmarkDetector and FACS-based expression detector (you can choose between this and emotionNet), we use a simplified version of openFace
- proxyEstimator is used to generate proxy mesh using expression/emotion prior. It is modified based on patrikhuber's fantastic work eos
- faceRender is used for interactive rendering
We would like to thank each of the related projects for their great work.
We present a single-image 3D face synthesis technique that can handle challenging facial expressions while recovering fine geometric details. Our technique employs expression analysis for proxy face geometry generation and combines supervised and unsupervised learning for facial detail synthesis. On proxy generation, we conduct emotion prediction to determine a new expression-informed proxy. On detail synthesis, we present a Deep Facial Detail Net (DFDN) based on Conditional Generative Adversarial Net (CGAN) that employs both geometry and appearance loss functions. For geometry, we capture 366 high-quality 3D scans from 122 different subjects under 3 facial expressions. For appearance, we use additional 163K in-the-wild face images and apply image-based rendering to accommodate lighting variations. Comprehensive experiments demonstrate that our framework can produce high-quality 3D faces with realistic details under challenging facial expressions.
- Functionality
- Proxy estimation with expression/emotion prior
- Facial details prediction, i.e. winkles
- Renderer for results (proxy mesh + normalMap/displacementMap)
- Input: Single image or image folder
- Output: Proxy mesh & texture, detailed displacementMap and normalMap
- OS: Windows 10
- Install windows version of Anaconda Python3.7 and pytorch
- [Optional] Install tensorflow and keras if you want to use emotion prior (emotionNet)
-
Download the released package. Release v0.1.0
-
Download models and pre-trained weights.
DFDN checkpoints, unzip to
./DFDN/checkpointslandmork models, unzip to
./landmarkDetector[Optional] emotionNet checkpoints, unzip to
./emotionNet/checkpoints -
Install BFM2017
-
Install eos-py by
pip install --force-reinstall eos-py==0.16.1 -
Download BFM2017 and copy
model2017-1_bfm_nomouth.h5to./proxyEstimator/bfm2017/ -
Run
python convert-bfm2017-to-eos.pyto generatebfm2017-1_bfm_nomouth.binin./proxyEstimator/bfm2017/folder
-
-
Have fun!
-
For proxy estimation,
python proxyPredictor.py -i path/to/input/image -o path/to/output/folder [--FAC 1][--emotion 1]-
For batch processing, you can set
-ito a image folder. -
For prior features, you can optional choose one of those two priors: FACS-based expression prior,
--FAC 1, emotion prior,--emotion 1.
example:
python proxyPredictor.py -i ./samples/proxy -o ./results -
-
For facial details estimation,
python facialDetails.py -i path/to/input/image -o path/to/output/folderexample:
python facialDetails.py -i ./samples/details/019615.jpg -o ./resultspython facialDetails.py -i ./samples/details -o ./results
We suggest you directly download the released package for convenience. If you are interested in compiling the source code, please go through the following guidelines.
proxyEstimator
Refer to this repo.
faceRender
Refer to this repo.
Note: The visualizer currently only supports mesh + normalMap, but will also support displacementMap in the near future.
Others
On the way .....
If you find this code useful to your research, please consider citing:
@InProceedings{Chen_2019_ICCV,
author = {Chen, Anpei and Chen, Zhang and Zhang, Guli and Mitchell, Kenny and Yu, Jingyi},
title = {Photo-Realistic Facial Details Synthesis From Single Image},
booktitle = {The IEEE International Conference on Computer Vision (ICCV)},
year = {2019}
}