Face and person detection with Deepstack - local and free!

OK just released v0.5 which adopts the new file structure required for custom components, please upgrade to avoid warnings in the logs. I also tested against the latest deepstack image and all is good

@robmarkcole, my changes available in the following repo, you are more than welcome to merge them into yours :slight_smile:

on top of the original integration I made the following changes:

  • Removed by default displaying response time
  • Support admin/api keys
  • Support face endpoints - list, register, recognize, delete
  • Support backup / restore endpoints
  • Added SSL flag to define whether the URL should be accesible with HTTPS, by default (since there’s no support for that :slight_smile:) it set to False

HA Events:

  • EVENT_DETECT_FACE - when face found and in the confidence level defined
  • EVENT_UNKNOWN_FACE_DETECT - when face is found but not recognized or lower than confidence level

HA Services:

  • Change confidence level (default is 80), I use it when there’s no light to reduce the level by 5 precent
  • Display response time (True / False)
  • Register face (name and path)
  • Delete face (name)
  • Backup (available only if admin_key provided)
  • Restore (available only if admin_key provided)

Configuration:
deepstack:
host: !secret deepstack_host (Required)
port: !secret deepstack_port (Required)
ssl: !secret deepstack_is_ssl (Optional)
admin_key: !secret deepstack_admin_key (Optional)
api_key: !secret deepstack_api_key (Optional)
unknown_directory: !secret deepstack_unknown_faces_directroy (Optional)

image_processing:

  • platform: deepstack
    scan_interval: 1
    source:
    • entity_id: !secret deepstack_camera_entity_id
      name: !secret deepstack_camera_name
2 Likes

@bar good work, be good to roll this into an official component soon, although I have been waiting for the stable deepstack release.
Cheers

Great Work!

New Features, Performance Improvements and More With DeepStack 3.4

Hi everyone!

Thanks for all the feedbacks and support. We are happy to announce the latest updates to DeepStack.
We have reviewed the feedbacks and requests and have addressed most of them in the latest 3.4 release.
Here are the core changes.

Speed and Performance

The speed of the detection and face APIs including recognition and face detection have been increased by 2X on the cpu version.
The GPU version has also been improved to better utilize the GPU for high volume requests.

The CPU overuse issues have also been resolved and DeepStack no longer uses much CPU when idle.

No AVX Support

We have added support for older systems with no avx optimization enabled.
On the DeepStack’s docker page https://hub.docker.com/r/deepquestai/deepstack/tags
you will find noavx tags with support for older systems. Note however that the noavx tags are not as fast as the standard tags.

Universal Custom Model Support

DeepStack now supports deploying custom ONNX, Keras and Tensorflow image recognition models.
With the ONNX support, you can train an image recognition model in almost any deep learning framework including Pytorch, MxNet, CNTK etc and deploy them for high speed inference using DeepStack.

See the custom models page for more info.

http://dev.deepstack.cc/docs/python/custommodels.html
http://dev.deepstack.cc/docs/nodejs/custommodels.html
http://dev.deepstack.cc/docs/csharp/custommodels.html

Note also that we plan to release support for custom object detection in coming weeks as well as a number of open source tools to facilititate training of your own custom models for deployment with deepstack.

Discounted Pricing

We have reviewed the pricing for the premium version and for a limited time, the premium can be purchased for only 9$.

Thank you so much for always for your patience and for helping us improve DeepStack with your requests and feedbacks.

Support for non-docker platforms, NCS acceleration and support for embedded devices are highly requested features that we shall be addressing in coming weeks.

We have so much more coming and we look forward to the great things you will build with DeepStack.

DeepStack Forum

Questions about DeepStack, feature requests and feedbacks can now be posted in the official forum.

If yet to join, do join the forum, we would be happy to hear from you.

2 Likes

Merged the deepstack_object image_processing component into deepstack and created README with all the details

Added also capability to define multiple targets according to the list in DeepStack Developer Portal

3 Likes

All please update to v0.6 for compatability with HA 0.92.
Thanks

2 Likes

Does one need the key for deepstack to work now? Im always getting 0 faces in home assistant but i can see all the image recognition requests going past in the terminal window.

[GIN] 2019/04/29 - 21:22:22 | 200 | 15.305µs | 192.168.2.36 | POST /v1/vision/detection
[GIN] 2019/04/29 - 21:22:30 | 200 | 14.361µs | 192.168.2.36 | POST /v1/vision/face/recognize

Also seeing this error in Home Assistant logs:

Log Details (ERROR)
Mon Apr 29 2019 23:38:41 GMT+0200 (South Africa Standard Time)
Update for image_processing.person_detector fails
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py”, line 220, in async_update_ha_state
await self.async_device_update()
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py”, line 375, in async_device_update
await self.async_update()
File “/usr/local/lib/python3.7/site-packages/homeassistant/components/image_processing/init.py”, line 132, in async_update
await self.async_process_image(image.content)
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/deepstack_object/image_processing.py”, line 115, in process_image
predictions_json = response.json()[“predictions”]
KeyError: ‘predictions’

1 Like

Their API has not changed, but I did not read in detail about changes to the services on the free tier

1 Like

So “Deepstack - local and free” is looking a bit dodgy. Considering they claim to be about to open source their product, how the hell are they going to be able to charge?

I suspect this “open sourcing” is a have.

Thanks Rob.
So would these errors be consistent with not having a key? I tried to get one but the site rejected my email account. Also tried to drop a message via their support page but it timed out. Guess I will need hit the deepstack forum next.

1 Like

Managed to get a key just using a gmail account. Seems that their system doesn’t like my email suffix.
Still having those same errors come up in the HomeAssistant log. Can anyone push me in the right direction of where to go next?

@calypso without testing I am just speculating, their forums might be a better source of info

1 Like

In the end it was just because DeepStack was not accepting the key. They managed to fix it and now everything is working.

2 Likes

OK face detection and person detection working fine. Only thing I cam struggling with no is registering faces via HA. Is someone could please share an example of the YAML they used to I can figure out where to start.

1 Like

Anyone noticing a memory leak here? Im just seeing it grow day after day.
Running off an 8 gig unraid box.

Often people think there is a memory leak on Linux because it aggressively buffers. One would need to look at your top output for a while to really know.

There is a small memory leak, memory keeps growing until I restart the container, but it’s just about 100 MB a day (using GPU version)

systems

1 Like

Doesn’t prove anything.

Have you raised this on the Deepstack forums?