Face and person detection with Deepstack - local and free!

Damn! Looking forward to testing! Nice work!

My use case is pretty simple.
Camera NVR (shinobi) detects motion. Use node-red to grab a snapshot and check the motion is from a person or car (avoiding wind moving trees, shadows etc) - as really I only care if a random person is somewhere near my house and less that a tree is moving lol. I currently manually save that file, but may move to your implementation.

I read you are looking to make an official integration. Haven’t played with your updates yet, but wondering if you could combine a single camera/image to have multiple targets, color bounding boxes differently. Save as a single file or different file?

image_processing:
  - platform: deepstack_object
    ip_address: localhost
    port: 5000
    api_key: Mysecretkey
    save_file_folder: /config/www/deepstack_person_images
    source:
      - entity_id: camera.local_file
        name: person_detector
        target: person
          show_bounding_box: true
          color: yellow
          save_file_prefix: person
        target: car
          show_boundjng_box: true
          color: red
          save_file_prefix: car

Not sure how useful that would be for folks though?

Either way, been using this for a while and LOVE it. In my mind your component is a key difference between an automated home, and a smart home! Thank you!

1 Like

Thanks for your reply.
I believe the port is not an issue as I can reach the web ui on port 5000
I’ll do some digging.
Btw, any idea why the bounding boxes on images from one specific camera are mis-alligned (below) the identified person? Not the end of the world, just the perfectionist in me :grin:

Hey thanks for all your awesome projects on here! I noticed on your coral hit hub it’s archived.

Is that project dead? Did this replace it?

Thanks again.

@nigel1 where is your image? I notice sometimes bounding boxes are not perfect, but usually not far off.

@Darbos to coral is now integrated through my deepstack_object integration as described in the readme. Why duplicated work

Thank you. I thought that may be it. These two projects (deepstack and the usb accelerate project I linked) look the same just using different api servers? Is one preffered over the other, or faster? Thanks

It depends which hardware you have. Coral is using tensorflow-lite models which are less accurate but faster than the deepstack models. So it depends if you want:

  • Fast and tolerate lower accuracy, use coral
  • Slower but higher accuracy, use deepstack

Thanks, that clears it up perfect.

Im using a coral to watch my driveway and garage…and notify me if my car is in the driveway and not the garage when it is about to rain.

1 Like

I am getting “Platform error image_processing.deepstack_object - Integration ‘deepstack_object’ not found.” when I check configuration in Home Assistant. I am using Hassio docker and DeepStack docker

curl -X POST -F [email protected]/disks/data/share/Photos/jmm.JPG ‘http://192.168.0.50:5000/v1/vision/detection’ does return {“success”:true,“predictions”:[{“confidence”:0.9992482,“label”:“person”…

here is config in HA

image_processing:
  - platform: deepstack_object
    ip_address: 192.168.0.50
    port: 5000
    api_key: !secret
    save_file_folder: /config/www/deepstack_person_images
    source:
      - entity_id: camera.local_file
        name: person_detector

I have restarted the machine where these dockers are running. Are there any dependencies I need to install to integrate deepstack_object as Image Processing platform in HA container?

Does anyone know if the deepstack_latest_{target}.jpg gets locked if a nofication grabs the file and sents it?

    - service: notify.android
      data_template:
        message: 'Car spottet {{states.image_processing.driveway_object_car.attributes.last_car_detection}}'
        data:
          image: https://xxxxxxxxxxxxxxxxxxxxxxxxx:8123/local/deepstack_car_images/driveway/deepstack_latest_car.jpg

It looks like the file sometimes locks and not gets updated, which results that I get the same file sent twice.

Anyone?

@Yoinkz I observed this and created an issue

Oh okay. Sounds good. Was also asking in the Ariela forum, because I use the fcm-android Notification system.

I was testing further yesterday and I got this

5 Notifications where the picture was the same. I Tag all the Notification messages with the last_person_detected variable you added lately. So The time is almost exactly the same as the ones that are on the images when created.

But when looking at the pictures that deepstack creates, it certainly is different pictures, which isn’t the case on the Notifications.

Let me know if you need any additional information or if you want me to test something! :slight_smile:

Yes its a race condition, will address

where do i add the scan_interval?
in the document, it says under sensor but i don’t have sensor, only :

image_processing:
  - platform: deepstack_object
    ip_address: 192.168.1.66
    port: 5000
    api_key: Mysecretkey
    save_file_folder: /config/www/deepstack_person_images
    source:
      - entity_id: camera.kitchen_1_camera
        name: person_detector
image_processing: 
  - platform: deepstack_object
    ip_address: 192.168.1.2
    port: 5000
    api_key: Mysecretkey
    scan_interval: 10000
    save_file_folder: /config/www/deepstack_person_images
    source:
      - entity_id: camera.entrada
        name: person_detector_entrada

and how do you do auto delete of the images in that folder that older then 1 day?

1 Like

Anybody try to compare Dlib and Deepstack? Who is faster and better?

define better :slight_smile:

I’m trying this out and it is indeed very cool. :slight_smile:
One thing that I can’t figure out though:

I’ve set this up so that the image_processing starts 20 seconds after motion stops where the camera is located. Seems to work. But - when motion goes on for a while, I don’t get deepstack to analyze every “movie” recorded by the camera. (The camera would record a number of small movieclips), and if this happens while waiting the 20 seconds and also the analyze time, I miss it completely. I guess if one could “queue up” the clips to be processed by deepstack that would help.

I hope that makes sense.

Does anyone have any ideas?

When checking my configuration I am getting this error:

Invalid config for [image_processing.deepstack_face]: [api_key] is an invalid option for [image_processing.deepstack_face]. Check: image_processing.deepstack_face->api_key. (See ?, line ?). Please check the docs at https://home-assistant.io/integrations/image_processing.deepstack_face/

Is there a special way I am supposed to put my key in?

Also these are flooding my logs:

2019-10-31 22:08:26 WARNING (MainThread) [homeassistant.components.image_processing] Updating deepstack_face image_processing took longer than the scheduled update interval 0:00:20
2019-10-31 22:08:46 WARNING (MainThread) [homeassistant.components.image_processing] Updating deepstack_face image_processing took longer than the scheduled update interval 0:00:20
2019-10-31 22:09:07 WARNING (MainThread) [homeassistant.components.image_processing] Updating deepstack_face image_processing took longer than the scheduled update interval 0:00:20
2019-10-31 22:09:27 WARNING (MainThread) [homeassistant.components.image_processing] Updating deepstack_face image_processing took longer than the scheduled update interval 0:00:20
2019-10-31 22:09:33 ERROR (MainThread) [homeassistant.components.hassio] Invalid config for [image_processing.deepstack_face]: [api_key] is an invalid option for [image_processing.deepstack_face]. Check: image_processing.deepstack_face->api_key. (See ?, line ?). Please check the docs at https://home-assistant.io/integrations/image_processing.deepstack_face/
2019-10-31 22:09:48 WARNING (MainThread) [homeassistant.components.image_processing] Updating deepstack_face image_processing took longer than the scheduled update interval 0:00:20
2019-10-31 22:10:09 WARNING (MainThread) [homeassistant.components.image_processing] Updating deepstack_face image_processing took longer than the scheduled update interval 0:00:20
2019-10-31 22:10:29 WARNING (MainThread) [homeassistant.components.image_processing] Updating deepstack_face image_processing took longer than the scheduled update interval 0:00:20```

Have you specified an api_key when starting deepstack?

sudo docker run -e VISION-FACE=True -e API-KEY="Mysecretkey" -v localstorage:/datastore -p 5000:5000 deepquestai/deepstack