コード例 #1
0
def render_label_pred_example():
    model_path = path_model2d()
    model = StarDist2D(None,
                       name=model_path.name,
                       basedir=str(model_path.parent))
    img, y_gt = real_image2d()
    x = normalize(img, 1, 99.8)
    y, _ = model.predict_instances(x)

    im = render_label_pred(y_gt, y, img=x)
    import matplotlib.pyplot as plt
    plt.figure(1, figsize=(12, 4))
    plt.subplot(1, 4, 1)
    plt.imshow(x)
    plt.title("img")
    plt.subplot(1, 4, 2)
    plt.imshow(render_label(y_gt, img=x))
    plt.title("gt")
    plt.subplot(1, 4, 3)
    plt.imshow(render_label(y, img=x))
    plt.title("pred")
    plt.subplot(1, 4, 4)
    plt.imshow(im)
    plt.title("tp (green) fp (red) fn(blue)")
    plt.tight_layout()
    plt.show()
    return im
コード例 #2
0
ファイル: test_model2D.py プロジェクト: ylch/stardist
def render_label_pred_example(model2d):
    model = model2d
    img, y_gt = real_image2d()
    x = normalize(img, 1, 99.8)
    y, _ = model.predict_instances(x)

    im = render_label_pred(y_gt, y , img = x)
    import matplotlib.pyplot as plt
    plt.figure(1, figsize = (12,4))
    plt.subplot(1,4,1);plt.imshow(x);plt.title("img")
    plt.subplot(1,4,2);plt.imshow(render_label(y_gt, img = x));plt.title("gt")
    plt.subplot(1,4,3);plt.imshow(render_label(y, img = x));plt.title("pred")
    plt.subplot(1,4,4);plt.imshow(im);plt.title("tp (green) fp (red) fn(blue)")
    plt.tight_layout()
    plt.show()
    return im
コード例 #3
0
ファイル: test_model2D.py プロジェクト: ylch/stardist
def render_label_example(model2d):
    model = model2d
    img, y_gt = real_image2d()
    x = normalize(img, 1, 99.8)
    y, _ = model.predict_instances(x)
    # im =  render_label(y,img = x, alpha = 0.3, alpha_boundary=1, cmap = (.3,.4,0))
    im =  render_label(y,img = x, alpha = 0.3, alpha_boundary=1)
    import matplotlib.pyplot as plt
    plt.figure(1)
    plt.imshow(im)
    plt.show()
    return im
コード例 #4
0
def render_label_example():
    model_path = path_model2d()
    model = StarDist2D(None,
                       name=model_path.name,
                       basedir=str(model_path.parent))
    img, y_gt = real_image2d()
    x = normalize(img, 1, 99.8)
    y, _ = model.predict_instances(x)
    # im =  render_label(y,img = x, alpha = 0.3, alpha_boundary=1, cmap = (.3,.4,0))
    im = render_label(y, img=x, alpha=0.3, alpha_boundary=1)
    import matplotlib.pyplot as plt
    plt.figure(1)
    plt.imshow(im)
    plt.show()
    return im