コード例 #1
0
def compute_one(img_path,gt_path):
    out = img_path
    gt = load_image(gt_path)
    # val_gt_erode paired with [0,0,0]label value
    # label order: R G B
    # num_classes = len(label_values)
    gt = util.reverse_one_hot(util.one_hot_it(gt, label_values))
    output_image = util.reverse_one_hot(util.one_hot_it(out, label_values))
    running_metrics_val.update(gt, output_image)
コード例 #2
0
def compute_one(img_path, gt_path):
    gt = load_image(gt_path)
    # val_gt_erode paired with [0,0,0]label value
    # label order: R G B
    # num_classes = len(label_values)
    gt = util.reverse_one_hot(util.one_hot_it(gt, label_values))
    gt_binary = np.zeros(gt.shape, dtype=np.uint8)
    gt_binary[gt == object_class] = 1
    output_image = img_path
    running_metrics_val.update(gt_binary, output_image)