StyleGAN2 is the official TensorFlow implementation of a generative adversarial network architecture designed to synthesize high-quality images through a style-based approach. Developed by researchers at NVIDIA Labs including Tero Karras, Samuli Laine, Miika Aittala, Janne Hellsten, Jaakko Lehtinen, and Timo Aila, the project addresses specific artifacts and limitations present in the original StyleGAN architecture while advancing the state of the art in unconditional generative image modeling.
The core contribution of StyleGAN2 involves multiple architectural and training improvements to the style-based GAN framework. The researchers redesigned generator normalization techniques, revisited progressive growing strategies, and introduced a path length regularizer that encourages proper conditioning in the mapping from latent vectors to generated images. This regularizer provides the additional benefit of making the generator significantly easier to invert, enabling reliable detection of whether an image was generated by a particular network. The work also identifies and addresses a capacity problem in the original architecture, motivating the training of larger models to achieve further quality improvements.
The repository is written in Python and requires TensorFlow 1.14 or 1.15, with support for both Linux and Windows systems though Linux is recommended for performance reasons. The implementation relies on custom TensorFlow operations compiled on the fly using NVCC, necessitating CUDA 10.0 toolkit and cuDNN 7.5. To reproduce results from the paper, users need NVIDIA GPUs with at least 16 GB of DRAM. The project includes a provided Dockerfile for users who prefer containerized deployment.
StyleGAN2 comes with multiple pre-trained networks available as pickle files, including models trained on the FFHQ dataset at 1024x1024 resolution, LSUN Car at 512x384, and LSUN Cat, Church, and Horse datasets at 256x256 resolution. The repository provides comprehensive tools for working with these models, including functionality to generate images, project images to latent space, and train custom networks on user-provided datasets. Training times vary significantly based on configuration and GPU count, with full FFHQ training at 1024x1024 requiring approximately 9 to 70 days depending on the number of GPUs available.
The project includes detailed dataset preparation workflows supporting FFHQ, LSUN categories, and custom image datasets, all stored as multi-resolution TFRecords. Users can evaluate trained models using provided metrics that measure both distribution quality and perceived image quality. The repository demonstrates that results match the paper when training with 1, 2, 4, or 8 GPUs, providing flexibility for researchers with varying computational resources.
StyleGAN2 has been classified across multiple domains including generative adversarial networks, image synthesis, deep learning, realistic imagery, neural networks, computer vision, latent space manipulation, generative models, and artificial intelligence. The work is accompanied by comprehensive supplementary materials including high-quality paper and video documentation, example images, curated results, and videos demonstrating the model's capabilities. A PyTorch variant, StyleGAN2-ADA-PyTorch, is also available as an alternative implementation.