Skip to content

Documentation for AugmentationInterface

Overview

The AugmentationInterface is an abstract class that defines a blueprint for single augmentation methods that transform an input object into a list of augmented objects. Utilizing the Python abstract base class (ABC) module, it requires any subclass to implement the transform method. The primary aim of this interface is to provide a common framework for augmentation strategies, standardizing transformations to be applied uniformly across the project. This approach facilitates experimentation with different augmentation methods without altering other code components.

Functionality

The transform method must be defined in any subclass, and it is responsible for transforming an input object into a list of augmented objects.

Parameters

  • object: The input object used for augmentation. Any type is allowed.

Return Value

  • A list of objects representing the augmented results of the input.

Usage

  • Purpose: To serve as a blueprint for augmenting objects within the application.

Inheritance

AugmentationInterface inherits from Python's ABC, enforcing all implementations to override the abstract transform method. This ensures consistent behavior across various augmenters.

Example Implementation

A simple implementation of the transform method might look like this:

def transform(self, object: Any) -> List[Any]:
    # A simple example duplicating the input object
    return [object, object]