Skip to content

Extend SimpleVideoDecoder index-based APIs #150

Open
@NicolasHug

Description

@NicolasHug

For consistency with tensor indexing semantics and with builtin Python indexing of sequences, we should extend the index-based APIs of SimpleVideoDecoder, namely __getitem__(), get_frame_at() and get_frames_at() to support:

  • negative indexing. -n just means len(decoder) - n.
  • upper bound in slices to be greated than len(decoder).

In short we should allow for that kind of stuff:

>>> torch.arange(10)[-3:1000]
tensor([7, 8, 9])

In terms of implementation, we can implement this within the SimpleVideoDecoder class in Python. No need to extend the core or C++ APIs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions