From f2c718540a491cde5f7ab6b0662a63df74da7545 Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Tue, 2 Jul 2019 11:27:02 +0200 Subject: [PATCH] Fixed label retrieval Signed-off-by: Jim Martens --- src/twomartens/masterthesis/cli.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/twomartens/masterthesis/cli.py b/src/twomartens/masterthesis/cli.py index 038843b..1f3d4d5 100644 --- a/src/twomartens/masterthesis/cli.py +++ b/src/twomartens/masterthesis/cli.py @@ -367,8 +367,6 @@ def visualise(args: argparse.Namespace) -> None: _, _, cats_to_names, _ = coco_utils.get_coco_category_maps(annotation_file_train) colors = pyplot.cm.hsv(np.linspace(0, 1, 81)).tolist() - classes = ['background'] - classes.extend(cats_to_names) i = 0 nr_images = len(file_names[args.trajectory]) @@ -392,7 +390,7 @@ def visualise(args: argparse.Namespace) -> None: xmax = bbox[2] ymax = bbox[3] color = colors[int(instance['coco_id'])] - label = f"{classes[int(instance['coco_id'])]}" + label = f"{cats_to_names[int(instance['coco_id'])]}" current_axis.add_patch( pyplot.Rectangle((xmin, ymin), xmax - xmin, ymax - ymin, color=color, fill=False, linewidth=2)) current_axis.text(xmin, ymin, label, size='x-large', color='white',