Hi,
I try to write a snippet and it works on my dataset.
f1_folder = './folder1'
f2_folder = './folder2'

f1_images = glob.glob(os.path.join(f1_folder, '*.png'))
f2_images = glob.glob(os.path.join(f2_folder, '*.png'))

for f1_img, f2_img in zip(f1_images, f2_images):

    img1 = Image.open(f1_img)
    img2 = Image.open(f2_img)

    cat_img = torch.cat((TF.to_tensor(img1), TF.to_tensor(img2)), dim=0)# for 'CHW'