Configuration

Utilities for parsing model configuration.

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

Get configurable parameters.

Parameters:
  • model_name – str | None: (Default value = None)

  • config_path – Path | str | None: (Default value = None)

  • weight_file – Path to the weight file

  • config_filename – str | None: (Default value = “config”)

  • config_file_extension – str | None: (Default value = “yaml”)

Returns:

Configurable parameters in DictConfig object.

Return type:

DictConfig | ListConfig

anomalib.config.update_input_size_config(config: DictConfig | ListConfig) DictConfig | 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 (DictConfig | ListConfig) – Configurable parameters object

Returns:

Configurable parameters with updated values

Return type:

DictConfig | ListConfig

anomalib.config.update_nncf_config(config: DictConfig | ListConfig) DictConfig | ListConfig[source]

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

Args

config (DictConfig | ListConfig): Configurable parameters of the current run.

Returns:

Updated configurable parameters in DictConfig object.

Return type:

DictConfig | ListConfig