BatchWiseImageTransform

class hybrid_learning.datasets.transforms.image_transforms.BatchWiseImageTransform(batch_wise=False)[source]

Bases: ImageTransform, ABC

Wrap a transformation operating on a batch of masks to also work on single masks.

Public Data Attributes:

settings

Settings to reproduce the instance.

Inherited from : py: class:Transform

IDENTITY_CLASS

The identity class or classes for composition / addition.

settings

Settings to reproduce the instance.

Public Methods:

apply_to(mask)

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

apply_to_batch(batch)

Batch-wise transformation.

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__([batch_wise])

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

batch_wise (bool) –

__init__(batch_wise=False)[source]
Parameters

batch_wise (bool) –

apply_to(mask)[source]

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

Parameters

mask (Tensor) –

Return type

Tensor

abstract apply_to_batch(batch)[source]

Batch-wise transformation.

Parameters

batch (Tensor) –

Return type

Tensor

batch_wise: bool

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

property settings: Dict[str, Any]

Settings to reproduce the instance.