From eba2a958d3ad73085a4676198f0c197d2b2a842a Mon Sep 17 00:00:00 2001 From: Cocoon-Break <54054995+kuishou68@users.noreply.github.com> Date: Tue, 14 Jul 2026 11:51:43 -0400 Subject: [PATCH] fix: skip empty face clusters in default_target_face (#1757) Skip face clusters when no best face was detected, preventing a NoneType error while preserving normal face-detection behavior. Closes #1755 --- modules/face_analyser.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/face_analyser.py b/modules/face_analyser.py index b2e48f7..51fa5ea 100644 --- a/modules/face_analyser.py +++ b/modules/face_analyser.py @@ -335,6 +335,9 @@ def default_target_face(): best_frame = frame break + if best_face is None: + continue # No faces detected in this cluster — skip + for frame in map['target_faces_in_frame']: for face in frame['faces']: if face['det_score'] > best_face['det_score']: