otx.algorithms.segmentation.adapters.openvino#

OTX Adapters - openvino.

Classes

OpenVINOSegmentationTask(task_environment)

Task implementation for Segmentation using OpenVINO backend.

OpenVINOSegmentationInferencer(hparams, ...)

Inferencer implementation for Segmentation using OpenVINO backend.

class otx.algorithms.segmentation.adapters.openvino.OpenVINOSegmentationInferencer(hparams: SegmentationConfig, label_schema: LabelSchemaEntity, model_file: str | bytes, weight_file: str | bytes | None = None, device: str = 'CPU', num_requests: int = 1)[source]#

Bases: IInferencer

Inferencer implementation for Segmentation using OpenVINO backend.

Inferencer implementation for Segmentation using OpenVINO backend.

Parameters:
  • hparams – Hyper parameters that the model should use.

  • label_schema – LabelSchemaEntity that was used during model training.

  • model_file – Path to model to load, .xml, .bin or .onnx file.

  • device – Device to run inference on, such as CPU, GPU or MYRIAD. Defaults to “CPU”.

  • num_requests – Maximum number of requests that the inferencer can make. Good value is the number of available cores. Defaults to 1.

await_all() None[source]#

Await all running infer requests if any.

enqueue_prediction(image: ndarray, id: int, result_handler: Any) None[source]#

Runs async inference.

predict(image: ndarray) Tuple[ImageResultWithSoftPrediction, AnnotationSceneEntity][source]#

Perform a prediction for a given input image.

class otx.algorithms.segmentation.adapters.openvino.OpenVINOSegmentationTask(task_environment: TaskEnvironment)[source]#

Bases: IDeploymentTask, IInferenceTask, IEvaluationTask, IOptimizationTask

Task implementation for Segmentation using OpenVINO backend.

deploy(output_model: ModelEntity) None[source]#

Deploy function of OpenVINOSegmentationTask.

evaluate(output_resultset: ResultSetEntity, evaluation_metric: str | None = None)[source]#

Evaluate function of OpenVINOSegmentationTask.

infer(dataset: DatasetEntity, inference_parameters: InferenceParameters | None = None) DatasetEntity[source]#

Infer function of OpenVINOSegmentationTask.

load_inferencer() OpenVINOSegmentationInferencer[source]#

load_inferencer function of OpenVINO Segmentation Task.

optimize(optimization_type: OptimizationType, dataset: DatasetEntity, output_model: ModelEntity, optimization_parameters: OptimizationParameters | None = None)[source]#

Optimize function of OpenVINOSegmentationTask.

property avg_time_per_image: float | None#

Average inference time per image.

property hparams#

Hparams of OpenVINO Segmentation Task.