Skip to content

Commit

Permalink
Merge pull request #1364 from serengil/feat-task-1110-configurable-yo…
Browse files Browse the repository at this point in the history
…lo-args

min detection confidence score retrieved from env vars
  • Loading branch information
serengil authored Oct 12, 2024
2 parents 075d32b + 387ded5 commit 8b654f8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion deepface/models/face_detection/Yolo.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# built-in dependencies
import os
from typing import Any, List

# 3rd party dependencies
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 8b654f8

Please sign in to comment.