neo-ZMES - Public Beta

Discussion topics related to mobile applications and ZoneMinder Event Server (including machine learning)
Posts: 226
Joined: Thu Dec 24, 2020 4:04 am

Re: neo-ZMES - Public Beta

Post by tsp84 »

Some exciting news, the new 1.35.7 release added a new 'event start' and 'event end' script execution (set it up in the 'source' modal i.e. where you setup the monitors 'analysis fps' and 'stporage'), this means things will be even faster and the script does not need scan the SHM for events.

I am just testing with automating everything, currently the ZM API does not return the scripts value from the DB or let you write to the DB for setting the scripts so I am using SQLAlchemy to interface with the ZM DB to test things out.
Posts: 64
Joined: Tue Apr 27, 2021 3:41 am

Re: neo-ZMES - Public Beta

Post by juan11perez »

Good day, apologies for the delay.
currently moving house, so my setup is in pieces :)
As with the "standard" zmes, i'd like to be able to pull camera, object (person, dog), confidence level, face (recognition), confidence.

Thank you
Posts: 226
Joined: Thu Dec 24, 2020 4:04 am

Re: neo-ZMES - Public Beta

Post by tsp84 »

I pushed an update for pyzm that will add another topic to subscribe to. Currently it's

zmes/picture/<mid> for jpeg/gif
zmes/data/<mid> for camera and event info

And now there is ->
zmes/rdata/<mid> that sends labels, bbox, conf and model

Code: Select all

11/30/21 22:44:35.487027 zmesdetect_m1[16760] DBG2 mqtt:292 [mqtt:publish: sending -> topic: 'zmes/picture/1'  data: '<serialized bytearray>'  size: 2.77 MB]
11/30/21 22:44:35.492501 zmesdetect_m1[16760] DBG2 mqtt:290 [mqtt:publish: sending -> topic: 'zmes/data/1' data: {"eid": "46513", "mid": 1, "name": "Front", "reason": "[150] :detected:person(99%-yolo[GPU])", "zone": "Front - Substream", "cause": "Linked", "type": "start", "start_time": "2021-11-10 16:53:33", "past_event": true}]
11/30/21 22:44:35.494418 zmesdetect_m1[16760] DBG2 mqtt:290 [mqtt:publish: sending -> topic: 'zmes/rdata/1' data: {"labels": ["person"], "conf": [0.9920536875724792], "bbox": [[2956, 990, 3518, 1870]], "models": ["yolo[gpu]"]}]
Posts: 43
Joined: Fri Mar 25, 2011 3:34 pm

Re: neo-ZMES - Public Beta

Post by Quantum »

Hi tsp84. After reading this whole thread, I am surprised and pleased to find the optimizations and improvements you've made to ES. Many thanks, and thanks to Juan for helping sort things out. I guess most users got discouraged by the difficulties and unknowns of the legacy ES.

I want to install neoES. I've renamed the legacy ES files in /etc/zm/ and /var/lib/zmeventnotification to *.old. Is there anything else that needs to be done to tear out the old ES? Or should I start from scratch with a new virtual machine?
Posts: 43
Joined: Fri Mar 25, 2011 3:34 pm

Re: neo-ZMES - Public Beta

Post by Quantum »

On ... a339aaa307

Code: Select all

# es.debug.objdet 4781
Traceback (most recent call last):
  File "/var/lib/zmeventnotification/bin/", line 36, in <module>
    import pyzm.helpers.new_yaml
ModuleNotFoundError: No module named 'pyzm.helpers.new_yaml'

# locate pyzm.helpers.new_yaml

# lsd -al /usr/local/lib/python3.10/site-packages/pyzm/helpers/
It's right. No pyzm.helpers.new_yaml . And I don't get any bounding boxes.

In /var/log/zmeventnotification.log I get a fatal error:
FAT [main:449] [SSL is enabled, but key or certificate file is missing]

That's odd, because in /etc/zm/zmeventnotification.yml I have:

Code: Select all

  # Enable SSL [Default: yes]
  enable: no
It's disobeying me.

Looks like this promising project is dead too. As baudneo says, "Nothing to see here." I wish he'd made that clearer that applies to the project. I guess he lost control of it.

Lost another week. No soup for me.
Posts: 226
Joined: Thu Dec 24, 2020 4:04 am

Re: neo-ZMES - Public Beta

Post by tsp84 »

? Repos are up and new versions are being worked on all the time.

