From 09b16b34ea75d28c27755032abddca9e8e6d8d3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BF=9D=E4=BF=8A=E6=9D=89=EF=BC=88Sanders=20Bao=EF=BC=89?= Date: Wed, 10 Nov 2021 11:16:28 +0800 Subject: [PATCH] three bugs from issue#99 --- easymocap/assignment/associate.py | 4 ++-- easymocap/assignment/criterion.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/easymocap/assignment/associate.py b/easymocap/assignment/associate.py index 3dc6940..7321e88 100644 --- a/easymocap/assignment/associate.py +++ b/easymocap/assignment/associate.py @@ -18,7 +18,7 @@ def views_from_dimGroups(dimGroups): def set_keypoints2d(indices, annots, Pall, dimGroups): Vused = np.where(indices!=-1)[0] if len(Vused) < 1: - return [], [], [] + return [], [], [], [] keypoints2d = np.stack([annots[nv][indices[nv]-dimGroups[nv]]['keypoints'].copy() for nv in Vused]) bboxes = np.stack([annots[nv][indices[nv]-dimGroups[nv]]['bbox'].copy() for nv in Vused]) Pused = Pall[Vused] @@ -63,7 +63,7 @@ def simple_associate(annots, affinity, dimGroups, Pall, group, cfg): p = proposal.copy() p[nv] = col proposals_new.append(p) - proposals = proposals_new + proposals += proposals_new results = [] while len(proposals) > 0: proposal = proposals.pop() diff --git a/easymocap/assignment/criterion.py b/easymocap/assignment/criterion.py index 34d3743..88a5fc1 100644 --- a/easymocap/assignment/criterion.py +++ b/easymocap/assignment/criterion.py @@ -46,7 +46,7 @@ class CritLenTorso(BaseCrit): if (keypoints3d[[self.src, self.dst], -1] < self.min_conf).all(): # low confidence, skip return True - length = np.linalg.norm(keypoints3d[self.dst] - keypoints3d[self.src]) + length = np.linalg.norm(keypoints3d[self.dst, :3] - keypoints3d[self.src, :3]) self.log = '{}: {:.3f}'.format(self.name, length) if length < self.min_torso_length or length > self.max_torso_length: return False