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

关于最后预测图像的问题 #62

Open xubigboy opened 6 months ago

xubigboy commented 6 months ago
    image, gt, name = test_loader.load_data()
    gt = np.asarray(gt, np.float32)
    gt /= (gt.max() + 1e-8)
    image = image.cuda()

    res5, res4, res3, res2 = model(image)
    res = res2
    res = F.upsample(res, size=gt.shape, mode='bilinear', align_corners=False)
    res = res.sigmoid().data.cpu().numpy().squeeze()
    res = (res - res.min()) / (res.max() - res.min() + 1e-8)
    misc.imsave(save_path+name, res)
    最后保存的图像是一个0-255的图像,而不是黑白二值图,请问是如何到二值化的呢。