From e07976945f23001279c9c0fa95124c0370cd6ead Mon Sep 17 00:00:00 2001 From: James Cotton Date: Thu, 22 Sep 2022 16:36:02 +0000 Subject: [PATCH] fix criterion crash for poor visibility --- easymocap/assignment/criterion.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/easymocap/assignment/criterion.py b/easymocap/assignment/criterion.py index 88a5fc1..bfd61f9 100644 --- a/easymocap/assignment/criterion.py +++ b/easymocap/assignment/criterion.py @@ -76,6 +76,8 @@ class CritMinMax(BaseCrit): def __call__(self, keypoints3d, **kwargs): idx = keypoints3d[..., -1] > self.min_conf k3d = keypoints3d[idx, :3] + if sum(idx) == 0: + return False mink = np.min(k3d, axis=0) maxk = np.max(k3d, axis=0) length = max(np.abs(maxk - mink))