From f9b236a6cdeec84555b17f9ba94c5722d9940648 Mon Sep 17 00:00:00 2001 From: David PAGNON Date: Mon, 19 Feb 2024 13:28:23 +0100 Subject: [PATCH] Check for consistent camera number --- Pose2Sim/personAssociation.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Pose2Sim/personAssociation.py b/Pose2Sim/personAssociation.py index 041f00b..f79db7a 100644 --- a/Pose2Sim/personAssociation.py +++ b/Pose2Sim/personAssociation.py @@ -307,6 +307,12 @@ def track_2d_all(config): f_range = [[min([len(j) for j in json_files])] if frame_range==[] else frame_range][0] n_cams = len(json_dirs_names) error_min_tot, cameras_off_tot = [], [] + + # Check that camera number is consistent between calibration file and pose folders + if n_cams != len(P): + raise Exception(f'Error: The number of cameras is not consistent:\ + Found {len(P)} cameras in the calibration file,\ + and {n_cams} cameras based on the number of pose folders.') for f in tqdm(range(*f_range)): json_files_f = [json_files[c][f] for c in range(n_cams)]