Implementation of CycleGan model in PyTorch (original implementation link). The implementation is used to remove rain from rainy images.
Install:
- PyTorch and dependencies
- Torch vision
- visdom and dominate
git clone https://github.com/pytorch/vision
cd vision
python setup.py install
pip install visdom
pip install dominate
you may have information on how to run train.py
by:
python train.py --help
you can train your own model by running (N.B.: example):
python train.py --dataroot ./data --name cyclegan_custom --model cycle_gan --no_dropout
you can test the model on a given collection, in order to transform A to B or B to A (Possible only after training).
python test.py --dataroot ./data --name cyclegan_custom --model cycle_gan --no_dropout --phase test --results_dir ./result_folder
└── cyclegan
├── data # data folder contaning both A and B images
├── testA # test images belonging to class A
├── testB # test images belonging to class B
├── trainA # train images belonging to class A
└── trainB # train images belonging to class B
├── images # images ...
├── models
└── ... # cycle gan model implementation .py
├── options
└── ... # options : base, train, test .py
├── util
└── ... # utils .py
├── test.py # to test
├── train.py # to train
├── README.md # Readme
The example below present 12 rainy images where cycleGAN has been used to de-rain.
Based on two implementations:
- https://github.com/junyanz/CycleGAN by Jun-Yan Zhu and Taesung Park
- https://github.com/EliasVansteenkiste/CycleGANwithPerceptionLoss by Elias Vansteenkiste