Shortcuts

mmedit.utils.setup_env

Module Contents

Functions

register_all_modules(→ None)

Register all modules in mmedit into the registries.

try_import(→ Optional[types.ModuleType])

Try to import a module.

mmedit.utils.setup_env.register_all_modules(init_default_scope: bool = True) None[源代码]

Register all modules in mmedit into the registries.

参数

init_default_scope (bool) – Whether initialize the mmedit default scope. When init_default_scope=True, the global default scope will be set to mmedit, and all registries will build modules from mmedit’s registry node. To understand more about the registry, please refer to https://github.com/open-mmlab/mmengine/blob/main/docs/en/tutorials/registry.md Defaults to True.

mmedit.utils.setup_env.try_import(name: str) Optional[types.ModuleType][源代码]

Try to import a module.

参数

name (str) – Specifies what module to import in absolute or relative terms (e.g. either pkg.mod or ..mod).

返回

If importing successfully, returns the imported module, otherwise returns None.

返回类型

ModuleType or None