The instructions should still be fairly relevant. There is also a docker image that hosts neo mlapi and has GPU and TPU lobs installed. The evertserver docker image has zoneminder+neo zmes installed that pairs with the mlapi docker image.

You can still install directly onto the host as well. Let me know if you need help installing and configuring.

Posts: 3
Joined: Fri Aug 21, 2020 5:13 pm

Re: neo-ZMES - Public Beta

Post by Noahe »

I've been using ZM since July 2020 when my sister-in-law gave me an old HP desktop with a Core i7-860, 4 cores, 8 threads at 2.8-3.46 GHz (Circa 2009). I love ZM.

Shortly thereafter I bought zmNinja-pro App for my iPhone, and I'll admit it took me awhile to figure out ES and get my dynamic-IP service a SSL certificate. ZM+ES is even more fantastic.

A couple months ago I trash-picked a Dell desktop with a Core i7-3770, 4-cores, 8 threads at 3.4-3.9 GHz (Circa 2012) and since it's quite a bit faster, thought I'd give hooks+MLAPI a try. I'll be honest, this took me months on and off to figure out. ZM+ES+hooks+MLAPI is epic.

I've now gone one further and purchased myself an $8/year domain name (nothing catchy). I use subdomains for my home services and a NGINX reverse proxy to send it to the right box. e.g.: (for ZM)

In my excitement, I set-up the biggest CPU load at the time (ZM) on the newer, faster, trash-picked Dell.

My setup currently has the 2012 machine doing ZM+ES on ubuntu server at about a 75% system load. It can't really manage to do this AND object detection, despite only using about 15% (on average) from the older 2009 HP.

The older 2009 machine is now doing NGINX, SQUID, OpenVPN (all Dockerized) and MLAPI (not Dockerized, couldn't figure it out) at about a 15% system load.

I'm just learning as I go, and could use a few tips from the more experienced.

1. why do the event bounding boxes sometimes not get put around the object when the object is moving? Processing lag?

2. what cheap used GPU offers worthwhile decent compatible acceleration? The two I have are junk. An nVidia Geforce GTX 260 and an ATI Radeon HD 7350. The Google Coral TPU's are backordered like 80 weeks now in Canada.

3. I can't seem to start

Code: Select all

python3 ./ -c mlapiconfig.ini
as me. I can only fire it with sudo or after running sudo -i. But more to the point, I thought systemctl processes ran as root anyway. Anyway, that's my problem, I can run it manually, but I can't get the

Code: Select all

to run. I get the following error:

Code: Select all

Traceback (most recent call last):
  File "./", line 3, in <module>
    from flask import Flask, send_file, request, jsonify, render_template
  File "/home/me/.local/lib/python3.8/site-packages/flask/", line 14, in <module>
    from jinja2 import escape
  File "/usr/lib/python3/dist-packages/jinja2/", line 33, in <module>
    from jinja2.environment import Environment, Template
  File "/usr/lib/python3/dist-packages/jinja2/", line 15, in <module>
    from jinja2 import nodes
  File "/usr/lib/python3/dist-packages/jinja2/", line 23, in <module>
    from jinja2.utils import Markup
  File "/usr/lib/python3/dist-packages/jinja2/", line 656, in <module>
    from markupsafe import Markup, escape, soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/home/noah/.local/lib/python3.8/site-packages/markupsafe/
I'm running the right version of everything in the requirements.txt file. I'm thinking it's a permissions issue, or install location. I probably installed everything under sudo -i instead of issuing individual sudo commands. Is that a problem? It does work. It just won't run automatically.

4. My detection times are understandably slow without GPU or TPU acceleration. What are people's best strategies to speed things up? I'm thinking disable face-detection for now, along with dialing-in motion events and probably also detection area. I increased the allowed CPU count, but the utilization didn't increase, I can't figure out why.

I'm well appreciative of any guidance or tips you can offer.

User avatar
Posts: 2055
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto

Re: neo-ZMES - Public Beta

Post by iconnor »

You may get faster responses from the slack channel. All the major players in the ES/ML space generally hang out there.

I think nvidia 1080 or better is where you want to be for gpu.

In 1.37.* we have the ability to run commands on event start/stop, so ES isn't really even needed anymore. Might be something you want to investigate.

Also in 1.37 there are a bunch of options for reducing cpu use.

Anyways, would definitely like to chat more with you and get you involved in improving and documenting all these setup details.

Post Reply