Face and person detection with Deepstack - local and free!

The image has to be a valid format for pillow, which it should be. Possibly the images are corrupted

Finally got all the parts sorted out and so for I am impressed, thanks for putting this together @robmarkcole

@danbutter Good point. I was looking at that for my Foscam Cameras and could not sort out how to enable motion detection within Home-Assistant.

I changed from Motioneye to Shinobi and that seem to have fixed my problem.

Hi Rob,

If you are interesting, iā€™ve succeed to detect 2 different faces with default image_processing dlib and send notifications with ā€œnameā€ through a Raspberry PI4 4Go.

If you are interested, iā€™ve planned to share it with community.

Exciting ā€¦
Thomas.

2 Likes

I ended up creating a loop so that if the senor for object detection is on it will keep processing new images every 15 seconds until the sensor is off.

Another random question. I have a foot path that is diagonally in front of my camera. I have tried the ROI box but I either miss half my driveway/entrance or keep getting alerts from people walking on the foot path. Does anyway have any clever ideas?

The simplest solution would be to rotate your cameraā€¦
I considered making the ROI a polygon but it got complicated quickly

Looks awesome, thanks a lot for your work on this!

Would you recommend Deepstack over Facebox? Do you have any performance / resource usage comparisons for face recognition?

Facebox is a black box, and also got bought by another company. Recommend deepstack face or dlib

Is there a list of targets that can be detected?

So, I did some testing today with Raspiberry with NCS2 and Deepstack. The new install-deepstack.sh is meant to be run on Buster Full.

Stretch Lite - Install Pip, Scipy using Apt-get, and run modified deepstack.sh; Requests donā€™t respond.
Stretch Full - Install Scipy using Apt-get and run modified deepstack.sh ; Deepstack works well.
Buster Lite - Install Pip and run deepstack.sh ; Requests donā€™t respond.
Buster Full - Run the deepstack.sh as-is and everything works. Can disable GUI etc.

2 Likes

Iā€™ve alerted the deepstack maintainers, certainly the script should work on all flavours of raspbian

I have commented out the ROI and then I do indeed get a picture saved.
The thing is that no matter what I enter for the ROI I get no picture. I have changed the ROI, rebooted HA and walked around the driveway for long enough for my neighbors to be wondering about me.

I was reading this from the readme:
" Optionally a region of interest (ROI) can be configured, and only objects with their center (represented by a x ) within the ROI will be included in the state count. The ROI will be displayed as a green box, and objects with their center in the ROI have a red box, whilst objects with their center outside the ROI have a yellow box."

So is this not expected behavior anymore?
I have a truck parked in the drive and want to make my ROI outside of the truck, but no matter how many times I change it I get no pics.
Coming from tensorflow where I can exclude areas. Deepstack works better so Iā€™d like to switch over if I can get everything worked out.

Thanks

There is a link in the Readme.
https://deepstackpython.readthedocs.io/en/latest/objectdetection.html

@danbutter if you comment out the ROI, it defaults to an ROI which is the full image. Given that you are getting detections the problem must be with your config of the ROI. I am going to develop a small app to help with this

I have a similar situation as you - camera image isnā€™t straight so ROI will either miss or include too much. To get around the issue I use Blueiris to duplicate the camera and black out/mask the area I donā€™t want detected. I believe you can do the same w/ motion eye.

Then, I add an automation to take a snapshot from the non-masked camera so that my picture alerts have a full, unmasked image.

I am not familiar with Blueiris at its windows only, but my advice is to do any preprocessing (cropping etc) BEFORE sending it to deepstack, if possible.
Cheers

I published an integration for scene detection if anyone is curious to try it out:

2 Likes

Thanks for the advice. I can imagine how complicated it would get with multivector points.

Cheers