datumaro.components.lazy_plugin#

Functions

extra_deps(*extra_dep_names)

Decorator to assign extra deps for the plugin class.

get_extra_deps(plugin_cls)

Get extra deps of the given plugin class.

get_lazy_plugin(import_path, plugin_name, ...)

Classes

LazyPlugin()

class datumaro.components.lazy_plugin.LazyPlugin[source]#

Bases: ABC

NAME: str#
abstract classmethod get_plugin_cls() Type[Transform | Exporter | DatasetGenerator | Importer | Launcher | Validator | DatasetBase][source]#
datumaro.components.lazy_plugin.get_lazy_plugin(import_path: str, plugin_name: str, plugin_type: str, extra_deps: List[str] = [], metadata: Dict = {}) LazyPlugin | None[source]#
datumaro.components.lazy_plugin.extra_deps(*extra_dep_names: Sequence[str])[source]#

Decorator to assign extra deps for the plugin class.

There exist some plugins that cannot be executable with the default installation setup. For example, AcLauncher plugin needs tensorflow and openvino.tools extra dependencies. In this case, you have to add this decorator to that plugin class definition as follows.

@extra_deps(“tensorflow”, “openvino.tools”) class AcLauncher(Launcher, CliPlugin): …

datumaro.components.lazy_plugin.get_extra_deps(plugin_cls: object) List[str][source]#

Get extra deps of the given plugin class. If not exists, return an empty list.