def eval_segment_best_possible():
    ds = PascalSegmentation()
    print("loading")
    data = load_pascal('train')
    print("getting edges")
    data = add_edges(data)
    print("computing segments")
    segments = [get_km_segments(x, ds.get_image(image_name), sps,
                                n_segments=25) for x, image_name, sps in
                zip(data.X, data.file_names, data.superpixels)]
    print("combining superpixels")
    segments = [seg[sp] for seg, sp in zip(segments, data.superpixels)]
    predictions = [gt_in_sp(ds, f, seg)[seg]
                   for seg, f in zip(segments, data.file_names)]
    Y_true = [ds.get_ground_truth(f) for f in data.file_names]
    hamming, jaccard = eval_on_pixels(ds, Y_true, predictions,
                                      print_results=True)
    tracer()
def eval_pixel_prediction():
    data = load_pascal_pixelwise('val')
    predictions = [np.argmax(x, axis=-1) for x in data.X]
    hamming, jaccard = eval_on_pixels(data.Y, predictions, print_results=True)
    tracer()
Example #3
0
def eval_pixel_prediction():
    dataset = NYUSegmentation()
    data = load_nyu_pixelwise('val')
    predictions = [np.argmax(x, axis=-1) for x in data.X]
    hamming, jaccard = eval_on_pixels(dataset, data.Y, predictions, print_results=True)
Example #4
0
def eval_pixel_prediction():
    dataset = NYUSegmentation()
    data = load_nyu_pixelwise("val")
    predictions = [np.argmax(x, axis=-1) for x in data.X]
    hamming, jaccard = eval_on_pixels(dataset, data.Y, predictions, print_results=True)