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

PaddleSeg中要求标签是单通道,EISeg标注出的伪彩色为什么是三通道 #122

Open
YasinFu opened this issue Jun 29, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@YasinFu
Copy link

YasinFu commented Jun 29, 2022

bug描述
PaddleSeg中要求标签是单通道,其示例训练代码中的optic_disc_seg 数据集标签也用的单通道伪彩色。请问EISeg标注出的伪彩色为什么是三通道,不能直接用于PaddleSeg训练吗?

@YasinFu YasinFu added the bug Something isn't working label Jun 29, 2022
@geoyee
Copy link
Member

geoyee commented Jun 29, 2022

你用PIL打开试试,,应该是单通道的伪彩色啊

from PIL import Image
import numpy as np

img = Image.open("xxxx.png")
img = np.asarray(img)
print(img.shape)

@YasinFu
Copy link
Author

YasinFu commented Jun 30, 2022

生成的是三通道,以下是对一张伪彩色图的分析

img = Image.open("MV-SUF401GC_20220507_141054474_pseudo.png")
img = np.asarray(img)
print(img.shape)
(2048, 2048, 3)

@YasinFu
Copy link
Author

YasinFu commented Jun 30, 2022

另外查看图片信息也能看到位深度是24

@geoyee
Copy link
Member

geoyee commented Jun 30, 2022

另外查看图片信息也能看到位深度是24

对不好意思记错了,今晚改一下 😄

@linhandev
Copy link
Member

伪彩色是方便人看的标签,彩色的图片肯定是3通道的。给网络训练的标签里面只有1 2 3,在0~255的灰度范围里一般都很小,直接看灰度的标签图基本都是黑的。 @geoyee

@geoyee
Copy link
Member

geoyee commented Jul 1, 2022

伪彩色是方便人看的标签,彩色的图片肯定是3通道的。给网络训练的标签里面只有1 2 3,在0~255的灰度范围里一般都很小,直接看灰度的标签图基本都是黑的。 @geoyee

也是哈,保存的时候保存了单通的图像的。我估计是想要那种调色板的,看起来是彩色的读出来是单通道的

@YasinFu
Copy link
Author

YasinFu commented Jul 1, 2022

对,正如PaddleSeg的“标注数据的准备”中提到的:“PaddleSeg支持伪彩色图作为标注图片,在原来的单通道图片基础上,注入调色板。在基本不增加图片大小的基础上,却可以显示出彩色的效果。”,示例数据集optic_disc_seg 里的就是这样的,方便既能算法使用也能人眼分析。
目前我标注的时候灰度图也一并保存了,就先用灰度做训练了,暂时没啥影响。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants