titu1994 / Super-Resolution-using-Generative-Adversarial-Networks

An implementation of SRGAN model in Keras
283 stars 85 forks source link

how to ready for training data? #6

Closed eeric closed 7 years ago

eeric commented 7 years ago

1.Training Details and Parameters is as the paper: Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network, is it?

2.the bicubic kernel is for bicubic interpolation when making the training data, does it?

titu1994 commented 7 years ago
  1. The paper uses 300,000 images from ImageNet dataset as final training data, and 50k validation images from ImageNet as pre-training dataset. You can provide path to the ImageNet dataset images as well and specify the nb_images parameter to specify how many images you wish to use as training data.
  2. The code uses the Keras ImageDataGenerator for obtaining the 256x256 batch from the image dataset path. Then I use bicubic interpolation to create a blurred, downscaled (64x64) and then upscaled version of that image (256x256) again. This is used as input for training the network and then compared with the original undistorted and sharp input image to compute the VGG loss.
eeric commented 7 years ago

Training data include 256x256 upscaled images and 256x256 original undistorted images, doesn't it? Training data hasn't label, is it?

titu1994 commented 7 years ago

No there are no labels.

eeric commented 7 years ago

Training data include 256x256 upscaled images, not 256x256 original undistorted images, doesn't it?

titu1994 commented 7 years ago

It includes the upscaled image as training data (X) and then computes the VGG loss through the original images (Y)

eeric commented 7 years ago

In model.py, for training full network, that is SRGAN network, step is following,

1st ---> To pretrain the SR network: srgan_network = SRGANNetwork(img_width=32, img_height=32, batch_size=1) srgan_network.pre_train_srgan(iamges_path, nb_epochs=1, nb_images=50000)

2nd ---> To pretrain the Discriminator network: srgan_network = SRGANNetwork(img_width=32, img_height=32, batch_size=1) srgan_network.pre_train_discriminator(iamges_path, nb_epochs=1, nb_images=50000)

3rd ---> To train the full network (Does NOT work properly right now, Discriminator is not correctly trained): srgan_network = SRGANNetwork(img_width=32, img_height=32, batch_size=1) srgan_network.train_full_model(coco_path, nb_images=80000, nb_epochs=10)

Is it so?

On 1st step, what images does iamges_path folder include? On 2nd step, what images does iamges_path folder include? On 3rd step, what images does coco_path folder include?

titu1994 commented 7 years ago

All three are trained by the same MS COCO dataset. The MSCOCO dataset contains 80k images. So we use 50k random images from that to pretrain the SRGAN and discriminator. Then we train the full SRGAN + Discriminator model in the 3rd step with several iterations over MS COCO 80k dataset.