Events are Triggered but zm_detect/Event Start for Object Detection does not always run?

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
Andybcfc
Posts: 2
Joined: Wed Jun 29, 2022 10:18 am

Events are Triggered but zm_detect/Event Start for Object Detection does not always run?

Post by Andybcfc »

Hi,

I am running Ubuntu 20.04, ZM 1.36.19 (Official PPA), Python 3.8.10, ES 6.1.28, OpenCV 4.5.5 (CUDA/CUDNN compiled for Arch 6.1), and MariaDB.

Everything is working fine as an event is triggered and saved every time as expected. Alarm frames and snapshots are generated. The problem is that zm_detect is not triggered sometimes and other times it works fine, there's no consistency. I have tried making all the changes I can to the active zone I have set up on the road that is capturing cars and vehicles. I can run zm_detect and zm_event_start without issue every time and it's running zm_detect even parallel detects manually run as I can see 2 x Python3 jobs on nvidia-smi. it's the triggering from an event that does not always work. On triggered and none triggered zm_detect events they all have good Yolov4 detection. When working Plate_Rec works also. See logs here and screenshots below,

--- > zmesdetect_m6.log
06/29/22 12:15:55 zmesdetect_m6[361341] INF ZMLog.py:292 [Setting up signal handler for logs]
06/29/22 12:15:55 zmesdetect_m6[361341] INF ZMLog.py:301 [Switching global logger to ZMLog]
06/29/22 12:15:56 zmesdetect_m6[361341] INF zm_detect.py:284 [---------| app:6.1.28, pyzm:0.3.56, ES:6.1.28
, OpenCV:4.5.1|------------]
06/29/22 12:15:56 zmesdetect_m6[361341] INF utils.py:405 [Reading config from: /etc/zm/objectconfig.ini]
06/29/22 12:15:56 zmesdetect_m6[361341] INF utils.py:410 [Reading secrets from: /etc/zm/secrets.ini]
06/29/22 12:15:56 zmesdetect_m6[361341] INF zm_detect.py:309 [Importing local classes for Object/Face]
06/29/22 12:15:56 zmesdetect_m6[361341] INF zm_detect.py:335 [Connecting with ZM APIs]
06/29/22 12:16:19 zmesdetect_m6[361341] INF zm_detect.py:480 [Prediction string:[s] detected:car:91% ]

--- > zmeventnotification.log
29/06/22 12:16:23.213613 zmeventnotification[361337].INF [main:1048] [|----> FORK:Road (6), eid:20171 Sending event_start notification over FCM]
29/06/22 12:17:41.374192 zmeventnotification[361337].INF [main:1048] [|----> FORK:Road (6), eid:20171 Event 20171 for Monitor 6 has finished]
29/06/22 12:17:43.375129 zmeventnotification[361337].INF [main:1048] [|----> FORK:Road (6), eid:20171 end hooks/use hooks not being used, going to directly send out a notification if checks pass]
29/06/22 12:17:45.375572 zmeventnotification[361337].INF [main:1048] [|----> FORK:Road (6), eid:20171 Sending event_end notification over FCM]
29/06/22 12:20:15.033422 zmeventnotification[353303].INF [main:1048] [PARENT: Re-loading monitors]
29/06/22 12:25:20.033704 zmeventnotification[353303].INF [main:1048] [PARENT: Re-loading monitors]
29/06/22 12:26:55.032833 zmeventnotification[353303].ERR [ZoneMinder::Memory:306] [Shared data not valid for monitor 6]
29/06/22 12:26:55.035554 zmeventnotification[353303].WAR [main:1467] [ Memory verify failed for Road(id:6)]
29/06/22 12:30:25.033380 zmeventnotification[353303].INF [main:1048] [PARENT: Re-loading monitors]

--- > Extract from zmc_m6 for zm_detect that didn't get triggered, but it did save an event.
06/29/22 12:54:57.150795 zmc_m6[361935].INF-zm_monitor.cpp/1980 [Road: 42134 - Gone into alarm state PreAlarmCount: 0 > AlarmFrameCount:1 Cause:Motion Road]
06/29/22 12:54:57.155182 zmc_m6[361935].INF-zm_monitor.cpp/1987 [Road: 42133 - Opening new event 20176, alarm start]
06/29/22 12:54:57.575242 zmc_m6[361935].INF-zm_monitor.cpp/2019 [Road: 42144 - Gone into alert state]
06/29/22 12:54:58.001352 zmc_m6[361935].INF-zm_zone.cpp/186 [ExtendAlarm count: 0, ExtendAlarm frames: 0]
06/29/22 12:54:59.785971 zmc_m6[361896].INF-zm_monitor.cpp/1680 [Road: 42200 - Capturing at 24.84 fps, capturing bandwidth 166582bytes/sec Analysing at 24.84 fps]
06/29/22 12:55:03.774561 zmc_m6[361896].INF-zm_monitor.cpp/1680 [Road: 42300 - Capturing at 25.07 fps, capturing bandwidth 164736bytes/sec Analysing at 25.07 fps]
06/29/22 12:55:04.044858 zmc_m6[361935].INF-zm_monitor.cpp/2027 [Road: 42306 - Left alarm state (20176) - 177(11) images]
06/29/22 12:55:04.044877 zmc_m6[361935].INF-zm_monitor.cpp/2032 [Road: 42306 - Closing event 20176, alarm end]

