IntersectEncode

class hybrid_learning.datasets.transforms.image_transforms.IntersectEncode(kernel_size=None, *, normalize_by='proto_shape', proto_shape=None, **thresh_args)[source]

Bases: ConvOpWrapper

Intersection encode a single mask. This is a wrapper around BatchIntersectEncode2D.

Public Data Attributes:

Inherited from : py: class:ConvOpWrapper

proto_shape

Wrap the proto_shape.

kernel_size

Wrap the kernel_size.

settings

Settings; essentially merged from wrapped encoder and super.

Inherited from : py: class:WithThresh

settings

Settings; essentially merged from wrapped encoder and super.

Inherited from : py: class:BatchWiseImageTransform

settings

Settings; essentially merged from wrapped encoder and super.

Inherited from : py: class:Transform

IDENTITY_CLASS

The identity class or classes for composition / addition.

settings

Settings; essentially merged from wrapped encoder and super.

Public Methods:

Inherited from : py: class:WithThresh

apply_to_batch(masks)

Forward method in which to apply the trafo and thresholding.

Inherited from : py: class:BatchWiseImageTransform

apply_to(mask)

Apply trafo to the mask (either considered as batch of mask or single mask).

apply_to_batch(masks)

Forward method in which to apply the trafo and thresholding.

Inherited from : py: class:ImageTransform

apply_to(mask)

Apply trafo to the mask (either considered as batch of mask or single mask).

Inherited from : py: class:Transform

apply_to(mask)

Apply trafo to the mask (either considered as batch of mask or single mask).

Special Methods:

__init__([kernel_size, normalize_by, ...])

Init.

Inherited from : py: class:ConvOpWrapper

__init__([kernel_size, normalize_by, ...])

Init.

Inherited from : py: class:WithThresh

__init__([kernel_size, normalize_by, ...])

Init.

Inherited from : py: class:BatchWiseImageTransform

__init__([kernel_size, normalize_by, ...])

Init.

Inherited from : py: class:ImageTransform

__call__(img)

Application of transformation.

Inherited from : py: class:Transform

__repr__()

Return repr(self).

__eq__(other)

Return self==value.

__copy__()

Return a shallow copy of self using settings.

__add__(other)

Return a flat composition of self with other.

__radd__(other)

Return a flat composition of other and self.

__call__(img)

Application of transformation.


Parameters
  • kernel_size (Tuple[int, int]) –

  • normalize_by (str) –

  • proto_shape (ndarray) –

__init__(kernel_size=None, *, normalize_by='proto_shape', proto_shape=None, **thresh_args)[source]

Init.

Parameters
batch_wise: bool

Whether to assume a batch of masks is given (True) or a single mask (False).

post_thresholder: Optional[Binarize]

Binarizing transformation applied to targets after IoU encoding if not None.

pre_thresholder: Optional[Binarize]

Binarizing transformation applied to targets before IoU encoding if not None.

trafo: BatchConvOp

Modifier (en- or decoder) module that is used for modifications.