LiteRTHandler

abstract class LiteRTHandler<I, O>

A generic base class for model-specific preprocessing and postprocessing logic, combined with high-level task orchestration.

Type Parameters

I

The type of the input data to be preprocessed (e.g., LiteRtImage).

O

The type of the final result returned after postprocessing.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open suspend fun close()

Closes the underlying LiteRTCompiler.

Link copied to clipboard
open suspend fun init()

Initializes the handler and its underlying resources. This is an optional step that can be called before the first runTask. Subclasses should initialize the compiler here using setupCompiler or setCompiler.

Link copied to clipboard
suspend fun runTask(input: I): O

Executes the full LiteRT task: preprocess -> run -> postprocess.