-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fix decoding issue with PYAV due to new support for multiple training… #541
base: main
Are you sure you want to change the base?
Conversation
Hi @dfan! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
1 similar comment
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
@lyttonhao has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Hi! There is an error in the code: |
@lyttonhao has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Very sorry ... yes you are right. With this additional fix I am now able to achieve correct results with the new code. Thanks and sorry again! |
Do you want to update the code? Thanks! |
this can solve the problems that I faced |
hi, |
pyav is much slower than other decode backends. I'm considering adding support to the |
@lyttonhao has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@dfan has updated the pull request. You must reimport the pull request before landing. |
@lyttonhao has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
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 great! We should also handle the case when duration is None
@@ -414,35 +418,49 @@ def pyav_decode( | |||
else: |
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.
For line 414-417, we should also decode the whole videos and return the frames. Example code could be:
decode_all_video = True
video_start_pts, video_end_pts = 0, math.inf
start_end_delta_time = None
frames = None
if container.streams.video:
video_frames, max_pts = pyav_decode_stream(
container,
video_start_pts,
video_end_pts,
container.streams.video[0],
{"video": 0},
)
frames = [frame.to_rgb().to_ndarray() for frame in video_frames]
frames = torch.as_tensor(np.stack(frames))
frames_out = [frames]
@dfan has updated the pull request. You must reimport the pull request before landing. |
Good catch! I saw there were additional fixes to the |
Yeah, that would be great if you could also include those changes! |
@dfan has updated the pull request. You must reimport the pull request before landing. |
Apologies for the delay |
@dfan hi, i am curious why remove parameter |
Hi. I started using SlowFast last week and I get the same error as you. As for
As for slowfast>datasets>decoder.py, it has already been corrected as described here. The libraries version are as follows: PyTorch = 1.12.1 What is not good? |
I meet leaks issue too. |
Hi. Any update on this? Why is this pr not merged? |
See issue #181. When using pyav as a backend, we get the exception
pyav with exception: unsupported operand type(s) for -: 'list' and 'int'
. This is becausenum_frames
is now a list.torchvision_decode()
is correct but notpyav_decode()
.