vis4d.config.registry

Utility function for registering config files.

Functions

get_config_by_name(name_or_path, *args[, ...])

Get a config by name or path.

register_config(category, name)

Register a config in the model zoo for the given name and category.

get_config_by_name(name_or_path, *args, method_name='get_config')[source]

Get a config by name or path.

Parameters:
  • name_or_path (str) – Name or path of the config. If the path has a .yaml or .py extension, the function will load the config from the file. Otherwise, the function will try to resolve the config from the registered config locations. You can specify a config by its full registered path (e.g. “a/b/cfg”) or by its name (e.g. “cfg”).

  • *args (Any) – Additional arguments to pass to the config.

  • method_name (str) – Name of the method to call from the file to get the config. Defaults to “get_config”.

Return type:

ConfigDict

Returns:

The config.

Raises:

ValueError – If the config is not found.

register_config(category, name)[source]

Register a config in the model zoo for the given name and category.

The config will then be available via get_config_by_name utilities and located in the AVAILABLE_MODELS dictionary located at [category][name].

Parameters:
  • category (str) – Category of the config.

  • name (str) – Name of the config.

Return type:

Callable[[Union[Callable[[Any], ConfigDict], type]], None]

Returns:

The decorator.