ConvOpWrapper
- class hybrid_learning.datasets.transforms.image_transforms.ConvOpWrapper(trafo, **kwargs)[source]
Bases:
WithThreshBase wrapper class to turn convolutional batch operations into single mask operations. Wraps classes inheriting from
BatchConvOp.Public Data Attributes:
Wrap the
proto_shape.Wrap the
kernel_size.Settings; essentially merged from wrapped encoder and super.
Inherited from : py: class:WithThresh
Settings; essentially merged from wrapped encoder and super.
Inherited from : py: class:BatchWiseImageTransform
Settings; essentially merged from wrapped encoder and super.
Inherited from : py: class:Transform
IDENTITY_CLASSThe identity class or classes for composition / addition.
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
selfwithother.__radd__(other)Return a flat composition of
otherandself.__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 thresholdpre_threshbefore modificationpost_thresh – if not
None, the tensors to be modified are binarized to 0 and 1 values with thresholdpost_threshafter modificationbatch_wise – see
batch_wisepre_high_class – value to set items to that exceed
pre_threshpre_low_class – value to set items to that are below
pre_threshpost_high_class – value to set items to that exceed
post_threshpost_low_class – value to set items to that are below
post_thresh
- property kernel_size: Tuple[int, ...]
Wrap the
kernel_size.
- property proto_shape: numpy.ndarray
Wrap the
proto_shape.