GeneGAN: Learning Object Transfiguration and Attribute Subspace from Unpaired Data

Overview

GeneGAN: Learning Object Transfiguration and Attribute Subspace from Unpaired Data

By Shuchang Zhou, Taihong Xiao, Yi Yang, Dieqiao Feng, Qinyao He, Weiran He

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

@inproceedings{DBLP:conf/bmvc/ZhouXYFHH17,
  author    = {Shuchang Zhou and
               Taihong Xiao and
               Yi Yang and
               Dieqiao Feng and
               Qinyao He and
               Weiran He},
  title     = {GeneGAN: Learning Object Transfiguration and Attribute Subspace from Unpaired Data},
  booktitle = {Proceedings of the British Machine Vision Conference (BMVC)},
  year      = {2017},
  url       = {http://arxiv.org/abs/1705.04932},
  timestamp = {http://dblp.uni-trier.de/rec/bib/journals/corr/ZhouXYFHH17},
  bibsource = {dblp computer science bibliography, http://dblp.org}
}

We have two following papers, DNA-GAN and ELEGANT, that generalize the method into multiple attributes case. It is worth mentioning that ELEGANT can transfer multiple face attributes on high resolution images. Please pay attention to our new methods!

Introduction

This is the official source code for the paper GeneGAN: Learning Object Transfiguration and Attribute Subspace from Unpaired Data. All the experiments are initially done in our proprietary deep learning framework. For convenience, we reproduce the results using TensorFlow.

cross

GeneGAN is a deterministic conditional generative model that can learn to disentangle the object features from other factors in feature space from weak supervised 0/1 labeling of training data. It allows fine-grained control of generated images on one certain attribute in a continous way.

Requirement

  • Python 3.5
  • TensorFlow 1.0
  • Opencv 3.2

Training GeneGAN on celebA dataset

  1. Download celebA dataset and unzip it into datasets directory. There are various source providers for CelebA datasets. To ensure that the size of downloaded images is correct, please run identify datasets/celebA/data/000001.jpg. The size should be 409 x 687 if you are using the same dataset. Besides, please ensure that you have the following directory tree structure.
├── datasets
│   └── celebA
│       ├── data
│       ├── list_attr_celeba.txt
│       └── list_landmarks_celeba.txt
  1. Run python preprocess.py. It will take several miniutes to preprocess all face images. A new directory datasets/celebA/align_5p will be created.

  2. Run python train.py -a Bangs -g 0 to train GeneGAN on the attribute Bangs. You can train GeneGAN on other attributes as well. All available attribute names are listed in the list_attr_celeba.txt file.

  3. Run tensorboard --logdir='./' --port 6006 to watch your training process.

Testing

We provide three kinds of mode for test. Run python test.py -h for detailed help. The following example is running on our GeneGAN model trained on the attribute Bangs. Have fun!

1. Swapping of Attributes

You can easily add the bangs of one person to another person without bangs by running

python test.py -m swap -i datasets/celebA/align_5p/182929.jpg -t datasets/celebA/align_5p/022344.jpg
input target out1 out2
Swap Attribute

2. Linear Interpolation of Image Attributes

Besides, we can control to which extent the bangs style is added to your input image through linear interpolation of image attribute. Run the following code.

python test.py -m interpolation -i datasets/celebA/align_5p/182929.jpg -t datasets/celebA/align_5p/035460.jpg -n 5
interpolation target
Linear Interpolation

3. Matrix Interpolation in Attribute Subspace

We can do something cooler. Given four images with bangs attributes at hand, we can observe the gradual change process of our input images with a mixing of difference bangs style.

python test.py -m matrix -i datasets/celebA/align_5p/182929.jpg --targets datasets/celebA/align_5p/035460.jpg datasets/celebA/align_5p/035451.jpg datasets/celebA/align_5p/035463.jpg datasets/celebA/align_5p/035474.jpg -s 5 5
matrix
Matrix Interpolation

Scikit-event-correlation - Event Correlation and Forecasting over High Dimensional Streaming Sensor Data algorithms

scikit-event-correlation Event Correlation and Changing Detection Algorithm Theo

Intellia ICT 5 Oct 30, 2022
4th place solution for the SIGIR 2021 challenge.

SIGIR-2021 (Tinkoff.AI) How to start Download train and test data: https://sigir-ecom.github.io/data-task.html Place it under sigir-2021/data/. Run py

Tinkoff.AI 4 Jul 01, 2022
PyTorch code for Composing Partial Differential Equations with Physics-Aware Neural Networks

FInite volume Neural Network (FINN) This repository contains the PyTorch code for models, training, and testing, and Python code for data generation t

Cognitive Modeling 20 Dec 18, 2022
rliable is an open-source Python library for reliable evaluation, even with a handful of runs, on reinforcement learning and machine learnings benchmarks.

Open-source library for reliable evaluation on reinforcement learning and machine learning benchmarks. See NeurIPS 2021 oral for details.

Google Research 529 Jan 01, 2023
Flexible time series feature extraction & processing

tsflex is a toolkit for flexible time series processing & feature extraction, that is efficient and makes few assumptions about sequence data. Useful

PreDiCT.IDLab 206 Dec 28, 2022
toroidal - a lightweight transformer library for PyTorch

toroidal - a lightweight transformer library for PyTorch Toroidal transformers are of smaller size and lower weight than the more common E-I types. Th

MathInf GmbH 64 Jan 07, 2023
High-Fidelity Pluralistic Image Completion with Transformers (ICCV 2021)

Image Completion Transformer (ICT) Project Page | Paper (ArXiv) | Pre-trained Models | Supplemental Material This repository is the official pytorch i

Ziyu Wan 243 Jan 03, 2023
Evaluation framework for testing segmentation networks in PyTorch

Evaluation framework for testing segmentation networks in PyTorch. What segmentation network to choose for next Kaggle competition? This benchmark knows the answer!

Eugene Khvedchenya 37 Apr 27, 2022
Code repository for EMNLP 2021 paper 'Adversarial Attacks on Knowledge Graph Embeddings via Instance Attribution Methods'

Adversarial Attacks on Knowledge Graph Embeddings via Instance Attribution Methods This is the code repository to accompany the EMNLP 2021 paper on ad

Peru Bhardwaj 7 Sep 25, 2022
TensorFlowOnSpark brings TensorFlow programs to Apache Spark clusters.

TensorFlowOnSpark TensorFlowOnSpark brings scalable deep learning to Apache Hadoop and Apache Spark clusters. By combining salient features from the T

Yahoo 3.8k Jan 04, 2023
Reference PyTorch implementation of "End-to-end optimized image compression with competition of prior distributions"

PyTorch reference implementation of "End-to-end optimized image compression with competition of prior distributions" by Benoit Brummer and Christophe

Benoit Brummer 6 Jun 16, 2022
Cross-media Structured Common Space for Multimedia Event Extraction (ACL2020)

Cross-media Structured Common Space for Multimedia Event Extraction Table of Contents Overview Requirements Data Quickstart Citation Overview The code

Manling Li 49 Nov 21, 2022
Alfred-Restore-Iterm-Arrangement - An Alfred workflow to restore iTerm2 window Arrangements

Alfred-Restore-Iterm-Arrangement This alfred workflow will list avaliable iTerm2

7 May 10, 2022
Exploit ILP to learn symmetry breaking constraints of ASP programs.

ILP Symmetry Breaking Overview This project aims to exploit inductive logic programming to lift symmetry breaking constraints of ASP programs. Given a

Research Group Production Systems 1 Apr 13, 2022
Fast Differentiable Matrix Sqrt Root

Fast Differentiable Matrix Sqrt Root Geometric Interpretation of Matrix Square Root and Inverse Square Root This repository constains the official Pyt

YueSong 42 Dec 30, 2022
Dynamic wallpaper generator.

Wiki • About • Installation About This project is a dynamic wallpaper changer. It waits untill you turn on the music, downloads album cover if it's po

3 Sep 18, 2021
The official PyTorch implementation for NCSNv2 (NeurIPS 2020)

Improved Techniques for Training Score-Based Generative Models This repo contains the official implementation for the paper Improved Techniques for Tr

174 Dec 26, 2022
Official implementation of the NeurIPS'21 paper 'Conditional Generation Using Polynomial Expansions'.

Conditional Generation Using Polynomial Expansions Official implementation of the conditional image generation experiments as described on the NeurIPS

Grigoris 4 Aug 07, 2022
Use .csv files to record, play and evaluate motion capture data.

Purpose These scripts allow you to record mocap data to, and play from .csv files. This approach facilitates parsing of body movement data in statisti

21 Dec 12, 2022