Skip to content

scape1989/RankCGAN

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository provides PyTorch implementations for RankCGAN paper published in BMVC 2018.

This code is based on DCGAN implementation pytorch-DCGAN.

Model

The model architecture comprises three modules, the discriminator, generator and ranker. As shown in the following Figure:

Datasets

Images

Annotations

In this code, only UT-Zap50K dataset is used. For other datasets, please edit dataloader.py accordingly.

Prerequisites

  • Python 3.5.2
  • Pytorch 0.4.0
  • NVIDIA GPU + CUDA CuDNN

Getting Started

Installation

git clone https://github.com/saquil/RankCGAN
cd RankCGAN

RankCGAN training

The code provides two implementations. RankCGAN.py demonstrates one attribute conditional model and RankCGAN_2D.py demonstrates multiple attributes case with two attributes conditional model.

  • Train a model on single attribute:
python3 main.py --gan_type=RankCGAN
  • Train a model on multiple attributes:
python3 main.py --gan_type=RankCGAN_2D

Image generation results

  • 1D images generation:

Generated shoe (top), face (middle), and scene (bottom) images associated with their ranking scores using “sporty”, “masculine” and “natural” attributes respectively.

  • 2D images generation:

Example of two-attributes interpolation on shoe and face images using (“sporty",“black") and (“masculine",“smiling") attributes.

Citation

If you use this code for your research, please cite our paper.

@inproceedings{saquil2018ranking,
  title={Ranking CGANs: Subjective Control over Semantic Image Attributes},
  author={Saquil, Yassir and Kim, Kwang In and Hall, Peter}
  booktitle={British Machine Vision Conference (BMVC)},
  year={2018}
}

Poster and Supplementary Material

  • You can find our BMVC 2018 poster here
  • You can find our Supplementary Material here

About

Ranking CGANs: Subjective Control over Semantic Image Attributes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%