Compose

class torchaug.transforms.Compose(transforms)[source]

Composes several transforms together.

This transform does not support torchscript. Please, see the note below.

Parameters:

transforms (Sequence[Callable]) – list of transforms to compose.

Example

>>> transforms.Compose([
>>>     transforms.CenterCrop(10),
>>>     transforms.PILToTensor(),
>>>     transforms.ConvertImageDtype(torch.float),
>>> ])

Note

In order to script the transformations, please use torch.nn.SequentialTransform as below.

>>> transforms = torch.nn.SequentialTransform(
>>>     transforms.CenterCrop(10),
>>>     transforms.Normalize((0.485, 0.456, 0.406), (0.229, 0.224, 0.225)),
>>> )
>>> scripted_transforms = torch.jit.script(transforms)

Make sure to use only scriptable transformations, i.e. that work with torch.Tensor.

extra_repr()[source]

Set the extra representation of the transform.

Return type:

str

forward(*inputs)[source]

Performs forward pass of the transform.

Parameters:

inputs (Any) – Inputs to the transform.

Return type:

Any

Returns:

Transformed inputs.