Face and person detection with Deepstack - local and free!

Hi All,

Does anyone know of a URL endpoint I can test to see if deepstack is running? I’ve been able to setup with blueiris and I would like to monitor the deepstack container by testing a deepstack endpoint. The API doco on the deepstack website doesn’t have any details at all.

Yes, I have the same issue when using NCS and Raspberry Pi, as you can see the bounding box is quite a far way from the actual object detected!

I’m hoping an update to Deepstack (when it happens!) fixes the issue

1 Like

I have setup deepstack on the cameras around my house. I have them scanning every five seconds when I’m not home and also when I go to sleep. Problem is that the one camera that points to the road picks up parked cars. Then I get the same parked car that does not move stored as a image every five seconds. Is there a way to disregard the next scan if the image is the same as the last one?

Hi @jazzmonger
can you share the code how you have done with the counter for detection_counter?

Sure @jompa68. I do it all in an automation. I have different automations if a car or person detected. I only open the gate for ups and Fedex trucks.

- id: '1599481292417'
  alias: Front Gate Object Detection = TRUCK
  description: ''
  trigger:
  - event_data:
      object: truck
    event_type: deepstack.object_detected
    platform: event
  condition:
  - condition: state
    entity_id: binary_sensor.gate_open_sw #is gate already open?
    state: 'off'
  - condition: state
    entity_id: input_boolean.object_detected_autom_triggered #flag to stop other processing
    state: 'off'
  action:
  - data: {}
    entity_id: input_boolean.object_detected_autom_triggered
    service: input_boolean.turn_on
  - data:
      filename: /config/www/snapshots/frontgate.latest_object.jpg
    entity_id: camera.frontgate_detector
    service: camera.snapshot
  - data: {}
    entity_id: counter.detection_counter
    service: counter.increment
  - data: {}
    entity_id: script.1586228141488 # opens the gate
    service: script.1586228141488
  - data: {}
    entity_id: script.1589227536392 #sends a pic of whats at the gate to my iPhone 
    service: script.1589227536392
  - delay: 00:2:00
  - data: {}
    entity_id: input_boolean.object_detected_autom_triggered
    service: input_boolean.turn_off
  mode: single

And in configuration.yaml

#
counter:
  detection_counter:
    initial: 0
    step: 1
1 Like

Need some help with deepstack_face, what ever i try it remains with status ‘unknow’
Can someone explain or give some input how-to do it the right way?
object_detection is working like it should.

- alias: '018: Dörr Deepstack Rörelse Dörr'
  id: '018'
  initial_state: true
  description: ''
  trigger:
  - entity_id: binary_sensor.motion_frontdoor
    platform: state
    from: 'off'
    to: 'on'
  condition: []
  action:
  - data:
      entity_id: image_processing.dorr_kamera
    service: image_processing.scan
  - data:
      entity_id: image_processing.face_counter
    service: image_processing.scan

Update
Suddenly it started to work so must have done something magic… :slight_smile:

After a night sleep my brain seems to work much better :laughing:
I have now also got my old cameras to work with deepstack.
I have them in motionEye and save a snapshot when motion. Then deepstack takes the file and analyze it for persons and cars.
Imaging what a good night sleep can do :grinning:

I’ve found that 3 scans waiting 3 seconds between scans is about right. I am using a 2nd pi and Coral stick to do the processing as I’ve got my home assistant setup running on a NUC and haven’t found a way to use the Coral stick on the NUC yet.

Jeff

i have my coral in my mini desktop PC, and did work with Frigate so i hope it works also with deepstack.
How can i check if deepstack is using my coral?

Hi @robmarkcole. I’m having problems reading the annotations boxes. I’m red-green color blind, so that is probably some of the reason.
I tested out another application that has similar functionalities as this app. It had great boxes that was easy to read and looked great. Might be worth taking a look :slight_smile:


Example:
119460435_791795691644319_1301823572468214390_n

Do you know if there anything new regarding custom models? Thanks

Hey,

So I never have any luck upgrading. I held off upgrading for a while and finning bit the bullet. Well after the upgrade it is no longer detecting objects.

The only thing in my log is:

2020-09-28 09:32:01 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for deepstack_object which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.

My config looks as follows:

image_processing:

  • platform: deepstack_object
    ip_address: 10.50.0.10
    port: 5000
    api_key: !secret deepstackapi
    scan_interval: 5
    confidence: 80
    save_file_folder: /config/www/deepstack_person_images/frontyard
    source:
    • entity_id: camera.front_yard
      name: person_detector_front_yard

Do you see anything wrong with it?

I’ve ended up rolling back to my previous version: v2.7 and it is back to working.

But I would like to upgrade…

doest it run on jetson xavier nx? if yes, any experiences on multicam performance?

Hello all, and thanks @robmarkcole for this extension!

I wanted to set up a HTML5 notification push to my phone. The best way is to trigger based on the event but catching the filename of the image was not that easy. My solution is the current automation where I store the current filename-url into the new variable function of Home Assistant. This is then used to trigger the notification:

- id: '1601385011168'
  alias: Person Detected
  description: ''
  trigger:
    platform: event
    event_type: deepstack.object_detected
  variables:
    url: >     
        {% set time = trigger.event.time_fired %}
        {% set timestamp_custom = as_timestamp(time) | timestamp_custom("%Y-%m-%d_%H-%M-%S") %}
        {% set entity_id = trigger.event.data.entity_id | regex_findall_index("\.(.*)") %}
        {{ "/local/snapshots/" + entity_id + "_" + timestamp_custom + ".jpg" }}
  action:
    - service: notify.html5
      data:
        title: Person detected!
        message: A {{ trigger.event.data.name }} is detected with {{ trigger.event.data.confidence }} confidence 
        data:
          url: '{{ url }}'
          image: '{{ url }}'

Hope this can help someone!

1 Like

Hey man I know this is a bit old but I’m having the same issue. After configuring all my cams to work with motionEye I’ve been having this UnidentifiedImageError issue.
And in addition I can’t manage to install Shinobi, it breaks in the middle of installation and corrupts my SD cards, I had twice to reformat and restore my backup.
Can you update on whether Shinobi is working and you are managing to use deepstack with Home Assistant?
Thanks

Is it totally impossible to run Deepstack on a RPi 3B+ without a Coral or Intel Movidius stick? I’m currently running TFlite and would like to test first if Deepstack gives significantly better results before buying additional hardware. Do I need a RPi with 8 GB memory? I need object detection only and (currently) only for 1 camera.

same question and same scenario (one camera) but with RPi 4 (4 GB) …thank you for the answer

I cannot answer 100% for you, but I will say I run this on an i3 NUC with 8GB without any extra hardware, and it take 8 seconds on average for an image to be processed. Sometimes longer, rarely quicker.

About use of RPi3 or RPi4, I think that the best thing will be to try. And I’m ready to do it. … So my question is: “Is there a Rpi -only (without external accelerators) dockerized version of Deepstack?” Thank you very much in advance for the answer