<jupyter_start><jupyter_text>Configure caffe and load net<jupyter_code>caffe.set_device(0)
caffe.set_mode_gpu()

net = caffe.Net('../nets/cityscapes-fcn8s.prototxt', 
                '../nets/cityscapes-fcn8s-heavy.caffemodel',
                caffe.TEST)<jupyter_output><empty_output><jupyter_text>Handle dataset details<jupyter_code>CS = cityscapes('/x/cityscapes')
n_cl = len(CS.classes)
valset = CS.get_dset('val')<jupyter_output><empty_output><jupyter_text>EvaluationInspect output and check scores on validation set.<jupyter_code>item = random.choice(valset)
im = CS.load_image('val', *item)
gt = CS.load_label('val', *item)
out = run_net.segrun(net, CS.preprocess(im))
plot_util.segshow(im, CS.palette(gt), CS.palette(out))
hist = np.zeros((n_cl, n_cl)) 
for i, item in enumerate(valset):
    if i % 100 == 0:
        print 'running {}/{}'.format(i, len(valset))
        sys.stdout.flush()
    im = CS.load_image('val', *item)
    gt = CS.load_label('val', *item)
    out = run_net.segrun(net, CS.preprocess(im))
    hist += score_util.score_out_gt(out, gt, n_cl=n_cl)   

acc, cl_acc, iu, fw_iu = score_util.get_scores(hist)
print 'val results: acc {:.3f} class acc {:.3f} iu {:.3f} fw iu {:.3f}'.format(acc, cl_acc, iu, fw_iu)<jupyter_output>running 0/500
running 100/500
running 200/500
running 300/500
running 400/500
val results: acc 0.942 class acc 0.764 iu 0.664 fw iu 0.895
{'fraction_non_alphanumeric': 0.1563400576368876, 'fraction_numerical': 0.03962536023054755, 'mean_word_length': 4.447058823529412, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '128335', 'license': 'BSD-4-Clause-UC', 'n_tokens_mistral': 618, 'n_tokens_neox': 564, 'n_words': 109, 'path': 'notebooks/data-cityscapes.ipynb', 'repo_name': 'alisure-ml/Semantic-Segmentation-clockwork-fcn', 'size': '1388'}