Presence awareness by face recognition

OK I got the openCV component running on my pi3 with Sketch by following this guide

Works nicely!

4 Likes

Of interest:

1 Like

Watched the whole video on hackster.io! Thanks for sharing. This project is a very nice summary of how to build a basic camera with object detection with OpenCV. In this case humans. The next step is to find an OpenCV setup that can detect humans with training data (pictures stored in a folder) and names in database. With the goal to detect for example if Jeff, John Doe or a stranger is walking into a room. The video links I posted earlier can help with that but a working setup/video demo would be nice to check how fast/reliable the opencv software works.

You mean a custom classifier? I’m running OpenCV on a pi3 with HA and the OpenCV component. Obviously this is pretty computationally intensive for the Pi but it does work. Whether a pi3 is powerful enough for your requirements would require testing.

Yes. If I’m correct the classifier is the smart part of OpenCV. Finding the right one that works nice and reliable is indeed a matter of testing and tweaking I guess. Unfortunately I don’t have a spare PI3 so I can’t help with testing. But if I find a setup that does want we want to then I let you guys know.

Checkout this thread for some info on classifiers:

Also:

http://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_objdetect/py_face_detection/py_face_detection.html#face-detection

Could train the classifier on your desktop pc the estimate the CPU requirements for deployment

This looks very relevant:

1 Like

That’s a very good example of a facial recognition system. And with a decent % of good results in recognition of known faces. Not sure if that percentage is usable for home automation (yet). And the CPU load is another thing. 2 or 3 camera’s running with face recognition is heavy…even for a macbook ;-). The Pi is used for less CPU intensive tasks in this setup. Good find @robmarkcole!!

1 Like

Found this nice tutorial for facial recognition on a pi using Google cloud service:

I’ve heard that Arlo Q security camera or the Q Plus (can’t remember the exact model) has this feature. Has anyone ever used a security camera with this feature? How effective/save is it?

That looks good… Hopefully there is a local version.

We can probably use Openface with a command line sensor.

1 Like

Thanks @arsaboo Openface on Docker was straightforward to get running on my Mac. This is the package which home_surveillance uses

I’ve started looking into Clarifai for facial recognition, appears to work well even in low light. The main limitation with this service is that you only get 5000 requests per month on the free tier, so approximately 1 request every 10 minutes.

Some of my code is on Github

Takes approximately 7 seconds to perform the facial recognition from a local file, and the bounding box is returned by the API.

Update: Clarifai is one of the slower cloud classifiers

https://blog.filestack.com/thoughts-and-knowledge/comparing-google-vision-microsoft-cognitive-amazon-rekognition-clarifai/

Does the 7 second delay depend on the processing speed of the host machine? 7 seconds delay makes it less useful for any automation.

The processing is on the Clarifai servers, so 7 seconds is from submission of the image to return of the result. Its certainly not good enough for video rate (which is not what I had in mind anyway) but probably adequate for unlocking a security system. Clarifai is interesting as it offers many models, not just facial recognition, and one can also train custom models.

I am interested to try the dlib (runs locally so probably comparable to openCV) and microsoft (following Microsoft own tutorial I can’t get this to work) components to see how they perform. With several cloud services offering similar recognition services, it must be that speed becomes a selling point. Cloud also appeals as less/no effort to maintain. Google an amazon also offer facial recognition API

I have been using dlib and OpenCV and their detection is far from ideal (or may be I have not configured them correctly). But, I still feel we should be able to use some of the local image_processing components or have some new one (we need a decent TensorFlow implementation).

1 Like

Agreed, I don’t have the patience for 7-10 second waiting times

What hardware do you have processing the OpenCV library? Is this leading to your far from ideal situation? I plan to have a dedicated Rpi Zero to process images I send to it so I’m curious about your experience.

I am using the Skull Canyon (Intel NUC; i7 and 32GB RAM).