I recently installed mlapi locally (on the same machine as the event notification server). I hoped that it could speed up the detection process by loading the model once. However, I found the process took longer with mlapi than without mlapi. Please help me to understand why.
when I run zm_detect manually:
Code: Select all
sudo -u www-data /var/lib/zmeventnotification/bin/zm_detect.py --config /etc/zm/objectconfig.ini --eventid 487487 --monitorid 22 --debug
Code: Select all
....
Jun 21 2025 20:42:34.908320 [DBG 2] Using URL 487487 for stream
Jun 21 2025 20:42:34.908347 [DBG 2] We will only process frames: ['snapshot', 'alarm']
Jun 21 2025 20:42:34.908366 [DBG 2] No need to start streams, we are picking images from https://x.x.x.x/zm/index.php?view=image&eid=487487
Jun 21 2025 20:42:34.908393 [DBG 2] Trying to convert snapshot to a real frame id
Jun 21 2025 20:42:34.908432 [DBG 3] No need to relogin as access token still has 86.25531593333334 minutes remaining
Jun 21 2025 20:42:34.908467 [DBG 3] make_request called with url=https://x.x.x.x/zm/api/events/487487.json payload={} type=get query={'token': 'xxxxxx'}
Jun 21 2025 20:42:45.288054 [DBG 2] At the point of analysis, Event:487487 snapshot frame id was:20,so using it
Jun 21 2025 20:42:45.288197 [DBG 3] Reading https://x.x.x.x/zm/index.php?view=image&eid=487487&fid=20
Jun 21 2025 20:42:45.288308 [DBG 3] No need to relogin as access token still has 86.08231828333334 minutes remaining
Jun 21 2025 20:42:45.288399 [DBG 3] make_request called with url=https://x.x.x.x/zm/index.php?view=image&eid=487487&fid=20 payload={} type=get query={'token': 'xxxxxx'}
Jun 21 2025 20:42:45.319819 [DBG 1] perf: Starting for frame:20
....
Jun 21 2025 20:42:48.482418 [DBG 1] perf: TOTAL detection sequence (with image loads) took: 13574.27 ms to process 487487
Code: Select all
....
06/21/25 20:58:02 zmesdetect_m22[1453443] DBG2 Media.py:99 [Using URL 487487 for stream]
06/21/25 20:58:02 zmesdetect_m22[1453443] DBG2 Media.py:114 [We will only process frames: ['snapshot']]
06/21/25 20:58:02 zmesdetect_m22[1453443] DBG2 Media.py:137 [No need to start streams, we are picking images from https://x.x.x.x/zm/index.php?view=image&eid=487487]
06/21/25 20:58:02 zmesdetect_m22[1453443] DBG3 Media.py:271 [Reading https://x.x.x.x/zm/index.php?view=image&eid=487487&fid=snapshot]
06/21/25 20:58:02 zmesdetect_m22[1453443] DBG3 api.py:144 [No need to relogin as access token still has 119.99980506666667 minutes remaining]
06/21/25 20:58:02 zmesdetect_m22[1453443] DBG3 api.py:272 [make_request called with url=https://x.x.x.x/zm/index.php?view=image&eid=487487&fid=snapshot payload={} type=get query={'token': xxxxxx'}]
06/21/25 20:58:02 zmesdetect_m22[1453443] DBG1 detect_sequence.py:654 [perf: Starting for frame:snapshot]
....
06/21/25 20:58:05 zmesdetect_m22[1453443] DBG1 detect_sequence.py:827 [perf: TOTAL detection sequence (with image loads) took: 2827.66 ms to process 487487]
Thanks
Edit: to add that I'm running zm v1.36.35 with Ubuntu 22.04.5 LTS