Hi,
I have an imagenet dataset. I want to extract only one image of the dataset and apply random augmentations on this single data point. So basically the transform I define is as following:
sample_transform = transforms.Compose([
transforms.RandomResizedCrop(img_size, scale=(0.2, 1.0)),
transforms.RandomHorizontalFlip(),
transforms.ToTensor(),
transforms.Normalize(mean=_IMAGENET_RGB_MEANS, std=_IMAGENET_RGB_STDS),
])
And assume that my one sample is as follows:
from torch.utils.data import Subset
def extract_sample(data, idx):
return Subset(data, [idx])
single_sample = extract_sample(data, idx = 0)
Not I want to create a dataset by applying sample_transform
, 64 times on single_sample
(in order to get 64 different augmentations of single_sample
). How can I do that?
Thanks in advance for your help!