diff --git a/utils/utils.py b/utils/utils.py index 642ebdba..a317b6ee 100755 --- a/utils/utils.py +++ b/utils/utils.py @@ -938,7 +938,7 @@ def plot_images(images, targets, paths=None, fname='images.jpg', names=None, max img = cv2.resize(img, (w, h)) mosaic[block_y:block_y + h, block_x:block_x + w, :] = img - if targets is not None: + if len(targets) > 0: image_targets = targets[targets[:, 0] == i] boxes = xywh2xyxy(image_targets[:, 2:6]).T classes = image_targets[:, 1].astype('int')