We know that GANs, if trained properly, are capable of learning the latent distribution of data and using that information to create new samples. This extraordinary ability of GANs makes them perfect for applications such as image inpainting, which is filling the missing part in images with plausible pixels.
In this section, we will learn how to train a GAN model to perform image inpainting, based on the work of Jiahui Yu, Zhe Lin, Jimei Yang, et. al. in their paper, Generative Image Inpainting with Contextual Attention. Although an updated version of their project has been published (http://jiahuiyu.com/deepfill2), the source code is not yet open source at the time of writing. Therefore, we should try to implement the model in PyTorch based on the source code of its previous version for TensorFlow (https://github.com/JiahuiYu/generative_inpainting...