SuperAPIAI Directory

hyperstyle

github.com · AI images

Official Implementation for "HyperStyle: StyleGAN Inversion with HyperNetworks for Real Image Editing" https://arxiv.org/abs/2111.15666

Open website Alternatives
PricingOpen source开源项目(可免费自部署)

About this tool

HyperStyle is the official implementation of the paper "HyperStyle: StyleGAN Inversion with HyperNetworks for Real Image Editing" (CVPR 2022), used to invert real images into the StyleGAN latent space. Traditional inversion methods face a trade-off between reconstruction accuracy and semantic editability: the latent space regions that can accurately represent real images often have poor semantic control. Existing work alleviates this problem by fine-tuning the generator for each image, but training is time-consuming and difficult to popularize. HyperStyle introduces this idea into encoder-based inversion and proposes a hypernetwork that learns to modulate the weights of StyleGAN so that a given image is faithfully represented in the editable region of the latent space. Direct modulation would require training a hypernetwork with over 3 billion parameters; the authors reduce the parameter count to a level comparable to existing encoders through careful design. HyperStyle's reconstruction quality is comparable to optimization methods, while having the near-real-time inference capability of an encoder, and it can be used for out-of-domain image editing not seen during training. The repository provides the official implementation for training and evaluation, including a pretrained HyperStyle model, auxiliary models (a pretrained e4e encoder, a StyleGAN2 generator, and loss computation models), inference scripts, metric computation, editing (InterFaceGAN, GANSpace, StyleCLIP), and domain adaptation scripts. Usage requires an NVIDIA GPU + CUDA CuDNN, an Anaconda environment is recommended, and dependencies are listed in environment/hyperstyle_env.yaml. The training script is scripts/train.py, the inference script is scripts/inference.py, and the editing scripts are located in the editing/ directory. The specific installation commands, pretrained model download links, and complete training commands are not fully provided in the materials and require reference to the repository files.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools