Skip to content
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 paddle.vision.transforms.Resize cn docs #4319

Merged
merged 6 commits into from
Mar 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion docs/api/paddle/vision/transforms/Resize_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,20 @@ resize

- img (numpy.ndarray|PIL.Image) - 输入数据,可以是(H, W, C)形状的图像或遮罩。
- size (int|tuple) - 输出图像大小。如果size是一个序列,例如(h,w),输出大小将与此匹配。如果size为int,图像的较小边缘将与此数字匹配,即如果 height > width,则图像将重新缩放为(size * height / width, size)。
- interpolation (int|str, optional) - 插值的方法. 默认值: 'bilinear'。 当使用 ``pil`` 作为后端时, 支持的插值方法如下: - "nearest": Image.NEAREST, - "bilinear": Image.BILINEAR, - "bicubic": Image.BICUBIC, - "box": Image.BOX, - "lanczos": Image.LANCZOS, - "hamming": Image.HAMMING。当使用 ``cv2`` 作为后端时, 支持的插值方法如下: - "nearest": cv2.INTER_NEAREST, - "bilinear": cv2.INTER_LINEAR, - "area": cv2.INTER_AREA, - "bicubic": cv2.INTER_CUBIC, - "lanczos": cv2.INTER_LANCZOS4。
- interpolation (int|str, optional) - 插值的方法,默认值: 'bilinear'。
- 当使用 ``pil`` 作为后端时, 支持的插值方法如下
+ "nearest": Image.NEAREST,
+ "bilinear": Image.BILINEAR,
+ "bicubic": Image.BICUBIC,
+ "box": Image.BOX,
+ "lanczos": Image.LANCZOS,
+ "hamming": Image.HAMMING。
- 当使用 ``cv2`` 作为后端时, 支持的插值方法如下
+ "nearest": cv2.INTER_NEAREST,
+ "bilinear": cv2.INTER_LINEAR,
+ "area": cv2.INTER_AREA,
+ "bicubic": cv2.INTER_CUBIC,
+ "lanczos": cv2.INTER_LANCZOS4。

返回
:::::::::
Expand All @@ -34,7 +47,9 @@ resize

converted_img = F.resize(fake_img, 224)
print(converted_img.size)
# (262, 224)

converted_img = F.resize(fake_img, (200, 150))
print(converted_img.size)
# (150, 200)

19 changes: 17 additions & 2 deletions docs/api/paddle/vision/transforms/resize_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,21 @@ resize

- img (numpy.ndarray|PIL.Image) - 输入数据,可以是(H, W, C)形状的图像或遮罩。
- size (int|tuple) - 输出图像大小。如果size是一个序列,例如(h,w),输出大小将与此匹配。如果size为int,图像的较小边缘将与此数字匹配,即如果 height > width,则图像将重新缩放为(size * height / width, size)。
- interpolation (int|str, optional) - 插值的方法. 默认值: 'bilinear'。 当使用 ``pil`` 作为后端时, 支持的插值方法如下: - "nearest": Image.NEAREST, - "bilinear": Image.BILINEAR, - "bicubic": Image.BICUBIC, - "box": Image.BOX, - "lanczos": Image.LANCZOS, - "hamming": Image.HAMMING。当使用 ``cv2`` 作为后端时, 支持的插值方法如下: - "nearest": cv2.INTER_NEAREST, - "bilinear": cv2.INTER_LINEAR, - "area": cv2.INTER_AREA, - "bicubic": cv2.INTER_CUBIC, - "lanczos": cv2.INTER_LANCZOS4。

- interpolation (int|str, optional) - 插值的方法,默认值: 'bilinear'。
- 当使用 ``pil`` 作为后端时, 支持的插值方法如下
+ "nearest": Image.NEAREST,
+ "bilinear": Image.BILINEAR,
+ "bicubic": Image.BICUBIC,
+ "box": Image.BOX,
+ "lanczos": Image.LANCZOS,
+ "hamming": Image.HAMMING。
- 当使用 ``cv2`` 作为后端时, 支持的插值方法如下
+ "nearest": cv2.INTER_NEAREST,
+ "bilinear": cv2.INTER_LINEAR,
+ "area": cv2.INTER_AREA,
+ "bicubic": cv2.INTER_CUBIC,
+ "lanczos": cv2.INTER_LANCZOS4。

返回
:::::::::

Expand All @@ -34,7 +47,9 @@ resize

converted_img = F.resize(fake_img, 224)
print(converted_img.size)
# (262, 224)

converted_img = F.resize(fake_img, (200, 150))
print(converted_img.size)
# (150, 200)