Skip to content

mossadhelali/style-transfer-cgan

Repository files navigation

CycleGAN with Wasserstein Loss

This repo is to demonestrate our submission for the project of High-level Computer Vision Course for Summer Semester 18 at Saarland University.

In this project, we combine a state-of-the-art GAN architecture, namely, CycleGAN with Wasserstein Loss.

The task at hand is style transfer, which in short is "drawing" captured images in the styles of medieval and modern artists, such as DaVinci, Picasso, etc.

More details about the method and design choices are provided in the project report.

Example Results

Here, we show example results of our model getting results that better mimic the styles of the artists.

  • Picasso:

  • Da Vinci:

  • Cezanne:

Running The Project

Installation

  • Install PyTorch 0.4 and dependencies from http://pytorch.org
  • Install Torch vision from the source.
git clone https://github.com/pytorch/vision
cd vision
python setup.py install
pip install visdom
pip install dominate
  • Alternatively, all dependencies can be installed by
pip install -r requirements.txt

CycleGAN & Wasserstein train/test

  • Download a CycleGAN dataset (e.g. maps):
bash ./datasets/download_cyclegan_dataset.sh maps

You can also use your own dataset. In our case, we used a subset of a Kaggle dataset of paintings, available Here.

  • Train a model:
#!./scripts/train_cyclegan.sh
python train.py --dataroot ./datasets/maps --name maps_cyclegan --model cycle_gan
  • To view training results and loss plots, run python -m visdom.server and click the URL http://localhost:8097. To see more intermediate results, check out ./checkpoints/maps_cyclegan/web/index.html
  • Test the model:
#!./scripts/test_cyclegan.sh
python test.py --dataroot ./datasets/maps --name maps_cyclegan --model cycle_gan

The test results will be saved to a html file here: ./results/maps_cyclegan/latest_test/index.html.

Acknowledgments

The code for CycleGAN was obtained from the original authors' Github Repository. We would like to thank the authors for releasing their source code.

Related Papers:

About

Style Transfer with CycleGAN and Wasserstein Loss

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published