Hello all
I’m trying to run a VDSR network in Pytorch and I wonder how I should use the DataLoader.
I have made 4 directories:

HR: the ground truth images
LR_div2: each image from the HR folder is downsampled by a factor 2 then upsampled again using bilinear interpolation. They have the same name as the original image
LR_div3 : the same with factor 3
LR_div4 : the same with factor 4

Each folder has subfolders ‘train’ and ‘test’. Now I’m wondering how I can write the DataLoader.
I have found this piece of code:
class AutoEncoderDataSet(Dataset):
    def __init__(self, dir_lr, dir_gt, traintest, transform=None):
        self.dir_lr = self.load_dir_single(join(dir_lr, traintest))
        self.dir_gt = self.load_dir_single(join(dir_gt, traintest))
        self.transform = transform

    def is_image_file(self, filename):
        return any(filename.endswith(extension) for extension in [".png", ".PNG", ".jpg", ".JPG", ".jpeg", ".JPEG"])

    def load_img(self, filename):
        img = Image.open(filename)
        return img

    def load_dir_single(self, directory):
        return [join(directory, x) for x in listdir(directory) if self.is_image_file(x)]

    def __len__(self):
        return len(self.dir_in)

    def __getitem__(self, index):
        img_lr = self.load_img(self.dir_lr[index])
        img_gt = self.load_img(self.dir_gt[index])
        sample = {'img_in': img_lr, 'img_gt': img_gt}

        if self.transform:
            sample = self.transform(sample)

        return sample

together with
ps = {
    'DIR_LR2': PATH + 'LR_div2',
    'DIR_LR3': PATH + 'LR_div3',
    'DIR_LR4': PATH + 'LR_div4',
    'DIR_HR':  PATH + 'HR'
}
train_set = AutoEncoderDataSet(ps['DIR_LR2'], ps['DIR_HR'], 'train', composed)
train_loader = DataLoader(train_set, batch_size=BATCH_SIZE_TRAIN, shuffle=True, num_workers=4)

But how can I take into account all 3 LR folders?
Thanks for your help.