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] Bugfix about requirements / to_uint8 and clean #123

Merged
merged 11 commits into from
Mar 31, 2023
Merged

[Fix] Bugfix about requirements / to_uint8 and clean #123

merged 11 commits into from
Mar 31, 2023

Conversation

geoyee
Copy link
Collaborator

@geoyee geoyee commented Mar 31, 2023

PR types

Bug fixes / Clean

PR changes

Transforms / Tools / Requirements

Description

  1. 尝试修复 [Bug] 依赖版本反馈 #122
  2. 移除了与mask2shape重复且无法使用的mask2geojson工具,在mask2shape已经可以导出shape和geojson。
  3. 修复了to_uint8,当输入本来就是uint8的图像时,目前该方法会* 255从而造成问题。例如在paddlers.utils.visualize.map_display中显示错误。

@geoyee geoyee requested a review from Bobholamovic March 31, 2023 05:22
im = _two_percent_linear(im)
im = np.uint8(im * 255)
return im
if dtype[:-2] == "uint" and np.max(dtype) < 256:
Copy link
Member

Choose a reason for hiding this comment

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

想问一下这里使用这种办法判断uint8类型主要是出于什么样的原因呀?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

考虑到有些图像明明就是0-255像素的uint图像,但是可能保存为了uint16等,针对这种图像我感觉可以直接使用np.uint8。晖哥看你觉得呢

Copy link
Collaborator 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 Mar 31, 2023

Choose a reason for hiding this comment

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

考虑到有些图像明明就是0-255像素的uint图像,但是可能保存为了uint16等

这种情况感觉不是很显式,我们这里来主观做这样的判断可能不太合适~ 我建议还是直接判断dtype为uint8的情况,剩余的由用户根据自己数据的性质自行处理

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok晖哥

@Bobholamovic Bobholamovic merged commit 70fe473 into PaddlePaddle:develop Mar 31, 2023
@geoyee geoyee deleted the requirement branch March 31, 2023 11:49
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.

2 participants