From f373764e4d4376e469f20dab527dd3444c0a5fa8 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sun, 8 Dec 2019 12:26:31 -0800 Subject: [PATCH] updates --- utils/datasets.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/datasets.py b/utils/datasets.py index c82abea4..3f1e1799 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -677,8 +677,8 @@ def random_affine(img, targets=(), degrees=10, translate=.1, scale=.1, shear=10, # xy = np.concatenate((x - w / 2, y - h / 2, x + w / 2, y + h / 2)).reshape(4, n).T # reject warped points outside of image - xy[:, [0, 2]] = xy[:, [0, 2]].clip(0, width) - xy[:, [1, 3]] = xy[:, [1, 3]].clip(0, height) + np.clip(xy[:, [0, 2]], 0, width, out=xy[:, [0, 2]]) + np.clip(xy[:, [1, 3]], 0, height, out=xy[:, [1, 3]]) w = xy[:, 2] - xy[:, 0] h = xy[:, 3] - xy[:, 1] area = w * h