otx.engine#

API for OTX Entry-Point User.

Functions

create_engine(model, data, **kwargs)

Create an engine.

Classes

Engine()

Engine base class.

class otx.engine.Engine[source]#

Bases: ABC

Engine base class.

abstract export(**kwargs) Path[source]#

Export the model.

abstract static is_supported(model: MODEL, data: DATA) bool[source]#

Check if the engine is supported for the given model and data.

abstract predict(**kwargs) ANNOTATIONS[source]#

Predict on model.

abstract test(**kwargs) METRICS[source]#

Test the model.

abstract train(**kwargs) METRICS[source]#

Train the model.

abstract property datamodule: DATA#

Returns the datamodule object associated with the engine.

Returns:

datamodule object.

Return type:

DATA

abstract property model: MODEL#

Returns the model object associated with the engine.

Returns:

model object.

Return type:

MODEL

abstract property work_dir: PathLike#

Get the working directory for the engine.

otx.engine.create_engine(model: MODEL, data: DATA, **kwargs) Engine[source]#

Create an engine.

Parameters:
  • model – The model to use

  • data – The data/datamodule to use

  • kwargs – Additional keyword arguments for engine initialization

Returns:

An instance of an Engine subclass that supports the model and data

Raises:

ValueError – If no compatible engine is found