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:
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_CLASS
The 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
self
withother
.__radd__
(other)Return a flat composition of
other
andself
.__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_thresh
before modificationpost_thresh – if not
None
, the tensors to be modified are binarized to 0 and 1 values with thresholdpost_thresh
after modificationbatch_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
- property kernel_size: Tuple[int, ...]
Wrap the
kernel_size
.
- property proto_shape: numpy.ndarray
Wrap the
proto_shape
.