Your browser does not support the canvas element.

↓ Click to select a better (and larger) model


What is it?

This is a showcase of a deep GAN (Generative Adversarial Network) that generates (or dreams) images. The neural network runs completely in your browser.

Code is available here.

How to use it?

Usage Just click the "generate" button for generating a single image, or "Animate" for animating the generation by morphing in the latent space (Thanks Nikhil Thorat for very helpful instructions on how to property animate!)

Different Models You can also choose different models --- the model's description suggests its architecture (see blow), dimension of images it can generates, and size of model files.

Model Discussion The default model to show is DCGAN, fast but with moderate quality. Choose ResNet models for much better result, but note they can be large and it may take some time to download. Also for animating, only DCGAN archives a reasonable frame rate.

Technical Details?

The network architecture is similar to the residual network (ResNet) based generator (Gulrajani et al.), as well as the classical DCGAN generator (Radford et al.) and the GAN training uses DRAGAN (Kodali et al.) style granient penalty for better stability.

Training code is written in Chainer. The trained model is then manually converted to a Keras model, which in turn is converted to a web-runnable TensorFlow.js model.

The dataset used for training is CelebAHQ, an dataset for Karras et al. which can be obtained by consulting its github repo. Note that only data is used in this showcase, but not the method (which is much more awesome, Check it out anway!)

Final Words?

I just create this a proof-of-concept piece of running deep generative model in browser using TensorFlow.js. Some code is inspired by this great repo and thanks for suggestions from friends in MakeGirlsMoe. Thanks Nikhil Thorat for very helpful instructions on how to property animate!

In case you notice that, I am a MakeGirlsMoe team member (Yeah I'm proud of my team!), still, this proof-of-concept piece uses completely different technique so it doest NOT represent the quality and status of MakeGirlsMoe.