Skip to content

Transforms Interface (core.transforms_interface)

class albumentations.core.transforms_interface.BasicTransform (always_apply=False, p=0.5) [view source on GitHub]

albumentations.core.transforms_interface.BasicTransform.add_targets (self, additional_targets)

Add targets to transform them the same way as one of existing targets ex: {'target_image': 'image'} ex: {'obj1_mask': 'mask', 'obj2_mask': 'mask'} by the way you must have at least one object with key 'image'


Name Type Description
additional_targets Dict[str, str]

keys - new target name, values - old target name. ex: {'image2': 'image'}

class albumentations.core.transforms_interface.DualTransform [view source on GitHub]

Transform for segmentation task.

class albumentations.core.transforms_interface.ImageOnlyTransform [view source on GitHub]

Transform applied to image only.

class albumentations.core.transforms_interface.NoOp [view source on GitHub]

Does nothing

def albumentations.core.transforms_interface.to_tuple (param, low=None, bias=None) [view source on GitHub]

Convert input argument to min-max tuple


Name Type Description
param scalar, tuple or list of 2+ elements

Input value. If value is scalar, return value would be (offset - value, offset + value). If value is tuple, return value would be value + offset (broadcasted).


Second element of tuple can be passed as optional argument


An offset factor added to each element