DALI icon indicating copy to clipboard operation
DALI copied to clipboard

Variable Stride Over Multiple Videos

Open SiftingSands opened this issue 4 years ago • 4 comments

Copied from a previous discussion (#2760), so that this is tracked separately : Is there a way to set the stride to a different number on a per video basis? For example, if we want to only capture a frame every second for processing, but we're ingesting videos that have different frame rates.

SiftingSands avatar Mar 08 '21 14:03 SiftingSands

I will add this to our ToDo list. Seems doable.

JanuszL avatar Mar 08 '21 15:03 JanuszL

Has there been any movement on this issue? It's very common to see videos with different framerates, even within sets of videos.

As a workaround, I'm thinking of grouping by stride and creating separate pytorch DALIGenericIterators for each. During training, I can do a weighted selection from these, and remove iterators that raise StopIteration from the pool.

Edit: This doesn't seem to be viable because VRAM usage increases with each iterator

Atheatos avatar Jul 24 '24 14:07 Atheatos

I am also interested in this, though for a slightly different use-case. I have videos of various lengths, but always want to sample N frames uniformly from each video (i.e. each sample is from a different video, and it covers the full video by selecting N equally spaced frames). If I can specify a different stride for each video (stride = video_length / N), this would be possible. Is that possible with the current version?

sthoduka avatar Jul 27 '24 08:07 sthoduka

Hi @sthoduka,

If I can specify a different stride for each video (stride = video_length / N)

I'm afraid it is not currently possible, still we will add this to our ToDo list.

JanuszL avatar Aug 05 '24 08:08 JanuszL