Made labels more visible
Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
parent
5f7870b92f
commit
34d7128a1c
|
@ -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"
|
annotation_file_train = f"{coco_path}/annotations/instances_minival2014.json"
|
||||||
_, _, _, classes_to_names = get_coco_cat_maps_func(annotation_file_train)
|
_, _, _, 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)
|
os.makedirs(output_path, exist_ok=True)
|
||||||
with Image.open(image_filename) as _image:
|
with Image.open(image_filename) as _image:
|
||||||
np_image = np.array(_image, dtype=np.uint8)
|
np_image = np.array(_image, dtype=np.uint8)
|
||||||
image = Image.fromarray(np_image)
|
image = Image.fromarray(np_image)
|
||||||
figure_filename = f"{output_path}/{os.path.basename(image_filename)}_bboxes.png"
|
figure_filename = f"{output_path}/{os.path.basename(image_filename)}_bboxes.png"
|
||||||
drawables = [(colors[i], _instances) for i, _instances in enumerate(instances)]
|
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,
|
_draw_bbox_image(image=image,
|
||||||
filename=figure_filename,
|
filename=figure_filename,
|
||||||
draw_func=functools.partial(
|
draw_func=functools.partial(
|
||||||
|
|
Loading…
Reference in New Issue