I have doubt if I call the transform function twice, the operation will change or not.This is what I have:
class Data_set():
    def __init__(self,transform):
        imgs,masks = make_dataset(imgpath,maskpath)
        self.transform = transform
        self.imgs = imgs
        self.masks = masks
    def __len__(self):
        return len(self.imgs)
    def __getitem__(self,index):
        imgpath,maskpath = self.imgs[index],self.masks[index]
        img_x = Image.open(imgpath)
        mask_x = Image.open(maskpath)
        img_x = self.transform(img_x)#.float()
        mask_x = self.transform(mask_x)#.long()
        return img_x,mask_x

I have earlier tried this way:
x, y = self.transform(image, mask)

but I dont know why that comes an error, so I call that twice.