Icon

01_Train GAN for Image Generation

01_Train GAN for Image Generation
Annotations and comments
  • Training GAN for image generation Read and preprocess an image dataset to train a GAN (Generative Adversarial Network) that produces similar images. The Discriminator and Generator models must match image dimension. You can use the provided models or define new ones.
  • GAN Models 128x128x3 NOTE: Generator output and discriminator input must match the size of the images
  • Preprocessing - Randomly sample dataset - Efficient image load with Parallel Loop - Resize to desired size (32x32, 64x64...). NOTE: the size must match the discriminator model input and the generator model output - Convert to Float and Normalize to -1,1 range
  • Training GAN - Set training parameters - Select a folder to save intermediate results. After training the generator model is provided in output.
  • Model execution Use the trained generator model to produce images. Select "To Image (Auto-mapping)" conversion for the last layer output
  • Postprocessing Fit images to correct representation - Swap dimensions to X,Y,Channel - Denormalize and convert to unsigned byte type
  • Visualization Show generated images in a Tile View
  • GAN Models 64x64x3 Alternative models for smaller images (less parameters therefore reduced training time)
  • Export model
  • Generator latent space dimension
  • Number of Rows
  • Generate vectors from latent space
  • model generator_128 GAN
  • model discriminator_128 GAN
  • model generator_64 GAN
  • model discriminator_64 GAN
  • Save intermediate results checkbox
  • Select input column
  • GPU
  • CPU
  • GAN training
  • Epochs
  • Batch size
  • results folder
  • Save generator model
  • Read image folder
  • Convert to FloatType
  • Normalize values to range [-1,1]
  • Resize each image (possible distortion)
  • Image size
  • Sample size
  • Compatible with the Image Reader (Table)
  • keep arrays and class
  • convert images to arrays
  • how many rows to sample
  • specify image size
  • steal images from Kathrin
  • path to dataset
  • 32x32 can be 25,000 64x64 can be 10,000
  • get class
  • Swap to X,Y,Channel
  • Normalize and scale to UnsignetByte type
  • Name dimensions (Channel, X, Y) The order is due to auto-mapping conversion
  • stratified sampling

Nodes

Extensions

Links