From 5543b89466d072a9f8f2e31f8257a1ccc7f588e9 Mon Sep 17 00:00:00 2001 From: Sheng Hu Date: Fri, 10 Mar 2023 06:55:02 +0800 Subject: [PATCH] Fix a visualization bug (#11134) Fix a visualization bug reported here: https://github.com/ultralytics/yolov5/issues/11133 Signed-off-by: Sheng Hu Co-authored-by: Glenn Jocher --- utils/segment/plots.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/segment/plots.py b/utils/segment/plots.py index 3ba097624fcd..1b22ec838ac9 100644 --- a/utils/segment/plots.py +++ b/utils/segment/plots.py @@ -54,7 +54,7 @@ def plot_images_and_masks(images, targets, masks, paths=None, fname='images.jpg' x, y = int(w * (i // ns)), int(h * (i % ns)) # block origin annotator.rectangle([x, y, x + w, y + h], None, (255, 255, 255), width=2) # borders if paths: - annotator.text((x + 5, y + 5 + h), text=Path(paths[i]).name[:40], txt_color=(220, 220, 220)) # filenames + annotator.text((x + 5, y + 5), text=Path(paths[i]).name[:40], txt_color=(220, 220, 220)) # filenames if len(targets) > 0: idx = targets[:, 0] == i ti = targets[idx] # image targets