Home

Awesome

pix2pix-tensorflow

This repository is a Tensorflow implementation of the Isola's Image-to-Image Tranaslation with Conditional Adversarial Networks, CVPR2017.

<p align="center"> <img src="https://user-images.githubusercontent.com/37034031/42619365-d285e190-85f2-11e8-8e52-9d53ddfc5653.png"> </p>

Requirements

Generated Results

<p align="center"> <img src="https://user-images.githubusercontent.com/37034031/42618142-0e1e6690-85ef-11e8-9aa0-e4bf88c3172d.png" width=700> </p> <p align="center"> <img src="https://user-images.githubusercontent.com/37034031/42619115-165cb430-85f2-11e8-8b0c-bfd3470751b3.png" width=700> </p> <p align="center"> <img src="https://user-images.githubusercontent.com/37034031/42619232-697bce44-85f2-11e8-95a8-8294be1489cd.png" width=700> </p> <p align="center"> <img src="https://user-images.githubusercontent.com/37034031/42619276-8a6ac128-85f2-11e8-99c2-eb6743aa4458.png" width=700> </p>

Generator & Discriminator Structure

<p align="center"> <img src="https://user-images.githubusercontent.com/37034031/42619487-2533caa6-85f3-11e8-9449-ada599622256.png" width=700> </p> <p align="center"> <img src="https://user-images.githubusercontent.com/37034031/42619942-699a0e0c-85f4-11e8-97e0-b7403cd9abc7.png" width=400> </p>

Documentation

Download Dataset

Download datasets (script borrowed from torch code)

bash ./src/download_dataset.sh [dataset_name]

Directory Hierarchy

├── pix2pix
│   ├── src
│   │   ├── dataset.py
│   │   ├── download_dataset.sh
│   │   ├── main.py
│   │   ├── pix2pix.py
│   │   ├── solver.py
│   │   ├── tensorflow_utils.py
│   │   └── utils.py
├── Data
│   ├── facades
│   └── maps

Note: please put datasets on the correct position based on the Directory Hierarchy.

Training pix2pix Model

Use main.py to train a pix2pix model. Example usage:

python main.py --dataset=facades --which_direction=0 --is_train=true

Evaluating pix2pix Model

Use main.py to evaluate a pix2pix model. Example usage:

python main.py --is_train=false --load_model=folder/you/wish/to/test/e.g./20180704-1746

Please refer to the above arguments.

Citation

  @misc{chengbinjin2018pix2pix,
    author = {Cheng-Bin Jin},
    title = {pix2pix tensorflow},
    year = {2018},
    howpublished = {\url{https://github.com/ChengBinJin/pix2pix-tensorflow}},
    note = {commit xxxxxxx}
  }

Attributions/Thanks

License

Copyright (c) 2018 Cheng-Bin Jin. Contact me for commercial use (or rather any use that is not academic research) (email: sbkim0407@gmail.com). Free for research use, as long as proper attribution is given and this copyright notice is retained.

Related Projects