You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug utils._which_frames does not filter frames as one would expect with respect to the freq-Attribute. It applies freq only within a present batch but not across batches for the entire movie. This leads to inconsistent steps in the output data.
To Reproduce
dextra = DataExtraction(FrameInput(input_path="./VID-20191006-WA0014.mp4")) # default bsize=256
dextra.run_annotators([LchAnnotatorRay(freq=10)], max_batch=2) #my custom annotator, using utils._which_frames function
which gives me data for the frames: [0, 10, 20, ..., 240, 250, 256, 266, 276, ..., 500, 510]
you see wrong frame step after switching from batch 1 to batch 2. This makes sense when looking at the implementation of utils._which_frames:
Regardless of the starting point of the current batch, the selection of frames always starts with 0 and the first frame in the second batch is frame 256.
Expected behavior
The correct frame sequence in the above example should be [0, 10, 20, ..., 240, 250, 260, 270, ..., 500, 510].
The first frame of the second batch should be 260 which equates to the index 4 (not 0).
Desktop (please complete the following information):
Arch Linux
Python 3.7.1
dvt 0.3.3
Additional context
I developed a fix which for which I would make a pull request if you agree upon my expected behaviour. It works like this:
The freq minus the rest of bnum times the bsize divided by the freq for bnum greater than 0 otherwise 0.
Describe the bug
utils._which_frames
does not filter frames as one would expect with respect to thefreq
-Attribute. It appliesfreq
only within a present batch but not across batches for the entire movie. This leads to inconsistent steps in the output data.To Reproduce
which gives me data for the frames:
[0, 10, 20, ..., 240, 250, 256, 266, 276, ..., 500, 510]
you see wrong frame step after switching from batch 1 to batch 2. This makes sense when looking at the implementation of
utils._which_frames
:dvt/dvt/utils.py
Line 218 in f4e5f89
Regardless of the starting point of the current batch, the selection of frames always starts with 0 and the first frame in the second batch is frame 256.
Expected behavior
The correct frame sequence in the above example should be
[0, 10, 20, ..., 240, 250, 260, 270, ..., 500, 510]
.The first frame of the second batch should be 260 which equates to the index 4 (not 0).
Desktop (please complete the following information):
Additional context
I developed a fix which for which I would make a pull request if you agree upon my expected behaviour. It works like this:
The
freq
minus the rest ofbnum
times thebsize
divided by thefreq
forbnum
greater than 0 otherwise 0.This works well for me so far.
The text was updated successfully, but these errors were encountered: