Skip to content

SaGAN PyTorch "Generative Adversarial Network with Spatial Attention for Face Attribute Editing"

License

Notifications You must be signed in to change notification settings

elvisyjlin/SpatialAttentionGAN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spatial Attention Generative Adversarial Network

This repository contains the PyTorch implementation of the ECCV 2018 paper "Generative Adversarial Network with Spatial Attention for Face Attribute Editing" (pdf).

My results with images and attention masks on CelebA 128 (original, eyeglasses, mouth_slightly_open, no_beard, smiling)

Results

Requirements

  • Python 3.5
  • PyTorch 1.0.0
pip3 install -r requirements.txt

The training procedure described in paper takes 5.5GB memory on a single GPU.

  • Datasets

    • CelebA
      • Put Align&Cropped Images in ./data/celeba/*.jpg
      • Put Attributes Annotations in ./data/list_attr_celeba.txt
  • Pretrained models (download from http://bit.ly/sagan-results and decompress the zips to ./results)

      results
      ├── celeba_128_eyeglasses
      ├── celeba_128_mouth_slightly_open
      ├── celeba_128_no_beard
      └── celeba_128_smiling
    

Usage

Train a model with a target attribute

python3 train.py --experiment-name celeba_128_eyeglasses --target-attr Eyeglasses --gpu

Generate images from trained models

python3 generate.py --experiment-name celeba_128_eyeglasses --gpu

About

SaGAN PyTorch "Generative Adversarial Network with Spatial Attention for Face Attribute Editing"

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages