Face and person detection with Deepstack - local and free!

See KeyError: 'predictions' · Issue #40 · robmarkcole/HASS-Deepstack-object · GitHub

1 Like

Thanks very much.
I wonder if its worth reinstalling with a fresh key.

I dont see how it would be a camera issue. Its a new Reolink 410 5mp which is running NX Witness and displaying perfectly in Home Assistant.

Update:
Just tried camera.local_file and still getting the “Is deepstack running?” error.

Oh changing from a real camera to a local imagine seemed to stop the KeyError.
Issue I just have now is HomeAssistant not knowing that deepstack is running. Even though HA send deepstack requests.

I think the KeyError occurs when an image is corrupted or incomplete, however I have not been able to reproduce it

Thanks for the feedback.
Its so frustrating when something works fine for ages, and then on reinstall just doesn’t work at all.

Yep that’s software engineering

Tried no AVX mode and that has not helped either. Possibly the custom component, it’s been updated since the last time i used DeppStack. Possibly it doesn’t like HASS.IO in the VM.

Probably a docker issue, please review the earlier comments in this thread

@robmarkcole
wierd - whatever issue was there before is back again. Now no longer functioning and just getting unknown all the time.
what curl command would be a definitive test for communication?

I’ve added this to the docs now:

curl -X POST -F image=@development/test-image3.jpg 'http://localhost:5000/v1/vision/detection'
1 Like

what should the return be? i’m not getting anything back, just looks like its doing something - hmmmm

if I put in the wrong file location, i get Warning: setting file /location/development/test-image3.jpg failed!
BUT the log in my deepstack docker container shows the connection hit the API (and the IP it came from) so network must be ok.

However if the location is correct, nada - seems to be waiting for a response

What docker command are you using to run deepstack?

sudo docker run --runtime=nvidia --name=deepstack -e VISION-DETECTION=True -e MODE=Low --restart always -v /home/jamie/docker/deepstack/data:/datastore -p 34856:5000 deepquestai/deepstack:gpu

have also tried with deepquestai/deepstack:gpu-3.6

@robmarkcole Thanks for all the work on this Integration!

Thought id share my setup - I am running a Hassio with Docker on a Raspberry Pi 4, I installed the Deepstack directly in Raspbian on the Pi with an Intel NCS2 stick. Works great! I am getting approx 900ms response time from Deepstack, I use this for person detecting on our CCTV so is plenty quick enough for now! Looking forward to further refinements in Deepstack and this integration.

Great work !! I miss only one function that it is very important for me: areas
In tensorflow i use this code:
area:
# Exclude top 26% of image
top: 0.26
Is there a way to integrate area management in this deepstack HA custom component ?

Nice setup!

How do you trigger your face detection? Using sensors or?

@jaburges everything looks fine, but did you try in CPU mode also?

@paul.etheridge setup looks good, but the NCS2 has USB3 and you are using the USB2 port on the pi.

@domtik you can use the proxy camera to crop the frame

Thanks Robin, proxy camera did the trick!

2 Likes

Just using the object detection currently (person), not the face detection. It is triggered off the motion trigger from the HIKvision NVR I have in the loft.

@robmarkcole that’s right… so I am using a Deconz stick as well, when Deconz is plugged into the USB2 port and the NCS stick into the USB3 as soon as DeepStack is running Deconz stops working… I have seen some articles online referencing potential interference issues with the USB ports of the PI4? Not sure if this is the case. Have found the setup pictured is working reliably (for the last 36 hours). Have the official Pi4 power socket, so don’t think I’ve got any basic power issues. I will try with some USB extensions to connect with. The NCS is rather chunky and blocks certain arrangements.