-
Notifications
You must be signed in to change notification settings - Fork 8
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
[torchcodec] add get_frames_at method to SimpleVideoDecoder #80
Conversation
This pull request was exported from Phabricator. Differential Revision: D59767617 |
This pull request was exported from Phabricator. Differential Revision: D59767617 |
This pull request was exported from Phabricator. Differential Revision: D59767617 |
This pull request was exported from Phabricator. Differential Revision: D59767617 |
This pull request was exported from Phabricator. Differential Revision: D59767617 |
This pull request was exported from Phabricator. Differential Revision: D59767617 |
This pull request was exported from Phabricator. Differential Revision: D59767617 |
Summary: Pull Request resolved: #80 This diff does several things: * Adds new method to `SimpleVideoDecoder`, with the signature: get_frames_at( self, start: int, stop: int, step: int = 1 ) -> FrameBatch * Adds the `FrameBatch` dataclass as a part of the public API. It has stacked version of the data, and pts and duration seconds are in N-dimensional tensors, where N is the size of the range. It is a sibling to the `Frame` dataclass. * Changes the return value of the core library function `get_frames_in_range()` as well as the underlying member function `VideoDecoder::getFramesInRange()` to return `Tuple[Tensor, Tensor, Tensor]`. The first value are the stacked frames, second is each pts in the range in a tensor, and third is each duration seconds in a tensor. This matches the new return type of `get_frame_at_index()`. * Updates our testing framework so that we can systematically associate pts and duration metadata with a particular test file. In this diff we are hardcoding the metadata into the testing utils. In the future, we should read it from a checked-in JSON file we generate with ffprobe. This diff is a partial implementation of the design in: https://fburl.com/gdoc/i6eqb634 Reviewed By: ahmadsharif1 Differential Revision: D59767617
This pull request was exported from Phabricator. Differential Revision: D59767617 |
This pull request has been merged in 13aadea. |
Summary:
This diff does several things:
SimpleVideoDecoder
, with the signature:get_frames_at(
self,
start: int,
stop: int,
step: int = 1,
) -> Frames
Frames
dataclass as a part of the public API. It has stacked versions of all return values, and is a sibling to theFrame
dataclass.This diff is a partial implementation of the design in: https://fburl.com/gdoc/i6eqb634
Differential Revision: D59767617