From 6a62c94190583cca257bb091c6ced9d9c3b2dd3d Mon Sep 17 00:00:00 2001 From: Laughing <61612323+Laughing-q@users.noreply.github.com> Date: Sat, 4 Feb 2023 20:21:30 +0800 Subject: [PATCH] fix zero labels (#10820) update --- utils/augmentations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/augmentations.py b/utils/augmentations.py index 1eae5db..7ab75f1 100644 --- a/utils/augmentations.py +++ b/utils/augmentations.py @@ -201,7 +201,7 @@ def random_perspective(im, # Transform label coordinates n = len(targets) if n: - use_segments = any(x.any() for x in segments) + use_segments = any(x.any() for x in segments) and len(segments) == n new = np.zeros((n, 4)) if use_segments: # warp segments segments = resample_segments(segments) # upsample