zm_detect.py error when testing zm_event_start.sh

Discussion topics related to mobile applications and ZoneMinder Event Server (including machine learning)
User avatar
Bluemax
Posts: 121
Joined: Wed Jun 12, 2019 5:15 pm

Re: zm_detect.py error when testing zm_event_start.sh

Post by Bluemax »

Are you sure it detected your bsd system properly and you have the proper environment? Opencv officially supports freebsd. It should compile out of the box (i guess).
JonMoore
Posts: 26
Joined: Wed May 26, 2010 5:55 pm

Re: zm_detect.py error when testing zm_event_start.sh

Post by JonMoore »

I think that's what the problem was but I'm not sure, took a fair bit of fiddling with the make files to finally get it built.

But it is built! And object detection is working well now. I can't get the boarder boxes as I'm on zm 1.32 but I believe the package is going to 1.34 in the next quarterly package release so hopefully I'll get even more cool stuff going then.

Next I'm going to try and get home assistant listening to the MQTT stuff, although this again is new for me so is going to take a bit of work. :D
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: zm_detect.py error when testing zm_event_start.sh

Post by asker »

When you have time, please share any mods you had to make to either pyzm or detection to get it to work - I'll try and incorporate options so the code doesn't have to be touched (I hope you used the updated packages I posted in another thread that allows configuration based overrides in objectconfig.ini)
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
JonMoore
Posts: 26
Joined: Wed May 26, 2010 5:55 pm

Re: zm_detect.py error when testing zm_event_start.sh

Post by JonMoore »

Hello!

Sorry this has taken so long... I didn't see the reply
asker wrote: Tue Mar 24, 2020 3:25 pm When you have time, please share any mods you had to make to either pyzm or detection to get it to work - I'll try and incorporate options so the code doesn't have to be touched (I hope you used the updated packages I posted in another thread that allows configuration based overrides in objectconfig.ini)
But I just had to find this thread as I've just updated zmeventnotification and needed to remember what I did to get it working again for use in a freenas jail.

Changes are;
in pyzm/ZMLog.py change
for f in glob.glob(config['conf_path']+'/conf.d/*.conf'):
to
for f in glob.glob(config['conf_path']+'/zoneminder/*.conf'):

also;
config_table = meta.tables['Config']
log_table = meta.tables['Logs']
to
config_table = meta.tables['config']
log_table = meta.tables['logs']

and of course in the newer version of objectconfig.ini;
pyzm_overrides= {'conf_path':'/usr/local/etc'}

plus fixing config paths in zm_event_start.sh
also a few places where I needed to change the shebang line to #!/usr/local/bin/python3 or bash

I think that's it other than normal configuration.

For ref again, this is zoneminder installed using "pkg install zoneminder" in a (now) Truenas (aka freenas) jail

really not sure how much you could do to sort the overrides tbh, especially for those tables with lower cases and on a smaller userbase like freenas.

But hopefully this helps people.... and I'll use it to refresh my memory next time I update!

I played around a lot today so I might have missed something here, but I'll add anything I spot on the next update too.

Many thanks again for such a great piece of software!

Jon
JonMoore
Posts: 26
Joined: Wed May 26, 2010 5:55 pm

Re: zm_detect.py error when testing zm_event_start.sh

Post by JonMoore »

Actually... there was one more thing I needed to do. This one took some tracking down as I didn't have to do it last time;

in /tmp/

I had to change the ownership of the file "pyzm cpu # or gpu_lock.00.lock"

it was owned by root:wheel and I found a permissions error buried deep in the locks. Changing owner to my web/zoneminder user fixed it.

Cheers,
Jon
Post Reply