shubz_308:

def __getitem__(self, idx):

        image_name = os.path.join(self.__image_path, self.__image_names[idx])
        image = io.imread(image_name)
        joints = self.__mat_data[:-1, :, idx]
        sample = {'image': image, 'joints': joints}
        if self.transform:
            sample = self.transform(sample)
            img = sample['image']
            label = sample['landmarks']

        return sample



you can apply self.transform(img) given that img contains the image.