hellozhuo / pidinet

Code for the ICCV 2021 paper "Pixel Difference Networks for Efficient Edge Detection" (Oral).
Other
445 stars 69 forks source link

数据加载edge_dataloader.py中把GT像素变为0\1\2,为什么像素值有2那? #28

Open lian666-ch opened 2 years ago

lian666-ch commented 2 years ago
        lb[lb == 0] = 0
        lb[np.logical_and(lb>0, lb<threshold)] = 2
        lb[lb >= threshold] = 1

作者您好,打扰了 我在阅读您的代码时发现,会把GT的像素变为含2的情况。我印象里一般处理为(0和1)的二值图。这我有些不明白了,期待并且谢谢您的回答!

zhuoinoulu commented 2 years ago

不好意思,现在才回答。 2的作用是让像素不参与loss的计算,因为一般认为2对应的像素的标签不确定

zhuoinoulu commented 2 years ago

https://github.com/zhuoinoulu/pidinet/blob/3df994747df9dc380e7b79ebb5ab17f3b17d9ebc/utils.py#L147-L151

在这里,把2的像素mask掉了 @Han666666666

lian666-ch commented 2 years ago

嗯嗯 我明白了,谢谢您

Kyridiculous1993 commented 4 months ago
        lb[lb == 0] = 0
        lb[np.logical_and(lb>0, lb<threshold)] = 2
        lb[lb >= threshold] = 1

作者您好,打扰了 我在阅读您的代码时发现,会把GT的像素变为含2的情况。我印象里一般处理为(0和1)的二值图。这我有些不明白了,期待并且谢谢您的回答!

您好!我自己制作的数据集mask也是二值图。请问这里的lb标签和utils.py代码的L147-L151该如何修改呢?谢谢!