Object detection working, kind of

Discussion topics related to mobile applications and ZoneMinder Event Server (including machine learning)
Post Reply
Chimaera
Posts: 21
Joined: Mon Apr 15, 2019 8:13 pm

Object detection working, kind of

Post by Chimaera »

I'm running 1.33.12 on Raspian Buster - I've tried upgrading to 1.33.14 but it's dependencies break other things I have installed. Anyway, I've got object detection working in that the logs show it detecting the object(s) (car, person etc) but then it throws "Could not write image to ZoneMinder as eventpath not present". I've double checked that write_image_to_zm=yes and hook_pass_image_path=yes. I've got wait: 10 in my ini file, and this is happening both in real-time detection and when running detect_wrapper from the command line. Any ideas as to what might be throwing the "eventpath not present" error??
Chimaera
Posts: 21
Joined: Mon Apr 15, 2019 8:13 pm

Re: Object detection working, kind of

Post by Chimaera »

I managed to get up to 1.33.14 and the same thing happens - I've tried grabbing zmeventnotification from GIT and reinstalling with new .ini files, same result.
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: Object detection working, kind of

Post by asker »

As you might have already seen, the comments just above the setting say you need 1.33.x. Now that you have updated to 1.33.x, this should not happen. Please post debug logs.

You'll know you are on the right ZM version, when you do the following test:

1. Launch a browser, login to ZM
2. Launch another tab and type in

Code: Select all

https://yoursever/zm/api/events.json
In the output, if you see a field called "FileSystemPath" for event entries, you are good.

example:

Code: Select all

{"Event":{"Id":"12344","MonitorId":"10","StorageId":"1","SecondaryStorageId":"0","Name":"New Event","Cause":"Continuous","StartTime":"2019-07-14 12:25:15","EndTime":null,"Width":"1280","Height":"720","Length":"1300.83","Frames":"7800","AlarmFrames":"0","DefaultVideo":"","SaveJPEGs":"0","TotScore":"0","AvgScore":"0","MaxScore":"0","Archived":"0","Videoed":"1","Uploaded":"0","Emailed":"0","Messaged":"0","Executed":"0","Notes":"","StateId":"1","Orientation":"0","DiskSpace":null,"Scheme":"Medium","Locked":false,"MaxScoreFrameId":"833061","FileSystemPath":"\/var\/cache\/zoneminder\/events\/10\/2019-07-14\/12344"}}
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
torkilt
Posts: 38
Joined: Thu Jul 06, 2017 10:56 am

Re: Object detection working, kind of

Post by torkilt »

Hi

I'm facing a seemingly similar issue. Zoneminder is version 1.33.16.

Test from command line:

Code: Select all

Jan 17 13:48:39 zm sudo[12000]:     root : TTY=pts/3 ; PWD=/var/lib/zmeventnotification/images ; USER=apache ; COMMAND=/var/lib/zmeventnotification/bin/zm_event_start.sh 2668 4
Jan 17 13:48:39 zm sudo[12000]: pam_unix(sudo:session): session opened for user apache by torkil(uid=0)
Jan 17 13:48:40 zm /zm_detect.py[12003]: INF [zmesdetect_m4] [---------| app version: 5.4.1 |------------]
Jan 17 13:48:40 zm /zm_detect.py[12003]: INF [zmesdetect_m4] [Importing local classes for Yolo/Face]
Jan 17 13:48:41 zm zmeventnotification[11246]: INF [PARENT: There are 0 active child forks...]
Jan 17 13:48:41 zm zmeventnotification[11246]: INF [PARENT: There are 0 new Events to process]
Jan 17 13:48:42 zm /zm_detect.py[12003]: INF [zmesdetect_m4] [object:person at [576, 287, 692, 667] has a acceptable confidence:0.9492924809455872 compared to min confidence of: 0.3, adding]
Jan 17 13:48:42 zm /zm_detect.py[12003]: INF [zmesdetect_m4] [rejecting object:chair at [570, 144, 612, 200] because its confidence is :0.2121814340353012 compared to min confidence of: 0.3]
Jan 17 13:48:42 zm /zm_detect.py[12003]: INF [zmesdetect_m4] [labels found: ['person']]
Jan 17 13:48:45 zm /zm_detect.py[12003]: ERR [zmesdetect_m4] [Could not write image to ZoneMinder as eventpath not present]
Jan 17 13:48:45 zm /zm_detect.py[12003]: INF [zmesdetect_m4] [Removing matches to past detections]
Jan 17 13:48:45 zm /zm_detect.py[12003]: INF [zmesdetect_m4] [Prediction string:[a] detected:person:95% ]
Jan 17 13:48:45 zm sudo[12000]: pam_unix(sudo:session): session closed for user apache
Images are pulled and debug image written:

Code: Select all

2668-alarm-bbox.jpg  2668-alarm.jpg  2668-snapshot.jpg  monitor-4-data.pkl
FileSystemPath seems to be present in event.json:

Code: Select all

FileSystemPath	"/zoneminder//4/2020-01-10/1"
Suggestions? I can't load the events.json directly with curl but it loads in firefox, might that be it?

Thanks,

Torkil
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: Object detection working, kind of

Post by asker »

What is the exact command line instruction you are using?
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
torkilt
Posts: 38
Joined: Thu Jul 06, 2017 10:56 am

Re: Object detection working, kind of

Post by torkilt »

asker wrote: Fri Jan 17, 2020 2:28 pm What is the exact command line instruction you are using?

Code: Select all

sudo -u apache /var/lib/zmeventnotification/bin/zm_event_start.sh 2668 4
Mvh.

Torkil
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: Object detection working, kind of

Post by asker »

You also need to pass the event path if you want to test the event path functionality. Or just run it as a daemon and when an event is detected it will work.
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
Post Reply