Images taken as pairs from the dataset

My train dataset has several video folders and in each folder, I have frames that are taken from that video. I should prepare my dataloader with consecutive frame pairs from the dataset such as (t0, t1), (t1, t2), (t2, t3) etc. I should shuffle the loader so that the network will get random pairs of frames from random videos. Could you please help me ??

Your use case sounds like this recent topic. Could you have a look at the suggestions in this topic and check if you could apply them to your use case?