diff --git a/deepface/models/face_detection/Yolo.py b/deepface/models/face_detection/Yolo.py index a0211ed4..77dd09b3 100644 --- a/deepface/models/face_detection/Yolo.py +++ b/deepface/models/face_detection/Yolo.py @@ -1,4 +1,5 @@ # built-in dependencies +import os from typing import Any, List # 3rd party dependencies @@ -58,7 +59,12 @@ def detect_faces(self, img: np.ndarray) -> List[FacialAreaRegion]: resp = [] # Detect faces - results = self.model.predict(img, verbose=False, show=False, conf=0.25)[0] + results = self.model.predict( + img, + verbose=False, + show=False, + conf=float(os.getenv("YOLO_MIN_DETECTION_CONFIDENCE", "0.25")), + )[0] # For each face, extract the bounding box, the landmarks and confidence for result in results: