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

【Hackathon No.152】PaddleRS API 文档完善 #115

Merged
merged 31 commits into from
Mar 29, 2023

Conversation

ggggkkkknnnn
Copy link
Contributor

@ggggkkkknnnn ggggkkkknnnn commented Mar 21, 2023

PR types

Others

PR changes

Docs

Description

撰写中英文文档,对 PaddleRS 每个模型的构造参数进行详细说明
撰写中英文文档,对 PaddleRS 每个数据预处理/数据变换算子的构造参数进行详细说明
完善 PaddleRS quick start 中英文文档,在已有的『模型训练』部分内容基础上,添加『模型精度验证』与『模型部署』部分内容。

Copy link
Member

@Bobholamovic Bobholamovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感谢你为PaddleRS贡献文档。对于这个PR,我有如下意见和建议:

  1. 请不要在PR中包含.idea目录中的任何内容;
  2. 『API文档』指的是文档(markdown、rst等格式),而不是doc string。这个PR中为每个API添加了额外的中文注释,这既不符合『撰写文档』的要求,也不符合Python语言规范(只有函数/类定义起始处的第一个string才是doc string)。
  3. 请注重翻译质量,修改如『罗德里戈·凯·达特等人。“用于变化检测的全卷积暹罗网络”』这样的『机翻』表述。另外,论文名称和作者的名字不需要翻译。
  4. 请在充分了解PaddleRS模型部署能力后再为PaddleRS增加『模型部署』教程。

@ggggkkkknnnn
Copy link
Contributor Author

ggggkkkknnnn commented Mar 21, 2023

“撰写中英文文档,对 PaddleRS 每个模型的构造参数进行详细说明”对于这个我有一些疑问,题目的意思是我需要新建两个文档来对每个模型的构造参数进行描述吗。如果是这样的话我的两个文档又该在哪里创建?有一些困惑,希望指点。

@CLAassistant
Copy link

CLAassistant commented Mar 21, 2023

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ ggggkkkknnnn
❌ gaokenan
You have signed the CLA already but the status is still pending? Let us recheck it.

@Bobholamovic
Copy link
Member

“撰写中英文文档,对 PaddleRS 每个模型的构造参数进行详细说明”对于这个我有一些疑问,题目的意思是我需要新建两个文档来对每个模型的构造参数进行描述吗。如果是这样的话我的两个文档又该在哪里创建?有一些困惑,希望指点。

已在 #116 回复。另外,请签署CLA协议。

@ggggkkkknnnn
Copy link
Contributor Author

感谢你为PaddleRS贡献文档。对于这个PR,我有如下意见和建议:

  1. 请不要在PR中包含.idea目录中的任何内容;
  2. 『API文档』指的是文档(markdown、rst等格式),而不是doc string。这个PR中为每个API添加了额外的中文注释,这既不符合『撰写文档』的要求,也不符合Python语言规范(只有函数/类定义起始处的第一个string才是doc string)。
  3. 请注重翻译质量,修改如『罗德里戈·凯·达特等人。“用于变化检测的全卷积暹罗网络”』这样的『机翻』表述。另外,论文名称和作者的名字不需要翻译。
  4. 请在充分了解PaddleRS模型部署能力后再为PaddleRS增加『模型部署』教程。

您好,已进行修改

Copy link
Member

@Bobholamovic Bobholamovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

留了一些意见。

.idea/.gitignore Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请不要在PR中包含.idea目录。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已删除PR中.idea目录

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -0,0 +1,241 @@
#PaddleRS中每个模型的构造参数

##BIT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

类名、变量名用反引号包围。请参考https://github.com/PaddlePaddle/PaddleRS/blob/develop/docs/apis/train.md

请同步检查PR中的其它位置,并做修改。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改,并修改PR中其他类似错误

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改,并修改PR中其他类似错误

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -0,0 +1,241 @@
#PaddleRS中每个模型的构造参数
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

名称不够书面。

另外请在撰写文档前阅读PaddleRS文档并了解PaddleRS相关概念。例如,PaddleRS的paddlers/tasks中存放的(也是这篇文档中介绍如何构造的)数据集结构的官方中文称呼是『训练器』,而不是『模型』。参见:
https://github.com/PaddlePaddle/PaddleRS/blob/develop/docs/apis/train.md

此处为了避免用户混淆,我认为可以保留『模型构造参数』的说法,但需要额外说明一下,这篇文档中的『模型』指的实际是『训练器』而不是『网络实现』。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改名称为“PaddleRS模型构造参数”,并对文档内容进行介绍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么修改这个文件呀?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

