Hey,
You should look at this tutorial 10. I think it’s what you’re looking for.
But basically you need to create your own dataset class like:
class Dataset(Dataset):
    """dataset."""

    def __init__(self, csv_file, root_dir, transform=None):
        """
        Args:
            csv_file (string): Path to the csv file with names of all images
            root_dir (string): Directory with all the images.
            transform (callable, optional): Optional transform to be applied
                on a sample.
        """
        self.names = pd.read_csv(csv_file)
        self.root_dir = root_dir
        self.transform = transform

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

    def __getitem__(self, idx):
        img_name1 = os.path.join(self.root_dir,
                                self.names.iloc[idx, 0])
        image1 = io.imread(img_name1)
        img_name2 = os.path.join(self.root_dir,
                                self.names.iloc[idx, 1])
        image2 = io.imread(img_name2)
        img_name3 = os.path.join(self.root_dir,
                                self.names.iloc[idx, 2])
        image3 = io.imread(img_name3)
        target_name = os.path.join(self.root_dir,
                                self.names.iloc[idx, 3])
        target = io.imread(target_name)
        sample = {'image1': image1, 'image2': image2, 'image3': image3, 'target': target}

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

        return sample