| The purpose of image inpainting is to provide a visually reasonable and credible restoration for the missing area of the damaged image,which has a very broad application scenario in reality.Traditional inpainting algorithms based on diffusion or image blocks are difficult to achieve semantic restoration,while image inpainting technology based on deep learning can better capture high-level semantic information,make up for the longterm shortcomings of traditional inpainting algorithms,significantly improve the quality of generated results,and make the results more authentic.However,in the face of images to be repaired with large missing areas,the existing methods cannot guarantee the consistency of the generated content,and the inpainted images are prone to texture blurring or artifacts.In addition,most image inpainting algorithms only produce a certain result for each input,but when the missing area is large,it should be able to provide a variety of reasonable inpainted results.In view of the above problems,the thesis proposes a two-stage image inpainting algorithm based on Transformer and generative adversarial networks.The first network extracts a variety of low-resolution image structure priors,and the second network combines the style of the original effective area to gradually upsample the low-resolution structure prior to the original resolution,thereby filling more detailed textures.In order to improve the problems of texture blur and content inconsistency of the inpainted area,the thesis proposes an upsampling network with deformable convolution,and proposes a sample loss to optimize the training process of the network,so that the network can learn advanced semantic information more fully.In addition,in order to improve the diversity of inpainted results,the thesis makes a theoretical analysis of the pattern collapse problem in the training of generative adversarial networks.In order to alleviate the pattern collapse problem,the thesis proposes a global distribution fitting method,which adds a penalty term to constrain the distribution of the generated data without changing the global minimum of the adversarial loss.This method is simple,effective,small in calculation and easy to transplant.Finally,comparative experiments on multiple datasets prove that the proposed algorithm can generate more realistic,reasonable and diversified inpainted results. |