Page 1 of 1

Object detection working, kind of

Posted: Wed Nov 13, 2019 12:13 am
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??

Re: Object detection working, kind of

Posted: Wed Nov 13, 2019 2:33 am
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.

Re: Object detection working, kind of

Posted: Wed Nov 13, 2019 8:39 pm
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"}}

Re: Object detection working, kind of

Posted: Fri Jan 17, 2020 1:30 pm
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

Re: Object detection working, kind of

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

Re: Object detection working, kind of

Posted: Fri Jan 17, 2020 3:38 pm
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

Re: Object detection working, kind of

Posted: Fri Jan 17, 2020 4:08 pm
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.