anomalib.config

Utilities for parsing model configuration.

Submodules

Package Contents

Functions

get_configurable_parameters(...)

Get configurable parameters.

update_input_size_config(→ Union[omegaconf.DictConfig, ...)

Update config with image size as tuple, effective input size and tiling stride.

update_nncf_config(→ Union[omegaconf.DictConfig, ...)

Set the NNCF input size based on the value of the crop_size parameter in the configurable parameters object.

anomalib.config.get_configurable_parameters(model_name: Optional[str] = None, config_path: Optional[Union[pathlib.Path, str]] = None, weight_file: Optional[str] = None, config_filename: Optional[str] = 'config', config_file_extension: Optional[str] = 'yaml') Union[omegaconf.DictConfig, omegaconf.ListConfig][source]

Get configurable parameters.

Parameters
  • model_name – Optional[str]: (Default value = None)

  • config_path – Optional[Union[Path, str]]: (Default value = None)

  • weight_file – Path to the weight file

  • config_filename – Optional[str]: (Default value = “config”)

  • config_file_extension – Optional[str]: (Default value = “yaml”)

Returns

Configurable parameters in DictConfig object.

Return type

Union[DictConfig, ListConfig]

anomalib.config.update_input_size_config(config: Union[omegaconf.DictConfig, omegaconf.ListConfig]) Union[omegaconf.DictConfig, omegaconf.ListConfig][source]

Update config with image size as tuple, effective input size and tiling stride.

Convert integer image size parameters into tuples, calculate the effective input size based on image size and crop size, and set tiling stride if undefined.

Parameters

config (Union[DictConfig, ListConfig]) – Configurable parameters object

Returns

Configurable parameters with updated values

Return type

Union[DictConfig, ListConfig]

anomalib.config.update_nncf_config(config: Union[omegaconf.DictConfig, omegaconf.ListConfig]) Union[omegaconf.DictConfig, omegaconf.ListConfig][source]

Set the NNCF input size based on the value of the crop_size parameter in the configurable parameters object.

Parameters

config (Union[DictConfig, ListConfig]) – Configurable parameters of the current run.

Returns

Updated configurable parameters in DictConfig object.

Return type

Union[DictConfig, ListConfig]