SkillAgentSearch skills...

SpatialAttentionGAN

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

Install / Use

/learn @elvisyjlin/SpatialAttentionGAN
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

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

Related Skills

View on GitHub
GitHub Stars104
CategoryDevelopment
Updated3mo ago
Forks19

Languages

Python

Security Score

97/100

Audited on Dec 9, 2025

No findings