From 433ee15275766f12f1850c8392e250ff1d9a10a1 Mon Sep 17 00:00:00 2001 From: Jozef Huscava <48366209+JoeApo108@users.noreply.github.com> Date: Sun, 12 Jul 2026 14:37:06 +0200 Subject: [PATCH] Make face detection_threshold effective below 0.5 FaceDetectorYN was created with a hardcoded score_threshold of 0.5, so configured face_recognition.detection_threshold values below 0.5 had no effect: lower-confidence faces were discarded inside OpenCV before the config threshold was applied as a post-filter. On cameras with low-resolution detect streams (e.g. 736x416 substreams), real faces routinely score 0.3-0.5 in YuNet, so face recognition never ran on them even though the embedding model handles such crops well. Cap the internal threshold at the configured value instead. --- frigate/data_processing/real_time/face.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frigate/data_processing/real_time/face.py b/frigate/data_processing/real_time/face.py index 83c8a2e55a..0109e03370 100644 --- a/frigate/data_processing/real_time/face.py +++ b/frigate/data_processing/real_time/face.py @@ -127,7 +127,7 @@ class FaceRealTimeProcessor(RealTimeProcessorApi): os.path.join(MODEL_CACHE_DIR, "facedet/facedet.onnx"), config="", input_size=(320, 320), - score_threshold=0.5, + score_threshold=min(0.5, self.face_config.detection_threshold), nms_threshold=0.3, ) self.faces_per_second.start()