Made labels more visible

Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
Jim Martens 2019-09-16 12:10:34 +02:00
parent 5f7870b92f
commit 34d7128a1c
1 changed files with 2 additions and 2 deletions

View File

@ -102,14 +102,14 @@ def draw_bbox_figure(image_filename: str, labels: Sequence[np.ndarray],
annotation_file_train = f"{coco_path}/annotations/instances_minival2014.json"
_, _, _, classes_to_names = get_coco_cat_maps_func(annotation_file_train)
colors = pyplot.cm.hsv(np.linspace(0, 1, len(instances) + 1)).tolist()
colors = pyplot.cm.hsv(np.linspace(0, 1, len(instances) + 10)).tolist()
os.makedirs(output_path, exist_ok=True)
with Image.open(image_filename) as _image:
np_image = np.array(_image, dtype=np.uint8)
image = Image.fromarray(np_image)
figure_filename = f"{output_path}/{os.path.basename(image_filename)}_bboxes.png"
drawables = [(colors[i], _instances) for i, _instances in enumerate(instances)]
drawables.append((colors[-1], labels))
drawables.append((colors[-9], labels))
_draw_bbox_image(image=image,
filename=figure_filename,
draw_func=functools.partial(