All Projects → carpedm20 → Discogan Pytorch

carpedm20 / Discogan Pytorch

Licence: apache-2.0
PyTorch implementation of "Learning to Discover Cross-Domain Relations with Generative Adversarial Networks"

Projects that are alternatives of or similar to Discogan Pytorch

Dragan
A stable algorithm for GAN training
Stars: ✭ 189 (-80.33%)
Mutual labels:  jupyter-notebook, gan, unsupervised-learning, generative-model
Hidt
Official repository for the paper "High-Resolution Daytime Translation Without Domain Labels" (CVPR2020, Oral)
Stars: ✭ 513 (-46.62%)
Mutual labels:  jupyter-notebook, gan, unsupervised-learning
Spectralnormalizationkeras
Spectral Normalization for Keras Dense and Convolution Layers
Stars: ✭ 100 (-89.59%)
Mutual labels:  jupyter-notebook, gan, generative-model
Psgan
Periodic Spatial Generative Adversarial Networks
Stars: ✭ 108 (-88.76%)
Mutual labels:  jupyter-notebook, gan, generative-model
Tf Tutorials
A collection of deep learning tutorials using Tensorflow and Python
Stars: ✭ 524 (-45.47%)
Mutual labels:  jupyter-notebook, gan
Generative Adversarial Networks
Introduction to generative adversarial networks, with code to accompany the O'Reilly tutorial on GANs
Stars: ✭ 505 (-47.45%)
Mutual labels:  jupyter-notebook, gan
Wgan Tensorflow
a tensorflow implementation of WGAN
Stars: ✭ 572 (-40.48%)
Mutual labels:  jupyter-notebook, gan
Machine Learning
머신러닝 입문자 혹은 스터디를 준비하시는 분들에게 도움이 되고자 만든 repository입니다. (This repository is intented for helping whom are interested in machine learning study)
Stars: ✭ 705 (-26.64%)
Mutual labels:  jupyter-notebook, gan
Generative Models
Annotated, understandable, and visually interpretable PyTorch implementations of: VAE, BIRVAE, NSGAN, MMGAN, WGAN, WGANGP, LSGAN, DRAGAN, BEGAN, RaGAN, InfoGAN, fGAN, FisherGAN
Stars: ✭ 438 (-54.42%)
Mutual labels:  jupyter-notebook, gan
All About The Gan
All About the GANs(Generative Adversarial Networks) - Summarized lists for GAN
Stars: ✭ 630 (-34.44%)
Mutual labels:  gan, unsupervised-learning
Fewshot Face Translation Gan
Generative adversarial networks integrating modules from FUNIT and SPADE for face-swapping.
Stars: ✭ 705 (-26.64%)
Mutual labels:  jupyter-notebook, gan
Seqgan
A simplified PyTorch implementation of "SeqGAN: Sequence Generative Adversarial Nets with Policy Gradient." (Yu, Lantao, et al.)
Stars: ✭ 502 (-47.76%)
Mutual labels:  gan, generative-model
Simclr
PyTorch implementation of SimCLR: A Simple Framework for Contrastive Learning of Visual Representations
Stars: ✭ 750 (-21.96%)
Mutual labels:  jupyter-notebook, unsupervised-learning
Deeplearning
深度学习入门教程, 优秀文章, Deep Learning Tutorial
Stars: ✭ 6,783 (+605.83%)
Mutual labels:  jupyter-notebook, gan
Gantts
PyTorch implementation of GAN-based text-to-speech synthesis and voice conversion (VC)
Stars: ✭ 460 (-52.13%)
Mutual labels:  jupyter-notebook, gan
Segan
Speech Enhancement Generative Adversarial Network in TensorFlow
Stars: ✭ 661 (-31.22%)
Mutual labels:  gan, generative-model
Gans In Action
Companion repository to GANs in Action: Deep learning with Generative Adversarial Networks
Stars: ✭ 748 (-22.16%)
Mutual labels:  jupyter-notebook, gan
Generative Models
Collection of generative models, e.g. GAN, VAE in Pytorch and Tensorflow.
Stars: ✭ 6,701 (+597.29%)
Mutual labels:  gan, generative-model
Dcgan Tensorflow
A tensorflow implementation of "Deep Convolutional Generative Adversarial Networks"
Stars: ✭ 6,963 (+624.56%)
Mutual labels:  gan, generative-model
Deep Learning Resources
由淺入深的深度學習資源 Collection of deep learning materials for everyone
Stars: ✭ 422 (-56.09%)
Mutual labels:  jupyter-notebook, gan

