语义分割的一键标注

问题描述:

在阅读语义分割论文时,有时我会读到像蒙版图像的一次性标签这样的术语.我不清楚这到底是什么意思?在阅读一些实现时,我可以看到它们通常是rows*columns*2

When reading the semantic segmentation paper, sometime I can read the term like one-hot labelling for mask images. I am not clear what does it really mean? When reading some implementations, I can see they are usually of the shape rows*columns*2

我的猜测是,一个通道对应于前景,而另一个通道对应于背景.是对的吗?此外,我怎么知道哪个是前景?如果现有训练集仅具有形状rows*columns*1.如何将其转换为这种格式,即rows*columns*2?我正在做的只是使用newimage[:,:,:,0] = original_imagenewimage[:,:,:,1] = 1-original_image.但是我不确定是否正确?

My guess is that one channel corresponds to foreground and the other one corresponds to background. Is that right? Further more, how can i know which one is foreground? If the existing training set is only of shape rows*columns*1. How can I transfer it to this type of format, i.e., rows*columns*2? What I am doing is just using newimage[:,:,:,0] = original_image and newimage[:,:,:,1] = 1-original_image. But I am not sure whether it is right?

分类标签(例如1,2,3,4,5等)没有任何自然顺序.因此,使用这些数字可能意味着标签5大于标签1,但冰箱和狗只是两个没有自然顺序的标签.

Categorical labels like 1,2,3,4,5 etc. don't have any natural ordering. So using those numbers might imply that label 5 is greater than label 1 but refrigerator and dog are just two labels with no natural ordering for example.

所以我们将标签1,2,3,4,5转换为

So we convert the labels 1,2,3,4,5 to

[1,0,0,0,0],[0,1,0,0,0],...,[0,0,0,0,1]

[1,0,0,0,0], [0,1,0,0,0], ...,[0,0,0,0,1]

因此,现在它们只是指向某个方向的向量,这使得使用Logistic回归和其他损失函数的工作变得更加容易.

So now they are just vectors pointing in some direction and it makes it easier to work with for logistic regression and other loss functions.

您还可以使用row * columns * 1

Also you can encode the foreground background already with rows*columns*1

只需将前景值设置为1,将背景值设置为0,就可以得到前景背景蒙版.

Simply set foreground values to 1 and background to 0 then we have our foreground background mask.

我需要看一个何时使用rows * columns * 2的示例,因为该示例并不常见,并且可能会随您看到的位置而有所不同.

I'd need to see an example of when to use rows*columns*2 because that one isn't as common and would probably vary depending upon where you saw it.