Home

Awesome

A Style-Based GAN Encoder for High Fidelity Reconstruction of Images and Videos

Official implementation for paper: A Style-Based GAN Encoder for High Fidelity Reconstruction of Images and Videos.

[Video Editing Results]

teaser

Abstract We propose a novel architecture for GAN inversion, which we call Feature-Style encoder. The style encoder is key for the manipulation of the obtained latent codes, while the feature encoder is crucial for optimal image reconstruction. Our model achieves accurate inversion of real images from the latent space of a pre-trained style-based GAN model, obtaining better perceptual quality and lower reconstruction error than existing methods. Thanks to its encoder structure, the model allows fast and accurate image editing. Additionally, we demonstrate that the proposed encoder is especially well-suited for inversion and editing on videos. We conduct extensive experiments for several style-based generators pre-trained on different data domains. Our proposed method yields state-of-the-art results for style-based GAN inversion, significantly outperforming competing approaches.

Requirements

Dependencies

You can install a new environment for this repo by running

conda env create -f environment.yml
conda activate feature_style

Prepare StyleGAN2 model and other necessary models

Training

Testing

Video Manipulation

We provide a script to achieve inversion and attribute manipulation for the videos in the test directory data/video/. You can upload your own video and modify the options in run_video_inversion_editing.sh.

sh run_video_inversion_editing.sh

Citation

@article{xuyao2022,
  title={A Style-Based GAN Encoder for High Fidelity Reconstruction of Images and Videos},
  author={Yao, Xu and Newson, Alasdair and Gousseau, Yann and Hellier, Pierre},
  journal={European conference on computer vision},
  year={2022}
}

License

Copyright © 2022, InterDigital R&D France. All rights reserved.

This source code is made available under the license found in the LICENSE.txt in the root directory of this source tree.