Skip to content

Uses a Pretrained Network (using Google's Deepmind) to generate images.

License

Notifications You must be signed in to change notification settings

crypto-code/BigGAN-Pretrained

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BigGAN-Pretrained

Uses a Pretrained Network (Trained using Google's Deepmind) to generate images.

BigGAN

The BigGAN is an implementation of the GAN architecture designed to leverage the best from what has been reported to work more generally. Specifically, the BigGAN is designed for class-conditional image generation. That is, the generation of images using both a point from latent space and image class information as input. Example datasets used to train class-conditional GANs include the CIFAR or ImageNet image classification datasets that have tens, hundreds, or thousands of image classes.

As its name suggests, the BigGAN is focused on scaling up the GAN models.

This includes GAN models with:

  • More model parameters (e.g. more feature maps).
  • Larger Batch Sizes
  • Architectural changes

For more info refer to paper

Download Pretrained Weights

The Pretrained weights can be downloaded from here

Installation

This requires anaconda or miniconda.

To create the environement run

conda env create -f environement.yml

The following dependencies will be installed:

  • python=3.6
  • cudatoolkit=10.0
  • pytorch
  • torchvision
  • scipy

Usage

To run the code, download the pretrained weights first.

python generate.py -w <PRETRAINED_WEIGHT_PATH> [-s IMAGE_SIZE] [-c CLASS_LABEL] [-t TRUNCATION] [-o OUTPUT_FILE] 

For example:

python generate.py -w ./biggan512-release.pt -s 512 -t 0.3 -c 156 
python generate.py -w ./biggan256-release.pt -s 256 -t 0.02 -c 11 -o output

The Valid parameters are:

  • Valid image size: 128, 256, 512
  • Valid class label: 0~999
  • Valid truncation: 0.02~1.0

Examples

Class 156

Class 292

Class 972

Class 992

G00D LUCK

For doubts email me at: atinsaki@gmail.com