Presence awareness by face recognition

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).

OK so tried out Google Cloud Vision could API. Appears to be quite fast, but time varies quite a lot. Fastest to upload file and return result was about 0.5 sec, and slowest about 5 seconds.
Overall once you have it configured, Google Vision is quite a nice API. However I found it easier to get started with Clarifai.

https://github.com/robmarkcole/Useful-python/tree/master/Google%20Vision

Today I was looking for a DIY Thermal Image camera for detecting presence of people in a room. I found Max Ritters open-source solution on Github.

Looks interesting, have you built one?

Nope. Just researching what is out there.

OK I have a proof-of-principle for image classification using Clarifai:

1 Like

Are you using it with a camera feed or manually saved image files? I guess, we can use the camera.snapshot service to save image files and use it.

Right now it’s iust a proof of principle with a saved image

How often is the API call made? The default scan_interval is 30 seconds, so it should make 2 calls every minute?

Right now it just makes a single call in start up. This isn’t a component yet, just a proof of principle. Need to decide the vest way to implement, as you don’t want to make too many requests to the cloud API on the free tier

We should make the call when the file is updated. That will be the most logical approach.

1 Like

Worth a read:

https://blogs.technet.microsoft.com/machinelearning/2018/03/01/now-available-access-to-source-code-demos-of-ai-infused-apps/

Hey Rob,

Have you got any experience with this?

https://github.com/intel-iot-devkit/reference-implementation/tree/master/face-access-control

It has mqtt and if possible to pipe some camera feeds into it. That would be awsome!!

Thinking of getting myself a NUC if anyone can get this working with Home Assistant.

No experience myself but looks interesting