-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
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) |
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.
示例代码个人感觉完全对齐中文文档比较好吧(就是直接 copy,两面完全一致),而且目前英文文档的示例输出应当是 (268, 224)
另外不太建议对同一个 fake_img
连续 transform 两次,这样第二个用例可能会依赖第一个用例,建议 transform 后换一个变量名~感觉参考 paddle.vision.transform.resize 的中英文文档那样就可以~
看样子 paddle.vision.transform.resize 中英文文档也有和 PaddlePaddle/docs#4239 相似的问题呀,可以一起解决下下(๑><๑)~~~
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.
已修改,因为我的电脑抽取英文文档报错,所以没有对英文的api解释说明修改
具体修改内容如下:
- 给resize增加输出示例
- 由于Resize的develop中文文档和resize保持一致,所以对英文的Resize的注释部分的代码没有完全和中文保持一致,仅修改示例使得输出一致。
可以等下周一哈~周末龙哥应该还在休息,可以先检查下 CI~我刚刚发现仅涉及文档的修改可以在 commit message (应该是最新一次 commit)里加上
|
或者手动重新触发下 PR-CI-iScan-Python 应该也可以~现在 CI 也支持手动 rerun 其中某一个了~ |
PR types
Others
PR changes
Docs
Describe
任务需求见PaddlePaddle/docs#4239
修改代码示例与中文文档保持一致