Neural Network Human Presence Detection

Hmmm, I think your tolerance value might be set too high. 0.6 will rule out a lot of human detections. It’s rare that it will see 0.7 unless it’s a pretty clear view of a person.

What you’re experiencing just might come down to inconsistent detection due to the tolerance value.

There is no difference in the code for detection with or without the video feed displaying.

By the way, what were your steps to get OpenVINO working on 18.06?

I tried with 0.2 and 0.4. But as i said i use the same command and only when add -no_image it stops working. Nothing special i think they support 18.04 with latest release. I created a how-to install on 18.04 i can share it on monday. Only pillow and libgtk-3-dev was needed on ubuntu server if i remember correctly.

Hmm, it’s really strange. Mind trying to compile it again and see if what I changed fixes it for you? You might want to rm neural_security_system before you run make -B again just to ensure it is compiled from my latest code.

rm neural_security_system
git pull
make -B

Sure. Will try it on monday. Thanks.

I just test it. And no change. I see that you added initial clearing of MQTT topic and i get OFF on startup. But i noticed something strange. While running neural with -no_image cpu usage is very low like it doesn’t do anything. If I run it without -no_image cpu usage is high and everything works.

This is very interesting, as there is no logical difference between “-no_image” and without it. The only difference is in whether it opens the window with the image of the current frame.

Are you certain that there are no differences between when you run it with and without the “-no_image”? Perhaps you are running it in different environments, or maybe in a different type of terminal window?

Yes i’m certain. When testing this i’m using same terminal window. One time with -no_image other without. Maybe it’s ubuntu 18.04 thing?

Got it. I think I have an idea. It must be something unique to this version of Ubuntu. There is a piece that calls getchar() if “-no_image” is specified that lets you kill the app through the terminal. However, you should still be able to kill it with Ctrl-C.

So, I’ve created a new branch to test out this theory. If you get a chance, get into the folder with my repo and run this:

rm neural_security_system
git pull
git checkout without_keypress
make -B

Then go ahead and try again. let me know if this helps you out. I might just make it a permanent change in master if it works out.

This is a very cool project!
Tell me, is it possible to do this as an addon in hassio?

1 Like

Technically it would be possible, since you’d really just need to build a Docker image with a Ubuntu 16.04 base and stacked up with all the packages and prerequisites.

I have it running in a VM on my machine, so for all intents and purposes it’s no different than if it was in a Docker container.

Unfortunately, I don’t know enough about programming to do this.
But I think many fans of HA will be happy if such an addon appears.
Then together we can test everything and make it available!

Yeah, I definitely thought about creating a Docker image out of this, and it wouldn’t be too much work.

However, I’d like to get one more camera up and running, and tweak this current app to handle any number of cameras simultaneously, before generating a Docker image out of it. The implementation would likely have to change.

Also, I’m not sure how passing through the Neural Compute Stick to a docker container in Hassio might work. Right now it’s relatively easy to pass through the neural stick to a virtual machine running this app. With Hassio, it might get more complicated… but it would likely work no problem using the CPU instead of the stick.

Hi @AndBobsYourUncle,
Do you think it would be possible to add a feature to detect if the object is standing or moving?
To be able to trace an object would be great.

It is just an idea :slight_smile:

Regards

That sounds like it would be straightforward, but there might be a catch.

  1. Calculate the center of each box.
  2. Average it’s location over X number of frames.

The problem arises when you analyze what the neural net returns back. The boxes are not always returned in the same order. So you’d have to have some logic to determine whether the box on frame 25 is the same box you saw on frame 15. Could be tricky.

Good news @AndBobsYourUncle. Now it’s working with -no_image. :slight_smile:

Awesome! So it was fixed using that new without_keypress branch?

Yes. Everything works as expected with without_keypress branch.

That’s great news. I assume that also when you Ctrl-C to end the program, you get a message about “exiting gracefully?”

1 Like

I believe so. I can’t test it now but i think i saw that message.

1 Like