DiscoGAN in PyTorch

PyTorch implementation of Learning to Discover Cross-Domain Relations with Generative Adversarial Networks.

* All samples in README.md are genearted by neural network except the first image for each row.
* Network structure is slightly diffferent (here) from the author's code.

Requirements

Usage

First download datasets (from pix2pix) with:

$ bash ./data/download_dataset.sh dataset_name

or you can use your own dataset by placing images like:

data
├── YOUR_DATASET_NAME
│   ├── A
│   |   ├── xxx.jpg (name doesn't matter)
│   |   ├── yyy.jpg
│   |   └── ...
│   └── B
│       ├── zzz.jpg
│       ├── www.jpg
│       └── ...
└── download_dataset.sh

All images in each dataset should have same size like using imagemagick:

# for Ubuntu
$ sudo apt-get install imagemagick
$ mogrify -resize 256x256! -quality 100 -path YOUR_DATASET_NAME/A/*.jpg
$ mogrify -resize 256x256! -quality 100 -path YOUR_DATASET_NAME/B/*.jpg

# for Mac
$ brew install imagemagick
$ mogrify -resize 256x256! -quality 100 -path YOUR_DATASET_NAME/A/*.jpg
$ mogrify -resize 256x256! -quality 100 -path YOUR_DATASET_NAME/B/*.jpg

# for scale and center crop
$ mogrify -resize 256x256^ -gravity center -crop 256x256+0+0 -quality 100 -path ../A/*.jpg

To train a model:

$ python main.py --dataset=edges2shoes --num_gpu=1
$ python main.py --dataset=YOUR_DATASET_NAME --num_gpu=4

To test a model (use your load_path):

$ python main.py --dataset=edges2handbags --load_path=logs/edges2handbags_2017-03-18_10-55-37 --num_gpu=0 --is_train=False

Results

1. Toy dataset

Result of samples from 2-dimensional Gaussian mixture models. IPython notebook

# iteration: 0:

# iteration: 10000:

2. Shoes2handbags dataset

# iteration: 11200:

x_A -> G_AB(x_A) -> G_BA(G_AB(x_A)) (shoe -> handbag -> shoe)

x_B -> G_BA(x_B) -> G_AB(G_BA(x_B)) (handbag -> shoe -> handbag)

x_A -> G_AB(x_A) -> G_BA(G_AB(x_A)) -> G_AB(G_BA(G_AB(x_A))) -> G_BA(G_AB(G_BA(G_AB(x_A)))) -> ...

3. Edges2shoes dataset

# iteration: 9600:

x_A -> G_AB(x_A) -> G_BA(G_AB(x_A)) (color -> sketch -> color)

x_B -> G_BA(x_B) -> G_AB(G_BA(x_B)) (sketch -> color -> sketch)

x_A -> G_AB(x_A) -> G_BA(G_AB(x_A)) -> G_AB(G_BA(G_AB(x_A))) -> G_BA(G_AB(G_BA(G_AB(x_A)))) -> ...

4. Edges2handbags dataset

# iteration: 9500:

x_A -> G_AB(x_A) -> G_BA(G_AB(x_A)) (color -> sketch -> color)

x_B -> G_BA(x_B) -> G_AB(G_BA(x_B)) (sketch -> color -> sketch)

x_A -> G_AB(x_A) -> G_BA(G_AB(x_A)) -> G_AB(G_BA(G_AB(x_A))) -> G_BA(G_AB(G_BA(G_AB(x_A)))) -> ...

5. Cityscapes dataset

# iteration: 8350:

x_B -> G_BA(x_B) -> G_AB(G_BA(x_B)) (image -> segmentation -> image)

x_A -> G_AB(x_A) -> G_BA(G_AB(x_A)) (segmentation -> image -> segmentation)

6. Map dataset

# iteration: 22200:

x_B -> G_BA(x_B) -> G_AB(G_BA(x_B)) (image -> segmentation -> image)

x_A -> G_AB(x_A) -> G_BA(G_AB(x_A)) (segmentation -> image -> segmentation)

7. Facades dataset

Generation and reconstruction on dense segmentation dataset looks weird which are not included in the paper.
I guess a naive choice of mean square error loss for reconstruction need some change on this dataset.

# iteration: 19450:

x_B -> G_BA(x_B) -> G_AB(G_BA(x_B)) (image -> segmentation -> image)

x_A -> G_AB(x_A) -> G_BA(G_AB(x_A)) (segmentation -> image -> segmentation)

Related works

Author

Taehoon Kim / @carpedm20

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].