Commit 68b6887e authored by tjsongzw's avatar tjsongzw
Browse files

fix typo

parent 0ad619c1
......@@ -67,7 +67,7 @@ def imwrite(img, file_path, params=None, auto_mkdir=True):
img (ndarray): Image array to be written.
file_path (str): Image file path.
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.
Returns:
......
......@@ -42,7 +42,7 @@ def get_time_str():
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.
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):
Args:
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.
default_args (dict, optional): Default arguments for initializing the
object.
......@@ -64,8 +64,8 @@ def obj_from_dict(info, parrent=None, default_args=None):
args = info.copy()
obj_type = args.pop('type')
if mmcv.is_str(obj_type):
if parrent is not None:
obj_type = getattr(parrent, obj_type)
if parent is not None:
obj_type = getattr(parent, obj_type)
else:
obj_type = sys.modules[obj_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