So I have this line of code to load a dataset of images from two classes called "0" and "1" for simplicity:
train_data = torchvision.datasets.ImageFolder(os.path.join(TRAIN_DATA_DIR), train_transform)
and then I prepare the loader to be used with my model in this way:
train_loader = torch.utils.data.DataLoader(train_data, TRAIN_BATCH_SIZE, shuffle=True)
So for now each image is associated to a class, what I want to do is take each image and apply a transformation to it between those two lines of code, let's say a rotation of one of four degrees: 0, 90, 180, 270, and add that info as an additional label of four classes: 0, 1, 2, 3. In the end I want the dataset to contain the rotated images and as their labels a list of two values: the class of the image and the applied rotation.
I tried this and there is no error, but the dataset remains unchanged if then I try to print the labels:
for idx,label in enumerate(train_data.targets):
train_data.targets[idx] = [label, 1]
Is there a nice way to do it by modifying directly train_data without requiring a custom dataset?