From 65acf304e6be4b9ea8dc55cbb1823a7163ec2b8d Mon Sep 17 00:00:00 2001 From: Kentaro Wada Date: Sun, 1 Apr 2018 04:57:07 +0900 Subject: [PATCH] Show class_id in Visualization --- examples/semantic_segmentation/labelme2voc.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/semantic_segmentation/labelme2voc.py b/examples/semantic_segmentation/labelme2voc.py index 284a7d2b4..de969ccb1 100755 --- a/examples/semantic_segmentation/labelme2voc.py +++ b/examples/semantic_segmentation/labelme2voc.py @@ -89,8 +89,10 @@ def main(): # lbl_pil.putpalette((colormap * 255).flatten()) lbl_pil.save(out_lbl_file) + label_names = ['%d: %s' % (cls_id, cls_name) + for cls_id, cls_name in enumerate(class_names)] viz = labelme.utils.draw_label( - lbl, img, class_names, colormap=colormap) + lbl, img, label_names, colormap=colormap) PIL.Image.fromarray(viz).save(out_viz_file)