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
parent
ea05d5cb6c
commit
5543b89466
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue