Merge pull request #1364 from serengil/feat-task-1110-configurable-yolo-args

min detection confidence score retrieved from env vars
This commit is contained in:
Sefik Ilkin Serengil 2024-10-12 08:51:22 +01:00 committed by GitHub
commit 8b654f8cc4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,5 @@
# built-in dependencies
import os
from typing import Any, List
# 3rd party dependencies
@ -58,7 +59,12 @@ class YoloClient(Detector):
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: