ash.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:CNNbasedMedicalSegmentation 作者: BRML 项目源码 文件源码
def vis_result(image, seg, gt, file_name='test.png'):
    indices = np.where(seg == 1)
    indices_gt = np.where(gt == 1)

    im_norm = image / image.max()
    rgb_image = color.gray2rgb(im_norm)
    multiplier = [0., 1., 1.]
    multiplier_gt = [1., 1., 0.]

    im_seg = rgb_image.copy()
    im_gt = rgb_image.copy()
    im_seg[indices[0], indices[1], :] *= multiplier
    im_gt[indices_gt[0], indices_gt[1], :] *= multiplier_gt

    fig = plt.figure()
    a = fig.add_subplot(1, 2, 1)
    plt.imshow(im_seg)
    a.set_title('Segmentation')
    a = fig.add_subplot(1, 2, 2)
    plt.imshow(im_gt)
    a.set_title('Ground truth')
    plt.savefig(file_name)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号