From febe26dd049fc851744eea099df92ea1fe6f2832 Mon Sep 17 00:00:00 2001 From: Stephane Chavin <stephane.chavin@lis-lab.fr> Date: Wed, 25 Oct 2023 16:57:48 +0200 Subject: [PATCH] modify --- overlay_annot_detect.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/overlay_annot_detect.py b/overlay_annot_detect.py index 3612db6..40453eb 100644 --- a/overlay_annot_detect.py +++ b/overlay_annot_detect.py @@ -52,9 +52,12 @@ def overlay_annotations(image_path, annotation_path, detection_path, output_dire cv2.putText(image, label, text_shape, cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255), 1) output_path = os.path.join(output_directory, f'{base_name}.jpg') + if not os.path.exists(output_directory): + os.mkdir(output_directory) + plt.imshow(image, cmap='jet') - plt.title('Blues : ANNOTATIONS; Greens : YOLO DETECTIONS', loc = 'center') - plt.subplots_adjust(top=1, bottom=0, left=0, right=1) + plt.title('Blues : ANNOTATION; Greens : YOLO DETECTION', loc = 'center') + plt.savefig(output_path) plt.close() -- GitLab