taesungp / contrastive-unpaired-translation

Contrastive unpaired image-to-image translation, faster and lighter training than cyclegan (ECCV 2020, in PyTorch)
https://taesung.me/ContrastiveUnpairedTranslation/
Other
2.23k stars 417 forks source link

Question: Code structure / template #124

Closed gogobd closed 2 years ago

gogobd commented 2 years ago

Hi! I have a question about the code structure.

I really like the structure of this code base, i.e. the way options are handled, the directory / module structure etc. I have seen this structure across multiple projects in different pytorch experiments now and simply wanted to learn if there is some sort of "template" or example code base you were using.

taesungp commented 2 years ago

Hello @gogobd, the code structure is similar to CycleGAN-pix2pix, SPADE, and Swapping Autoencoder. I don't have a template, but it's not too much work to strip away paper-specific codes.

To use these codes as template, I recommend taking the code base of Swapping Autoencoder, since that's the newest code, and modify swapping_autoencoder_optimizer.py, swapping_autoencoder_model.py. I usually find myself writing a new subclass of BaseDataset for data loading, and network structures under models/networks/. Please take a look at a brief explanation of the code structure here.

gogobd commented 2 years ago

Thank you for sharing!