Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

StyTr$^2$: Image Style Transfer with Transformers

About

The goal of image style transfer is to render an image with artistic features guided by a style reference while maintaining the original content. Owing to the locality in convolutional neural networks (CNNs), extracting and maintaining the global information of input images is difficult. Therefore, traditional neural style transfer methods face biased content representation. To address this critical issue, we take long-range dependencies of input images into account for image style transfer by proposing a transformer-based approach called StyTr$^2$. In contrast with visual transformers for other vision tasks, StyTr$^2$ contains two different transformer encoders to generate domain-specific sequences for content and style, respectively. Following the encoders, a multi-layer transformer decoder is adopted to stylize the content sequence according to the style sequence. We also analyze the deficiency of existing positional encoding methods and propose the content-aware positional encoding (CAPE), which is scale-invariant and more suitable for image style transfer tasks. Qualitative and quantitative experiments demonstrate the effectiveness of the proposed StyTr$^2$ compared with state-of-the-art CNN-based and flow-based approaches. Code and models are available at https://github.com/diyiiyiii/StyTR-2.

Yingying Deng, Fan Tang, Weiming Dong, Chongyang Ma, Xingjia Pan, Lei Wang, Changsheng Xu• 2021

Related benchmarks

TaskDatasetResultRank
Style TransferMS-COCO and WikiArt
Execution Time (s)0.034
48
Style TransferMS-COCO (content) + WikiArt (style) (test)
LPIPS0.48
31
Image Style TransferUser Study
Overall Quality Score31
30
Image Style Transfer(test)
Average Inference Time (s)0.116
22
Facial Texture GenerationCelebA
MAE0.0418
16
Artistic Style TransferMS-COCO content images and WikiArt style images 512x512 resolution (test)
FID (Artistic Style)30.72
13
Style TransferStyle Transfer (test)
Lc1.91
11
Artistic transferWikiArt
FID (Style)18.89
11
Artistic Style TransferCOCO and WikiArt (test)
LPIPS0.33
11
Photo-realistic transferMSCOCO
FID (Style)30.998
11
Showing 10 of 23 rows

Other info

Code

Follow for update