Incremental Transformer Structure Enhanced Image Inpainting with Masking Positional Encoding
About
Image inpainting has made significant advances in recent years. However, it is still challenging to recover corrupted images with both vivid textures and reasonable structures. Some specific methods only tackle regular textures while losing holistic structures due to the limited receptive fields of convolutional neural networks (CNNs). On the other hand, attention-based models can learn better long-range dependency for the structure recovery, but they are limited by the heavy computation for inference with large image sizes. To address these issues, we propose to leverage an additional structure restorer to facilitate the image inpainting incrementally. The proposed model restores holistic image structures with a powerful attention-based transformer model in a fixed low-resolution sketch space. Such a grayscale space is easy to be upsampled to larger scales to convey correct structural information. Our structure restorer can be integrated with other pretrained inpainting models efficiently with the zero-initialized residual addition. Furthermore, a masking positional encoding strategy is utilized to improve the performance with large irregular masks. Extensive experiments on various datasets validate the efficacy of our model compared with other competitors. Our codes are released in https://github.com/DQiaole/ZITS_inpainting.
Related benchmarks
| Task | Dataset | Result | Rank | |
|---|---|---|---|---|
| Image Inpainting | Places2 irregular mask (val) | PSNR28.31 | 48 | |
| Inpainting | Places2 Wide Mask 512x512 (test) | FID5.56 | 30 | |
| Image Inpainting | Places2 512x512 (test) | LPIPS0.133 | 20 | |
| Inpainting | Places2 512x512 Narrow Mask (test) | FID1.27 | 15 | |
| Inpainting | Places2 Medium Mask 512x512 (test) | FID3.02 | 15 | |
| Inpainting | Places2 Narrow Mask 512 x 512 | FID1.27 | 15 | |
| Inpainting | Places2 Medium Mask 512 x 512 | FID3.02 | 15 | |
| Image Inpainting | Indoor custom (val) | PSNR25.57 | 4 | |
| Image Inpainting | Places 1k 512x512 images 40% center rectangular masks (test) | PSNR19.65 | 3 | |
| Image Inpainting | Indoor 512x512 (test) | PSNR25.36 | 2 |