As @smth pointed out, you should start with folder.py 77

Below are the major steps that I think you might need to go through.


make_dataset()
You probably need to make some changes to the make_dataset() function, which is basically listing all the video frame files. If you need to group a number of video frames and tie them with a video, you probably want to do that in here (when listing the video frames)

_ _ getitem _ _
The second part will be how you collect the items. This can be straight forward or can be quite complicated. The easiest way to do is: given a video id (obtained by using index and the list you just collected in step one), grab all the video frames associated with that particular video id. Note that, in this way, your data loading time will be considerably longer, and your system memory might explode because you are loading tens or hundreds of images per video into system memory before you pass it to GPU for training.

YourOwn_collate_fn()
By default, the items collected in _ _ getitem _ _ will be combined into batch by default_collate 54. This might no longer be the case when you have a list or stack of video frames. The easiest way I can think of is to create your own collate function and reformating the data you collected so that you can call default_collate within your own collate function.


These are just some of my thoughts and I am also very interested in having an off-the-shelf video dataloader and having some example codes so that people can refer to.