Skip to content

Commit

Permalink
min detection confidence score retrieved from env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
serengil committed Oct 11, 2024
1 parent 075d32b commit 387ded5
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 387ded5

Please sign in to comment.