Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why the value n in dataset.py function get_seg_range is subtracted 1 twice? #70

Open
TyroneLi opened this issue Aug 16, 2019 · 0 comments

Comments

@TyroneLi
Copy link

TyroneLi commented Aug 16, 2019

Hi~I am confused about this operation as I mention in title.Inside dataset.py function get_seg_range, n is subtracted 1 twice.could u make some more expression details?Thanks
``def get_seg_range(n, num_segments, seg, representation):
if representation in ['residual', 'mv']:
n -= 1
seg_size = float(n - 1) / num_segments
seg_begin = int(np.round(seg_size * seg))
seg_end = int(np.round(seg_size * (seg+1)))
if seg_end == seg_begin:
seg_end = seg_begin + 1

if representation in ['residual', 'mv']:
    # Exclude the 0-th frame, because it's an I-frmae.
    return seg_begin + 1, seg_end + 1

return seg_begin, seg_end``
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant