I setup event server with opencv. Event server updates the notes with object detection (person, car, face, etc....) for new events since the setup.
Is there a way to update the notes for all the older events using event server object detection? This way I can delete old false negative events, but keep events that have people in it so I can clear up hard drive space. Thanks.
Object detection for older events?
Re: Object detection for older events?
You can run detect.py --eventid 1234 from a filter....
-
- Posts: 3
- Joined: Fri May 23, 2025 5:07 am
Re: Object detection for older events?
I'm not a dev and I'm struggling with this.
I took your suggestion and I'm trying to use event filter execute a command on all matches
I tried using
python3 zm_detect.py
but couldn't get that to work. I tried running python3 zm_detect.py on the command line, but got errors about permissions. I think I have to run it as www-data?
Now I'm trying to use zm_event_start.sh. I've used that on the command line with success. I just needed to add --notes TRUE so that it would update the cause description to add person detection.
I'm using %EI% to get the event id, but then it keeps appending the path of the event to the command and that messes things up.
I've been googling, searching for hours, please help.
I took your suggestion and I'm trying to use event filter execute a command on all matches
I tried using
python3 zm_detect.py
but couldn't get that to work. I tried running python3 zm_detect.py on the command line, but got errors about permissions. I think I have to run it as www-data?
Now I'm trying to use zm_event_start.sh. I've used that on the command line with success. I just needed to add --notes TRUE so that it would update the cause description to add person detection.
I'm using %EI% to get the event id, but then it keeps appending the path of the event to the command and that messes things up.
I've been googling, searching for hours, please help.
Re: Object detection for older events?
/var/lib/zmeventnotification/bin/zm_event_start.sh 19329459
[ WARN:0@3.411] global net_impl.cpp:178 setUpNet DNN module was not built with CUDA backend; switching to CPU
[s] detected:bowl:91% bird:71% --SPLIT--{"labels": ["bowl", "bird"], "boxes": [[322, 28, 374, 78], [224, 92, 350, 226]], "frame_id": "snapshot", "confidences": [0.9128377437591553, 0.7132459878921509], "image_dimensions": {"original": [1080, 1920], "resized": [450, 800]}}
When running from command line, it doesn't need to be www-data, could be root, so:
sudo /var/lib/zmeventnotification/bin/zm_event_start.sh 19329459
Or if you want to make sure www-data can run it
sudo su -s/bin/bash -c"/var/lib/zmeventnotification/bin/zm_event_start.sh 19329459" www-data
[ WARN:0@3.411] global net_impl.cpp:178 setUpNet DNN module was not built with CUDA backend; switching to CPU
[s] detected:bowl:91% bird:71% --SPLIT--{"labels": ["bowl", "bird"], "boxes": [[322, 28, 374, 78], [224, 92, 350, 226]], "frame_id": "snapshot", "confidences": [0.9128377437591553, 0.7132459878921509], "image_dimensions": {"original": [1080, 1920], "resized": [450, 800]}}
When running from command line, it doesn't need to be www-data, could be root, so:
sudo /var/lib/zmeventnotification/bin/zm_event_start.sh 19329459
Or if you want to make sure www-data can run it
sudo su -s/bin/bash -c"/var/lib/zmeventnotification/bin/zm_event_start.sh 19329459" www-data
Re: Object detection for older events?
Yeah the path thing is a 1.36 thing... in 1.37 it won't do that.
You could alter your zmfilter.pl to behave like 1.37
line 1062:
my $command = $filter->{AutoExecuteCmd}.' '.$event_path;
$command = substituteTags($command, $filter, $Event);
Make it look like:
my $command = $filter->{AutoExecuteCmd};
if ($command =~ /%\w+%/) {
$command = substituteTags($command, $filter, $Event);
} else {
$command .= ' '.$Event->Path();
}
You could alter your zmfilter.pl to behave like 1.37
line 1062:
my $command = $filter->{AutoExecuteCmd}.' '.$event_path;
$command = substituteTags($command, $filter, $Event);
Make it look like:
my $command = $filter->{AutoExecuteCmd};
if ($command =~ /%\w+%/) {
$command = substituteTags($command, $filter, $Event);
} else {
$command .= ' '.$Event->Path();
}