Hi,
I’m not sure if I have correctly implemented applying augmentations to only one class during training (binary classes). The code runs however, I’m just unsure if the augmentations is actually happening during the get item function. Would anyone be able to tell me if this would cause any potential issues (for example memory or speed)? :
 if self.phase == 'train':
            self.transforms = T.Compose([T.RandomResizedCrop(224),
                                    T.ToTensor(),
                                    T.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])]) 
            self.transforms_augs = T.Compose([T.RandomResizedCrop(224),
                                    T.RandomHorizontalFlip(),
                                    T.RandomVerticalFlip(),
                                    T.ToTensor(),
                                    T.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])]) 

        else:
            self.transforms = T.Compose([T.RandomResizedCrop(224),T.ToTensor(),
                                T.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])])


    def __getitem__(self, index):
        if self.phase == 'train':
            path = self.imgs[index]
            label = int(path.split('/')[11])
            data = Image.open(path).convert('RGB')
            if label == 1:
                data = self.transforms_augs(data)
            else:
                data = self.transforms(data)


Cheers,
T