I have a directory with multiple images separated into folders. Each folder has up to 3000 images. I would like to modify the pytorch dataset getitem function so that it returns bags of images, where each bag contains 10 images.
Here is what I have so far:
transform = transforms.Compose([transforms.Resize(255), transforms.CenterCrop(224), transforms.ToTensor() ]) dataset = datasets.ImageFolder('./../BCNB/patches/WSI_1', transform=transform) data_loader = torch.utils.data.DataLoader(dataset, batch_size = 1)
My output of DataLoader should be a tensor with a shape of [1, 10, 3, 256, 256].
Any input would be very helpful!
Thank you very much in advance!