paddlers/rs_models/clas/condensenetv2.py Show resolved Hide resolved
growth (list[int]): Contains a list of the output channels of the convolutional layer in the Dense Block.
HS_start_block (int): Which Dense Block starts with the initial bangs (Hard-Swish) activation function.
SE_start_block (int): Which Dense Block to start with is the Squeeze-and-Excitation (SE) module.
fc_channel (int): indicates the number of output channels of the full connection layer.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

大小写不统一。句首字母请统一大写。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

Copy link
Member

@Bobholamovic Bobholamovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请根据review意见继续修改~ 如果对review意见有疑问的话,可以直接在conversation中回复。

.gitignore Outdated
@@ -26,6 +26,7 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
.idea
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这一个block全是安装相关的。建议把移到.idea放在

# myvscode
.vscode

之后,并添加相应注释

# myidea
.idea

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

docs/intro/model_cons_param_cn.md Outdated Show resolved Hide resolved
##`CondenseNetV2`
基于PaddlePaddle的CondenseNetV2实现。

该模型的原始文章见于Yang L, Jiang H, Cai R, et al. Condensenet v2: Sparse feature reactivation for deep networks[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2021: 3569-3578. (https://arxiv.org/abs/2104.04382)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

参考文献格式与其它文章不同

|------------------|-----------------------|------|
|`in_channels (int)`| 输入图像的频带数 | |
|`num_classes(int)`| 目标类别数 | |
|`video_len (int,可选)`| 构造的伪视频的帧数 | `8` |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有的地方optional被翻译为了可选,有的地方没有。请统一风格。


| 参数名 | 描述 | 默认值 |
|------------------|-----|-------|
|`in_channels (int)`|输入图像的频带数| |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

频带数疑似机翻,是不是波段数

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

|`backbone (str,可选)`| 骨干网,模型在' paddle.vision.models.resnet '中可用 | `resnet50` |
|`backbone_pretrained (bool,可选)`|骨干网是否使用IMAGENET预训练权重| `True` |
|`fpn_out_channels (int,可选)` | 特征金字塔网络输出的通道数量 | `256` |
|`fsr_out_channels (int,可选)`| F-S关系模块输出的通道数 | `256` |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

对于论文中提出的特殊模块名称,如果在不确定准确翻译的情况下,可以保留英文原名,或者在翻译的名字后面加括号注释英文原名。

本文档详细介绍了PaddleRS各个数据变化算子的构造参数,包括算子名称、算子用途、各个算子的参数名称、参数类型、参数意义以及参数默认值。


| 数据变换算子名 | 用途 | 任务 | ... |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个列表是不是和已有文档中的内容重复了?如果是的话,建议给一个链接就可以,以免后续维护重复的样本

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

| `size_divisor (int)` | 填充后的图像宽度和高度将是' size_divisor '的倍数 | |

##`RandomBlur
对输入施加随机模糊
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里是不是格式不太对?漏写了一个反引号

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

paddlers/rs_models/clas/condensenetv2.py Show resolved Hide resolved
paddlers/rs_models/clas/condensenetv2.py Show resolved Hide resolved
@ggggkkkknnnn
Copy link
Contributor Author

针对提出的建议已全部进行修改,请review一下

Copy link
Member

@Bobholamovic Bobholamovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

还是有一些基础问题,请修改~

.gitignore Outdated
@@ -129,6 +130,9 @@ dmypy.json
# myvscode
.vscode

#myidea
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#之后空一格

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

.gitignore Outdated
@@ -27,6 +27,7 @@ share/python-wheels/
*.egg
MANIFEST


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

无需增加空行

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -0,0 +1,528 @@
#PaddleRS模型构造参数
本文档详细介绍了PaddleRS各个模型训练器的构造参数,包括其参数名,参数类型,参数描述及默认值。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

参数名参数类型参数描述用顿号()分隔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

docs/intro/model_cons_param_en.md Show resolved Hide resolved
2. python部署(以BIT为例)

使用预测接口的基本流程为:首先构建Predictor对象,然后调用Predictor的predict()方法执行预测。需要说明的是,Predictor对象的predict()方法返回的结果与对应的训练器(在paddlers/tasks/目录的文件中定义)的predict()方法返回结果具有相同的格式。
```shell
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

语言名称错误,应该是python

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


2. python部署(以BIT为例)

使用预测接口的基本流程为:首先构建Predictor对象,然后调用Predictor的predict()方法执行预测。需要说明的是,Predictor对象的predict()方法返回的结果与对应的训练器(在paddlers/tasks/目录的文件中定义)的predict()方法返回结果具有相同的格式。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Predictorpredict()paddlers/tasks/等均未添加反引号。请同步检查PR中其它部分。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么删除此模块?这将导致PaddleRS不可用。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的修改应该pre-commit进行的格式修改,我看修改都是删除行末的空格。辛苦您了

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

看起来好像是把operators.py整个文件给删除了,请检查一下是不是之前误删了~
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

之前误删了,已经重新push了,修改的地方都是删除原来行末的空格。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@ggggkkkknnnn
Copy link
Contributor Author

已完成修改~

Copy link
Member

@Bobholamovic Bobholamovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

留了一些意见

| 参数名 | 描述 | 默认值 |
|----------------------------|----------------------------------------------------------------------------------------|-------|
| `losses (list)` | 损失函数列表 | `None` |
| `sr_factor (int) ` | 超分辨率的缩放因子,原始图像的大小将乘以此因子。例如,如果原始图像为 `H` x `W`,则输出图像将为 `sr_factor * H` x `sr_factor * W` | `4` |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sr_factor (int) 第二个反引号前有3个多余的空格。

@@ -0,0 +1,254 @@
# PaddleRS Data Transform Operator Construct Parameter
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PaddleRS Data Transform Operator Construct Parameter -> PaddleRS Data Transformation Operator Construction Parameters

@@ -0,0 +1,254 @@
# PaddleRS Data Transform Operator Construct Parameter

This document describes the parameters of each PaddleRS data transform operator in detail, including the operator name, operator purpose, parameter name, parameter type, parameter meaning, and parameter Default Value value of each operator.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. transform operator -> transformation operator
  2. Default Value需要首字母小写,请不要在句中随意进行首字母大写。


导出模型可见:[模型导出](./deploy/export/README.md)

### 2. python部署
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python的规范写法为Python


## 模型部署

### 1. 导出模型
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

『导出模型』->『模型导出』


### 2. python部署

python部署可见:[Python部署](./deploy/README.md)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python部署可参考:

@@ -0,0 +1,147 @@
# 快速开始

本目录中整理了使用PaddleRS训练模型的示例代码。代码中均提供对示例数据的自动下载,并均使用GPU对模型进行训练。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

本目录中整理了使用PaddleRS训练模型的示例代码。

『本目录』是docs,其中并没有『整理了使用PaddleRS训练模型的示例代码』。这样的说法让读者感到疑惑。

此外,不建议大段拷贝其它文档中的内容,因为这会导致文件内容冗余,从而使项目可维护性降低(后续如果有一处文档需要改动,就不得不同步修改两个地方)。

请去除此部分。


## 模型部署

### 1. 导出模型
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

标题样式不统一。一级标题没有编号,二级标题却使用了一级标题编号。建议统一不使用编号,或者一级标题使用1. 标题风格编号,二级标题使用1.1 子标题风格编号。

docs/quick_start.md Show resolved Hide resolved
## 模型训练

+ 在安装完成PaddleRS后,即可开始模型训练。
+ 模型训练可参考:[使用教程——训练模型](./tutorials/train/README.md)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

当前目录为docs,其中并没有./tutorials子目录,因此该链接应该是无效的。

请同步检查PR中涉及到的所有链接,修改无效的链接。

@ggggkkkknnnn
Copy link
Contributor Author

已针对您提出的建议进行修改~

@@ -1,6 +1,6 @@
# PaddleRS Data Transform Operator Construct Parameter
# PaddleRS Data Transformation Operator Construct Parameters
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Construct->Construction

docs/quick_start.md Outdated Show resolved Hide resolved
@ggggkkkknnnn
Copy link
Contributor Author

已完成修改

Copy link
Member

@Bobholamovic Bobholamovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@Bobholamovic
Copy link
Member

我们将在CI通过后合入此PR。

再次感谢你为PaddleRS贡献文档,以及对PR review工作的配合。

@Bobholamovic Bobholamovic merged commit 66f89f4 into PaddlePaddle:develop Mar 29, 2023
@Harryoung
Copy link
Collaborator

不容易啊!顺利合入了!为ggggkkkknnnn的耐心和坚持点个赞!也为我们负责review的研发同学的认真和负责点赞!!!
开源项目需要这样的精神!飞桨因你们更精彩!

@Ligoml
Copy link

Ligoml commented Jun 7, 2023

@ggggkkkknnnn 开发者你好,第四期飞桨黑客松已全部结束,进入荣誉&奖金发放阶段,有一些信息需要与你收集与确认,请尽快添加工作人员的微信,备注黑客松+队名,他会拉你进群,感谢配合~
wechat

@Ligoml
Copy link

Ligoml commented Jun 13, 2023

@ggggkkkknnnn 开发者您好,请尽快添加我们的工作人员微信,如果在6.20之前无法确认您的信息,我们将不再进行奖金发放,本任务算作自发贡献。
注:因为您在issue上进行任务认领的队名我们并未在AI Studio的报名平台查询到,所以我们无法获取您的联系方式。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants