All Projects → genforce → eqgan

genforce / eqgan

Licence: other
[CVPR 2022] Improving GAN Equilibrium by Raising Spatial Awareness

Programming Languages

python
139335 projects - #7 most used programming language
Cuda
1817 projects
C++
36643 projects - #6 most used programming language

Labels

Projects that are alternatives of or similar to eqgan

GazeCorrection
Unsupervised High-Resolution Portrait Gaze Correction and Animation (TIP 2022)
Stars: ✭ 174 (+34.88%)
Mutual labels:  gans
coursera-gan-specialization
Programming assignments and quizzes from all courses within the GANs specialization offered by deeplearning.ai
Stars: ✭ 277 (+114.73%)
Mutual labels:  gans
Awesome-GAN-Resources
🤖A list of resources to help anyone getting started with GANs 🤖
Stars: ✭ 90 (-30.23%)
Mutual labels:  gans
Everybody-dance-now
Implementation of paper everybody dance now for Deep learning course project
Stars: ✭ 22 (-82.95%)
Mutual labels:  gans
Anime2Sketch
A sketch extractor for anime/illustration.
Stars: ✭ 1,623 (+1158.14%)
Mutual labels:  gans
awesome-generative-deep-art
A curated list of generative deep learning tools, works, models, etc. for artistic uses
Stars: ✭ 172 (+33.33%)
Mutual labels:  gans
SMIT
Pytorch implemenation of Stochastic Multi-Label Image-to-image Translation (SMIT), ICCV Workshops 2019.
Stars: ✭ 37 (-71.32%)
Mutual labels:  gans
gan-vae-pretrained-pytorch
Pretrained GANs + VAEs + classifiers for MNIST/CIFAR in pytorch.
Stars: ✭ 134 (+3.88%)
Mutual labels:  gans
pytorch-deep-photo-enhancer
pytorch implementation of deep photo enhancer
Stars: ✭ 23 (-82.17%)
Mutual labels:  gans
FusionGAN
PyTorch Implementation of FusionGAN paper: Generating a Fusion Image: One's Identity and Another's Shape (https://arxiv.org/abs/1804.07455)
Stars: ✭ 28 (-78.29%)
Mutual labels:  gans
Drowsy
💤🖌️ AI making tiny Bitsy video games. Features an experimental generative structure inspired by GANs and Genetic Algorithms
Stars: ✭ 19 (-85.27%)
Mutual labels:  gans
tools-generation-detection-synthetic-content
Compilation of the state of the art of tools, articles, forums and links of interest to generate and detect any type of synthetic content using deep learning.
Stars: ✭ 107 (-17.05%)
Mutual labels:  gans
AffineGAN
PyTorch Implementation of "Facial Image-to-Video Translation by a Hidden Affine Transformation" in MM'19.
Stars: ✭ 46 (-64.34%)
Mutual labels:  gans
GAN-XML-Fixer
No description or website provided.
Stars: ✭ 55 (-57.36%)
Mutual labels:  gans
simsg
Semantic Image Manipulation using Scene Graphs (CVPR 2020)
Stars: ✭ 49 (-62.02%)
Mutual labels:  gans
CoCosNet-v2
CoCosNet v2: Full-Resolution Correspondence Learning for Image Translation
Stars: ✭ 312 (+141.86%)
Mutual labels:  gans
FaceData
A macOS app to parse face landmarks from a video for GANs training
Stars: ✭ 71 (-44.96%)
Mutual labels:  gans
SieNet-Image-extrapolation
SiENet: Siamese Expansion Network for Image Extrapolation(IEEE SPL2020)
Stars: ✭ 42 (-67.44%)
Mutual labels:  gans
deep-learning-roadmap
my own deep learning mastery roadmap
Stars: ✭ 40 (-68.99%)
Mutual labels:  gans
Pose2vec
A Repository for maintaining various human skeleton preprocessing steps in numpy and tensorflow along with tensorflow model to learn pose embeddings.
Stars: ✭ 25 (-80.62%)
Mutual labels:  gans

EqGAN-SA: Improving GAN Equilibrium by Raising Spatial Awareness

Improving GAN Equilibrium by Raising Spatial Awareness
Jianyuan Wang, Ceyuan Yang, Yinghao Xu, Yujun Shen, Hongdong Li, Bolei Zhou
CVPR 2022

image

[Paper] [Project Page] [Demo]

In Generative Adversarial Networks (GANs), a generator (G) and a discriminator (D) are expected to reach a certain equilibrium where D cannot distinguish the generated images from the real ones. However, in practice it is difficult to achieve such an equilibrium in GAN training, instead, D almost always surpasses G. We attribute this phenomenon to the information asymmetry that D learns its own visual attention when determining whether an image is real or fake, but G has no explicit clue on which regions to focus on.

To alleviate the issue of D dominating the competition in GANs, we aim to raise the spatial awareness of G. We encode randomly sampled multi-level heatmaps into the intermediate layers of G as an inductive bias. We further propose to align the spatial awareness of G with the attention map induced from D. Through this way we effectively lessen the information gap between D and G. Extensive results show that our method pushes the two-player game in GANs closer to the equilibrium, leading to a better synthesis performance. As a byproduct, the introduced spatial awareness facilitates interactive editing over the output synthesis.

TODO

Training Code

Training Script

  • Check the Code

  • Pretrained Model

  • User Interface

Environment

This work was developed on the codebase styleGAN2-ada-pytorch. Please follow its requirement as below:

  • Linux and Windows are supported, but Linux is recommended for performance and compatibility reasons.
  • The original codebase used CUDA toolkit 11.0 and PyTorch 1.7.1. Our experiments were conducted by CUDA toolkit 9.0 and PyTorch 1.8.1. Both the settings are acceptable but may observe a performance difference.
  • Python libraries: pip install click requests tqdm pyspng ninja imageio-ffmpeg==0.4.3.

The code relies heavily on custom PyTorch extensions that are compiled on the fly using NVCC. On Windows, the compilation requires Microsoft Visual Studio. We recommend installing Visual Studio Community Edition and adding it into PATH using "C:\Program Files (x86)\Microsoft Visual Studio\<VERSION>\Community\VC\Auxiliary\Build\vcvars64.bat".

Dataset Preparation

Please refer to the original page for data processing for details. All the datasets are stored as uncompressed ZIP archives containing uncompressed PNG files and a metadata file dataset.json for labels. Please see dataset_tool.py for more information. Alternatively, the folder can also be used directly as a dataset, without running it through dataset_tool.py first, but doing so may lead to suboptimal performance.

FFHQ:

Step 1: Download the Flickr-Faces-HQ dataset as TFRecords.

Step 2: Extract images from TFRecords using dataset_tool.py from the TensorFlow version of StyleGAN2-ADA:

# Using dataset_tool.py from TensorFlow version at
# https://github.com/NVlabs/stylegan2-ada/
python ../stylegan2-ada/dataset_tool.py unpack \
    --tfrecord_dir=~/ffhq-dataset/tfrecords/ffhq --output_dir=/tmp/ffhq-unpacked

Step 3: Create ZIP archive using dataset_tool.py from this repository:

# Scaled down 256x256 resolution.
python dataset_tool.py --source=/tmp/ffhq-unpacked --dest=~/datasets/ffhq256x256.zip \
    --width=256 --height=256

LSUN: Download the desired categories from the LSUN project page and convert to ZIP archive:

python dataset_tool.py --source=~/downloads/lsun/raw/cat_lmdb --dest=~/datasets/lsuncat200k.zip \
    --transform=center-crop --width=256 --height=256 --max_images=200000

Training

Taking the LSUN Cat dataset as an example:

python ./train.py --outdir=/runs --data=/data/lsuncat200k.zip --gpus=8 --cfg=paper256 \
--aug=noaug --pl_w=0 --close_style_mixing=True \
--use_sel=True --align_loss=True 

The flag --use_sel indicates using the spatial encoding layer or not, while --align_loss determines whether using the alignment loss.

You may replace --data by the paths of other datasets. We set --aug to noaug to disable the ADA augmentation, i.e., switching to StyleGAN2 instead of StyleGAN2-ADA. We close the path length regularization and style mixing because they have a little effect on our method.

Acknowledgement

Thanks Janne Hellsten and Tero Karras for their excellent codebase styleGAN2-ada-pytorch.

BibTeX

@article{wang2021eqgan,
  title   = {Improving GAN Equilibrium by Raising Spatial Awareness},
  author  = {Wang, Jianyuan and Yang, Ceyuan and Xu, Yinghao and Shen, Yujun and Li, Hongdong and Zhou, Bolei},
  article = {arXiv preprint arXiv: 2112.00718},
  year    = {2021}
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].