Open Anecdote-Lee opened 6 months ago
Hi @Anecdote-Lee,
We have documents how to run alternative GAN models here: https://github.com/LS4GAN/benchmarking . Please, check out that repository -- it has information on how we trained and evaluated models in CelebA and Anime datasets.
As for the CelebA-HQ and AFHQ datasets -- we relied on the results reported by EGSDE.
Good, thank you!
Hello again! @usert5432 I have few more questions about the codes.
In pretrain_anime2selfie.py, it is training dataset with 2 domains. However in other pretraining codes, they don't use any domains even though they also have several domain. What's difference between them? (https://github.com/LS4GAN/uvcgan2/blob/40b60d20c767fb629d3eeeaf5a207b47fe77fc09/scripts/anime2selfie/pretrain_anime2selfie.py#L17-L46)
I am just using hundreds of images for training. It is very small compared with your dataset. So, is there any recommendation to get better training? Like, do more augmentation or changing these hyperparameters...?
Hi @Anecdote-Lee,
In pretrain_anime2selfie.py, it is training dataset with 2 domains. However in other pretraining codes, they don't use any domains even though they also have several domain. What's difference between them?
The difference in configuration options is purely cosmetic and just a historical artifact. All the datasets use all the domains for the pre-training. The reason for this cosmetic difference is that:
anime2selfie
is a very old dataset and has an old CycleGAN
-like structure:
anime2selfie:
-- trainA/
-- trainB/
-- testA/
-- testB/
The standard pytorch
loaders cannot handle this dataset, so it requires a custom dataset implementation with explicit domain specifications. The other datasets have more modern structure, e.g.:
cat2dog:
-- train/
---- cat/
---- dog/
-- test/
---- cat/
---- dog/
and can be read by the default pytorch
data loaders, without specifying domains.
I am just using hundreds of images for training. It is very small compared with your dataset. So, is there any recommendation to get better training? Like, do more augmentation or changing these hyperparameters...?
Unfortunately, I cannot give any concrete suggestions here. I do not think the small dataset size should be a problem by itself, although having more data augmentations may benefit (as long as you are ok with these augmentations to leak into the generated images (https://arxiv.org/pdf/2006.06676.pdf).)
From my experience -- if you dataset is "good" then the CycleGAN-like models will work with minimal modifications (even with small datasets). If your dataset is "bad", then you would need to do a lot of hyperparameter tunes and data augmentations to make it work. And, unfortunately, the easiest way to find out if your dataset is "good" or "bad" is to run the training and see if it works.
Thank you for your help and suggestion. It will be very helpful!
Hello! I want to ask the other question. In the Generator pretraining(pretexting) process, I think both domain datasets(A&B) should adapted to the process. So, my understanding is that when domain B is used for pretraining, it trains generator A->B, and when domain A is used, it trains generator B->A, is that correct?
Hi @Anecdote-Lee,
Sure.
So, my understanding is that when domain B is used for pretraining, it trains generator A->B, and when domain A is used, it trains generator B->A, is that correct?
During the pre-training process we actually train a single joint generator for A and B domains simultaneously. Then we use that single generator to initialize both A->B and B->A translations. Here is the corresponding configuration: https://github.com/LS4GAN/uvcgan2/blob/40b60d20c767fb629d3eeeaf5a207b47fe77fc09/scripts/celeba_hq/train_m2f_translation.py#L50-L53
Both, gen_ab
and gen_ba
are initialized from a single pre-trained encoder.
Thanks for your kind explanation. I was mistaken. I think i know now!
Hello, I am using this model to train and test my datasets. Like the paper of this code, I want to compare this model with other models such as CycleGAN or other GANs. Is there any provided code in this github to run other models to compare? (The reason why I thought it is provided is that I saw 'model' parameter to select)