mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-11-19 15:23:20 +00:00
Ensure that a negative score can not be sent (#20483)
This commit is contained in:
1 parent
a96a617fc9
commit
c091b10df9
1 file changed
+2
-2
@@ -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))
|
||||
Reference in new issue
Block a user