pyiqa.utils.registry¶
Module Contents¶
- class pyiqa.utils.registry.Registry(name, entry_point_group=None)[source]¶
The registry that provides name -> object mapping, to support third-party users’ custom modules.
To create a registry (e.g. a backbone registry):
BACKBONE_REGISTRY = Registry('BACKBONE')
To register an object:
@BACKBONE_REGISTRY.register() class MyBackbone(): ...
Or:
BACKBONE_REGISTRY.register(MyBackbone)
- register_lazy(name, import_path, aliases=None, override=False)[source]¶
Register an object lazily from an import path.
- Parameters:
name (str) – Name used in this registry.
import_path (str) – ‘module.submodule’ or ‘module.submodule:ClassOrFn’.
aliases (list[str] | tuple[str] | None) – Optional alias names.
override (bool) – Whether to override existing registrations.