Lightning-Universe / lightning-bolts

Toolbox of models, callbacks, and datasets for AI/ML researchers.
https://lightning-bolts.readthedocs.io
Apache License 2.0
1.7k stars 323 forks source link

Add CycleGAN #397

Open Adi-iitd opened 4 years ago

Adi-iitd commented 4 years ago

🚀 Feature

CycleGAN in PyTorch Lightning

Motivation

The authors of this paper proposed an unpaired image to image translation algorithm using the well-known GAN framework. Obtaining input-output pairs for graphics tasks like artistic stylization can be difficult since the desired output is highly complex, and typically requires artistic authoring. For many tasks, like object transfiguration (e.g., zebra <-> horse), the desired output is not even well-defined. So, this algorithm comes in very handy in such situations. Nowadays, researchers use CycleGAN even in the Compressive Sensing and BioMedical domain.

Pitch

I already ported my code of CycleGAN from PyTorch to PyTorch Lightning. I want to add this in the PyTorch Lightning Bolts repo, but I still need help from your side to check the robustness of my code. You can find the code on my repo.

Alternatives

I couldn't find CycleGAN implementation in PyTorch Lightning. So, adding it would be of great help who are just starting in GAN research or want to use PyTorch Lightning to do advanced research in the GAN domain.

Additional context

I am attaching a few results that I obtained to build some credibilty.

Screenshot 2020-11-22 at 5 23 48 PM Screenshot 2020-11-22 at 5 43 40 PM Screenshot 2020-11-22 at 5 44 28 PM Screenshot 2020-11-22 at 5 44 44 PM Screenshot 2020-11-22 at 6 17 16 PM Screenshot 2020-11-22 at 7 09 01 PM
github-actions[bot] commented 4 years ago

Hi! thanks for your contribution!, great first issue!

ananyahjha93 commented 4 years ago

@Adi-iitd this seems like a good addition to the library. Feel free to create a PR for this.

I think the code needs some minor changes but overall looks good. Do you have saved weights for the model? Or loss plots? We are encouraging saved checkpoints and loss plots (and images like you posted) to be added to alongside implementations to build credibility for the correctness of code.

Adi-iitd commented 4 years ago

@ananyahjha93 Yes, I do have the loss plots as well as the pre-trained weights. Attaching the TensorBorad loss logs here, kindly let me know how to share the saved checkpoints. I will open a PR for the same.

Screenshot 2020-11-24 at 9 36 26 PM Screenshot 2020-11-24 at 9 36 37 PM Screenshot 2020-11-24 at 9 36 50 PM Screenshot 2020-11-24 at 9 37 01 PM Screenshot 2020-11-24 at 9 37 14 PM
akihironitta commented 3 years ago

@Adi-iitd Sorry for the delay.

Do you have saved weights for the model? Or loss plots? We are encouraging saved checkpoints and loss plots (and images like you posted) to be added to alongside implementations to build credibility for the correctness of code.

@ananyahjha93 @Borda I'd love to have this in Bolts, but I'm not aware of how to store pretrained weights in Bolts. Do we currently have guidance on this for contributors? Is it something like this?: https://github.com/PyTorchLightning/pytorch-lightning-bolts/blob/99232c32602165410779c494b6bf492c2d291a71/pl_bolts/utils/pretrained_weights.py#L5-L6

Borda commented 3 years ago

yep would be nice to have, atm we have custom/manual model uploading... :rabbit: