otx.core.exporter.detection_3d#
Class definition for object detection 3D model exporter used in OTX.
Classes
|
Class definition for object detection 3D model exporter used in OTX. |
- class otx.core.exporter.detection_3d.OTXObjectDetection3DExporter(task_level_export_parameters: TaskLevelExportParameters, input_size: tuple[int, ...], mean: tuple[float, float, float] = (0.0, 0.0, 0.0), std: tuple[float, float, float] = (1.0, 1.0, 1.0), resize_mode: Literal['crop', 'standard', 'fit_to_window', 'fit_to_window_letterbox'] = 'standard', pad_value: int = 0, swap_rgb: bool = False, via_onnx: bool = False, onnx_export_configuration: dict[str, Any] | None = None, output_names: list[str] | None = None, input_names: list[str] | None = None)[source]#
Bases:
OTXNativeModelExporter
Class definition for object detection 3D model exporter used in OTX.
- to_exportable_code(model: OTXModel, output_dir: Path, base_model_name: str = 'exported_model', precision: OTXPrecisionType = OTXPrecisionType.FP32) Path [source]#
Export to zip folder final OV IR model with runable demo.
NOT SUPPORTED FOR OD 3D. It will raise an error.
- Parameters:
- Returns:
path to the exported model.
- Return type:
Path
- to_onnx(model: OTXModel, output_dir: Path, base_model_name: str = 'exported_model', precision: OTXPrecisionType = OTXPrecisionType.FP32, embed_metadata: bool = True) Path [source]#
Export the given PyTorch model to ONNX format and save it to the specified output directory.
- Parameters:
model (OTXModel) – The PyTorch model to be exported.
output_dir (Path) – The directory where the ONNX model will be saved.
base_model_name (str, optional) – The base name for the exported model. Defaults to “exported_model”.
precision (OTXPrecisionType, optional) – The precision type for the exported model.
OTXPrecisionType.FP32. (Defaults to) –
embed_metadata (bool, optional) – Whether to embed metadata in the ONNX model. Defaults to True.
- Returns:
The path to the saved ONNX model.
- Return type:
Path