otx.cli.manager#

Configuraion Manager for OTX CLI.

Classes

ConfigManager(args[, workspace_root, mode])

Auto configuration manager that could set the proper configuration.

class otx.cli.manager.ConfigManager(args, workspace_root: str | None = None, mode: str = 'train')[source]#

Bases: object

Auto configuration manager that could set the proper configuration.

Currently, it only supports the small amount of functions. * Data format detection * Task type detection * Write the data to the workspace * Write the data configuration to the workspace

However, it will supports lots of things in the near future. * Automatic train type detection (Supervised, Self, Semi) * Automatic resource allocation (num_workers, HPO)

auto_split_data(data_roots: str, task: str, ann_file: str | None = None)[source]#

Automatically Split train data –> train/val dataset.

auto_task_detection(data_roots: str) str[source]#

Detect task type automatically.

build_workspace(new_workspace_path: str | None = None) None[source]#

Create OTX workspace with Template configs from task type.

This function provides a user-friendly OTX workspace and provides more intuitive and create customizable templates to help users use all the features of OTX.

Parameters:

new_workspace_path (Optional[str]) – Workspace dir name for build

check_workspace() bool[source]#

Check that the class’s workspace_root is an actual workspace folder.

Returns:

true for workspace else false

Return type:

bool

configure_data_config(update_data_yaml: bool = True) None[source]#

Configure data_config according to the situation and create data.yaml.

configure_template(model: str | None = None) None[source]#

Update the template appropriate for the situation.

get_dataset_config(subsets: List[str], hyper_parameters: ConfigurableParameters | None = None) dict[source]#

Returns dataset_config in a format suitable for each subset.

Parameters:
  • subsets (list, str) – Defaults to [“train”, “val”, “unlabeled”].

  • hyper_parameters (ConfigurableParameters) – Set of hyper parameters.

Returns:

dataset_config

Return type:

dict

get_hyparams_config(override_param: List | None = None) ConfigurableParameters[source]#

Separates the input params received from args and updates them..

update_data_config(data_yaml: dict) None[source]#

Convert the data yaml format to the data_config format consumed by the task.

Parameters:

data_yaml (dict) – data.yaml format

property data_config_file_path: Path#

The path of the data configuration yaml to use for the task.

Raises:

FileNotFoundError – If data is received as args from otx train and the file does not exist, Error.

Returns:

Path of target data configuration file.

Return type:

Path

property encryption_key#

Get encryption key from CLI argument or OS environment variables. If it is not specified, return None.

property output_path: Path#

The path of output directory for workspace.

Returns:

Path of output directory.

Return type:

Path