Skip to content

A simple drag-and-drop web interface for generating images with GANs

License

Notifications You must be signed in to change notification settings

ryanbloom/gan-explorer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GAN Explorer

This is a simple drag-and-drop web interface for generating images with GANs (generative adversarial networks). It supports:

  • Generating images from random latent vectors
  • Generating variants of an image by moving the latent vector in a random direction
  • Interpolating between two images by averaging their latent vectors
  • Completing "image analogies" like A:B::C:D (the latent vector of D is calculated as C+B-A)

A live demo is available here; the model is from ThisJustin-code/pretrained-gan-landscapes-256. You may have to wait a few moments for the container to start up.

Development

The backend is designed to be compatible with NVlabs/stylegan2-ada-pytorch. It should be adaptable to similar architectures by modifying server.py.

You'll need Node.js to build the frontend.

git clone https://github.com/ryanbloom/gan-explorer.git
cd gan-explorer
# Unpickling models relies on having source code available
git clone https://github.com/NVlabs/stylegan2-ada-pytorch
# Download a pretrained model from somewhere
wget $SOME_MODEL_URL -P models
# Bundle JavaScript and run the application
npm install
npx parcel build src/index.html
python server.py