Source code for metallic.data.transforms.flip

import torch
import torchvision.transforms.functional as TF

[docs]class VerticalFlip: """Vertically flip the given PIL Image or torch Tensor.""" def __call__(self, image: torch.Tensor): return TF.vflip(image)
[docs]class HorizontalFlip: """Horizontal flip the given PIL Image or torch Tensor.""" def __call__(self, image: torch.Tensor): return TF.hflip(image)