Browse Source

Mosaic plots bug fix (#1526)

5.0
Glenn Jocher GitHub 4 years ago
parent
commit
2c3efa430b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      utils/plots.py

+ 3
- 0
utils/plots.py View File

@@ -140,6 +140,9 @@ def plot_images(images, targets, paths=None, fname='images.jpg', names=None, max
labels = image_targets.shape[1] == 6 # labels if no conf column
conf = None if labels else image_targets[:, 6] # check for confidence presence (label vs pred)

if boxes.max() <= 1: # if normalized
boxes[[0, 2]] *= w # scale to pixels
boxes[[1, 3]] *= h
boxes[[0, 2]] += block_x
boxes[[1, 3]] += block_y
for j, box in enumerate(boxes.T):

Loading…
Cancel
Save