mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-18 17:14:26 +03:00
Use constants
This commit is contained in:
parent
aa5f7721b6
commit
b84201c030
@ -81,9 +81,9 @@ class FaceProcessor(RealTimeProcessorApi):
|
|||||||
self.face_detector = cv2.FaceDetectorYN.create(
|
self.face_detector = cv2.FaceDetectorYN.create(
|
||||||
"/config/model_cache/facedet/facedet.onnx",
|
"/config/model_cache/facedet/facedet.onnx",
|
||||||
config="",
|
config="",
|
||||||
input_size=(320, 320),
|
input_size=FACE_INPUT_SIZE,
|
||||||
score_threshold=0.8,
|
score_threshold=MIN_FACE_SCORE,
|
||||||
nms_threshold=0.3,
|
nms_threshold=NMS_THRESHOLD
|
||||||
)
|
)
|
||||||
self.landmark_detector = cv2.face.createFacemarkLBF()
|
self.landmark_detector = cv2.face.createFacemarkLBF()
|
||||||
self.landmark_detector.loadModel("/config/model_cache/facedet/landmarkdet.yaml")
|
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]]
|
face = img[face_box[1] : face_box[3], face_box[0] : face_box[2]]
|
||||||
_, thumbnail = cv2.imencode(
|
_, thumbnail = cv2.imencode(
|
||||||
".webp", face, [int(cv2.IMWRITE_WEBP_QUALITY), 100]
|
".webp", face, [int(cv2.IMWRITE_WEBP_QUALITY), FACE_QUALITY]
|
||||||
)
|
)
|
||||||
|
|
||||||
# write face to library
|
# write face to library
|
||||||
@ -441,4 +441,4 @@ class FaceProcessor(RealTimeProcessorApi):
|
|||||||
if self.landmark_detector:
|
if self.landmark_detector:
|
||||||
self.landmark_detector = None
|
self.landmark_detector = None
|
||||||
if self.face_recognizer:
|
if self.face_recognizer:
|
||||||
self.face_recognizer = None
|
self.face_recognizer = None
|
||||||
Loading…
Reference in New Issue
Block a user