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
inplaceattribute is found, it is set toTrue,inplaceis handled at the wrapper level.
Note
If a transform makes a copy, the resulting tensor will not share the same underlying storage even if
inplaceis set toTrue.- 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
transformson the batch of images.Call
torchaug.transforms.Wrapper.forward().Note
If
same_on_framesisFalse, the batch and frames dimensions are merged.- Parameters:
imgs (
Tensor) – The batch of images to transform.- Return type:
Tensor- Returns:
The transformed images.