What does SampleFrames means? #655
-
What does SampleFrames actually mean in the code? I see the parameters are clip_len, frame_interval, and num_clips. Can anybody explain it to me? I am a newbie here :) |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 10 replies
-
Does the doc offer any help? https://mmaction2.readthedocs.io/en/latest/api.html#mmaction.datasets.pipelines.SampleFrames |
Beta Was this translation helpful? Give feedback.
-
Dense strategy samples continuous frames. To be more specific, samples one frame every If there are 96 frames for one sample, frame id in range [1, 96]. More details could refer to source code |
Beta Was this translation helpful? Give feedback.
-
it may like sliding window on video frame sequence,the windows size is clip_len*fram_interval,the start index of the windows can computed by num_clips. |
Beta Was this translation helpful? Give feedback.
-
Does that mean if I have a video with 200 frames for example and I use |
Beta Was this translation helpful? Give feedback.
SampleFrames
defines sample strategy for input frames. Sample strategy is defined asclip_len x frame_interval x num_clips
. There are two sample strategy, uniform sampling and dense sampling.Dense strategy samples continuous frames. To be more specific, samples one frame every
frame_interval
frames and finally getclip_len
frames.Uniform strategy(
clip_len == 1
) devides all frames intonum_clips
parts and samples one frame from each part.If there are 96 frames for one sample, frame id in range [1, 96].
Dense strategy demo:
32x2x1
may select no.1, 3, 5, ..., 63
frames.Uniform strategy demo:
1x1x8
divides 100 frames into [1, 12], [13, 24], [25, 36], [37, 48], ..., [85, 96] and may select no.