NVIDIA Open-Sources Hyper-Realistic Face Generator StyleGAN

Synced
Synced
Feb 9, 2019 · 3 min read
Image for post
Image for post

In December Synced reported on a hyperrealistic face generator developed by US chip giant NVIDIA. The GAN-based model performs so well that most people can’t distinguish the faces it generates from real photos. This week NVIDIA announced that it is open-sourcing the nifty tool, which it has dubbed “StyleGAN”.

Image for post
Image for post
Fake faces generated by StyleGAN.

The Flickr-Faces-HQ (FFHQ) dataset used for training in the StyleGAN paper contains 70,000 high-quality PNG images of human faces at 1024x1024 resolution (aligned and cropped).

Users can either train their own model or use the pretrained model to build their face generators. Linux and Windows are supported, with specific system requirements as follows:

  • Both Linux and Windows are supported, but we strongly recommend Linux for performance and compatibility reasons.
  • 64-bit Python 3.6 installation. We recommend Anaconda3 with numpy 1.14.3 or newer.
  • TensorFlow 1.10.0 or newer with GPU support.
  • One or more high-end NVIDIA GPUs with at least 11GB of DRAM. We recommend NVIDIA DGX-1 with 8 Tesla V100 GPUs.
  • NVIDIA driver 391.35 or newer, CUDA toolkit 9.0 or newer, cuDNN 7.3.1 or newer.
Image for post
Image for post

The pre-trained models are stored as pickle(.pkl) files in Google Drive. To use the pre-trained network, users have the option of minimal examples at pretrained_example.py or more advanced examples from generate_figures.py.

Those who prefer to train the model themselves with a prepared dataset can complete the following steps:

  • Edit train.py to specify the dataset and training configuration by uncommenting or editing specific lines.
  • Run the training script with python train.py.
  • The results are written to a newly created directory results/<ID>-<DESCRIPTION>.
Image for post
Image for post

Training time varies depending on configurations and hardware. NVIDIA estimates training time for 1024x1024 resolution images using Tesla V100 GPU as follows:

Image for post
Image for post

All related project material is available on the StyleGan Github page, including the updated paper A Style-Based Generator Architecture for Generative Adversarial Networks, result videos, source code, dataset, and a shared folder containing additional material such as pre-trained models.

The hyperrealistic results do require marshalling some significant compute power, as the project Github page advises: “Please note that we have used 8 GPUs in all of our experiments. Training with fewer GPUs may not produce identical results — if you wish to compare against our technique, we strongly recommend using the same number of GPUs.” This sort of reminds us of NVIDIA Founder and CEO Jensen Huang’s hardware pitch-quip at the GTC 2018: “The more you buy, the more you save!”

Author: Mos Zhang | Editor: Michael Sarazen

2018 Fortune Global 500 Public Company AI Adaptivity Report is out!
Purchase a Kindle-formatted report on Amazon.
Apply for Insight Partner Program to get a complimentary full PDF report.

Image for post
Image for post

Follow us on Twitter @Synced_Global for daily AI news!

We know you don’t want to miss any stories. Subscribe to our popular Synced Global AI Weekly to get weekly AI updates.

Image for post
Image for post
Synced

Written by

Synced

AI Technology & Industry Review — syncedreview.com | Newsletter: http://bit.ly/2IYL6Y2 | Share My Research http://bit.ly/2TrUPMI | Twitter: @Synced_Global

SyncedReview

We produce professional, authoritative, and thought-provoking content relating to artificial intelligence, machine intelligence, emerging technologies and industrial insights.

Synced

Written by

Synced

AI Technology & Industry Review — syncedreview.com | Newsletter: http://bit.ly/2IYL6Y2 | Share My Research http://bit.ly/2TrUPMI | Twitter: @Synced_Global

SyncedReview

We produce professional, authoritative, and thought-provoking content relating to artificial intelligence, machine intelligence, emerging technologies and industrial insights.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store