otenim / GLCIC-PyTorch

A High-Quality PyTorch Implementation of "Globally and Locally Consistent Image Completion".
MIT License
282 stars 54 forks source link

About hole area generation during training #14

Closed zhiyang-fu closed 2 years ago

zhiyang-fu commented 4 years ago

Thanks for your awesome implementation!

I have a question regarding the hole area generation for the local discriminator during training. First of all, I am assuming that the "hole area" in your code represents the region that the local discriminator gonna look at. However, I notice that here and here you generated random hole area for fake and real images respectively.

Are there any reasons or benefits doing this? Or should the hole area for the real and fake images be the same at each iteration?

otenim commented 4 years ago

@zhiyang-fu

You can choose whichever you prefer. I suppose whether to use the same hole or different holes for real and fake images is unrelated to the final results (if you have any reasons that you think the hole should be the same, it would be beneficial if you could share it :)).

zhiyang-fu commented 4 years ago

@otenim

I think it comes to the unpaired/paired supervised training for GAN. If you use the same hole generation for the fake and real images, the inputs (fake and real) to the local discriminator are paired. Technically, different hole generations should also work since the goal of discriminator is to identify if the real and fake images are from the same distribution. My intuition is that if we stick to have the same hole generations, the inpainting results may look more similar to the real image. But it will need some experiments to test the performance difference for the image inpainting application before drawing the conclusion.

Thanks,