robmarkcole / HASS-Deepstack-face

Home Assistant custom component for using Deepstack face recognition
https://community.home-assistant.io/t/face-and-person-detection-with-deepstack-local-and-free/92041
MIT License
218 stars 68 forks source link

Not getting events sometimes - No faces in picture ? #63

Open Ulrar opened 2 years ago

Ulrar commented 2 years ago

Hi,

Just set this up to try and recognize people from my unifi protect cameras, I want to replace the large number of person detected notifications I get from their system to something a bit smarter that won't spam me every time I step outside, I'd like to ignore known people and alert only on unknown faces.

The G4 Pros already do person detection, so I created an automation to run image_processing.scan on cameras reporting a person in frame every second until their detected object entity goes back to none. I then went and walked by one and saw some image_processing.detect_face events flow in : great.

Now someone else just walked by a camera, and the automation did trigger (a lot) of scans, but no events got generated. Looking at the recorded footage I suspect the issue is simply the angle, the person's face was almost always facing away from the camera which unfortunately is going to be true a lot of the time with this.

Is that correct, running a scan on a picture with no visible faces does nothing at all ? If so I'm thinking a separate event could be triggered when the scan completes saying no faces were found, that might be handy.

If there is indeed nothing returned when the face isn't visible then my plan B would be something like this :

A 'no face found' events could be nice here to avoid relying on a timeout, but that should be fine. From the perspective of someone who's been using this integration for more than 5 minutes, does the above make sense or am I missing something ?

Thanks !