-
Notifications
You must be signed in to change notification settings - Fork 875
fix cn docs of paddle.vision.transforms.Normalize, paddle.vision.models.alexnet, paddle.vision.models.mobilenet, ops apis #4704
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
Changes from all commits
832689a
2fb4d40
15b01ec
ba54a40
e2f8bb4
d7aeb86
f3fd681
fdb7469
433558f
0eaac5b
b90caa3
3b202fe
ff08ed1
6fe4ee7
5360b76
e8cf1bd
ad71096
a4235d3
f2ce3db
4820b4d
5fbfdcd
947a72d
d69b735
92ecb21
597dce6
c401ad9
9a5b13f
036afb0
43285e3
20cfca0
2f6517b
fd1735c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,8 @@ MobileNetV2 | |
|
|
||
| .. py:class:: paddle.vision.models.MobileNetV2(scale=1.0, num_classes=1000, with_pool=True) | ||
|
|
||
|
|
||
|
|
||
| MobileNetV2模型,来自论文 `"MobileNetV2: Inverted Residuals and Linear Bottlenecks" <https://arxiv.org/abs/1801.04381>`_ 。 | ||
|
|
||
| 参数 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. num_classes: |
||
|
|
@@ -19,15 +21,5 @@ mobilenetv2模型,Layer的实例。 | |
|
|
||
| 代码示例 | ||
| ::::::::: | ||
| COPY-FROM: paddle.vision.models.MobileNetV2:code-example1 | ||
|
|
||
| .. code-block:: python | ||
|
|
||
| import paddle | ||
| from paddle.vision.models import MobileNetV2 | ||
|
|
||
| model = MobileNetV2() | ||
|
|
||
| x = paddle.rand([1, 3, 224, 224]) | ||
| out = model(x) | ||
|
|
||
| print(out.shape) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,15 +3,17 @@ | |
| VGG | ||
| ------------------------------- | ||
|
|
||
| .. py:class:: paddle.vision.models.VGG(features, num_classes=1000) | ||
| .. py:class:: paddle.vision.models.VGG(features, num_classes=1000, with_pool=True) | ||
|
|
||
|
|
||
|
|
||
| VGG模型,来自论文 `"Very Deep Convolutional Networks For Large-Scale Image Recognition" <https://arxiv.org/pdf/1409.1556.pdf>`_ 。 | ||
|
|
||
| 参数 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| ::::::::: | ||
| - **features** (Layer) - vgg模型的特征层。由函数make_layers产生。 | ||
| - **num_classes** (int,可选) - 最后一个全连接层输出的维度。如果该值小于等于0,则不定义最后一个全连接层。默认值:1000。 | ||
| - **with_pool** (bool,可选): - 是否在最后三个全连接层前使用池化。默认值:True。 | ||
| - **with_pool** (bool,可选) - 是否在最后三个全连接层前使用池化。默认值:True。 | ||
|
|
||
| 返回 | ||
| ::::::::: | ||
|
|
@@ -20,19 +22,4 @@ vgg模型,Layer的实例。 | |
| 代码示例 | ||
| ::::::::: | ||
|
|
||
| .. code-block:: python | ||
|
|
||
| import paddle | ||
| from paddle.vision.models import VGG | ||
| from paddle.vision.models.vgg import make_layers | ||
|
|
||
| vgg11_cfg = [64, 'M', 128, 'M', 256, 256, 'M', 512, 512, 'M', 512, 512, 'M'] | ||
|
|
||
| features = make_layers(vgg11_cfg) | ||
|
|
||
| vgg11 = VGG(features) | ||
|
|
||
| x = paddle.rand([1, 3, 224, 224]) | ||
| out = vgg11(x) | ||
|
|
||
| print(out.shape) | ||
| COPY-FROM: paddle.vision.models.VGG:code-example | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,30 +5,18 @@ alexnet | |
|
|
||
| .. py:function:: paddle.vision.models.alexnet(pretrained=False, **kwargs) | ||
|
|
||
|
|
||
| AlexNet模型,来自论文 `"ImageNet Classification with Deep Convolutional Neural Networks" <https://papers.nips.cc/paper/2012/file/c399862d3b9d6b76c8436e924a68c45b-Paper.pdf>`_ 。 | ||
|
|
||
| 参数 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 参数是不是少了 **kwargs |
||
| ::::::::: | ||
| - **pretrained** (bool,可选) - 是否加载在imagenet数据集上的预训练权重。默认值:False。 | ||
|
|
||
| - **\*\*kwargs** (可选) - 附加的关键字参数,具体可选参数请参见 :ref:`AlexNet <cn_api_paddle_vision_models_AlexNet>`。 | ||
| 返回 | ||
| ::::::::: | ||
| alexnet模型,Layer的实例。 | ||
|
|
||
| 代码示例 | ||
| ::::::::: | ||
| .. code-block:: python | ||
|
|
||
| import paddle | ||
| from paddle.vision.models import alexnet | ||
|
|
||
| # build model | ||
| model = alexnet() | ||
|
|
||
| # build model and load imagenet pretrained weight | ||
| # model = alexnet(pretrained=True) | ||
|
|
||
| x = paddle.rand([1, 3, 224, 224]) | ||
| out = model(x) | ||
|
|
||
| print(out.shape) | ||
| COPY-FROM: paddle.vision.models.alexnet:code-example | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,8 +9,8 @@ PSRoIPool | |
|
|
||
| 参数 | ||
| ::::::::: | ||
| - output_size (int|Tuple(int, int)) - 池化后输出的尺寸(H, W),数据类型为int32。如果output_size是int类型,H和W都与其相等。 | ||
| - spatial_scale (float) - 空间比例因子,用于将boxes中的坐标从其输入尺寸按比例映射到输入特征图的尺寸。 | ||
| - **output_size** (int|Tuple(int, int)) - 池化后输出的尺寸(H, W), 数据类型为int32. 如果output_size是int类型,H和W都与其相等。 | ||
| - **spatial_scale** (float,可选) - 空间比例因子,用于将boxes中的坐标从其输入尺寸按比例映射到输入特征图的尺寸。 | ||
|
|
||
| 形状 | ||
| ::::::::: | ||
|
|
@@ -25,13 +25,4 @@ PSRoIPool | |
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. spatial_scale是可选参数 |
||
| 代码示例 | ||
| ::::::::: | ||
|
|
||
| .. code-block:: python | ||
|
|
||
| import paddle | ||
|
|
||
| psroi_module = paddle.vision.ops.PSRoIPool(7, 1.0) | ||
| x = paddle.uniform([2, 490, 28, 28], dtype='float32') | ||
| boxes = paddle.to_tensor([[1, 5, 8, 10], [4, 2, 6, 7], [12, 12, 19, 21]], dtype='float32') | ||
| boxes_num = paddle.to_tensor([1, 2], dtype='int32') | ||
| pool_out = psroi_module(x, boxes, boxes_num) | ||
| COPY-FROM: paddle.vision.ops.PSRoIPool:code-example1 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,25 +11,18 @@ PSROIPooling由R-FCN提出。更多详细信息,请参阅 https://arxiv.org/ab | |
|
|
||
| 参数 | ||
| ::::::::: | ||
| - x (Tensor) - 输入的特征图,形状为(N, C, H, W),数据类型为float32或float64。 | ||
| - boxes (Tensor) - 待执行池化的ROIs(Regions of Interest,感兴趣区域)的框坐标。它应当是一个形状为(num_rois, 4)的2-D Tensor,以[[x1, y1, x2, y2], ...]的形式给出。其中(x1, y1)是左上角的坐标值,(x2, y2)是右下角的坐标值。 | ||
| - boxes_num (Tensor) - 该batch中每一张图所包含的框数量。 | ||
| - output_size (int|Tuple(int, int)) - 池化后输出的尺寸(H, W),数据类型为int32。如果output_size是int类型,H和W都与其相等。 | ||
| - spatial_scale (float) - 空间比例因子,用于将boxes中的坐标从其输入尺寸按比例映射到输入特征图的尺寸。 | ||
| - **x** (Tensor) - 输入的特征图,形状为(N, C, H, W),数据类型为float32或float64。 | ||
| - **boxes** (Tensor) - 待执行池化的ROIs(Regions of Interest,感兴趣区域)的框坐标。它应当是一个形状为(num_rois, 4)的2-D Tensor,以[[x1, y1, x2, y2], ...]的形式给出。其中(x1, y1)是左上角的坐标值,(x2, y2)是右下角的坐标值。 | ||
| - **boxes_num** (Tensor) - 该batch中每一张图所包含的框数量。 | ||
| - **output_size** (int|Tuple(int, int)) - 池化后输出的尺寸(H, W),数据类型为int32。如果output_size是int类型,H和W都与其相等。 | ||
| - **spatial_scale** (float,可选) - 空间比例因子,用于将boxes中的坐标从其输入尺寸按比例映射到输入特征图的尺寸。 | ||
| - **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 | ||
|
|
||
|
|
||
| 返回 | ||
| ::::::::: | ||
| 4-D Tensor。池化后的ROIs,其形状是(Roi数量,输出通道数,池化后高度,池化后宽度)。输出通道数等于输入通道数/(池化后高度 * 池化后宽度)。 | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 中英文标点符号不要混用:
|
||
| 代码示例 | ||
| ::::::::: | ||
|
|
||
| .. code-block:: python | ||
|
|
||
| import paddle | ||
|
|
||
| x = paddle.uniform([2, 490, 28, 28], dtype='float32') | ||
| boxes = paddle.to_tensor([[1, 5, 8, 10], [4, 2, 6, 7], [12, 12, 19, 21]], dtype='float32') | ||
| boxes_num = paddle.to_tensor([1, 2], dtype='int32') | ||
| pool_out = paddle.vision.ops.psroi_pool(x, boxes, boxes_num, 7, 1.0) | ||
| COPY-FROM: paddle.vision.ops.psroi_pool:code-example1 | ||
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.
num_classes:
,-->,