Skip to content

The code of "Invertible conditional GANs for image editing" in tensorflow

License

Notifications You must be signed in to change notification settings

zhangqianhui/ICGan-tensorflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ICGan-tensorflow

the test code of Invertible conditional GANs for image editing using Tensorflow.

The Torch code of Author.

INTRODUCTION

In this paper , a real image can be encoded into a latent code z and conditional information y,and then reconstucted to the origial image by generative model of Gans.The paper fix z and modify y to obtain variations of the original image.

The IcGAN is trained in three steps.

1.Train the Gan.
2.Train the encoder Z to map an image x to a latent representation z with the dataset generated images.
3.Train the encoder Y to map an image x to a conditional information vector y with the dataset of real images.

Prerequisites

  • tensorflow 1.0

  • python 2.7

  • opencv 2.4.8

Usage

Download mnist:

$ python download.py

Train Gan:

$ python main.py --OPER_FLAG 0

Train Encode z:

$ python main.py --OPER_FLAG 1

Train Encode y:

$ python main.py --OPER_FLAG 2

Test to reconstuction:

$ python main.py --OPER_FLAG 3 --extend 0

Test new result:

$ python main.py --OPER_FLAG 3 --extend 1

Result of Test in mnist dataset:

The original image:

The restruction image:

The new sample of changing y:

Reference code

DCGAN

About

The code of "Invertible conditional GANs for image editing" in tensorflow

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages