diff --git a/utils/datasets.py b/utils/datasets.py index 07647166..81371c8f 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -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]