Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
FluidDoc
提交
942b9a07
F
FluidDoc
项目概览
PaddlePaddle
/
FluidDoc
通知
10
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
23
列表
看板
标记
里程碑
合并请求
111
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
FluidDoc
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
23
Issue
23
列表
看板
标记
里程碑
合并请求
111
合并请求
111
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
942b9a07
编写于
9月 25, 2019
作者:
Z
Zhang Ting
提交者:
Aurelius84
9月 25, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modified cn doc of image_resize for param data_layout, test=develop, test=document_preview (#1250)
上级
ef2365b1
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
7 addition
and
5 deletion
+7
-5
doc/fluid/api_cn/layers_cn/image_resize_cn.rst
doc/fluid/api_cn/layers_cn/image_resize_cn.rst
+7
-5
未找到文件。
doc/fluid/api_cn/layers_cn/image_resize_cn.rst
浏览文件 @
942b9a07
...
@@ -3,13 +3,13 @@
...
@@ -3,13 +3,13 @@
image_resize
image_resize
-------------------------------
-------------------------------
.. py:function:: paddle.fluid.layers.image_resize(input, out_shape=None, scale=None, name=None, resample='BILINEAR', actual_shape=None, align_corners=True, align_mode=1)
.. py:function:: paddle.fluid.layers.image_resize(input, out_shape=None, scale=None, name=None, resample='BILINEAR', actual_shape=None, align_corners=True, align_mode=1
, data_format='NCHW'
)
**注意:** 参数 ``actual_shape`` 将被弃用,请使用 ``out_shape`` 替代。
**注意:** 参数 ``actual_shape`` 将被弃用,请使用 ``out_shape`` 替代。
该OP用于调整一个batch中图片的大小。
该OP用于调整一个batch中图片的大小。
输入
张量的shape为(num_batches, channels, in_h, in_w)或者(num_batches, channels, in_d, in_h, in_w),并且调整大小只适用于最后两或三个维度(深度,高度和宽度)
。
输入
为4-D Tensor时形状为(num_batches, channels, in_h, in_w)或者(num_batches, in_h, in_w, channels),输入为5-D Tensor时形状为(num_batches, channels, in_d, in_h, in_w)或者(num_batches, in_d, in_h, in_w, channels),并且调整大小只适用于深度,高度和宽度对应的维度
。
支持的插值方法:
支持的插值方法:
...
@@ -20,7 +20,7 @@ image_resize
...
@@ -20,7 +20,7 @@ image_resize
NEAREST:最近邻插值
NEAREST:最近邻插值
最近邻插值是在输入张量的
第3维(高度)和第4维(宽度)
上进行最近邻插值。
最近邻插值是在输入张量的
高度和宽度
上进行最近邻插值。
双线性插值是线性插值的扩展,用于在直线2D网格上插值两个变量(例如,该操作中的H方向和W方向)的函数。 关键思想是首先在一个方向上执行线性插值,然后在另一个方向上再次执行线性插值。
双线性插值是线性插值的扩展,用于在直线2D网格上插值两个变量(例如,该操作中的H方向和W方向)的函数。 关键思想是首先在一个方向上执行线性插值,然后在另一个方向上再次执行线性插值。
...
@@ -116,7 +116,7 @@ https://en.wikipedia.org/wiki/Bilinear_interpolation
...
@@ -116,7 +116,7 @@ https://en.wikipedia.org/wiki/Bilinear_interpolation
https://en.wikipedia.org/wiki/Trilinear_interpolation
https://en.wikipedia.org/wiki/Trilinear_interpolation
参数:
参数:
- **input** (Variable) -
形状为(num_batches, channels, in_h, in_w)的4-D Tensor或者形状为(num_batches, channels, in_d, in_h, in_w)的5-D Tensor
。
- **input** (Variable) -
4-D或5-D Tensor,数据类型为float32、float64或uint8,其数据格式由参数 ``data_format`` 指定
。
- **out_shape** (list|tuple|Variable|None) - 输出Tensor,输入为4D张量时,形状为为(out_h, out_w)的2-D Tensor。输入为5-D Tensor时,形状为(out_d, out_h, out_w)的3-D Tensor。如果 :code:`out_shape` 是列表,每一个元素可以是整数或者形状为[1]的变量。如果 :code:`out_shape` 是变量,则其维度大小为1。默认值为None。
- **out_shape** (list|tuple|Variable|None) - 输出Tensor,输入为4D张量时,形状为为(out_h, out_w)的2-D Tensor。输入为5-D Tensor时,形状为(out_d, out_h, out_w)的3-D Tensor。如果 :code:`out_shape` 是列表,每一个元素可以是整数或者形状为[1]的变量。如果 :code:`out_shape` 是变量,则其维度大小为1。默认值为None。
- **scale** (float|Variable|None)-输入的高度或宽度的乘数因子 。 out_shape和scale至少要设置一个。out_shape的优先级高于scale。默认值为None。
- **scale** (float|Variable|None)-输入的高度或宽度的乘数因子 。 out_shape和scale至少要设置一个。out_shape的优先级高于scale。默认值为None。
- **name** (str|None) - 该参数供开发人员打印调试信息时使用,具体用法请参见 :ref:`api_guide_Name` 。默认值为None。
- **name** (str|None) - 该参数供开发人员打印调试信息时使用,具体用法请参见 :ref:`api_guide_Name` 。默认值为None。
...
@@ -124,8 +124,9 @@ https://en.wikipedia.org/wiki/Trilinear_interpolation
...
@@ -124,8 +124,9 @@ https://en.wikipedia.org/wiki/Trilinear_interpolation
- **actual_shape** (Variable) - 可选输入,用于动态指定输出形状。如果指定actual_shape,图像将根据给定的形状调整大小,而不是根据指定形状的 :code:`out_shape` 和 :code:`scale` 进行调整。也就是说, :code:`actual_shape` 具有最高的优先级。如果希望动态指定输出形状,建议使用 :code:`out_shape` ,因为 :code:`actual_shape` 未来将被弃用。在使用actual_shape指定输出形状时,还需要设置out_shape和scale之一,否则在图形构建阶段会出现错误。默认值:None
- **actual_shape** (Variable) - 可选输入,用于动态指定输出形状。如果指定actual_shape,图像将根据给定的形状调整大小,而不是根据指定形状的 :code:`out_shape` 和 :code:`scale` 进行调整。也就是说, :code:`actual_shape` 具有最高的优先级。如果希望动态指定输出形状,建议使用 :code:`out_shape` ,因为 :code:`actual_shape` 未来将被弃用。在使用actual_shape指定输出形状时,还需要设置out_shape和scale之一,否则在图形构建阶段会出现错误。默认值:None
- **align_corners** (bool)- 一个可选的bool型参数,如果为True,则将输入和输出张量的4个角落像素的中心对齐,并保留角点像素的值。 默认值为True
- **align_corners** (bool)- 一个可选的bool型参数,如果为True,则将输入和输出张量的4个角落像素的中心对齐,并保留角点像素的值。 默认值为True
- **align_mode** (int)- 双线性插值的可选项。 可以是 '0' 代表src_idx = scale *(dst_indx + 0.5)-0.5;如果为'1' ,代表src_idx = scale * dst_index。
- **align_mode** (int)- 双线性插值的可选项。 可以是 '0' 代表src_idx = scale *(dst_indx + 0.5)-0.5;如果为'1' ,代表src_idx = scale * dst_index。
- **data_format** (str,可选)- 对于4-D Tensor,支持 NCHW(num_batches, channels, height, width) 或者 NHWC(num_batches, height, width, channels),对于5-D Tensor,支持 NCDHW(num_batches, channels, depth, height, width)或者 NDHWC(num_batches, depth, height, width, channels),默认值:'NCHW'。
返回:
4-D Tensor,形状为 [num_batches, channls, out_h, out_w]。或者5-D Tensor,形状为 [num_batches, channls, out_d, out_h, out_w]
。
返回:
4-D Tensor,形状为 (num_batches, channels, out_h, out_w) 或 (num_batches, out_h, out_w, channels);或者5-D Tensor,形状为 (num_batches, channels, out_d, out_h, out_w) 或 (num_batches, out_d, out_h, out_w, channels)
。
返回类型: 变量(variable)
返回类型: 变量(variable)
...
@@ -139,6 +140,7 @@ https://en.wikipedia.org/wiki/Trilinear_interpolation
...
@@ -139,6 +140,7 @@ https://en.wikipedia.org/wiki/Trilinear_interpolation
- :code:`ValueError` - scale应大于0。
- :code:`ValueError` - scale应大于0。
- :code:`TypeError` - align_corners 应为bool型。
- :code:`TypeError` - align_corners 应为bool型。
- :code:`ValueError` - align_mode 只能取 ‘0’ 或 ‘1’。
- :code:`ValueError` - align_mode 只能取 ‘0’ 或 ‘1’。
- :code:`ValueError` - data_format 只能取 ‘NCHW’、‘NHWC’、‘NCDHW’ 或者 ‘NDHWC’。
**代码示例**
**代码示例**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录