Augmentation#

class augraphy.base.augmentation.Augmentation(mask=None, keypoints={}, bounding_boxes=[], p=0.5, numba_jit=1)[source]#

Bases: object

The base class which all pipeline augmentations inherit from.

Parameters:
  • mask (numpy array (uint8), optional) – The mask of labels for each pixel. Mask value should be in range of 0 to 255.

  • keypoints (dictionary, optional) – A dictionary of single or multiple labels where each label is a nested list of points coordinate (x, y).

  • bounding_boxes (list, optional) – A nested list where each nested list contains box location (x1, y1, x2, y2).

  • numba_jit (int, optional) – The flag to enable numba jit to speed up the processing in the augmentation.

  • p (float, optional) – The probability that this augmentation will be run when executed as part of a pipeline.

should_run()[source]#

Determines whether or not the augmentation should be applied by callers.

Returns:

True if the probability given was no smaller than the random sample on the unit interval.

Return type:

bool

Overview#

Augmentation is the base class for all augmentations.