Zoneminder NVR 1.34 Docker by dlandon includes object vision

I think you can do a pip install --no-binary <package> to force pip to compile against the currently installed libraries, no?

Good idea, however this python package is some complex in configuring its build they only support building without CUDA.

Seems I may be blocked. Managed to work through building opencv for python without the cuda DNN library. However when I try to build for my Quadra M4000:

CMake Error at modules/dnn/CMakeLists.txt:99 (message):
CUDA backend for DNN module requires CC 5.3 or higher. Please remove
unsupported architectures from CUDA_ARCH_BIN option.

This error is due to NVIDIA not wanting to support the older less capable GPUs.

I made some progress building a docker image that builds the needed .so file for cv2 module.

FWIW

I have all set up, notifications work, mqtt, just no object deteting. Tried to run script: ./zm_detect.py, have also installed: opencv-contrib-python. How to enable object detecting?
If I run

sudo bash zm_event_start.sh
usage: zm_detect.py [-h] -c CONFIG -e EVENTID [-p EVENTPATH] [-m MONITORID]
                    [-v] [-f FILE]
zm_detect.py: error: argument -m/--monitorid: expected one argument

and

python3 zm_detect.py -e 360
usage: zm_detect.py [-h] -c CONFIG -e EVENTID [-p EVENTPATH] [-m MONITORID]
                    [-v] [-f FILE]
zm_detect.py: error: the following arguments are required: -c/--config

and in logs it seem it is starting object detecting??

FORK:vhod (1), eid:422 Invoking hook on event start:/mnt/Zoneminder/hook/zm_event_start.sh 422 1 "vhod" "Forced Web" "/var/cache/zoneminder/events/1/2020-02-17/422"

I dont find ant hook_helpers folder:

/mnt/Zoneminder/hook$ ./zm_detect.py -m 1 -e 425 -c /etc/zm
Traceback (most recent call last):
  File "./zm_detect.py", line 135, in <module>
    log.init(process_name='zmesdetect_'+'m'+args['monitorid'])
  File "/usr/local/lib/python3.7/dist-packages/zmes_hook_helpers/log.py", line 35, in init
    g.logger = wrapperLogger(name=process_name, dump_console=dump_console)
  File "/usr/local/lib/python3.7/dist-packages/zmes_hook_helpers/log.py", line 10, in __init__
    zmlog.init(name=name)
  File "/usr/local/lib/python3.7/dist-packages/pyzm/ZMLog.py", line 131, in init
    with open(f) as s:
NotADirectoryError: [Errno 20] Not a directory: '/etc/zm/zm.conf'

I’m trying to follow your guide, but i can’t find the keys folder with the ServerName file and the .key and .crt files. Where they are?

did you map the folders as listed in the guide?
if so inside the config folder is the keys folder.

Forgive me but i’m a total linux noob. I’ve followed step by step your guide, so i’ve run the docker with your commands. I suppose that the map of folders are the “-v” option isn’t it?

yep, its a way to keep a persistent folder on your host that is surfaced into the docker container. Useful for accessing those files as well and changing them (you may already be doing this with HomeAssistant if you use docker).
the command is:
-v <local_path>:<docker_path>

so assuming your user is john. make sure you are in your home directory:
cd ~

create the docker folder if it doesnt already exist:
mkdir docker

Create the Zoneminder folder in the docker folder
cd docker
mkdir Zoneminder

so now you have a folder /home/john/docker/Zoneminder
this would be mapped in the docker command:

-v "/home/john/docker/Zoneminder":"/config":rw

oh ok, but if i do not have created the folder before running the docker? Where the hell the files are? :smiley:

Nevermind, found it! I didn’t even know that there was a root dir :smiley:

Ehm, ok, i told you i’m a linux total noob… now it’s time to tells you that i’m a home assistant noob (not total, i’ve learned something in the last month :D). How can i receive notification of alarm in nodered? ZmNinja seems to works correctly, i can see the alarms there. I have installed mosquitto on home assistant and setted up the ip address in zmeventnotification.ini

you’ll need to follow the instructions for the dlandon’s docker container here:

I’ve this hook error in the log, what i am missing?

In the file “ServerName” i have to put the server port after the ip of the docker? Same for the MQTT server in zmeventnotification.ini?

Check you have MQTT listed as where to send the alert.
I had
‘MQTT, fcm’

I think the default was
‘web, fcm.

Yes i’ve put ‘all’ , but the message it’s the same…

I’ve noticed this error in log, could help? And i see the mqtt sensor in home assistant as “unknown”…

You have on_fail: none
It looks like it failed to detect anything based on your detections rules so didn’t send an alert.

Check hooks are enabled, check the ini files, and specifically for the monitors you have [1] or the global monitor rules.

I can see “exit 1” and “exit 0” for the start and the end of the event, so i suppose that at the start or the end of the event it detect something?

Without sharing your whole setup I can’t really troubleshoot but just throw ideas.
I would recommend following the guide on dlandon’s docker.
Make sure you have hooks enabled, and all the .ini files are configured correctly with your Zoneminder user name, password (and you have the right permissions) you have enabled 3rd party API usage as per the steps, and you have correctly added the portal ZM Portal and video/image URL.