I did not get it.
The variables i am using t1, t2 are frames at t, t+1 timestamps.
From the above code:
t1 = random.sample(range(0, len(sequence-max_n_frames_wanted), 1)
t2 = random.sample(range(0, len(max_n_frames_wanted), 1)

i assume number of samples to be drawn for instance be k = 10 (argument is missing in random.sample()) or if at all we consider k = max_n_frames_wanted, sequence = 400.
t1 = [0, 1, 2, 3, 4,…389]
t2 = [0, 1, 2, 3, 4,…9]
I hope i am getting it correctly.
But, my main concern is when we using random sampling the length in def __len__(self) varies and the index should point out to the sequence to retrieve image from disk.