-
Notifications
You must be signed in to change notification settings - Fork 838
Fix vistransform api #4727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix vistransform api #4727
Conversation
@@ -3,16 +3,22 @@ | |||
RandomCrop | |||
------------------------------- | |||
|
|||
.. py:class:: paddle.vision.transforms.RandomCrop(size, padding=0, pad_if_needed=False, keys=None) | |||
.. py:class:: paddle.vision.transforms.RandomCrop(size, padding=None, pad_if_needed=False, keys=None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里需要加上fill和padding_mode两个参数
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
- pad_if_needed (boolean,可选) - 如果裁剪后的图像小于期望的大小时,是否对裁剪后的图像进行填充,以避免引发异常,默认值:False,保持初次裁剪后的大小,不填充。 | ||
- fill (float|tuple, 可选) - 用于填充的像素值。仅当padding_mode为constant时参数值有效。 默认值:0。 如果参数值是一个长度为3的元组,则会分别用于填充R,G,B通道。 | ||
- padding_mode (string,可选) - 填充模式。支持: constant, edge, reflect 或 symmetric。 默认值:constant。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- ``constant`` 表示使用常量值进行填充,该值由fill参数指定。 | ||
- ``edge`` 表示使用图像边缘像素值进行填充。 | ||
- ``reflect`` 表示使用原图像的镜像值进行填充(不使用边缘上的值);比如:使用该模式对 ``[1, 2, 3, 4]`` 的两端分别填充2个值,结果是 ``[3, 2, 1, 2, 3, 4, 3, 2]``。 | ||
- ``symmetric`` 表示使用原图像的镜像值进行填充(使用边缘上的值);比如:使用该模式对 ``[1, 2, 3, 4]`` 的两端分别填充2个值,结果是 ``[2, 1, 1, 2, 3, 4, 4, 3]``。 | ||
- keys (list[str]|tuple[str],可选) - 与 ``BaseTransform`` 定义一致。默认值: None。 | ||
|
||
形状 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
…ix_vistransform_api
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PADDLEPADDLE_PR=42428