dcnum.segm.segm_torch.segm_torch_uni

Classes

SegmentTorchUNI

Segmenter for use with UniversalWorker

Module Contents

class dcnum.segm.segm_torch.segm_torch_uni.SegmentTorchUNI(*, kwargs_mask: dict | None = None, debug: bool = False, **kwargs)[source]

Bases: dcnum.segm.segm_torch.segm_torch_base.TorchSegmenterBase, dcnum.segm.segmenter_uni.UNISegmenter

Segmenter for use with UniversalWorker

Parameters:
  • kwargs_mask (dict) – Keyword arguments for mask post-processing (see process_labels)

  • debug (bool) – Debugging parameters

  • kwargs – Additional, optional keyword arguments for segment_algorithm defined in the subclass.

requires_model_format_version = '2.0'
static segment_algorithm(images, *, model_file: str | None = None)[source]
Parameters:
  • images (3d ndarray) – event image

  • model_file (str) – path to or name of a dcnum model file (.dcnm); if only a name is provided, then the “torch_model_files” directory paths are searched for the file name

Returns:

mask – mask or labeling image for the give index

Return type:

3d boolean or integer ndarray