Spaces:
Running
Running
Oliver Nitsche Claude Sonnet 4.6 commited on
Commit ·
897c12b
1
Parent(s): 6026dde
Fix: always speak name after enrollment, even when face save fails
Browse filesThe enrollment loop was catching only ValueError, but add_face can also
raise OSError (from save()), onnxruntime errors, or numpy exceptions.
Any of those caused the exception to propagate past the loop, skipping
the speak("Nice to meet you, {name}!") call entirely.
Broadened the catch to Exception so that enrollment frame failures are
logged at DEBUG level but never prevent the robot from greeting the user.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- recognizer/main.py +2 -2
recognizer/main.py
CHANGED
|
@@ -177,8 +177,8 @@ class Recognizer(ReachyMiniApp):
|
|
| 177 |
try:
|
| 178 |
add_face(name, ef, face_db)
|
| 179 |
enrolled += 1
|
| 180 |
-
except
|
| 181 |
-
|
| 182 |
if enrolled == 0:
|
| 183 |
logger.warning("Enrollment failed: no face detected in captured frames")
|
| 184 |
enrollment_frames.clear()
|
|
|
|
| 177 |
try:
|
| 178 |
add_face(name, ef, face_db)
|
| 179 |
enrolled += 1
|
| 180 |
+
except Exception as exc:
|
| 181 |
+
logger.debug("Enrollment frame skipped: %s", exc)
|
| 182 |
if enrolled == 0:
|
| 183 |
logger.warning("Enrollment failed: no face detected in captured frames")
|
| 184 |
enrollment_frames.clear()
|