Unverified Commit 0f7d5718 authored by Kai Chen's avatar Kai Chen Committed by GitHub
Browse files

Merge pull request #31 from tjsongzw/master

fix typo
parents 0ad619c1 68b6887e
...@@ -67,7 +67,7 @@ def imwrite(img, file_path, params=None, auto_mkdir=True): ...@@ -67,7 +67,7 @@ def imwrite(img, file_path, params=None, auto_mkdir=True):
img (ndarray): Image array to be written. img (ndarray): Image array to be written.
file_path (str): Image file path. file_path (str): Image file path.
params (None or list): Same as opencv's :func:`imwrite` interface. params (None or list): Same as opencv's :func:`imwrite` interface.
auto_mkdir (bool): If the parrent folder of `file_path` does not exist, auto_mkdir (bool): If the parent folder of `file_path` does not exist,
whether to create it automatically. whether to create it automatically.
Returns: Returns:
......
...@@ -42,7 +42,7 @@ def get_time_str(): ...@@ -42,7 +42,7 @@ def get_time_str():
return time.strftime('%Y%m%d_%H%M%S', time.localtime()) return time.strftime('%Y%m%d_%H%M%S', time.localtime())
def obj_from_dict(info, parrent=None, default_args=None): def obj_from_dict(info, parent=None, default_args=None):
"""Initialize an object from dict. """Initialize an object from dict.
The dict must contain the key "type", which indicates the object type, it The dict must contain the key "type", which indicates the object type, it
...@@ -51,7 +51,7 @@ def obj_from_dict(info, parrent=None, default_args=None): ...@@ -51,7 +51,7 @@ def obj_from_dict(info, parrent=None, default_args=None):
Args: Args:
info (dict): Object types and arguments. info (dict): Object types and arguments.
module (:class:`module`): Module which may containing expected object parent (:class:`module`): Module which may containing expected object
classes. classes.
default_args (dict, optional): Default arguments for initializing the default_args (dict, optional): Default arguments for initializing the
object. object.
...@@ -64,8 +64,8 @@ def obj_from_dict(info, parrent=None, default_args=None): ...@@ -64,8 +64,8 @@ def obj_from_dict(info, parrent=None, default_args=None):
args = info.copy() args = info.copy()
obj_type = args.pop('type') obj_type = args.pop('type')
if mmcv.is_str(obj_type): if mmcv.is_str(obj_type):
if parrent is not None: if parent is not None:
obj_type = getattr(parrent, obj_type) obj_type = getattr(parent, obj_type)
else: else:
obj_type = sys.modules[obj_type] obj_type = sys.modules[obj_type]
elif not isinstance(obj_type, type): elif not isinstance(obj_type, type):
......
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