Git Product home page Git Product logo

gdwct's Introduction


This repository provides the official code of GDWCT, and it is written in PyTorch.

Paper

Image-to-Image Translation via Group-wise Deep Whitening-and-Coloring Transformation (link)
Wonwoong Cho1), Sungha Choi1,2), David Keetae Park1), Inkyu Shin3), Jaegul Choo1)
1)Korea University, 2)LG Electronics, 3)Hanyang University
IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019 (Oral)

Additional resources for comprehending the paper

Comparison with baselines on CelebA dataset


Comparison with baselines on Artworks dataset


Prerequisites

  • Python 3.6
  • PyTorch 0.4.0+
  • Linux and NVIDIA GPU + CUDA CuDNN

Instructions

Installation

git clone https://github.com/WonwoongCho/GDWCT.git
cd GDWCT

Dataset

  1. Artworks dataset Please go to the github repository of CycleGAN (link) and download monet2photo, cezanne2photo, ukiyoe2photo, and vangogh2photo.

  2. CelebA dataset Our data loader necessitates data whose subdirectories are composed of 'trainA', 'trainB', 'testA', and 'testB'. Hence, after downloading CelebA dataset, you need to preprocess CelebA data by separating the data according to a target attribute of a translation. i.e., A: Male, B: Female.
    CelebA dataset can be easily downloaded with the following script.

bash download.sh celeba
  1. BAM dataset Similar to CelebA, you need to preprocess the data after downloading. Downloading the data is possible if you fulfill a given task (segmentation labeling). Please go to the link in order to download it.

We wish to directly provide the data we used in the paper, however it cannot be allowed because the data is preprocessed. We apologize for this.

Train and Test

Settings and hyperparameters are set in the config.yaml file. Please refer to specific descriptions provided in the file as comments. After setting, GDWCT can be trained or tested by the following script (NOTE: the values of 'MODE', 'LOAD_MODEL', and 'START' should be changed if a user want to test the model.):

python run.py

Pretrained models

Run the script if you need to download pretrained models (Smile <=> Non-Smile), (Bangs <=> Non-Bangs). The pretrained models will be downloaded and unzipped into ./pretrained_models/ directory.

bash download.sh pretrained

In order to test the pretrained models, please change several options in the config file, as described in the script below.
If the name of a pretrained model is G_A_CelebA_Bangs_G4_320000.pth,

N_GROUP: 4
SAVE_NAME: CelebA_Bangs_G4
MODEL_SAVE_PATH: pretrained_models/
START: 320000
LOAD_MODEL: True
MODE: test

Results

Citation

Please cite our paper if our work including this code is helpful for your research.

@InProceedings{GDWCT2019,
author = {Wonwoong Cho, Sungha Choi, David Keetae Park, Inkyu Shin, Jaegul Choo},
title = {Image-to-Image Translation via Group-wise Deep Whitening-and-Coloring Transformation},
booktitle = {The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
year = {2019}
}

gdwct's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gdwct's Issues

Please add license information

Thank you for your great job!

I cannot use your code for research because your repository does not include a license file (i.e. no license).
Please add license information.
Thanks.

Experiment result

I tried to train on my custom datasets from scratch.
However, the generated image is so bad as follow.
image

Dataset sizes

Do your datasets have to be the same size? Or do they just have to be divisible by batch size? I was trying this repo out but ran into some issues where randomly the losses would become NaN.

My trainA has 33344 images and my trainB has 22933 images. All hyperparams were default except dataset paths/names.

How to preprocess celebA dataset?

Firstly, Thank you for your great job.
After I download celebA dataset using download.sh, how to preprocess celebA dataset? (i.e. split trainA and trainB and so on)
Could you upload the preprocessing code or tell me web site which teaches the preprocessing method?
Thanks.

multiple gpu training

When I set the DATA_PARALLEL True, I met a runtime error: arguments are located on different GPUs. Anyone knows how to solve it? Thx

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.