gitmyhub

stylegan

Python ★ 14k updated 2y ago

StyleGAN - Official TensorFlow Implementation

NVIDIA's official StyleGAN code: an AI model that generates photorealistic images of faces, cars, bedrooms, and cats that do not exist in real life.

PythonTensorFlowsetup: hardcomplexity 4/5

StyleGAN is the official code release from NVIDIA for a research paper published in 2018 that introduced a new way to train an AI to generate realistic images. The paper is titled "A Style-Based Generator Architecture for Generative Adversarial Networks." The teaser image in the README shows human faces that do not belong to real people. They were entirely synthesized by the model.

The core idea behind StyleGAN is a different approach to how the image generator is structured. Traditional image generators start from a single random input and transform it step by step into an image. StyleGAN instead draws inspiration from "style transfer," a technique where the visual style of one image is applied to another. This architecture allows separate control over different aspects of the generated image: high-level traits like the overall shape and identity of a face are handled separately from fine details like freckles or individual hair strands. The result is that you can adjust these aspects at different scales without them interfering with each other.

The repository provides pre-trained model files for generating faces (trained on two large face datasets), bedroom interiors, cars, and cats. You can load these pre-trained models and immediately generate new images without doing your own training. The code is written in Python and uses TensorFlow 1.10, which is an older version of the TensorFlow machine learning library.

The material is released under a Creative Commons BY-NC license, meaning it is free for non-commercial use with proper attribution, but commercial use requires a separate license from NVIDIA. The paper was published on arXiv and an accompanying video demonstrating the results is also available.

A newer version, StyleGAN2, has since been released and the README points to that repository for anyone wanting the more up-to-date implementation.

Where it fits