mit-han-lab / data-efficient-gans

[NeurIPS 2020] Differentiable Augmentation for Data-Efficient GAN Training
https://arxiv.org/abs/2006.10738
BSD 2-Clause "Simplified" License
1.27k stars 175 forks source link

How to use DiffAugment in Image to Image Translation? #93

Closed hahahappyboy closed 2 years ago

hahahappyboy commented 2 years ago

Hello, I try to use diffaugment in Image to Image Translation. The G use an label_image as input. The D use fake/real_image and label_image as input. I don't know how to use DiffAugment to train them. Could you give me some advice? Thank You! Image to Image Translation training example

# update D
fake_img = G(label_img)
fake_score = D(fake_img.detach(),label_img)
real_score = D(real_img,label_img)
# Calculating D's loss based on real_scores and fake_scores...
...
....
# update G
fake_score = D(fake_img,label_img)
# Calculating G's loss based on fake_scores...
zsyzzsoft commented 2 years ago

You can try color and cutout augmentation on only real & fake images or translation augmentation on the concatenation of real (fake) and the label images.

hahahappyboy commented 2 years ago

OK, I will try it. Thank you!!!