-
Notifications
You must be signed in to change notification settings - Fork 7.1k
add _backend argument to __init__() of class VideoClips #1363
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks!
I'm approving it, but I'd like to know if using get_video_backend
in VideoClips
would be enough, instead of passing a _backend
argument.
Is this because the metadata changes depending on the backend?
@@ -49,9 +67,11 @@ class VideoClips(object): | |||
on the resampled video | |||
""" | |||
def __init__(self, video_paths, clip_length_in_frames=16, frames_between_clips=1, | |||
frame_rate=None, _precomputed_metadata=None, num_workers=1): | |||
frame_rate=None, _precomputed_metadata=None, num_workers=1, | |||
_backend="pyav"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of passing a _backend
argument, what about just using the get_video_backend
to get this? Would this be enough for your use-case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sending a commit changing backend
to _backend
in the self, so no need to do anything here.
Codecov Report
@@ Coverage Diff @@
## master #1363 +/- ##
==========================================
- Coverage 64.76% 64.41% -0.36%
==========================================
Files 76 76
Lines 5975 6028 +53
Branches 915 929 +14
==========================================
+ Hits 3870 3883 +13
- Misses 1833 1869 +36
- Partials 272 276 +4
Continue to review full report at Codecov.
|
Summary: Pull Request resolved: #62 Current dependency torchvision 0.4.0 was released in August. It missed quite a few PRs that are merged after that, and that are needed for video classification, such as - pytorch/vision#1437 - pytorch/vision#1431 - pytorch/vision#1423 - pytorch/vision#1418 - pytorch/vision#1408 - pytorch/vision#1376 - pytorch/vision#1363 - pytorch/vision#1353 - pytorch/vision#1303 This will fail the CI test when a diff uses changes made in those PRs. Before a new official version of TorchVision is released, we can temporarily use the nightly torchvision to get all the recent PRs, and unblock the PR merging. We plan to use a fixed version of TorchVision later. Reviewed By: vreis Differential Revision: D17944239 fbshipit-source-id: 86ff540e3fc4f08ef767e84ef103525db5158201
* add _backend argument to __init__() of class VideoClips * minor fix * minor fix * Make backend private in VideoClips * Fix lint * Fix conflict due to cherry-pick for 0.4.2
Changes
VideoClips
, add an argument_backend
to switch between pyav and video_reader backend.torchvision/__init__.py
, add a global variable to control the video backendtest/test_io.py
andtest/test_datasets_video_utils.py
to retrieve global video backend configUnit test
test/test_io.py
test/test_datasets_video_utils.py