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.
pull/1298/head
google-labs-jules[bot] 2025-06-13 15:11:17 +00:00
parent b5294c6ca9
commit 0db2d109c8
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: if FACE_ANALYSER is None:
FACE_ANALYSER = insightface.app.FaceAnalysis(name='buffalo_l', providers=modules.globals.execution_providers) 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 return FACE_ANALYSER