mirror of
https://github.com/serengil/deepface.git
synced 2025-06-07 03:55:21 +00:00
Merge pull request #1362 from tyasnk/configurable-mediapipe-params
Configurable mediapipe params
This commit is contained in:
commit
075d32ba38
@ -1,4 +1,5 @@
|
||||
# built-in dependencies
|
||||
import os
|
||||
from typing import Any, List
|
||||
|
||||
# 3rd party dependencies
|
||||
@ -32,7 +33,14 @@ class MediaPipeClient(Detector):
|
||||
) from e
|
||||
|
||||
mp_face_detection = mp.solutions.face_detection
|
||||
face_detection = mp_face_detection.FaceDetection(min_detection_confidence=0.7)
|
||||
|
||||
min_detection_confidence = float(os.environ.get("MEDIAPIPE_MIN_DETECTION_CONFIDENCE", 0.7))
|
||||
model_selection = int(os.environ.get("MEDIAPIPE_MODEL_SELECTION", 0))
|
||||
|
||||
face_detection = mp_face_detection.FaceDetection(
|
||||
min_detection_confidence=min_detection_confidence,
|
||||
model_selection=model_selection
|
||||
)
|
||||
return face_detection
|
||||
|
||||
def detect_faces(self, img: np.ndarray) -> List[FacialAreaRegion]:
|
||||
|
Loading…
x
Reference in New Issue
Block a user