Question: how to control the number of frames in a video reader
Say I have a very long video, and I want to randomly draw sequences just from a specific segment of the video (e.g., just frames 100-900 for a video with 1000 frames). How should I go about it? In general, wanted to gain control over how many frames I'll be reading from a video per epoch of training.
I'm using a standard fn.readers.video() together with a LightningWrapper to train a pytorch-lightning model.
Here's how I do it now.
Hi @danbider,
Have you tried using file_list? It follows the file label [start_frame [end_frame]] format where you can define multiple frame/timestamp ranges for video files including a different label for each of them, like in this example.
I'm not sure if that covers your use case fully because you need to define this ranged ahead of time and you cannot adjust them in the runtime.
@JanuszL thanks,
I'll try using file_list -- I can definitely define start_frame and end_frame ahead of time.
Are there any modifications needed if I have no labels, just a a raw video?
@danbider you can put any value you like (you still need to provide a value in the file) as a label and just don't use it in the pipeline.