Writing StyleGAN from scratch with TensorFlow to edit face (and CycleGAN, GauGAN, BigGAN and many more)

SoonYau
5 min readDec 29, 2020

Nowadays, we can’t escape from seeing social media posts showing how AI create amazing results. This include using deepfakes to swap face with actor in Hollywood films, transforming face into different gender or age, or more recently, to swap your pyjamas into suit for video conferencing call! This all looks like magic. Indeed, any sufficiently advanced technology is indistinguishable from magic.

All images were generated using StyleGAN as implemented in my book “Hands-on Image Generation with TensorFlow”. The right most face are created by mixing styles and latent noise from the left most two faces.

These are made possible with recent advancement in deep learning, or more specifically deep neural networks known as Generative Adversarial Networks (GANs) and autoencoder. There are many free online resources teaching how to use GANs but they tend to use simple GANs on toy dataset such as MNIST. On the other hand, many researchers publish code for their state-of-the-art models but they were often written in an obscure way that optimized for model performance at the expense of readability. More importantly, at the time of writing, I could not find any teaching materials, be it textbooks or online courses that systematically teach the important techniques needed to understand these models. This motivated me to write a book to bridge the gap.

In this blog post, I will introduce the book’s content which will take you from understanding basic concepts…

--

--

SoonYau
SoonYau

Written by SoonYau

Independent AI Consultant | Book author of “Hands-on Image Generation with TensorFlow” http://linkedin.com/in/soonyau