NVIDIA has open source code if developments related to the StyleGAN project, which allows generating images of new faces of people by imitating photographs. The system automatically takes into account aspects of the placement of individuals and makes the result indistinguishable from real photos (most of the respondents could not distinguish the original photos from the generated ones). For the synthesis of individuals, a machine learning system based on a generative-competitive neural network (GAN) is used. The code is written in Python using the TensorFlow framework and published under the Creative Commons BY-NC 4.0 license (for non-commercial use only).
Both ready-made trained models and collections of images for self-learning of a neural network are available for download. The basic model was trained on the basis of the Flickr-Faces-HQ (FFHQ) collection, which includes 70,000 high-quality (1024x1024) PNG images of people's faces. At the same time, the system is not tied to persons - as an example, the variants trained on collections of photographs of cars, cats and beds are shown. It requires one or more NVIDIA graphics cards (Tesla V100 GPU recommended), at least 11 GB of RAM, NVIDIA 391.35+ drivers, CUDA 9.0+ tools and the cuDNN 7.3.1 library.
The system allows you to synthesize the image of a new face based on interpolation of features of several faces, combining features characteristic of them, as well as adapting the final image to the required age, gender, hair length, smile character, nose shape, skin color, glasses, face rotation in the photo. The generator considers the image as a collection of styles, automatically separates the characteristic details (freckles, hair, glasses) from common high-level attributes (posture, gender, age changes) and allows you to combine them in an arbitrary form with the definition of the dominant properties through weights.