Face and person detection with Deepstack - local and free!

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

I installed this plugin, but when manually run automation - got error:

Error rendering data template: UndefinedError: ‘trigger’ is undefined

What can be wrong?

2nd question…

I click “Call service”, at service I see POST register command, but no answer after run command… Is it OK?

Sorry. Again me :slight_smile:
I teach AI photo with incorrect name. How can I delete face from HA?

How can run like this from HA?

import requests

response = requests.post("http://localhost:80/v1/vision/face/delete",
data={"userid":"Idris Elba"}).json()

print(response)

You could use a shell_command to run the python script above

@robmarkcole I am running into an issue where I believe I have the custom component setup right, and the docker container running on another device. I see the image_processing.camera devices being created, but it seems like I am not getting a connection between the Hass.iO and the deepstack container.

Here is the code from config.yaml.

image_processing:
  - platform: deepstack_face
    ip_address: docker IP
    port: 5000
    scan_interval: 20000
    source:
      - entity_id: camera.jungle
        name: Jungle
      - entity_id: camera.dafang
        name: Dafang

When I try and do the server call to do a face train, I get no response back at all from it nor do I see it showing on the deepstack container log.

Any ideas?

This sounds like a docker issue, check the port mappings, host network etc. I’m really just learning docker myself and encountering similar issues where there are gaps in my understanding

If the other device is a Synology, the DSM access uses port 5000 so you will need to change the ports in that docker container.

1 Like