ImageWrapper#

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

Wrap transforms to handle image data.

Note

Iterates through transforms and their submodules.

  • 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(img)[source]#

Apply transforms on the image.

Call Wrapper.forward().

Parameters:

image – The image to transform.

Return type:

Tensor

Returns:

The transformed image.