How to do the same random crop on 2 images?

Hi! I want to do some augmentation on pix2pix model. I need to do the same random crop on 2 images. Ho to use transforms.RandomCrop to do that?

I added torch.manual_seed(1) before transforms.RandomCrop , but it fails, output 2 different crop image :frowning:

I would recommend to use the functional API as shown here.

1 Like