-
Notifications
You must be signed in to change notification settings - Fork 92
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
Conversation
paddlers/transforms/functions.py
Outdated
im = _two_percent_linear(im) | ||
im = np.uint8(im * 255) | ||
return im | ||
if dtype[:-2] == "uint" and np.max(dtype) < 256: |
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.
想问一下这里使用这种办法判断uint8类型主要是出于什么样的原因呀?
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.
考虑到有些图像明明就是0-255像素的uint图像,但是可能保存为了uint16等,针对这种图像我感觉可以直接使用np.uint8
。晖哥看你觉得呢
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.
中间的那儿打错了,修改了下
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.
考虑到有些图像明明就是0-255像素的uint图像,但是可能保存为了uint16等
这种情况感觉不是很显式,我们这里来主观做这样的判断可能不太合适~ 我建议还是直接判断dtype为uint8的情况,剩余的由用户根据自己数据的性质自行处理
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.
ok晖哥
PR types
Bug fixes / Clean
PR changes
Transforms / Tools / Requirements
Description
mask2shape
重复且无法使用的mask2geojson
工具,在mask2shape
已经可以导出shape和geojson。to_uint8
,当输入本来就是uint8的图像时,目前该方法会* 255
从而造成问题。例如在paddlers.utils.visualize.map_display
中显示错误。