Segmentation IOProcessor Plugin#
This plugin targets segmentation tasks and allows for the input image to be split in tiles of a size that depends on the model and on an arbitrary number of bands.
During initialization, the plugin accesses the model's data module configuration from the vLLM configuration and instantiates a DataModule object dynamically.
This plugin is installed as terratorch_segmentation
.
Plugin specification#
Plugin configuration#
This plugin allows for additional configuration data to be passed via the TERRATORCH_SEGMENTATION_IO_PROCESSOR_CONFIG
environment variable. If set, the variable should contain the plugin configuration in json string format.
The plugin configuration format is defined in the PluginConfig
class.
terratorch.vllm.plugins.segmentation.types.PluginConfig
#
Bases: BaseModel
Source code in terratorch/vllm/plugins/segmentation/types.py
output_path = None
class-attribute
instance-attribute
#
Default output folder path to be used when the out_data_format is set to path. If omitted, the plugin will default to the current user home directory.
Request Data Format#
The input format for for the plugin is defined in the RequestData
class.
terratorch.vllm.plugins.segmentation.types.RequestData
#
Bases: BaseModel
Source code in terratorch/vllm/plugins/segmentation/types.py
data
instance-attribute
#
Input image data
data_format
instance-attribute
#
Data type for the input image.
Allowed values are: [b64_json
, path
, url
]
indices = None
class-attribute
instance-attribute
#
Indices for bands to be processed in the input file
out_data_format
instance-attribute
#
Data type for the output image.
Allowed values are: [b64_json
, path
]
Depending on the values set in data_format
, the plugin expects data
to contain a string that complies to the format. Similarly, out_data_format
controls the data format returned to the user.
Request Output Format#
The output format for the plugin is defined in the RequestOutput
class.
terratorch.vllm.plugins.segmentation.types.RequestOutput
#
Bases: BaseModel