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 en docs #40719

Merged
merged 4 commits into from
Mar 25, 2022
Merged

fix paddle.vision.transforms.Resize en docs #40719

merged 4 commits into from
Mar 25, 2022

Conversation

Liyulingyue
Copy link
Contributor

PR types

Others

PR changes

Docs

Describe

任务需求见PaddlePaddle/docs#4239
修改代码示例与中文文档保持一致

@paddle-bot-old paddle-bot-old bot added contributor External developers status: proposed labels Mar 18, 2022
@paddle-bot-old
Copy link

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Comment on lines 390 to 403
from PIL import Image
from paddle.vision.transforms import Resize

transform = Resize(size=224)

fake_img = Image.fromarray((np.random.rand(100, 120, 3) * 255.).astype(np.uint8))

transform = Resize(size=224)
fake_img = transform(fake_img)
print(fake_img.size)
# (262, 224)

transform = Resize(size=(200,150))
fake_img = transform(fake_img)
print(fake_img.size)
# (150, 200)
Copy link
Member

@SigureMo SigureMo Mar 18, 2022

Choose a reason for hiding this comment

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

示例代码个人感觉完全对齐中文文档比较好吧(就是直接 copy,两面完全一致),而且目前英文文档的示例输出应当是 (268, 224)

另外不太建议对同一个 fake_img 连续 transform 两次,这样第二个用例可能会依赖第一个用例,建议 transform 后换一个变量名~感觉参考 paddle.vision.transform.resize 的中英文文档那样就可以~

看样子 paddle.vision.transform.resize 中英文文档也有和 PaddlePaddle/docs#4239 相似的问题呀,可以一起解决下下(๑>؂<๑)~~~

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改,因为我的电脑抽取英文文档报错,所以没有对英文的api解释说明修改

具体修改内容如下:

  1. 给resize增加输出示例
  2. 由于Resize的develop中文文档和resize保持一致,所以对英文的Resize的注释部分的代码没有完全和中文保持一致,仅修改示例使得输出一致。

@Liyulingyue
Copy link
Contributor Author

@TCChenlong

@SigureMo
Copy link
Member

@TCChenlong

可以等下周一哈~周末龙哥应该还在休息,可以先检查下 CI~我刚刚发现仅涉及文档的修改可以在 commit message (应该是最新一次 commit)里加上 test=document_fix 使其仅执行 static check~

参考 Paddle CI 手册

@SigureMo
Copy link
Member

或者手动重新触发下 PR-CI-iScan-Python 应该也可以~现在 CI 也支持手动 rerun 其中某一个了~

@TCChenlong TCChenlong merged commit 236a3bc into PaddlePaddle:develop Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants