From 795e77915fdfe8a35585109263d5bee57057a8e1 Mon Sep 17 00:00:00 2001 From: Liyulingyue <83450930+Liyulingyue@users.noreply.github.com> Date: Fri, 18 Mar 2022 23:02:36 +0800 Subject: [PATCH 1/6] Update Resize_cn.rst --- docs/api/paddle/vision/transforms/Resize_cn.rst | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/api/paddle/vision/transforms/Resize_cn.rst b/docs/api/paddle/vision/transforms/Resize_cn.rst index 7db3404dba1..18977f5133b 100644 --- a/docs/api/paddle/vision/transforms/Resize_cn.rst +++ b/docs/api/paddle/vision/transforms/Resize_cn.rst @@ -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。 返回 ::::::::: @@ -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) From 67be523c0d266200764239e1ba1bfbc908094f52 Mon Sep 17 00:00:00 2001 From: Liyulingyue <83450930+Liyulingyue@users.noreply.github.com> Date: Sat, 19 Mar 2022 07:08:41 +0800 Subject: [PATCH 2/6] Update resize_cn.rst --- .../paddle/vision/transforms/resize_cn.rst | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/docs/api/paddle/vision/transforms/resize_cn.rst b/docs/api/paddle/vision/transforms/resize_cn.rst index 7db3404dba1..29a57755f03 100644 --- a/docs/api/paddle/vision/transforms/resize_cn.rst +++ b/docs/api/paddle/vision/transforms/resize_cn.rst @@ -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。 + 返回 ::::::::: @@ -32,9 +45,11 @@ resize fake_img = Image.fromarray(fake_img) - converted_img = F.resize(fake_img, 224) + converted_img1 = F.resize(fake_img, 224) print(converted_img.size) + # (262, 224) - converted_img = F.resize(fake_img, (200, 150)) + converted_img2 = F.resize(fake_img, (200, 150)) print(converted_img.size) + # (150, 200) From 176df122cfd7f9431e8b7bfcba5502c6a055fa3b Mon Sep 17 00:00:00 2001 From: Liyulingyue <83450930+Liyulingyue@users.noreply.github.com> Date: Sat, 19 Mar 2022 07:09:08 +0800 Subject: [PATCH 3/6] Update resize_cn.rst --- docs/api/paddle/vision/transforms/resize_cn.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api/paddle/vision/transforms/resize_cn.rst b/docs/api/paddle/vision/transforms/resize_cn.rst index 29a57755f03..24d0ab44b16 100644 --- a/docs/api/paddle/vision/transforms/resize_cn.rst +++ b/docs/api/paddle/vision/transforms/resize_cn.rst @@ -46,10 +46,10 @@ resize fake_img = Image.fromarray(fake_img) converted_img1 = F.resize(fake_img, 224) - print(converted_img.size) + print(converted_img1.size) # (262, 224) converted_img2 = F.resize(fake_img, (200, 150)) - print(converted_img.size) + print(converted_img2.size) # (150, 200) From a9d2c0d19091799df20aeeab51b32710e8b9d7ac Mon Sep 17 00:00:00 2001 From: Liyulingyue <83450930+Liyulingyue@users.noreply.github.com> Date: Sat, 19 Mar 2022 07:10:04 +0800 Subject: [PATCH 4/6] Update Resize_cn.rst --- docs/api/paddle/vision/transforms/Resize_cn.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/api/paddle/vision/transforms/Resize_cn.rst b/docs/api/paddle/vision/transforms/Resize_cn.rst index 18977f5133b..afbe1915e9b 100644 --- a/docs/api/paddle/vision/transforms/Resize_cn.rst +++ b/docs/api/paddle/vision/transforms/Resize_cn.rst @@ -45,11 +45,11 @@ resize fake_img = Image.fromarray(fake_img) - converted_img = F.resize(fake_img, 224) - print(converted_img.size) + converted_img1 = F.resize(fake_img, 224) + print(converted_img1.size) # (262, 224) - converted_img = F.resize(fake_img, (200, 150)) - print(converted_img.size) + converted_img2 = F.resize(fake_img, (200, 150)) + print(converted_img2.size) # (150, 200) From cf58e9402f6c15689a05e8a273309a3f70183db5 Mon Sep 17 00:00:00 2001 From: Liyulingyue <83450930+Liyulingyue@users.noreply.github.com> Date: Sat, 19 Mar 2022 07:16:30 +0800 Subject: [PATCH 5/6] Update Resize_cn.rst --- docs/api/paddle/vision/transforms/Resize_cn.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/api/paddle/vision/transforms/Resize_cn.rst b/docs/api/paddle/vision/transforms/Resize_cn.rst index afbe1915e9b..18977f5133b 100644 --- a/docs/api/paddle/vision/transforms/Resize_cn.rst +++ b/docs/api/paddle/vision/transforms/Resize_cn.rst @@ -45,11 +45,11 @@ resize fake_img = Image.fromarray(fake_img) - converted_img1 = F.resize(fake_img, 224) - print(converted_img1.size) + converted_img = F.resize(fake_img, 224) + print(converted_img.size) # (262, 224) - converted_img2 = F.resize(fake_img, (200, 150)) - print(converted_img2.size) + converted_img = F.resize(fake_img, (200, 150)) + print(converted_img.size) # (150, 200) From 9ee66c10f8d3cd4cc6463bcfe37f58827dc97a03 Mon Sep 17 00:00:00 2001 From: Liyulingyue <83450930+Liyulingyue@users.noreply.github.com> Date: Sat, 19 Mar 2022 07:16:45 +0800 Subject: [PATCH 6/6] Update resize_cn.rst --- docs/api/paddle/vision/transforms/resize_cn.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/api/paddle/vision/transforms/resize_cn.rst b/docs/api/paddle/vision/transforms/resize_cn.rst index 24d0ab44b16..35ede707dc5 100644 --- a/docs/api/paddle/vision/transforms/resize_cn.rst +++ b/docs/api/paddle/vision/transforms/resize_cn.rst @@ -45,11 +45,11 @@ resize fake_img = Image.fromarray(fake_img) - converted_img1 = F.resize(fake_img, 224) - print(converted_img1.size) + converted_img = F.resize(fake_img, 224) + print(converted_img.size) # (262, 224) - converted_img2 = F.resize(fake_img, (200, 150)) - print(converted_img2.size) + converted_img = F.resize(fake_img, (200, 150)) + print(converted_img.size) # (150, 200)