I’m not sure I understand the implementation of your Dataset fully.
Are you creating a new Dataset for each sequence, i.e. when are you passing new start and end values?
It looks like you are returning one sample from the sequence. As far as I’ve understood your use case, I thought you would like to return 4 samples holding the images and text data?
Could you post the shapes of your whole dataset and each sample?