Face and person detection with Deepstack - local and free!

when using `

sudo docker run -v localstorage:/datastore -p 5000:5000 deepquestai/deepstack

` getting that error

standard_init_linux.go:207: exec user process caused "exec format error"

Hello Guys,

Just wondering if anyone got deepstack component to work with A ring camera. I am unable to teach a face. I run my instance on Ubuntu 18.02 in docker and when I use image_processing_teach_face nothing happens and do not even get a message in my logs

Thanks in advance

looking awsome, could yuo add support for custom_updater: so it’s easy to see whrn there is an update? thanks :slight_smile:
Or perhaps switching to something else like HACS, i think custom_updater won’t get many updates.

Hi all
I just released v0.7 which adds an event that is fired when objects are detected, allowing notifications to be fired when target objects are detected. I still need to figure out how to include the camera image in notifications, perhaps someone in the community already knows :slight_smile:

Event image_processing.object_detected

An event image_processing.object_detected is fired for each object detected. The event payload includes:

  • classifier : the classifier (i.e. deepstack_object)
  • entity_id : the entity id responsible for the event
  • object : the object detected
  • confidence : the confidence in detection in the range 0 - 1 where 1 is 100% confidence.

An example automation using the event is given below:

- action:
  - data_template:
      title: "New object detection"
      message: "{{ trigger.event.data.object }} with confidence {{ trigger.event.data.confidence }}"
    service: notify.pushbullet
  alias: Object detection automation
  condition: []
  id: '1120092824622'
  trigger:
  - platform: event
    event_type: image_processing.object_detected
    event_data:
      object: person
1 Like

Hi all
just published releasev0.8 which adds saving of processed images with bounding boxes around target objects. This makes it really easy to include the bounding box image in notifications like below.
Cheers

1 Like

is this supposed to work with rtsp stream camera entities ?

Iam somehow unsure about

source:
- entity_id: camera.local_file
name: face_counter

I put also my amcrest camera but nothing is detetected at all. Either ffmpeg rtsp or amcrest platform
deppstack is running and can be accessed via web ifc or API. I sucessfully registered faces. There is no log entry in home assistant.

Any ideas =?

PS: in deepstack I dont see any incoming requests from HA

Yes your config is wrong, and you have not posted it here

Does the latest version of your component require an updated version of Deepstack to be installed?

I’m getting the following error in HA logs:

Your configuration contains extra keys that the platform does not support.
Please remove [save_file_folder].  (See /config/configuration.yaml, line 350). 
Offending data: {"platform": "deepstack_object", "ip_address": "<redacted>", "port": "<redacted>", "scan_interval": "<redacted>", "save_file_folder": "/config/www/deepstack_car_images", "target": "<redacted>", "source": "<redacted>"}

With the following config:

  - platform: deepstack_object
    ip_address: xxx.xxx.xxx.xxx
    port: 5000
    scan_interval: 10000
    save_file_folder: /config/www/deepstack_car_images
    target: car
    source:
      - entity_id: camera.front_of_house
        name: car_detector

UPDATE: 0.95.0 complained that the config is wrong and won’t enable the component due to save_file_folder

I hope my configuration is wrong…

configuration.yaml

I have two cameras for testing

amcrest:

  • host: 192.168.IP.IP
    username: admin
    password: kao23523
    sensors:

    • motion_detector
      switches:
    • motion_detection
    • motion_recording
      scan_interval: 2
      stream_source: rtsp
      resolution: high
      name: GartenBaum
  • platform: ffmpeg
    name: Hoteleingang
    input: -rtsp_transport tcp -i rtsp://user:pw@ip:port/

image_processing:

  • platform: deepstack_face
    ip_address: ip of deepstack server
    port: 5000
    scan_interval: 5000
    source:
    • entity_id: camera.gartenbaum
      name: Garten
    • entity_id: camera.hoteleingang2
      name: Hotel

in the state ui it looks like

image

image

What does work ?

service: image_processing.deepstack_teach_face via home assistant. I was able to teach faces and the API responces succesful that my faces are registered.

What does not work:

Any sort of facial regocnition it does not count at all. In the API logs I dont see any access from home assistant except for my image_processing.deepstack_teach_face request.

@apt be sure to remove any cached files from within the custom_components subdirectories - sounds like HA is not loading the updated files

@realfire you have set a scan interval of 5000 seconds, is that intentional? You should call the image_processing.scan service to trigger the processing manually

As general advice, if you suspect the problem is on the deepstack end, you can check for errors using cURL

i tested it with standard 10k and 5. So for testing.

I will test the manual trigger asap. I assume it is something in HA that camera images are not checked or submitted… Lets see the other test

OK I added a folder on the automations I am using with the new deepstack events

it works if I trigger it manually, doesnt recongize my face but thats on another page.

Still should the system process the data in realtime ?

I mean I created an automation with scans every 3 seconds…

Sounds like the automation is buggy, I just linked to an automation you can check against

I removed the __pycache__ folders from directly within the custom_components dir and within the Deepstack components folders and get the same issue.

I’m using HACS to install and update my components. Could this be an issue? It’s showing that the components are up to date.

Hmm check against what’s on GitHub. I’m not up to speed with HACS, but my impression is it pulls the latest release from GitHub

1 Like

Pulling down the version from Github resolved the issue. Think I may need to let @ludeeus know there may be an updating issue in HACS.

Out of interest are there any plans to limit the number of files saved? I can see the folder getting larger pretty quick. Would be good to have the option of an upper limit (10 for example) and also the ability to save the last 1 so you can refer to the last saved file within HA if needed.

It does, but only the first dir https://github.com/robmarkcole/HASS-Deepstack/tree/v0.8/custom_components under custom_components if there are multiple in the same dir.

1 Like

@apt there are already ways to manage the file system, eg using folder sensor + automations.

1 Like

This might be useful: https://custom-components.github.io/hacs/next/developer/integration/

2 Likes