vflip¶
- paddle.vision.transforms. vflip ( img ) [source]
-
Vertically flips the given Image or np.array or paddle.Tensor.
- Parameters
-
img (PIL.Image|np.array|paddle.Tensor) – Image to be flipped.
- Returns
-
Vertically flipped image.
- Return type
-
PIL.Image|np.array|paddle.Tensor
Examples
>>> import numpy as np >>> from PIL import Image >>> from paddle.vision.transforms import functional as F >>> fake_img = (np.random.rand(256, 300, 3) * 255.).astype('uint8') >>> fake_img = Image.fromarray(fake_img) >>> flipped_img = F.vflip(fake_img) >>> print(flipped_img.size) (300, 256)