import torchvision.transforms as transforms from PIL import Image
img_path = "/home/ztb/CV_method/image_augmentation/img.png" image = Image.open(img_path)
horizontal_flip = transforms.RandomHorizontalFlip()
flipped_image = horizontal_flip(image)
flipped_image.save("/home/ztb/CV_method/image_augmentation/flip.png")
|