Person Detection

Hi, I am very new to this and just got my H7 a few days ago and I love it. I am very impressed with all of the work that has gone into this product.

I have successfully got the device up and running with the Tensorflow person detection example but my project needs to know if the detected person is moving around. Basically, I need to know if the person is alive. I wrongly assumed that it would draw a box around the person, like with blob detection, and return the values of the location of the box so that I can check if those values move around. Is there an easy way to do this without slowing it down too much? I don’t actually need to draw the box, just to know the location of it. I am currently getting around 6 FPS and I need to be in that range.

I should say that I am new to python although I do have some basic programming skills.

Thank you in advance for any help.

Hi, the model we are using just detection if a person is in the image or not. The camera isn’t really powerful enough to do anything other than image classification. Bounding box CNNs will come in the future.

You can do this however… it will slow the FPS down by a huge amount. The algorithm has a lot of example text about how it can be used to do a sliding window. You can just turn the sliding window feature on and it will be able to see a person moving around. But, you will get below 1FPS frame rates.

Thank you so much for your quick response.
Okay, I am thinking to use a PIR detector on one of the GPIO pins to do the motion detecting. Do you have any example of how I can program the camera to start to detect only after receiving an input?
Can I also ask if the TFLite person detection software is already stored on the device? If so, is it possible to update it with the latest version from google, from time to time?

I don’t have an example with an I/O pin. However, there’s a lot of examples on the camera already. It’s not hard to just read the I/O pin state in python and then only run the the detection loop if the pin changes state. Please see the pyb.Pin module documentation. It’s quite simple. Just gate the while loop to having the pin high. Note, add a second while loop for this… if the main while loop finishes the script stops.

Regarding TF Lite, we update the library as Google releases more stuff and then its rolled into a firmware update for all cameras.

Thank you again. Very prompt service.

Hi Kwagyeman,

Looking for an update on a person detection model with bounding box surrounding the person. Has this been implemented, and if not, do you have any suggestions on how one would go about this?

Yes, see edge impulse and use their FOMO model.

1 Like