Generate batches of photorealistic human face images at 1024×1024 resolution using a pre-trained model.
Blend visual characteristics, like hair and pose from one image with the skin tone of another, using style mixing.
Detect whether a photograph was generated by the StyleGAN2 model using its invertibility feature.
Reproduce the NVIDIA Research paper's image quality results to benchmark against your own generative model.
Requires an NVIDIA GPU with at least 16 GB VRAM, the CUDA toolkit, and TensorFlow 1.14 or 1.15, TensorFlow 2 is not supported.
StyleGAN2 is NVIDIA Research's official code release for a model that generates photorealistic images from scratch. The model is a generative adversarial network, a type of AI system trained to produce new images that look indistinguishable from real photographs. StyleGAN2 was released alongside a research paper that identified quality problems in the original StyleGAN model and proposed fixes for them. The code comes with pre-trained models for several categories: human faces (at 1024x1024 pixel resolution), cars, cats, churches, and horses. To generate new images, you point the code at one of those pre-trained model files and run a command that produces a batch of PNG images. A truncation setting controls the trade-off between variety and quality in the output. One notable capability is style mixing, where the visual characteristics of two different generated images can be blended together at varying degrees. This lets you combine, for example, the hair and pose of one generated face with the skin tone and age of another. The paper also notes that this version is significantly easier to invert, meaning you can detect whether a given image was produced by the model. Running this code requires a high-end NVIDIA graphics card with at least 16 gigabytes of memory, along with the CUDA toolkit and TensorFlow 1.14 or 1.15. TensorFlow 2 is not supported. The README recommends Linux, though Windows is also possible with some extra setup. A Docker configuration is included for those who prefer containers. A newer successor called StyleGAN2-ADA-PyTorch is noted in the README and available separately. This repository uses a custom NVIDIA license that permits non-commercial research use.
← nvlabs on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.