glenn-jocher commited on
Commit
2c3efa4
1 Parent(s): 12499f1

Mosaic plots bug fix (#1526)

Browse files
Files changed (1) hide show
  1. utils/plots.py +3 -0
utils/plots.py CHANGED
@@ -140,6 +140,9 @@ def plot_images(images, targets, paths=None, fname='images.jpg', names=None, max
140
  labels = image_targets.shape[1] == 6 # labels if no conf column
141
  conf = None if labels else image_targets[:, 6] # check for confidence presence (label vs pred)
142
 
 
 
 
143
  boxes[[0, 2]] += block_x
144
  boxes[[1, 3]] += block_y
145
  for j, box in enumerate(boxes.T):
 
140
  labels = image_targets.shape[1] == 6 # labels if no conf column
141
  conf = None if labels else image_targets[:, 6] # check for confidence presence (label vs pred)
142
 
143
+ if boxes.max() <= 1: # if normalized
144
+ boxes[[0, 2]] *= w # scale to pixels
145
+ boxes[[1, 3]] *= h
146
  boxes[[0, 2]] += block_x
147
  boxes[[1, 3]] += block_y
148
  for j, box in enumerate(boxes.T):