Fix a visualization bug (#11134)

Fix a visualization bug reported here: https://github.com/ultralytics/yolov5/issues/11133

Signed-off-by: Sheng Hu <husheng_7@163.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
pull/11154/head
Sheng Hu 2023-03-10 06:55:02 +08:00 committed by GitHub
parent ea05d5cb6c
commit 5543b89466
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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