otx.core.model.segmentation#
Class definition for detection model entity used in OTX.
Classes
|
Base class for the semantic segmentation models used in OTX. |
|
Semantic segmentation model compatible for OpenVINO IR inference. |
- class otx.core.model.segmentation.OTXSegmentationModel(label_info: LabelInfoTypes, model_name: str, input_size: tuple[int, int] = (512, 512), optimizer: OptimizerCallable = <function _default_optimizer_callable>, scheduler: LRSchedulerCallable | LRSchedulerListCallable = <function _default_scheduler_callable>, metric: MetricCallable = <function _segm_callable>, torch_compile: bool = False, tile_config: TileConfig = TileConfig(enable_tiler=False, enable_adaptive_tiling=True, tile_size=(400, 400), overlap=0.2, iou_threshold=0.45, max_num_instances=1500, object_tile_ratio=0.03, sampling_ratio=1.0, with_full_img=False))[source]#
Bases:
OTXModel
Base class for the semantic segmentation models used in OTX.
Base semantic segmentation model.
- Parameters:
label_info (LabelInfoTypes) – The label information for the segmentation model.
model_name (str) – The version/name/size of the model.
input_size (tuple[int, int]) – Model input size in the order of height and width.
optimizer (OptimizerCallable, optional) – The optimizer to use for training. Defaults to DefaultOptimizerCallable.
scheduler (LRSchedulerCallable | LRSchedulerListCallable, optional) – The scheduler to use for learning rate adjustment. Defaults to DefaultSchedulerCallable.
metric (MetricCallable, optional) – The metric to use for evaluation. Defaults to SegmCallable.
torch_compile (bool, optional) – Whether to compile the model using TorchScript. Defaults to False.
- forward_explain(inputs: SegBatchDataEntity) SegBatchPredEntity [source]#
Model forward explain function.
- forward_for_tracing(image: Tensor) Tensor | dict[str, Tensor] [source]#
Model forward function used for the model tracing during model exportation.
- class otx.core.model.segmentation.OVSegmentationModel(model_name: str, model_type: str = 'Segmentation', async_inference: bool = True, max_num_requests: int | None = None, use_throughput_mode: bool = True, model_api_configuration: dict[str, Any] | None = None, metric: MetricCallable = <function _segm_callable>, **kwargs)[source]#
Bases:
OVModel
Semantic segmentation model compatible for OpenVINO IR inference.
It can consume OpenVINO IR model path or model name from Intel OMZ repository and create the OTX segmentation model compatible for OTX testing pipeline.