From 3ffd39fe1776e7747d5dc7415627811af683cf19 Mon Sep 17 00:00:00 2001 From: davidpagnon Date: Tue, 5 Mar 2024 01:35:06 +0100 Subject: [PATCH] fixed error when comparing lists with nana --- Pose2Sim/personAssociation.py | 8 ++++---- setup.cfg | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pose2Sim/personAssociation.py b/Pose2Sim/personAssociation.py index 6a13043..8874fa6 100644 --- a/Pose2Sim/personAssociation.py +++ b/Pose2Sim/personAssociation.py @@ -317,10 +317,10 @@ def best_persons_and_cameras_combination(config, json_files_framef, personsIDs_c comb_ok = np.concatenate((comb_ok, [comb[0]])) except: break - sorted_pruned_idx = [comb_errors_below_thresh.index(c.tolist()) for c in comb_ok] - errors_below_thresh = np.array(errors_below_thresh_sorted)[sorted_pruned_idx] - comb_errors_below_thresh = np.array(comb_errors_below_thresh)[sorted_pruned_idx] - Q_kpt = Q_kpt[sorted_pruned_idx] + sorted_pruned_idx = [i for i, x in enumerate(comb_errors_below_thresh) for c in comb_ok if np.array_equal(x,c,equal_nan=True)] + errors_below_thresh = np.array(errors_below_thresh_sorted)[sorted_pruned_idx].tolist() + comb_errors_below_thresh = np.array(comb_errors_below_thresh)[sorted_pruned_idx].tolist() + Q_kpt = Q_kpt[sorted_pruned_idx].tolist() # Remove indices already used for a person personsIDs_combinations = np.array([personsIDs_combinations[i] for i in range(len(personsIDs_combinations)) diff --git a/setup.cfg b/setup.cfg index 2cf28eb..7a55c70 100644 --- a/setup.cfg +++ b/setup.cfg @@ -32,7 +32,7 @@ zip_safe = False python_requires = >=3.8 install_requires = toml - numpy + numpy>=1.19 opencv-python lxml matplotlib