acia.segm.processor.online#

Processors to apply remote models for segmentation

class acia.segm.processor.online.OnlineModel[source]#

Bases: Processor

The model is not running locally on the computer but in a remote location

__init__(url, username=None, password=None, timeout=30)[source]#

url: remote model executer (can also contain a port definition) username: username password: password

Parameters:

url (str)

predict(source, params=None)[source]#
Parameters:

source (ImageSequenceSource)

static parseContours(response_body)[source]#
Return type:

list[Contour]

class acia.segm.processor.online.ModelDescriptor[source]#

Bases: object

Describing all parameters to run a segmentation model from a git repository

__init__(repo, entry_point, version, parameters=None)[source]#
Parameters:
acia.segm.processor.online.batch(iterable, size)[source]#

Make iterable over packages of a certain size

Parameters:
  • iterable (_type_) – source iterable

  • size (_type_) – size of the batches

Yields:

_type_ – iterable over individual batches

class acia.segm.processor.online.FlexibleOnlineModel[source]#

Bases: Processor

The model is not running locally on the computer but in a remote location

__init__(executorUrl, modelDesc, timeout=600, batch_size=1)[source]#
Parameters:
predict(source, params=None)[source]#
Parameters:

source (ImageSequenceSource)

predict_single(frame_id, image, params)[source]#
predict_batch(frame_ids, images, params)[source]#

Predict segmentation for a batch of frames

Parameters:
  • frame_ids (List[int]) – ids of the frames

  • images (List) – numpy array for every image

  • params ([type]) – dictionary of additional parameters

Raises:

ValueError – [description]

Returns:

[Overlay] – An overlay containing the segmentation information for the images

Return type:

Overlay

static parseContours(response_body)[source]#
Return type:

list[Contour]