From a4d95234be89ecb8f4377c718d18f9fc7a1d23ed Mon Sep 17 00:00:00 2001 From: lochhh Date: Tue, 7 Nov 2023 16:33:43 +0000 Subject: [PATCH] Log warning when assigning fixed conf scores --- movement/io/load_poses.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/movement/io/load_poses.py b/movement/io/load_poses.py index 590fd46e..f601474d 100644 --- a/movement/io/load_poses.py +++ b/movement/io/load_poses.py @@ -17,7 +17,7 @@ ValidPosesCSV, ValidPoseTracks, ) -from movement.logging import log_error +from movement.logging import log_error, log_warning logger = logging.getLogger(__name__) @@ -255,6 +255,11 @@ def _load_from_sleap_analysis_file( # Assume user-labelled and assign 1.0 as score mask = np.isnan(tracks[:, :, :, 1]) scores = np.where(mask, scores, 1.0) + log_warning( + f"Could not find confidence scores in {file.path}. " + "Assuming pose tracks are user-labelled and " + "assigning fixed confidence scores of 1.0." + ) return ValidPoseTracks( tracks_array=tracks.astype(np.float32), scores_array=scores.astype(np.float32), @@ -290,6 +295,11 @@ def _load_from_sleap_labels_file( if _sleap_labels_contains_user_labels_only(labels): tracks_with_scores = _sleap_user_labels_to_numpy(labels) + log_warning( + f"Could not find PredictedInstances in {file.path}. " + "Assuming pose tracks are user-labelled and " + "assigning fixed confidence scores of 1.0." + ) else: tracks_with_scores = labels.numpy( untracked=False, return_confidence=True