BatchImageWrapper#

class torchaug.batch_transforms.BatchImageWrapper(transforms, inplace=False)[source]#

Wrap transforms to handle image data.

Note

Transforms and their submodules are iterated over:

  • If inplace attribute is found, it is set to True, inplace is handled at the wrapper level.

Note

If a transform makes a copy, the resulting tensor will not share the same underlying storage even if inplace is set to True.

Parameters:
  • transforms (Union[Sequence[Module], Module]) – A list of transform modules.

  • inplace (bool, optional) – Whether to perform the transforms inplace.

    Default: False

forward(imgs)[source]#

Apply transforms on the batch of images.

Call torchaug.transforms.Wrapper.forward().

Parameters:

imgs (Tensor) – The batch of images to transform.

Return type:

Tensor

Returns:

The transformed images.