From eb83c132d52dfb79843f8f09dcece1a296156ec8 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Tue, 19 Nov 2024 16:46:59 -0700 Subject: [PATCH] Formatting --- frigate/util/model.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frigate/util/model.py b/frigate/util/model.py index 6badb8547..8aa2545ce 100644 --- a/frigate/util/model.py +++ b/frigate/util/model.py @@ -229,11 +229,13 @@ class FaceClassificationModel: self.__build_classifier() cosine_index = self.labeler.transform([sub_label])[0] - probabilities: list[float] = self.classifier.predict_proba([embedding])[0] + probabilities: np.ndarray = self.classifier.predict_proba([embedding])[0] svc_probability = max(probabilities) - logger.debug(f"SVC face classification probability: {svc_probability} and index match: {cosine_index} / {probabilities.index(svc_probability)}") + logger.debug( + f"SVC face classification probability: {svc_probability} and index match: {cosine_index} / {np.where(probabilities == svc_probability)[0]}" + ) - if cosine_index == probabilities.index(svc_probability): + if cosine_index == np.where(probabilities == svc_probability)[0]: return ( sub_label, min(avg_score, svc_probability),