How to make a dataloader for segmentation?

How can I make a dataloader so that every time I can get two images, one actual image from …/actual and another corresponding segmented image from …/segmented ?