otx.backend.native.cli#

CLI for Native backend.

Note: This is temporary as the new CLI should cover all the utilities mentioned here.

Functions

list_models([task, pattern, print_table])

Returns a list of available models for training.

get_otx_root_path()

Return the root path of the otx module.

otx.backend.native.cli.get_otx_root_path() Path[source]#

Return the root path of the otx module.

Returns:

The root path of the otx module.

Return type:

str

Raises:

ModuleNotFoundError – If the otx module is not found.

otx.backend.native.cli.list_models(task: OTXTaskType | None = None, pattern: str | None = None, print_table: bool = False) list[str][source]#

Returns a list of available models for training.

Parameters:
  • task (OTXTaskType | None, optional) – Recipe Filter by Task.

  • pattern (Optional[str], optional) – A string pattern to filter the list of available models. Defaults to None.

  • print_table (bool, optional) – Output the recipe information as a Rich.Table. This is primarily used for otx find in the CLI.

Returns:

A list of available models for pretraining.

Return type:

list[str]

Example

# Return all available model list. >>> models = list_models() >>> models [‘atss_mobilenetv2’, ‘atss_r50_fpn’, …]

# Return INSTANCE_SEGMENTATION model list. >>> models = list_models(task=”INSTANCE_SEGMENTATION”) >>> models [‘maskrcnn_efficientnetb2b’, ‘maskrcnn_r50’, ‘maskrcnn_swint’, ‘openvino_model’]

# Return all available model list that matches the pattern. >>> models = list_models(task=”MULTI_CLASS_CLS”, pattern=”*efficient”) >>> models [‘efficientnet_v2’, ‘efficientnet_b0’, …]

# Print the recipe information as a Rich.Table (include task, model name, recipe path) >>> models = list_models(task=”MULTI_CLASS_CLS”, pattern=”*efficient”, print_table=True)