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
MMCV
Commits
c75ff259
Commit
c75ff259
authored
Sep 27, 2018
by
xiongyu
Browse files
add more tests for video_reader slice
parent
c16fab7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
tests/test_video.py
tests/test_video.py
+21
-0
No files found.
tests/test_video.py
View file @
c75ff259
...
...
@@ -74,6 +74,27 @@ class TestVideo(object):
imgs
=
v
[
-
105
:
-
103
]
assert
int
(
round
(
imgs
[
0
].
mean
()))
==
94
assert
int
(
round
(
imgs
[
1
].
mean
()))
==
205
assert
len
(
imgs
)
==
2
imgs
=
v
[
63
:
65
]
assert
int
(
round
(
imgs
[
0
].
mean
()))
==
94
assert
int
(
round
(
imgs
[
1
].
mean
()))
==
205
assert
len
(
imgs
)
==
2
imgs
=
v
[
64
:
62
:
-
1
]
assert
int
(
round
(
imgs
[
0
].
mean
()))
==
205
assert
int
(
round
(
imgs
[
1
].
mean
()))
==
94
assert
len
(
imgs
)
==
2
imgs
=
v
[:
5
]
assert
len
(
imgs
)
==
5
for
img
in
imgs
:
assert
int
(
round
(
img
.
mean
()))
==
94
imgs
=
v
[
165
:]
assert
len
(
imgs
)
==
3
for
img
in
imgs
:
assert
int
(
round
(
img
.
mean
()))
==
0
imgs
=
v
[
-
3
:]
assert
len
(
imgs
)
==
3
for
img
in
imgs
:
assert
int
(
round
(
img
.
mean
()))
==
0
def
test_current_frame
(
self
):
v
=
mmcv
.
VideoReader
(
self
.
video_path
)
...
...
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