otx.api.usecases.tasks.interfaces.inference_interface#

This module contains the interface class for tasks.

Classes

IInferenceTask()

A base interface class for a task.

IRawInference()

A base interface class for raw inference tasks.

class otx.api.usecases.tasks.interfaces.inference_interface.IInferenceTask[source]#

Bases: object

A base interface class for a task.

abstract infer(dataset: DatasetEntity, inference_parameters: InferenceParameters) DatasetEntity[source]#

This is the method that is called upon inference.

This happens when the user wants to analyse a sample or multiple samples need to be analysed.

Parameters:
  • dataset – The input dataset to perform the analysis on.

  • inference_parameters – The parameters to use for the analysis.

Returns:

The results of the analysis.

class otx.api.usecases.tasks.interfaces.inference_interface.IRawInference[source]#

Bases: object

A base interface class for raw inference tasks.

abstract raw_infer(input_tensors: Dict[str, ndarray], output_tensors: Dict[str, ndarray])[source]#

This is the method that is called to run a neural network over a set of tensors.

This method takes as input/output the tensors which are directly fed to the neural network, and does not include any additional pre- and post-processing of the inputs and outputs.

Parameters:
  • input_tensors – Dictionary containing the input tensors.

  • output_tensors – Dictionary to be filled by the task with the output tensors.