-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[torchcodec] refactor test utils to be based around dataclasses (#57)
Summary: Pull Request resolved: #57 Refactors our testing utilities to consider the actual reference file to be a first-class concept by making it an object, and then all operations we do are on that object. Some principles I was trying to keep: 1. There should be one clear definition of a reference media file, with all of its important parameters in one place with names that have obvious semantic meaning. 2. Operations that are conceptually connected to a reference media file should be methods on that object. 3. Tests should only have to use the object defined in 1. 4. Formalize the patterns we've already established in how we name reference files. 5. Make adding new reference files easy and obvious. Right now, we can only support reference tensors by timestamp with a generic approach. I think we should try to make that more an explicit pattern based on the pts value, but I'm not sure exactly how to do that right now. That will probably require changing some of our current reference file names. This diff also addresses the awkwardness in how we numbered our reference frames: the first 10 frames used to be 1-index based, and the rest 0-index based. This diff makes all frames 0-index based. Also in the future, the reference file *generation* should probably use these definitions as well. That will ensure we keep everything consistent. Reviewed By: ahmadsharif1 Differential Revision: D59161329 fbshipit-source-id: f60b733b1bdeb672832e221c30761dea1d4112a9
- Loading branch information
1 parent
faf73b0
commit 7af94c7
Showing
18 changed files
with
320 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.