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.
GATYSL, ECKERA, BETHGEM. A neural algorithm of artistic style[J]. Journal of Vision, 2016, 16(12): 326.
[2]
HUANGX, BELONGIES. Arbitrary style transfer in real-time with adaptive instance normalization[C]//2017 Proceedings of the IEEE International Conference on Computer Vision, 2017: 1501-1519.
[3]
PARKD Y, LEEK H. Arbitrary style transfer with style-attentional networks[C]//2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2019: 5873-5881.
[4]
LIUS, LINT, HED, et al. Adaattn: revisit attention mechanism in arbitrary neural style transfer[C]//2021 IEEE/CVF International Conference on Computer Vision, 2021: 6629-6638.
[5]
DENGY, TANGF, DONGW, et al. StyTr2: image style transfer with transformers[C]//2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2022: 11316-11326.
[6]
VASWANIA, SHAZEERN, PARMARN, et al. Attention is all you need[C]//Proceedings of the 31st International Conference on Neural Information Processing Systems, 2017: 6000-6010.
WANGYang, YUZhenxin, LUJia. An image saliency area style transfer method combining visual attention mechanism[J]. Computer Engineering & Science, 2022, 44(1): 118-123. (in Chinese)
[11]
KIRILLOVA, MINTUNE, RAVIN, et al. Segment anything[C]//2023 IEEE/CVF International Conference on Computer Vision, 2023: 3992-4003.
[12]
SIMONYAN, KAREN, ANDREWZISSERMAN. Very deep convolutional networks for large-scale image recognition[C]//3rd International Conference on Learning Representations, 2015: 1-14.
[13]
WANGT C, LIUM Y, ZHUJ Y, et al. High-resolution image synthesis and semantic manipulation with conditional gans[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2018: 8798-8807.
[14]
WUZ, ZHUZ, DUJ, et al. CCPL: contrastive coherence preserving loss for versatile style transfer[C]//Lecture Notes in Computer Science. Cham: Springer Nature Switzerland, 2022: 189-206.
[15]
LINT Y, MAIREM, BELONGIES, et al. Microsoft COCO: common objects in context[C]//European Conference on Computer Vision, 2014: 740-755.
[16]
PHILLIPSF, MACKINTOSHB. Wiki art gallery, inc.: a case for critical thinking[J]. Issues in Accounting Education, 2011, 26(3): 593-608.