Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
74559c47
Unverified
Commit
74559c47
authored
May 21, 2021
by
Nicolas Hug
Committed by
GitHub
May 21, 2021
Browse files
Use torch.testing.assert_close in test_video_reader.py (#3888)
Co-authored-by:
Philip Meier
<
github.pmeier@posteo.de
>
parent
31ee79e6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
test/test_video_reader.py
test/test_video_reader.py
+5
-8
No files found.
test/test_video_reader.py
View file @
74559c47
...
...
@@ -11,6 +11,7 @@ import torchvision.io as io
from
numpy.random
import
randint
from
torchvision.io
import
_HAS_VIDEO_OPT
from
common_utils
import
PY39_SKIP
from
_assert_utils
import
assert_equal
try
:
...
...
@@ -359,8 +360,7 @@ class TestVideoReader(unittest.TestCase):
)
self
.
assertAlmostEqual
(
mean_delta
,
0
,
delta
=
1.0
)
is_same
=
torch
.
all
(
torch
.
eq
(
vtimebase
,
ref_result
.
vtimebase
)).
item
()
self
.
assertEqual
(
is_same
,
True
)
assert_equal
(
vtimebase
,
ref_result
.
vtimebase
)
if
(
config
.
check_aframes
...
...
@@ -369,8 +369,7 @@ class TestVideoReader(unittest.TestCase):
):
"""Audio stream is available and audio frame is required to return
from decoder"""
is_same
=
torch
.
all
(
torch
.
eq
(
aframes
,
ref_result
.
aframes
)).
item
()
self
.
assertEqual
(
is_same
,
True
)
assert_equal
(
aframes
,
ref_result
.
aframes
)
if
(
config
.
check_aframe_pts
...
...
@@ -378,11 +377,9 @@ class TestVideoReader(unittest.TestCase):
and
ref_result
.
aframe_pts
.
numel
()
>
0
):
"""Audio stream is available"""
is_same
=
torch
.
all
(
torch
.
eq
(
aframe_pts
,
ref_result
.
aframe_pts
)).
item
()
self
.
assertEqual
(
is_same
,
True
)
assert_equal
(
aframe_pts
,
ref_result
.
aframe_pts
)
is_same
=
torch
.
all
(
torch
.
eq
(
atimebase
,
ref_result
.
atimebase
)).
item
()
self
.
assertEqual
(
is_same
,
True
)
assert_equal
(
atimebase
,
ref_result
.
atimebase
)
@
unittest
.
skip
(
"This stress test will iteratively decode the same set of videos."
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment