Skip to content

NVR with realtime local object detection for IP cameras

Ensure that a negative score can not be sent (#20483)

Nicolas Mowenc091b10df932
diff --git a/frigate/data_processing/common/face/model.py b/frigate/data_processing/common/face/model.py
index 68a5681c35..51ee649380 100644
--- a/frigate/data_processing/common/face/model.py
+++ b/frigate/data_processing/common/face/model.py
@@ -262,7 +262,7 @@ class FaceNetRecognizer(FaceRecognizer):
score = confidence
label = name
- return label, round(score - blur_reduction, 2)
+ return label, max(0, round(score - blur_reduction, 2))
class ArcFaceRecognizer(FaceRecognizer):
@@ -370,4 +370,4 @@ class ArcFaceRecognizer(FaceRecognizer):
score = confidence
label = name
- return label, round(score - blur_reduction, 2)
+ return label, max(0, round(score - blur_reduction, 2))