"src/git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "05c8b42b750ed4a7c0e66df6254e3649be80afa2"
Commit 7ccd8b0b authored by Kai Chen's avatar Kai Chen
Browse files

minor fix

parent 4adf7006
...@@ -25,7 +25,7 @@ def load(file, file_format=None, **kwargs): ...@@ -25,7 +25,7 @@ def load(file, file_format=None, **kwargs):
Returns: Returns:
The content from the file. The content from the file.
""" """
if file_format is None and isinstance(file, str): if file_format is None and is_str(file):
file_format = file.split('.')[-1] file_format = file.split('.')[-1]
if file_format not in file_processors: if file_format not in file_processors:
raise TypeError('Unsupported format: {}'.format(file_format)) raise TypeError('Unsupported format: {}'.format(file_format))
......
...@@ -13,16 +13,16 @@ class Timer(object): ...@@ -13,16 +13,16 @@ class Timer(object):
:Example: :Example:
>>> import time >>> import time
>>> import cvbase as cvb >>> import mmcv
>>> with cvb.Timer(): >>> with mmcv.Timer():
>>> # simulate a code block that will run for 1s >>> # simulate a code block that will run for 1s
>>> time.sleep(1) >>> time.sleep(1)
1.000 1.000
>>> with cvb.Timer(print_tmpl='it takes {:.1f} seconds'): >>> with mmcv.Timer(print_tmpl='it takes {:.1f} seconds'):
>>> # simulate a code block that will run for 1s >>> # simulate a code block that will run for 1s
>>> time.sleep(1) >>> time.sleep(1)
it takes 1.0 seconds it takes 1.0 seconds
>>> timer = cvb.Timer() >>> timer = mmcv.Timer()
>>> time.sleep(0.5) >>> time.sleep(0.5)
>>> print(timer.since_start()) >>> print(timer.since_start())
0.500 0.500
...@@ -95,11 +95,11 @@ def check_time(timer_id): ...@@ -95,11 +95,11 @@ def check_time(timer_id):
:Example: :Example:
>>> import time >>> import time
>>> import cvbase as cvb >>> import mmcv
>>> for i in range(1, 6): >>> for i in range(1, 6):
>>> # simulate a code block >>> # simulate a code block
>>> time.sleep(i) >>> time.sleep(i)
>>> cvb.check_time('task1') >>> mmcv.check_time('task1')
2.000 2.000
3.000 3.000
4.000 4.000
......
...@@ -50,12 +50,12 @@ class VideoReader(object): ...@@ -50,12 +50,12 @@ class VideoReader(object):
cache. cache.
:Example: :Example:
>>> import cvbase as cvb >>> import mmcv
>>> v = cvb.VideoReader('sample.mp4') >>> v = mmcv.VideoReader('sample.mp4')
>>> len(v) # get the total frame number with `len()` >>> len(v) # get the total frame number with `len()`
120 120
>>> for img in v: # v is iterable >>> for img in v: # v is iterable
>>> cvb.show_img(img) >>> mmcv.imshow(img)
>>> v[5] # get the 6th frame >>> v[5] # get the 6th frame
""" """
......
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