Skip to content
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

Read video from memory newapi #6771

Merged
merged 20 commits into from
Oct 21, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions test/test_videoapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,14 @@ def test_frame_reading(self, test_video):

# compare the frames and ptss
for i in range(len(vr_frames)):
assert av_pts[i] == vr_pts[i]
torch.test.assert_equal(av_frames[i], vr_frames[i])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was added in the wrong section so reverted the commit. My comment regarding why we cannot make the tests strict from read_from_memory still holds

assert float(av_pts[i]) == approx(vr_pts[i], abs=0.1)

mean_delta = torch.mean(torch.abs(av_frames[i].float() - vr_frames[i].float()))
# on average the difference is very small and caused
# by decoding (around 1%)
# TODO: asses empirically how to set this? atm it's 1%
# averaged over all frames
assert mean_delta.item() < 2.55

del vr_frames, av_frames, vr_pts, av_pts

Expand Down