From 000bd7b09eb31cd056ee914bdacf9e24e2bfaca6 Mon Sep 17 00:00:00 2001 From: davidpagnon Date: Mon, 23 Sep 2024 00:47:02 +0200 Subject: [PATCH] fixed case where plucker coordinates are nan (caused person association to fail after sorting in multi-person) --- Pose2Sim/personAssociation.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Pose2Sim/personAssociation.py b/Pose2Sim/personAssociation.py index cf2d3a7..427e0f3 100644 --- a/Pose2Sim/personAssociation.py +++ b/Pose2Sim/personAssociation.py @@ -278,7 +278,11 @@ def compute_rays(json_coord, calib_params, cam_id): line = norm_Q - cam_center norm_line = line/np.linalg.norm(line) moment = np.cross(cam_center, norm_line) - plucker.append(np.concatenate([norm_line, moment, [likelihood[i]]])) + plucker_i = np.concatenate([norm_line, moment, [likelihood[i]]]) + if not np.isnan(plucker_i).any(): + plucker.append(plucker_i) + else: + plucker.append(np.array([0.0]*7)) return np.array(plucker)