otx.cli.utils.io#
Utils for model io operations.
Functions
|
Get explain dataset with empty annotation. |
|
Recursively get all image file paths from given root_dir. |
|
Loads binary data stored at path. |
|
Reads a deployed model from disk and returns a ModelEntity object. |
|
Reads serialized LabelSchema and returns deserialized LabelSchema. |
|
Creates ModelEntity based on model_configuration and data stored at path. |
|
Reads an OpenVINO model from disk and returns a ModelEntity object. |
|
Reads a PyTorch model from disk and returns a ModelEntity object. |
|
Saves model data to folder. |
|
Saves processed saliency map (with image overlay) or raw saliency map. |
- otx.cli.utils.io.get_explain_dataset_from_filelist(image_files: list)[source]#
Get explain dataset with empty annotation.
- otx.cli.utils.io.get_image_files(root_dir: str) List[Tuple[str, str]] | None [source]#
Recursively get all image file paths from given root_dir.
- otx.cli.utils.io.read_deployed_model(model_configuration: ModelConfiguration, path: str, train_dataset: DatasetEntity) ModelEntity [source]#
Reads a deployed model from disk and returns a ModelEntity object.
- otx.cli.utils.io.read_label_schema(path: str) LabelSchemaEntity [source]#
Reads serialized LabelSchema and returns deserialized LabelSchema.
- Parameters:
path (str) – Path to model. It assmues that the label_schema.json is at the same location as the model.
- Returns:
Desetialized LabelSchemaEntity.
- Return type:
- otx.cli.utils.io.read_model(model_configuration: ModelConfiguration, path: str, train_dataset: DatasetEntity) ModelEntity [source]#
Creates ModelEntity based on model_configuration and data stored at path.
- Parameters:
model_configuration (ModelConfiguration) – ModelConfiguration object.
path (str) – Path to the model data.
train_dataset (DatasetEntity) – DatasetEntity object.
- Returns:
ModelEntity object.
- Return type:
- otx.cli.utils.io.read_openvino_model(model_configuration: ModelConfiguration, path: str, train_dataset: DatasetEntity) ModelEntity [source]#
Reads an OpenVINO model from disk and returns a ModelEntity object.
- otx.cli.utils.io.read_pytorch_model(model_configuration: ModelConfiguration, path: str, train_dataset: DatasetEntity) ModelEntity [source]#
Reads a PyTorch model from disk and returns a ModelEntity object.
- otx.cli.utils.io.save_model_data(model: ModelEntity, folder: str) None [source]#
Saves model data to folder. Folder is created if it does not exist.
- Parameters:
model (ModelEntity) – The model to save.
folder (str) – Path to output folder.