ConvOpWrapper

class hybrid_learning.datasets.transforms.image_transforms.ConvOpWrapper(trafo, **kwargs)[source]

Bases: WithThresh

Base wrapper class to turn convolutional batch operations into single mask operations. Wraps classes inheriting from BatchConvOp.

Public Data Attributes:

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__(trafo, **kwargs)

Init.

Inherited from : py: class:WithThresh

__init__(trafo, **kwargs)

Init.

Inherited from : py: class:BatchWiseImageTransform

__init__(trafo, **kwargs)

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

trafo (BatchConvOp) –

__init__(trafo, **kwargs)[source]

Init.

Parameters
  • trafo (BatchConvOp) – the transformation instance to wrap

  • pre_thresh – if not None, the tensors to be modified are binarized to 0 and 1 values with threshold pre_thresh before modification

  • post_thresh – if not None, the tensors to be modified are binarized to 0 and 1 values with threshold post_thresh after modification

  • batch_wise – see batch_wise

  • pre_high_class – value to set items to that exceed pre_thresh

  • pre_low_class – value to set items to that are below pre_thresh

  • post_high_class – value to set items to that exceed post_thresh

  • post_low_class – value to set items to that are below post_thresh

batch_wise: bool

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

property kernel_size: Tuple[int, ...]

Wrap the kernel_size.

property proto_shape: numpy.ndarray

Wrap the proto_shape.

property settings: Dict[str, Any]

Settings; essentially merged from wrapped encoder and super.