Tiler#
- class model_api.tilers.tiler.Tiler(model, configuration={}, execution_mode='async')#
Bases:
ABC
Base constructor for creating a tiling pipeline
- Parameters:
model – underlying model
configuration (
dict
) – it contains values for parameters accepted by specific tiler (tile_size, tiles_overlap etc.) which are set as data attributes.execution_mode (
str
) – Controls inference mode of the tiler (async or sync).
- __call__(inputs)#
Applies full pipeline of tiling inference in one call.
- Parameters:
inputs – raw input data, the data type is defined by underlying model wrapper
- Returns:
postprocessed data in the format defined by underlying model wrapper
- get_model()#
Getter for underlying model
- classmethod parameters()#
Defines the description and type of configurable data parameters for the tiler.
The structure is similar to model wrapper parameters.
- Returns:
the dictionary with defined wrapper tiler parameters
- EXECUTION_MODES = ['async', 'sync']#
An abstract tiler
The abstract tiler is free from any executor dependencies. It sets the Model instance with the provided model and applies it to tiles of the input image, and then merges results from all tiles.
The _postprocess_tile and _merge_results methods must be implemented in a specific inherited tiler. .. attribute:: logger
instance of the Logger
- type:
Logger
- model_loaded#
a flag whether the model is loaded to device
- Type:
bool
- async_pipeline#
a pipeline for asynchronous execution mode
- Type:
- execution_mode#
Controls inference mode of the tiler (async or sync).