This commit is contained in:
Glenn Jocher 2018-08-26 23:59:13 +02:00
parent 2769d79d05
commit a660211733
1 changed files with 1 additions and 1 deletions

View File

@ -270,7 +270,7 @@ def random_affine(img, targets=None, degrees=(-10, 10), translate=(.1, .1), scal
h = xy[:, 3] - xy[:, 1]
area = w * h
ar = np.maximum(w / (h + 1e-16), h / (w + 1e-16))
i = (w > 4) & (h > 4) & (area / area0 > 0.1) & (ar < 10)
i = (w > 4) & (h > 4) & (area / (area0 + 1e-16) > 0.1) & (ar < 10)
targets = targets[i]
targets[:, 1:5] = xy[i]