def __init__(self, data_root, test_mode=False, **kwargs):
    self.classes = list(range(1000))
    normalize = T.Normalize(mean=[0.456], std=[1.0])
    if (not test_mode):
        traindir = os.path.join(data_root, 'train')
        self.dataset = ImageFolder(traindir, T.Compose([T.Grayscale(num_output_channels=1), T.RandomResizedCrop(224, scale=(0.8, 1.0)), T.RandomHorizontalFlip(), T.ToTensor(), normalize]))
    else:
        valdir = os.path.join(data_root, 'val')
        self.dataset = ImageFolder(valdir, T.Compose([T.Resize(256), T.CenterCrop(224), T.ToTensor(), normalize]))
    if (not test_mode):
        self._set_group_flag()
def __init__(self, data_root, test_mode=False, **kwargs):
    self.classes = list(range(1000))
    normalize = T.Normalize(mean=[0.456], std=[1.0])
    if (not test_mode):
        traindir = os.path.join(data_root, 'train')
        self.dataset = ImageFolder(traindir, T.Compose([T.Grayscale(num_output_channels=1), T.RandomResizedCrop(224, scale=(0.8, 1.0)), T.RandomHorizontalFlip(), T.ToTensor(), normalize]))
    else:
        valdir = os.path.join(data_root, 'val')
        self.dataset = ImageFolder(valdir, T.Compose([T.Resize(256), T.CenterCrop(224), T.ToTensor(), normalize]))
    if (not test_mode):
        self._set_group_flag()