GAN starting with images, not noise (lesson 7)

Hi! How can I replace the random noise with actual images in the Bedroom generator of lesson 7? I’d like to feed in images of kitchens and use them as a base for image generation instead of noise. The goal is to make the kitchen images look like bedrooms. Below is the data function of the lesson 7 bedroom notebook. I haven’t found a way to replace the “noise_sz=100” of line 2 with a path to the kitchen images. Any ideas? Am I in a completely wrong direction? Thanks!

def get_data(bs, size):
    return (GANItemList.from_folder(path_bedrooms, noise_sz=100)
               .split_none()
               .label_from_func(noop)
               .transform(tfms=[[crop_pad(size=size, row_pct=(0,1), col_pct=(0,1))], []], size=size, tfm_y=True)
               .databunch(bs=bs)
               .normalize(stats = [torch.tensor([0.5,0.5,0.5]), torch.tensor([0.5,0.5,0.5])], do_x=False, do_y=True))
1 Like

This would be an image to image task so you could probably use an ImageImageList. Look in the superres lesson notebook for an example of this.

In the superres example there are labels for each image, and the generator and discriminator are trained with labels. Since there are no labels for kitchen images (how they would look if they were bedrooms), I cant use the superres notebook directly. Would there be some workaround to make ImageImageList work in the WGAN bedroom notebook?

The dataset labels are used for pretraining, which isn’t exactly necessary but helpful for GAN convergence so you can skip that part and just start training the GAN.