Style Transformer for Image Inversion and Editing

Xueqi Hu, Qiusheng Huang, Zhengyi Shi, Siyuan Li, Changxin Gao +2 more
3/15/2022
cs.CVcs.AI
transformer-attention

Official code: sapphire497/style-transformer (181 stars, Python, last commit 2023-01-13).

Abstract

Existing GAN inversion methods fail to provide latent codes for reliable reconstruction and flexible editing simultaneously. This paper presents a transformer-based image inversion and editing model for pretrained StyleGAN which is not only with less distortions, but also of high quality and flexibility for editing.

Show full abstract

The proposed model employs a CNN encoder to provide multi-scale image features as keys and values. Meanwhile it regards the style code to be determined for different layers of the generator as queries. It first initializes query tokens as learnable parameters and maps them into W+ space. Then the multi-stage alternate self- and cross-attention are utilized, updating queries with the purpose of inverting the input by the generator. Moreover, based on the inverted code, we investigate the reference- and label-based attribute editing through a pretrained latent classifier, and achieve flexible image-to-image translation with high quality results. Extensive experiments are carried out, showing better performances on both inversion and editing tasks within StyleGAN.

View on arXivView PDF

Code Implementations(1)

Official implementation for "Style Transformer for Image Inversion and Editing" (CVPR 2022)

18111Python, CudaMar 14, 20223 years ago
attention-mechanismgenerative-adversarial-networkstylegan2transformer

Similar Papers

Cite this paper

@article{hu2022style,
  title  = {Style Transformer for Image Inversion and Editing},
  author = {Xueqi Hu and Qiusheng Huang and Zhengyi Shi and Siyuan Li and Changxin Gao and Li Sun and Qingli Li},
  year   = {2022},
  eprint = {2203.07932},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2203.07932}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2203.07932.svg)](https://codeofpaper.com/paper/2203.07932)

Discussion