multiaug.augmenters package

Submodules

multiaug.augmenters.meta module

class multiaug.augmenters.meta.Augmenter(seed: int = None, **kwargs)

Bases: object

Base class for all objects that can augment data.

Parameters:seed (None or int) –

random seed for augmenter

  • If None then default seed will be used.
  • If int then random state will be seeded with value provided.
class multiaug.augmenters.meta.OneOf(augment: Union[float, list], **kwargs)

Bases: multiaug.augmenters.meta.Augmenter

Augmenter that always executes exactly one of the augmentation methods on each of the modalities provided.

Parameters:augment (float or list) –

Determines portion of dataset that will be used for augmentation

  • If float then that fraction of samples are drawn from the dataset
  • If list then this samples are directly used for augmentation
apply_image3d(images: numpy.ndarray, labels: numpy.ndarray = None) → Tuple[numpy.ndarray, numpy.ndarray]

Apply a random transform to a set of images.

Parameters:
  • images (np.ndarray) – Set of images of dimension N x H x W x D
  • labels (list) – Corresponding labels to images. Currently, labels as categorical integers are only supported.
Returns:

  • np.ndarray – Set of augmented images concatenated on the original images, of shape N x H x W x D
  • list – Corresponding labels to images

apply_tabular(data: numpy.ndarray, labels: numpy.ndarray = None) → Tuple[numpy.ndarray, numpy.ndarray]

Apply a random transform to a set of images.

Parameters:
  • data (np.ndarray) – Set of tabular data of dimension N x D
  • labels (list) – Corresponding labels to data. Currently, labels as categorical integers are only supported.
Returns:

  • np.ndarray – Set of augmented tabular data concatenated on the original data, of shape N x D
  • list – Corresponding labels to data

Module contents