dispatch event when an unknown face is detected#1362
Conversation
✅ Deploy Preview for viseron canceled.
|
There was a problem hiding this comment.
Pull request overview
This PR adds event dispatching for unknown face detections in the face recognition domain so consumers can react to “unknown” faces similarly to recognized faces.
Changes:
- Dispatch
EVENT_FACE_DETECTEDwhen an unknown face is found. - Include
EventFaceDetectedpayload for unknown face events.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| self._vis.dispatch_event( | ||
| EVENT_FACE_DETECTED.format( | ||
| camera_identifier=self._camera.identifier, face=UNKNOWN_FACE | ||
| ), | ||
| EventFaceDetected( | ||
| camera_identifier=self._camera.identifier, | ||
| face=face_dict, | ||
| ), | ||
| ) |
|
Thank you! Any specific reason you didnt make it expire like known faces? |
|
I'm new to Viseron and python and wasn't aware of that timer. I will implement that now and update my PR |
Mirror known_face_found behavior: cancel any existing timer for UNKNOWN_FACE, start the new expiry timer, save the snapshot only once until expired, and store the face dict in self._faces so that expire_face(UNKNOWN_FACE) can properly emit EVENT_FACE_EXPIRED without raising a KeyError.
…com/snaquaye/viseron into feature/unknown_face_detected_event
|
|
||
| if self._config[CONFIG_SAVE_UNKNOWN_FACES]: | ||
| # Only store face once until it is expired | ||
| if ( |
There was a problem hiding this comment.
I think it is best to revert this if statement since this would be a change in behaviour.
Before the change, every unknown face would be stored.
After the change, only one unknown face would be saved until the expiry timer hits.
Otherwise i think it looks good! If you can fix that i can merge this
No description provided.