Hi all,
I’m trying to find a way to make a balanced sampling using ImageFolder and DataLoader with a imbalanced dataset. I suppose that I should build a new sampler.
I’m not sure if I’m missing something. Is there an already implemented way of do it?
Thanks
Code:
train_loader = torch.utils.data.DataLoader(
datasets.ImageFolder(traindir, transforms.Compose([
transforms.Scale(600),
transforms.RandomSizedCrop(512),
transforms.ToTensor(),
normalize
])),
batch_size=args.batch_size, shuffle=True,
num_workers=args.workers, pin_memory=True)