otx.algorithms.visual_prompting.adapters.pytorch_lightning.config.visual_prompting_config#

Set configurable parameters for Visual Prompting.

Functions

get_visual_promtping_config(task_name, ...)

Get visual prompting configuration.

update_visual_prompting_config(...)

Update visual prompting configuration.

otx.algorithms.visual_prompting.adapters.pytorch_lightning.config.visual_prompting_config.get_visual_promtping_config(task_name: str, otx_config: ConfigurableParameters, config_dir: str, mode: str = 'train', model_checkpoint: str | None = None, resume_from_checkpoint: str | None = None) DictConfig | ListConfig[source]#

Get visual prompting configuration.

Create a visual prompting config object that matches the values specified in the OTX config.

Parameters:
  • task_name (str) – Task name to load configuration from visual prompting.

  • otx_config (ConfigurableParameters) – OTX config object parsed from configuration.yaml file.

  • config_dir (str) – Path to load raw config.yaml or save updated config.yaml.

  • mode (str) – Mode to run visual prompting task. Default: “train”.

  • model_checkpoint (Optional[str]) – Path to the checkpoint to load the model weights.

  • resume_from_checkpoint (Optional[str]) – Path to the checkpoint to resume training.

Returns:

Visual prompting config object for the specified model type

with overwritten default values.

Return type:

Union[DictConfig, ListConfig]

otx.algorithms.visual_prompting.adapters.pytorch_lightning.config.visual_prompting_config.update_visual_prompting_config(visual_prompting_config: DictConfig | ListConfig, otx_config: ConfigurableParameters) None[source]#

Update visual prompting configuration.

Overwrite the default parameter values in the visual prompting config with the values specified in the OTX config. The function is recursively called for each parameter group present in the OTX config.

Parameters:
  • visual_prompting_config (Union[DictConfig, ListConfig]) – Visual prompting config object for the specified model type with overwritten default values.

  • otx_config (ConfigurableParameters) – OTX config object parsed from configuration.yaml file.