Compare commits

..

2 Commits

Author SHA1 Message Date
rehanbgmi 54f914c62f
Merge 0db2d109c8 into 745d449ca6 2025-06-13 23:16:57 +08:00
google-labs-jules[bot] 0db2d109c8 fix: Lower face detection threshold for improved reliability
Modifies modules/face_analyser.py to set det_thresh=0.4
(down from the default of 0.5) when preparing the
insightface.app.FaceAnalysis model.

This change aims to make face detection more sensitive,
particularly for webcam feeds under varied conditions, to reduce
instances of "Face detection failed for target or source" errors.
2025-06-13 15:11:17 +00:00
1 changed files with 2 additions and 1 deletions

View File

@ -20,7 +20,8 @@ def get_face_analyser() -> Any:
if FACE_ANALYSER is None:
FACE_ANALYSER = insightface.app.FaceAnalysis(name='buffalo_l', providers=modules.globals.execution_providers)
FACE_ANALYSER.prepare(ctx_id=0, det_size=(640, 640))
# Lowered detection threshold for potentially better webcam face detection (default is 0.5)
FACE_ANALYSER.prepare(ctx_id=0, det_size=(640, 640), det_thresh=0.4)
return FACE_ANALYSER