matlab-deep-learning / pix2pix

Image to Image Translation Using Generative Adversarial Networks
Other
30 stars 12 forks source link

Add random rotation to data augmentation #17

Closed corona-discharge closed 2 years ago

corona-discharge commented 2 years ago

I noticed the code applied random cropping and horizontal flipping to data augmentation. How can I modify the code to add random rotation to augment images?

justinpinkney commented 2 years ago

Yes it should be as straightforward as adding to this line: https://github.com/matlab-deep-learning/pix2pix/blob/dec1f666edf0858acee990701ea601376f756435/code/%2Bp2p/train.m#L42-L43

Simply pass any extra parameters which the ImageDataAugmenter can take. So in your case I'd suggest adding RandRotation and a pair of values

corona-discharge commented 2 years ago

Thanks!The code worked successfully.