From b84201c0302e433c26a9f8bb7f5259d619d8b16c Mon Sep 17 00:00:00 2001 From: Weitheng Haw Date: Tue, 28 Jan 2025 09:34:35 +0000 Subject: [PATCH] Use constants --- frigate/data_processing/real_time/face_processor.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frigate/data_processing/real_time/face_processor.py b/frigate/data_processing/real_time/face_processor.py index da165c6a5..47abfdd9c 100644 --- a/frigate/data_processing/real_time/face_processor.py +++ b/frigate/data_processing/real_time/face_processor.py @@ -81,9 +81,9 @@ class FaceProcessor(RealTimeProcessorApi): self.face_detector = cv2.FaceDetectorYN.create( "/config/model_cache/facedet/facedet.onnx", config="", - input_size=(320, 320), - score_threshold=0.8, - nms_threshold=0.3, + input_size=FACE_INPUT_SIZE, + score_threshold=MIN_FACE_SCORE, + nms_threshold=NMS_THRESHOLD ) self.landmark_detector = cv2.face.createFacemarkLBF() self.landmark_detector.loadModel("/config/model_cache/facedet/landmarkdet.yaml") @@ -394,7 +394,7 @@ class FaceProcessor(RealTimeProcessorApi): face = img[face_box[1] : face_box[3], face_box[0] : face_box[2]] _, thumbnail = cv2.imencode( - ".webp", face, [int(cv2.IMWRITE_WEBP_QUALITY), 100] + ".webp", face, [int(cv2.IMWRITE_WEBP_QUALITY), FACE_QUALITY] ) # write face to library @@ -441,4 +441,4 @@ class FaceProcessor(RealTimeProcessorApi): if self.landmark_detector: self.landmark_detector = None if self.face_recognizer: - self.face_recognizer = None + self.face_recognizer = None \ No newline at end of file