otx.core.exporter.anomaly#

Class definition for anomaly models exporter used in OTX.

Classes

OTXAnomalyModelExporter([image_shape, ...])

Exporter for anomaly tasks.

class otx.core.exporter.anomaly.OTXAnomalyModelExporter(image_shape: tuple[int, int] = (256, 256), image_threshold: float = 0.5, pixel_threshold: float = 0.5, task: TaskType = TaskType.CLASSIFICATION, mean_values: tuple[float, float, float] = (0.0, 0.0, 0.0), scale_values: tuple[float, float, float] = (1.0, 1.0, 1.0), normalization_scale: float = 1.0, via_onnx: bool = False, onnx_export_configuration: dict[str, Any] | None = None)[source]#

Bases: OTXNativeModelExporter

Exporter for anomaly tasks.

Initializes OTXAnomalyModelExporter object.

Parameters:
  • image_shape (tuple[int, int], optional) – Shape of the input image. Defaults to (256, 256).

  • image_threshold (float, optional) – Threshold for image anomaly detection. Defaults to 0.5.

  • pixel_threshold (float, optional) – Threshold for pixel anomaly detection. Defaults to 0.5.

  • task (AnomalibTaskType, optional) – Task type for anomaly detection. Defaults to AnomalibTaskType.CLASSIFICATION.

  • mean_values (tuple[float, float, float], optional) – Mean values for normalization. Defaults to (0.0, 0.0, 0.0).

  • scale_values (tuple[float, float, float], optional) – Scale values for normalization. Defaults to (1.0, 1.0, 1.0).

  • normalization_scale (float, optional) – Scale value for normalization. Defaults to 1.0.

  • via_onnx (bool, optional) – Whether to export the model in OpenVINO format via ONNX first. Defaults to False.

  • onnx_export_configuration (dict[str, Any] | None, optional) – Configuration for ONNX export. Defaults to None.

property metadata: dict[tuple[str, str], str | float | int | tuple[int, int]]#

Returns a dictionary containing metadata about the model.

Returns:

A dictionary with metadata.

Return type:

dict[tuple[str, str], str | float | int | tuple[int, int]]