Would you like to manually define these indices (e.g. [1, 5, 10, 15])?
If so, you could add your logic in the __getitem__ method of your Dataset or alternatively use a custom collate_fn.
Could you explain your workflow a bit more? E.g. would each “set” have the same number of frames?