DengPingFan / PraNet

PraNet: Parallel Reverse Attention Network for Polyp Segmentation, MICCAI 2020 (Oral). Code using Jittor Framework is available.
http://dpfan.net/PraNet
452 stars 121 forks source link

请问网络输出的概率图是如何转换为黑白图像的? #56

Closed LiYAnErr closed 1 year ago

LiYAnErr commented 1 year ago

在MyTest.py里,如下代码所示,网络输出的概率图为res,res中每个像素的范围在0到1之间,misc.imsave函数会自动对res*255。由此,输出的图像应该是一张灰度图。

截屏2022-11-25 18 17 44

可是在论文中,输出的图像是一张黑白二值图像。

截屏2022-11-25 18 23 40

请问MyTest.py里输出的灰度图,是如何转换为论文中的黑白二值图像的呢?谢谢~

GewelsJI commented 1 year ago

Hi, @LiYAnErr

The shown figure is gray but not binary since the sigmoid operation is used to get dense and normalised probabilities. I am not sure what you wanna get from this mask, and you can take a thresholding binarized strategy or use the argmax function.

Best.

LiYAnErr commented 1 year ago

thank u~