未验证 提交 a37658da 编写于 作者: B Bin Lu 提交者: GitHub

Update transforms.py (#31252)

update RandomHorizontal Flip random description and examples
上级 5610c171
......@@ -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))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册