Home

Awesome

CONFIG: Controllable Neural Face Image Generation

Intro Figure

This is a reference implementation of CONFIG: Controllable Neural Face Image Generation published at ECCV 2020. ConfigNet is a neural face model that allows for controlling individual aspects of output images in semantically meaningful ways. ConfigNet is trained on real face images as well as synthetic face renders. It uses synthetic data to factorize the latent space into elements that correspond to the inputs of a traditional rendering pipeline, separating aspects such as head pose, facial expression, hair style, illumination, and many others which are very hard to annotate in real data. The real images, which are presented to the network without labels, extend the variety of the generated images and encourage realism.

Getting started

To start working with ConfigNet you will need to take the following steps:

At this point you should be ready to go. To see how ConfigNet works please try the demo, which is described below. You can also reproduce the controllability metrics reported in the paper as described further down. If you want to explore more scenarios, please take a look at the tests directory, which demonstrates a lot of the scripts used in this repo.

Running the demo app

The demo app allows for modifying existing images using ConfigNet, as shown in the video above, as well as sampling novel images and modifying them. The app can be started in several ways:

The demo can be controlled using the keyboard, when the window showing the output images is in focus. The instructions will be displayed in the console window.

One-shot learning

One-shot learning

ConfigNet allows for fine-tuning the generator on the input image, in order to better preserve the persons's identity in the output images. This can be done by supplying only a single image to the demo app and then pressing B to initiate fine-tuning. Once the process is complete, the output image can be driven with the same set of commands as before.

Reproducing experiment results

Take the following steps to reproduce the controllability metrics reported in the paper:

3rd Party Libraries

Our ConfigNet implementation uses OpenFace to detect facial landmarks that are required to align the face images. When using our code and pre-trained models make sure to follow the constraints of the OpenFace license as well as the licences of the datasets used in its training.

The pre-trained models were trained using data from the FFHQ dataset and their use is thus constrained by the licence of FFHQ. The face images in the top figure in this readme also come from the FFHQ dataset.

Citation

If you use our code, models or method in your research, please cite our paper as follows.

@inproceedings{KowalskiECCV2020,
    author = {Kowalski, Marek and Garbin, Stephan J. and Estellers, Virginia and BaltruĊĦaitis, Tadas and Johnson, Matthew and Shotton, Jamie},
    title = {CONFIG: Controllable Neural Face Image Generation},
    booktitle = {European Conference on Computer Vision (ECCV)},
    year = {2020}
}

Code of conduct

This project has adopted the Microsoft Open Source Code of Conduct.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.