From a37658daff841f670d557b2ec2aee09ca8feec75 Mon Sep 17 00:00:00 2001 From: Bin Lu Date: Mon, 1 Mar 2021 15:30:38 +0800 Subject: [PATCH] Update transforms.py (#31252) update RandomHorizontal Flip random description and examples --- python/paddle/vision/transforms/transforms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/paddle/vision/transforms/transforms.py b/python/paddle/vision/transforms/transforms.py index 4101c41f2aa..a244d447829 100644 --- a/python/paddle/vision/transforms/transforms.py +++ b/python/paddle/vision/transforms/transforms.py @@ -537,7 +537,7 @@ class RandomHorizontalFlip(BaseTransform): """Horizontally flip the input data randomly with a given probability. Args: - prob (float, optional): Probability of the input data being flipped. Default: 0.5 + prob (float, optional): Probability of the input data being flipped. Should be in [0, 1]. Default: 0.5 keys (list[str]|tuple[str], optional): Same as ``BaseTransform``. Default: None. Examples: @@ -548,7 +548,7 @@ class RandomHorizontalFlip(BaseTransform): from PIL import Image from paddle.vision.transforms import RandomHorizontalFlip - transform = RandomHorizontalFlip(224) + transform = RandomHorizontalFlip(0.5) fake_img = Image.fromarray((np.random.rand(300, 320, 3) * 255.).astype(np.uint8)) -- GitLab