AI-Homeguard Object Detection

Add any particular hints or tricks you have found to help with your ZoneMinder experience.
Post Reply
traveler21
Posts: 2
Joined: Tue Jan 28, 2020 1:52 am

AI-Homeguard Object Detection

Post by traveler21 »

I am running ZM 1.34 in a VM under windows 10 with 8 cameras and I wanted to add object detection to improve motion detection since I have a lot of trees, sun and wind. Running ZM in a VM gives me limited access to the GPU. I ran across AI-Homeguard, a Windows (or Linux) based AI NVR. The software uses the GPU to determine and identify the type of object detected so I decided to run it under Windows and use it to trigger ZM events. The detection area is very easy to set up as it uses “virtual lasers” drawn on the image and analyzes anything that crosses one. Fortunately, AI-Homeguard has a Multicast API and ZMTrigger has a Telnet interface so I was able to run a Python script that receives the multicast event trigger from Homeguard and send a Telnet trigger to ZM.

The AI-Homeguard multicast is restricted to the local machine so I had to run the Python script under windows instead of the Linux VM. All in all this setup works very well. The camera network can support both AI-Homeguard and ZM. Motion detection is very solid with almost no false or missed detections. I end up with motion events on both systems but still use much less storage space than before. The downside is this setup takes a lot of horsepower.

The script is attached. I am not a Python programmer, the Multicast and Telnet code is based on code from multiple sites found in the forums. Basically, the script uses a While loop to detect the camera name in the received multicast string and assign and send the appropriate ZM Telnet string. Once I finish tweaking etc., I’ll probably compile it into an executable with some command line parameters. I’ll eventually add light and/or sound triggering through the home HA controller.

Anyway, It may not be the most elegant solution but works well for my configuration.

Links:
https://www.ai-homeguard.com
https://wiki.zoneminder.com/ZMTrigger
http://thebaldgeek.net/index.php/home/orac/zoneminder/ (good ZMtrigger info)
http://chaos.weblogs.us/archives/164 (Multicast)
https://codereview.stackexchange.com/qu ... -to-a-file (telnet)
AIHG_ZM.txt
(4.49 KiB) Downloaded 515 times
denver_compdoc
Posts: 7
Joined: Sun Jun 14, 2015 3:32 pm

Re: AI-Homeguard Object Detection

Post by denver_compdoc »

This works very well, but running under ubuntu the script caused a cpu core to constantly run at 100%.

So, I added a command 'time.sleep(0.01)' on a line just beneath 'while 1:' and now it runs fine.

Thanks!
Post Reply