otx.core.model.action_classification#

Class definition for action_classification model entity used in OTX.

Classes

OTXActionClsModel(label_info, input_size, ...)

Base class for the action classification models used in OTX.

OVActionClsModel(model_name, model_type, ...)

Action Classification model compatible for OpenVINO IR inference.

class otx.core.model.action_classification.OTXActionClsModel(label_info: LabelInfoTypes, input_size: tuple[int, int], optimizer: OptimizerCallable = <function _default_optimizer_callable>, scheduler: LRSchedulerCallable | LRSchedulerListCallable = <function _default_scheduler_callable>, metric: MetricCallable = <function _multi_class_cls_metric_callable>, torch_compile: bool = False)[source]#

Bases: OTXModel[ActionClsBatchDataEntity, ActionClsBatchPredEntity]

Base class for the action classification models used in OTX.

forward_for_tracing(image: Tensor) Tensor | dict[str, Tensor][source]#

Model forward function used for the model tracing during model exportation.

get_classification_layers(prefix: str = 'model.') dict[str, dict[str, int]][source]#

Get final classification layer information for incremental learning case.

get_dummy_input(batch_size: int = 1) ActionClsBatchDataEntity[source]#

Returns a dummy input for action classification model.

class otx.core.model.action_classification.OVActionClsModel(model_name: str, model_type: str = 'Action Classification', async_inference: bool = True, max_num_requests: int | None = None, use_throughput_mode: bool = False, model_api_configuration: dict[str, Any] | None = None, metric: MetricCallable = <function _multi_class_cls_metric_callable>, **kwargs)[source]#

Bases: OVModel[ActionClsBatchDataEntity, ActionClsBatchPredEntity]

Action Classification model compatible for OpenVINO IR inference.

It can consume OpenVINO IR model path or model name from Intel OMZ repository and create the OTX classification model compatible for OTX testing pipeline.

get_dummy_input(batch_size: int = 1) ActionClsBatchDataEntity[source]#

Returns a dummy input for action classification OV model.

transform_fn(data_batch: ActionClsBatchDataEntity) array[source]#

Data transform function for PTQ.

property model_adapter_parameters: dict#

Model parameters for export.