"git@developer.sourcefind.cn:OpenDAS/pytorch3d.git" did not exist on "1af6af9bc11d8c6d523e9a41d4f3c8c0aa3ad927"
Commit 7bea02c0 authored by xiongyu's avatar xiongyu
Browse files

update video reader test code

parent a5529848
...@@ -58,11 +58,11 @@ class TestVideo(object): ...@@ -58,11 +58,11 @@ class TestVideo(object):
v = mmcv.VideoReader(self.video_path) v = mmcv.VideoReader(self.video_path)
img = v.read() img = v.read()
assert int(round(img.mean())) == 94 assert int(round(img.mean())) == 94
img = v.get_frame(64) img = v.get_frame(63)
assert int(round(img.mean())) == 94 assert int(round(img.mean())) == 94
img = v[65]
assert int(round(img.mean())) == 205
img = v[64] img = v[64]
assert int(round(img.mean())) == 205
img = v[63]
assert int(round(img.mean())) == 94 assert int(round(img.mean())) == 94
img = v.read() img = v.read()
assert int(round(img.mean())) == 205 assert int(round(img.mean())) == 205
...@@ -82,7 +82,7 @@ class TestVideo(object): ...@@ -82,7 +82,7 @@ class TestVideo(object):
for _ in range(10): for _ in range(10):
v.read() v.read()
assert v.position == 10 assert v.position == 10
v.get_frame(100) v.get_frame(99)
assert v.position == 100 assert v.position == 100
def test_iterator(self): def test_iterator(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment