Face and person detection with Deepstack - local and free!

Anyone have any sample of automations for person and face detection? This is as far as I’ve gotten but it isn’t detecting people.

- alias: Image scan when motion detected front door
  trigger:
    - platform: state
      entity_id: sensor.front_door_motion_detected
      to: 'true'
  action:
    - service: image_processing.scan
      entity_id: image_processing.front_door_person_detector
    - delay: 00:00:02
    - service_template: '{% if states.image_processing.front_door_person_detector != "unknown" %} notify.ios_jon_iphone {% endif %}'
      data_template:
        message: "Person detected at the front door"

I figured it out with some help, the state of the person detector is a string not an int. So I need to convert it to int to compare to 0

{% if (states.image_processing.front_door_person_detector.state | int) > 0 %} notify.ios_jon_iphone {% endif %}

1 Like

This component is a WIP - will add events in future release

Possibly stupid question - but what sort of cameras are best to use with this for occupancy detection in a room? Any recommendations?

I’m using Hikvision DS-2CD2132F-IS.

It really shouldn’t matter which camera, although obviously the image quality (illumination of scene etc) will make a difference

1 Like

Hi @arsaboo , it’s great to know. I am the CEO of DeepQuest AI, the company building DeepStack.

We will love to hear your findings on the comparison.

5 Likes

Thanks very much @mayker . I am the CEO of DeepQuest AI, the company building DeepStack.

Updates will be made to DeepStack soon with more APIs and Admin UI added.

5 Likes

Dusted down an old Mac with Ubuntu and running deepstack on it, getting sub second responses :slight_smile: I am curious what other hardware people are using to run Deepstack?

1 Like

This is cool! Great work trying that out.

DeepStack works best on Ubuntu because Docker is well optimized for Linux systems, allowing the full potentials of DeepStack to manifest.

For much higher performance, we also provide a version of DeepStack that leverages NVIDIA GPUs to provide 10X and more performance on both Linux and Windows systems. Installation guide for this can be found in the documentations linked below.

Python Documentation: https://deepstackpython.readthedocs.io

NodeJS Documentation: https://deepstacknodejs.readthedocs.io

C# Documentation: https://deepstackcsharp.readthedocs.io

Mine is running on a 10 year old desktop . Seem to work great.

1 Like

Right - more clearer then…which cameras actually work well with HomeAssistant? Do any of them support live streaming?

I have all my camera connected through zoneminder, I have minder event server turned on , it sends a MQTT message to HASS when it see motion in the ZM zones. I use the motion detection to trigger the image_processing.scan service

Doesn’t that defy the point of occupancy detection? You’re having to move to scan the picture. This sounds like it works as a very complicated PIR, unless you just want it for face detection?

I want it to sense if someone is in the room or not live so i can do proper accurate occupancy stuff.

1 Like

I don’t use it for occupancy detection , all my camera are outside. When I am not at home I want to know what/who is in the yard or drive way or how many people are at the front door.

2 Likes

@TheDanShepherd cameras on the HA front end update 1 fps, so not exactly a live stream, but usable. I believe there are improvements in the pipeline. Personally I am using $10 USB webcams

2 Likes

Would it be possible (noob here), to make a short video of how you got it up and running on the Linux on your Mac?
Just the deepstack part and the link to HA?

Thanks really cool feature!!

1 Like

Just my two cents, but the person needs to get into the room somehow, so the initial motion could trigger taking a snapshot of the room. Which is then analyzed for occupancy and stored in a sensor. Or if you want to just use a live stream, just have it analyze the feed in real time.

1 Like

@Yoinkz theres many ways you could go about it, I actually replaced the whole OSX with Ubuntu, but equally you could run in Virtualbox. Then, I just followed the Deepstack docs, simples :slight_smile:

1 Like

Makes sense.

I think for my room occupany stuff it would be best to have perhaps two cameras. One in the corner of the room looking over everything and one along the desk checking to see if anyone is sat down. The one in the corner would probably miss someone sat at the desk as its going to be almost behind a large chair.

I guess a standard PIR to capture initial movement for turning lights on quickly would complete the package.

It’s either than or a mixture of an IR beam and motion sensors.

1 Like