Py-Torch implementation of CycleGANs Paper.
- You can find more about this project in my blog here.
- Clone the repository:
git clone https://github.com/abhishekyana/CycleGANs-PyTorch.git
cd CycleGANs-PyTorch
# As this is a huge project, I'd suggest to make a conda environment and then run the training and all.
- Install all the requirements from requirements.txt file:
- Download the dataset, It can be grabbed from here.
- Unzip and Move the dataset folder into this project's root directory.
- Adjust the configure.py file according to your flavour, these parameters affect the training.
- Run the
python train.py
file and see the training happen for yourself.
- The models will be saved to and loaded from ./outputs as default.
- The model trained for around 4 hours on GTX1080 and i7 system.
If you want to test the mode, then you can download the pretrained model from here. Sorry the link is broken I'll fix it..
- Download the dataset.
- Download the pretrained model. Only Generator model is enough.
- Copy these folders into appropriate directories as mentioned above.
- Run
python test.py
, After the provess is done, you can see the Juxtaposed results in./outputs/A
and./outputs/B
. - If you want to run this on your own images, Copy your image into a directory in
./directory/A
if you want to make your picture old or into./directory/B
if you want your picture to be Young. Then edit the./directory
in testoptions inconfigure.py
and run the code again. Now, you can see the your image in the outputs directory.
- Not only this data, A CycleGAN can map from any unpaired domains, as this application si trending now, I've chosen this to code.
This project is inspired from Aitor Ruano and I would like to thank him for providing such a beautiful code which I used to clarify my doubts during the implementation.