--- > Extract from zmc_m6 for zm_detect that did run and save and event
06/29/22 12:15:49.486309 zmc_m6[359611].INF-zm_zone.cpp/186 [ExtendAlarm count: 0, ExtendAlarm frames: 0]
06/29/22 12:15:49.721293 zmc_m6[359611].INF-zm_zone.cpp/186 [ExtendAlarm count: 0, ExtendAlarm frames: 0]
06/29/22 12:15:49.957774 zmc_m6[359611].INF-zm_zone.cpp/186 [ExtendAlarm count: 0, ExtendAlarm frames: 0]
06/29/22 12:15:50.285881 zmc_m6[359611].INF-zm_zone.cpp/186 [ExtendAlarm count: 0, ExtendAlarm frames: 0]
06/29/22 12:15:50.845545 zmc_m6[359611].INF-zm_zone.cpp/186 [ExtendAlarm count: 0, ExtendAlarm frames: 0]
06/29/22 12:15:51.031263 zmc_m6[359611].INF-zm_zone.cpp/186 [ExtendAlarm count: 0, ExtendAlarm frames: 0]
06/29/22 12:15:51.419683 zmc_m6[359611].INF-zm_zone.cpp/186 [ExtendAlarm count: 0, ExtendAlarm frames: 0]
06/29/22 12:15:51.747513 zmc_m6[359611].INF-zm_zone.cpp/186 [ExtendAlarm count: 0, ExtendAlarm frames: 0]
06/29/22 12:15:52.051025 zmc_m6[359611].INF-zm_zone.cpp/186 [ExtendAlarm count: 0, ExtendAlarm frames: 0]
06/29/22 12:15:52.483149 zmc_m6[359573].INF-zm_monitor.cpp/1680 [Road: 84200 - Capturing at 24.96 fps, capturing bandwidth 165930bytes/sec Analysing at 12.48 fps]
06/29/22 12:15:52.657238 zmc_m6[359611].INF-zm_zone.cpp/186 [ExtendAlarm count: 0, ExtendAlarm frames: 0]
06/29/22 12:15:54.430958 zmc_m6[359611].INF-zm_monitor.cpp/1980 [Road: 84248 - Gone into alarm state PreAlarmCount: 0 > AlarmFrameCount:1 Cause:Motion Road]
06/29/22 12:15:54.433977 zmc_m6[359611].INF-zm_monitor.cpp/1987 [Road: 84247 - Opening new event 20171, alarm start]
06/29/22 12:15:56.476403 zmc_m6[359573].INF-zm_monitor.cpp/1680 [Road: 84300 - Capturing at 25.04 fps, capturing bandwidth 164413bytes/sec Analysing at 25.04 fps]
06/29/22 12:15:56.542043 zmc_m6[359611].INF-zm_monitor.cpp/2019 [Road: 84300 - Gone into alert state]
06/29/22 12:16:00.472098 zmc_m6[359573].INF-zm_monitor.cpp/1680 [Road: 84400 - Capturing at 25.03 fps, capturing bandwidth 165155bytes/sec Analysing at 12.51 fps]
06/29/22 12:16:02.015021 zmc_m6[359611].INF-zm_monitor.cpp/2027 [Road: 84437 - Left alarm state (20171) - 194(53) images]
06/29/22 12:16:02.015040 zmc_m6[359611].INF-zm_monitor.cpp/2032 [Road: 84437 - Closing event 20171, alarm end]
---
Alarm
Alarm
Alarm.png (366.6 KiB) Viewed 206 times
Summary
Summary
Summary.png (182.29 KiB) Viewed 206 times
I have checked zm_eventnotification.log and nothing is showing at the time of the event. Even with an event that has more alarm frames found does not run zm_detect? any ideas? I need to trigger zm_event_start on each event which it is not doing. I can provide what logs are required to look further.

Help is much appreciated if anyone has seen this issue?

Cheers,
Andy
Andybcfc
Posts: 2
Joined: Wed Jun 29, 2022 10:18 am

Re: Events are Triggered but zm_detect/Event Start for Object Detection does not always run?

Post by Andybcfc »

Fixed the issue by downgrading to 1.34.26. I now get constant detection being processed correctly. The issue seemed to be related to the zmMemattach process which caused ZM to not release the IP cam so I had to kill the zmeventnotification process running under www-data.
Post Reply