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
7ccd8b0b
"vscode:/vscode.git/clone" did not exist on "9e2bc3a17faf7dfffad9b0803f335da328b08a61"
Commit
7ccd8b0b
authored
Aug 28, 2018
by
Kai Chen
Browse files
minor fix
parent
4adf7006
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
mmcv/fileio/io.py
mmcv/fileio/io.py
+1
-1
mmcv/utils/timer.py
mmcv/utils/timer.py
+6
-6
mmcv/video/io.py
mmcv/video/io.py
+3
-3
No files found.
mmcv/fileio/io.py
View file @
7ccd8b0b
...
...
@@ -25,7 +25,7 @@ def load(file, file_format=None, **kwargs):
Returns:
The content from the file.
"""
if
file_format
is
None
and
is
instance
(
file
,
str
):
if
file_format
is
None
and
is
_str
(
file
):
file_format
=
file
.
split
(
'.'
)[
-
1
]
if
file_format
not
in
file_processors
:
raise
TypeError
(
'Unsupported format: {}'
.
format
(
file_format
))
...
...
mmcv/utils/timer.py
View file @
7ccd8b0b
...
...
@@ -13,16 +13,16 @@ class Timer(object):
:Example:
>>> import time
>>> import cv
base as cvb
>>> with cv
b
.Timer():
>>> import
mm
cv
>>> with
mm
cv.Timer():
>>> # simulate a code block that will run for 1s
>>> time.sleep(1)
1.000
>>> with cv
b
.Timer(print_tmpl='it takes {:.1f} seconds'):
>>> with
mm
cv.Timer(print_tmpl='it takes {:.1f} seconds'):
>>> # simulate a code block that will run for 1s
>>> time.sleep(1)
it takes 1.0 seconds
>>> timer = cv
b
.Timer()
>>> timer =
mm
cv.Timer()
>>> time.sleep(0.5)
>>> print(timer.since_start())
0.500
...
...
@@ -95,11 +95,11 @@ def check_time(timer_id):
:Example:
>>> import time
>>> import cv
base as cvb
>>> import
mm
cv
>>> for i in range(1, 6):
>>> # simulate a code block
>>> time.sleep(i)
>>> cv
b
.check_time('task1')
>>>
mm
cv.check_time('task1')
2.000
3.000
4.000
...
...
mmcv/video/io.py
View file @
7ccd8b0b
...
...
@@ -50,12 +50,12 @@ class VideoReader(object):
cache.
:Example:
>>> import cv
base as cvb
>>> v = cv
b
.VideoReader('sample.mp4')
>>> import
mm
cv
>>> v =
mm
cv.VideoReader('sample.mp4')
>>> len(v) # get the total frame number with `len()`
120
>>> for img in v: # v is iterable
>>>
cvb.show_img
(img)
>>>
mmcv.imshow
(img)
>>> v[5] # get the 6th frame
"""
...
...
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