Hi,
After a couple of break ins to vehicles and property in my street I thought it would be a good idea to set up the OpenCV component of HAss and have HAss notify me when it detects a face on a specific camera. I live in a quiet street so there’s not a lot of faces going past this camera.
I am, however, hitting two problems. My post here isn’t so much to ask the community to solve this for me - although if you could that would be great - but more to help me diagnose the problem(s) because I can’t see a way to get to the bottom of this.
I successfully set up the OpenCV component and got it to monitor my street-facing security camera. My configuration is on GitHub if you’d like to have a look.
My first problem is that HAss seems to be detecting faces everywhere. I get a notification every 15 to 20 seconds from the my automation but there’s no-one in the photo anywhere.
So reading through the docs I found this
Which is referenced at the bottom of the OpenCV entry in components. I know the instructions are unclear as mentioned in the comments at the bottom but by reading that and the HAss dev docs for custom components I installed this script and added the camera config.
When I restarted the camera config gave me an error. So I commented it out and restarted again. No errors on the logs. Long story short, I tried various things and then set the contents of opencv.py to garbage, my thinking being that HAss would try and load it and throw some sort of error.
So what it seems like to me is that the contents of ./custom_components/camera/opencv.py aren’t being loaded at all. It’s also possible that HAss has functionality that says “This is garbage I’m just going to ignore it” but if that’s the case, how do I diagnose problems with it?
In brief my thinking was too many notifications > probably the default cascade is too vague and it’s seeing a face in my neighbour’s tree> drawing a red box round what it thinks is a face will help me confirm that. But instead I’ve still got my original problem and I’ve uncovered another one.
Incidentally, the error that appears for the camera config is
Invalid config for [camera.opencv]: string value is None for dictionary value @ data['classifier']. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/camera.opencv/
But I’m assuming that’s because the opencv.py script doesn’t appear to be loading.
Grateful for any suggestions about other ways I can diagnose this (and advice on which cascades to use)
Thanks
Steve
P.S. I have a Docker server that has 128Gb of memory in it. Even with every other container stopped, when I tried to run FaceBox I got an error saying it couldn’t start because there isn’t enough memory. I’m only mentioning this to pre-empt “Have you tried Facebox” responses. I may try it again in the future when I’ve got time to figure out why 128Gb isn’t enough because TagBox looks interesting as well but for now I’m going to persevere with OpenCV.
