Abstract:
Aiming at the problems of the current local image style transfer methods, such as the difficulty in selecting the target region, the lack of transfer flexibility, the easy occurrence of content leakage and unnatural transitions between foreground and background boundaries, an interactive local image style transfer method based on SAM segmentation is proposed in this paper. Firstly, SAM segmentation network is employed to extract the target transfer region of the input content image interactively under the guidance of the user input prompt, and the effective object mask is binarized. The binary mask is used to extract the target region of the global stylized image as the foreground and the content image as the background image for Poisson fusion to realize the local image style transfer. In order to avoid content leakage during the transfer process, the architecture of generative adversarial network is adopted in the global style transfer network. The multi-level adaptive attention normalization module is used for style feature conversion, and the joint loss function is used for comprehensive training of the network. The experimental results show that the interactive local image style transfer network designed in this paper can generate flexible and controllable local transfer results according to user prompts, and can carry out style transfer for any object in the image. The transfer results well preserve the content structure in the content source image, avoid content leakage and the boundaries of foreground and background transit more naturally.