Event Server Object Detection not working
Re: Event Server Object Detection not working
I have played around with python a bit but would consider myself rookie status at best.
I decided to start over one more time and attempt to follow every step of your article and report any issues along the way rather than trying myself to resolve them.
The first issue I ran into was when installing the zmeventnotification config's it would throw an error in which originally I thought was a problem but now I understand that it is using yml files and not ini files anymore. I created zm_secrets.yml from your example and modified objectconfig.yml with the required parameters. I don't see a zmeventnotification.yml but it seems to be using the defaults from zmeventnotification.pl so I guess that is fine.
The next issue is creating a user in MLAPI after cloning the repo. I attempted to create the directory db as suggested but it said it was already there. I also deleted db and recreated it to no avail. I always get the same error. I even went as far as to create a blank db.json file
root@NVR:~/git/mlapi# python3 mlapi_dbuser.py -u mlapitest -p test123
mlapi db: './db/db.json' does not exist or is not a file! you must create a mlapi DB user by running python3 ml_dbuser.py
Traceback (most recent call last):
File "mlapi_dbuser.py", line 21, in <module>
db = Database(prompt_to_create=False, db_globals=g)
File "/usr/local/lib/python3.8/dist-packages/pyzm/helpers/mlapi_db.py", line 31, in __init__
g.logger.log_close()
AttributeError: 'NoneType' object has no attribute 'log_close'
After creating a blank db.json
root@NVR:~/git/mlapi# python3 mlapi_dbuser.py -u mlapitest -p test123
Traceback (most recent call last):
File "mlapi_dbuser.py", line 21, in <module>
db = Database(prompt_to_create=False, db_globals=g)
File "/usr/local/lib/python3.8/dist-packages/pyzm/helpers/mlapi_db.py", line 26, in __init__
g.logger.error(f"{lp} there are no configured users in the MLAPI Database! you must create a mlapi "
AttributeError: 'NoneType' object has no attribute 'error'
When I originally ran into the zmeventnotification config error I grabbed the repo from here
git clone https://github.com/pliablepixels/zmeven ... cation.git
and set that up which was giving the 'invalid device function' error.
Now that I have everything as close to your article as I can get it besides the issues I mentuned above I am getting the following error when trying to detect.
root@NVR:/var/lib/zmeventnotification/bin# ./zm_detect.py --eventid 19 --debug
zmes: err_msg->process_config() missing 1 required positional argument: 'type_'
zmes: traceback: Traceback (most recent call last):
File "./zm_detect.py", line 1468, in <module>
main_handler()
File "./zm_detect.py", line 563, in main_handler
zmesc, g = proc_conf(args=args, conf_globals=g)
TypeError: process_config() missing 1 required positional argument: 'type_'
I decided to start over one more time and attempt to follow every step of your article and report any issues along the way rather than trying myself to resolve them.
The first issue I ran into was when installing the zmeventnotification config's it would throw an error in which originally I thought was a problem but now I understand that it is using yml files and not ini files anymore. I created zm_secrets.yml from your example and modified objectconfig.yml with the required parameters. I don't see a zmeventnotification.yml but it seems to be using the defaults from zmeventnotification.pl so I guess that is fine.
The next issue is creating a user in MLAPI after cloning the repo. I attempted to create the directory db as suggested but it said it was already there. I also deleted db and recreated it to no avail. I always get the same error. I even went as far as to create a blank db.json file
root@NVR:~/git/mlapi# python3 mlapi_dbuser.py -u mlapitest -p test123
mlapi db: './db/db.json' does not exist or is not a file! you must create a mlapi DB user by running python3 ml_dbuser.py
Traceback (most recent call last):
File "mlapi_dbuser.py", line 21, in <module>
db = Database(prompt_to_create=False, db_globals=g)
File "/usr/local/lib/python3.8/dist-packages/pyzm/helpers/mlapi_db.py", line 31, in __init__
g.logger.log_close()
AttributeError: 'NoneType' object has no attribute 'log_close'
After creating a blank db.json
root@NVR:~/git/mlapi# python3 mlapi_dbuser.py -u mlapitest -p test123
Traceback (most recent call last):
File "mlapi_dbuser.py", line 21, in <module>
db = Database(prompt_to_create=False, db_globals=g)
File "/usr/local/lib/python3.8/dist-packages/pyzm/helpers/mlapi_db.py", line 26, in __init__
g.logger.error(f"{lp} there are no configured users in the MLAPI Database! you must create a mlapi "
AttributeError: 'NoneType' object has no attribute 'error'
When I originally ran into the zmeventnotification config error I grabbed the repo from here
git clone https://github.com/pliablepixels/zmeven ... cation.git
and set that up which was giving the 'invalid device function' error.
Now that I have everything as close to your article as I can get it besides the issues I mentuned above I am getting the following error when trying to detect.
root@NVR:/var/lib/zmeventnotification/bin# ./zm_detect.py --eventid 19 --debug
zmes: err_msg->process_config() missing 1 required positional argument: 'type_'
zmes: traceback: Traceback (most recent call last):
File "./zm_detect.py", line 1468, in <module>
main_handler()
File "./zm_detect.py", line 563, in main_handler
zmesc, g = proc_conf(args=args, conf_globals=g)
TypeError: process_config() missing 1 required positional argument: 'type_'
Re: Event Server Object Detection not working
Oh boy, I need to update that article to make a distinction between the source zmes and my forked version.
Ok let me try and nail these one by one. For the no db folder when attempting to create a db user when using the mlapi_dbuser.py script. What directory are you running it in? It says you still have the base-data-path set to '.' that means it is using whatever directory you run the script in as the install dir. I recommend putting the base data path as an absolute path (if your mlapi is installed at /home/me/mlapi put /home/me/mlapi as the base data path).
My forked version will not work with any of the source repos, so mixing baudneo repos with anyone elses will result in total failure.
Zmeventnotification.ini is the configuration file for the zmeventnotification.pl perl daemon script that reads the shared memory looking for ZoneMinder events and also runs the websocket interface to connect to zmninja clients. Zmeventnotification.ini needs to stay an .Ini file. The only files that moves to a yaml syntax are the objectconfig and the mlapiconfig (and their secrets files).
The final error is because you are using the source repo zmeventnotification with my forked pyzm.
Ok let me try and nail these one by one. For the no db folder when attempting to create a db user when using the mlapi_dbuser.py script. What directory are you running it in? It says you still have the base-data-path set to '.' that means it is using whatever directory you run the script in as the install dir. I recommend putting the base data path as an absolute path (if your mlapi is installed at /home/me/mlapi put /home/me/mlapi as the base data path).
My forked version will not work with any of the source repos, so mixing baudneo repos with anyone elses will result in total failure.
Zmeventnotification.ini is the configuration file for the zmeventnotification.pl perl daemon script that reads the shared memory looking for ZoneMinder events and also runs the websocket interface to connect to zmninja clients. Zmeventnotification.ini needs to stay an .Ini file. The only files that moves to a yaml syntax are the objectconfig and the mlapiconfig (and their secrets files).
The final error is because you are using the source repo zmeventnotification with my forked pyzm.
Re: Event Server Object Detection not working
I'll hop on here shortly and try and walk you through installing the original repos.
You have opencv compiled with GPU support?
Edit the fork is not stable enough yet to be friendly. I've been making optimizations lately and haven't tested installing from scratch in awhile.
I'll walk you through setting up source repos and in the future if you want to check out the fork, try it.
You have opencv compiled with GPU support?
Edit the fork is not stable enough yet to be friendly. I've been making optimizations lately and haven't tested installing from scratch in awhile.
I'll walk you through setting up source repos and in the future if you want to check out the fork, try it.
Re: Event Server Object Detection not working
Repos have been updated, I installed from scratch and got detections going with minimum configuration so I'm hoping things should be good now.
Re: Event Server Object Detection not working
GMail likes to decide for me what is important and what is not so I never got notified on your response. Let me pull everything again and see were I land.
Re: Event Server Object Detection not working
OK, so I was able to get to the point of running the debug on MLAPI and it seems to be working but I am not getting any detection. I tried it on 4 different recordings that clearly have a woman and a child in them.
I've looked over the entire article a few times again and I'm pretty sure I have everything correct.
What am I missing here?
Notice the BASE EXCEPTION at the beginning.
I've looked over the entire article a few times again and I'm pretty sure I have everything correct.
What am I missing here?
Notice the BASE EXCEPTION at the beginning.
Code: Select all
root@NVR:/home/jrosetto# es.debug.objdet 66
BASE EXCEPTION-> 'NoneType' object has no attribute 'timestamp'
11/12/21 10:58:41.692528 zmesdetect_m4[2612] DBG1 new_yaml.py:242->[config:init: the supplied config file exists -> '/etc/zm/objectconfig.yml']
11/12/21 10:58:41.816086 zmesdetect_m4[2612] DBG1 new_yaml.py:265->[config::init: default configuration built (no secrets or substitution vars replaced, yet!)]
11/12/21 10:58:41.817735 zmesdetect_m4[2612] DBG1 new_yaml.py:170->[config:zmes:proc: 35 built in default keys added to the 'base' config -> ['custom_push', 'force_mpd', 'same_model_high_conf', 'skip_mons', 'force_live', 'sanitize_str', 'basic_user', 'basic_password', 'image_path', 'max_detection_size', 'contained_area', 'hass_enabled', 'hass_notify', 'hass_cooldown', 'push_jpg', 'push_jpg_key', 'push_gif', 'push_gif_key', 'push_debug_device', 'push_cooldown', 'mqtt_topic', 'mqtt_broker', 'mqtt_port', 'tls_cert', 'tls_key', 'fp16_target', 'alpr_api_type', 'alpr_url', 'openalpr_recognize_vehicle', 'openalpr_country', 'openalpr_state', 'openalpr_min_confidence', 'smart_fs_thresh', 'frame_strategy', 'same_model_sequence_strategy']]
11/12/21 10:58:41.818628 zmesdetect_m4[2612] DBG1 new_yaml.py:114->[config:zmes:proc: substituting '{{variables}}' for the 'base' config keys]
11/12/21 10:58:41.820262 zmesdetect_m4[2612] DBG1 new_yaml.py:136->[config:zmes: successfully replaced 3 default sub vars in the base config -> ['base_data_path', 'yolo_models', 'coral_models']]
11/12/21 10:58:41.821 zmesdetect_m4[2612] DBG1 new_yaml.py:285->[config:zmes: the configured secrets file exists and is a file -> '/etc/zm/zm_secrets.yml']
11/12/21 10:58:41.821603 zmesdetect_m4[2612] DBG1 new_yaml.py:291->[config:zmes: starting '{[secrets]}' substitution]
11/12/21 10:58:41.832082 zmesdetect_m4[2612] DBG1 new_yaml.py:324->[config:zmes: successfully replaced 19 secrets in the base config -> ['PUSHOVER_USER', 'mlapi_one_key', 'PUSHOVER_APP_TOKEN', 'MQTT_PASSWORD', 'HA_TOKEN', 'ZM_ML_USER', 'ML_PASSWORD', 'PUSHOVER_USER_KEY', 'ZM_USER', 'ML_USER', 'MQTT_USERNAME', 'ZM_ML_PASSWORD', 'PLATEREC_ALPR_KEY', 'ZM_PORTAL', 'ZM_PASSWORD', 'HA_SERVER', 'PUSHOVER_ERR_TOKEN', 'ZM_API_PORTAL', 'PUSHOVER_PASS']]
11/12/21 10:58:41.833107 zmesdetect_m4[2612] DBG1 new_yaml.py:329->[config:zmes: there are 2 secrets configured that have no substitution candidates in the base config or the secrets file -> ['AWS_SECRET_ACCESS_KEY', 'AWS_ACCESS_KEY_ID']]
11/12/21 10:58:41.835962 zmesdetect_m4[2612] DBG1 new_yaml.py:358->[config:zmes: starting '{{variable}}' substitution]
11/12/21 10:58:41.843418 zmesdetect_m4[2612] DBG1 new_yaml.py:375->[config:zmes: successfully replaced 51 sub vars in the base config -> ['tpu_efficientdet_lite3', 'yolo4_object_weights', 'platerec_min_score', 'yolo4_object_processor', 'gpu_max_lock_wait', 'openalpr_cmdline_binary', 'openalpr_cmdline_min_confidence', 'frame_set', 'object_detection_pattern', 'cpu_max_processes', 'platerec_min_dscore', 'face_recog_dist_threshold', 'known_images_path', 'contained_area', 'show_models', 'openalpr_cmdline_params', 'smart_fps_thresh', 'face_upsample_times', 'past_det_max_diff_area', 'tpu_object_weights_mobiledet', 'object_min_confidence', 'face_train_model', 'tpu_face_weights_mobilenetv2', 'yolo4_object_config', 'tpu_max_lock_wait', 'tpu_max_processes', 'yolo4_object_labels', 'save_unknown_faces_leeway_pixels', 'model_sequence', 'platerec_stats', 'face_detection_framework', 'max_detection_size', 'tpu_object_labels', 'face_detection_pattern', 'tpu_object_framework', 'tpu_min_confidence', 'face_num_jitters', 'unknown_images_path', 'frame_strategy', 'same_model_sequence_strategy', 'gpu_max_processes', 'disable_locks', 'save_unknown_faces', 'match_past_detections', 'tpu_object_weights_mobilenetv2', 'alpr_key', 'alpr_detection_pattern', 'face_model', 'cpu_max_lock_wait', 'yolo4_object_framework', 'tpu_tf2_mobilenetv2']]
11/12/21 10:58:41.846067 zmesdetect_m4[2612] DBG1 new_yaml.py:187->[config:zmes:proc: Base config has been built, all properly configured {[secrets]} and {{vars}} have been replaced! Remember you must manually build per monitor overrode configurations]
11/12/21 10:58:41.846678 zmesdetect_m4[2612] DBG1 zm_detect.py:586->[perf:zmes: building the intial config took 0.154242 ]
11/12/21 10:58:41.847289 zmesdetect_m4[2612] DBG1 new_yaml.py:747->[zmes:api create: building ZM API Session]
11/12/21 10:58:41.852829 zmesdetect_m4[2612] DBG1 api.py:112->[api: SSL certificate verification disabled (encryption enabled, vulnerable to MITM attacks)]
11/12/21 10:58:41.854028 zmesdetect_m4[2612] DBG1 api.py:281->[api: no token found, trying user/pass for login]
11/12/21 10:58:42.808937 zmesdetect_m4[2612] DBG1 ZMLog:336->[------| FORKED NEO --- app->Hooks: 7.0.2 - pyzm: 1.0.2 - ES: 7.0.0 - OpenCV:4.5.4 |------]
11/12/21 10:58:42.059851 zmesdetect_m4[2612] DBG1 zm_detect.py:617->[zmes: waiting for the monitor ID to be verified! This happens on PAST events because the api double checks to make sure its the correct monitor ID]
11/12/21 10:58:42.33306 zmesdetect_m4[2612] DBG1 api.py:318->[api: detected API ver 2.0+, using token system]
11/12/21 10:58:42.378183 zmesdetect_m4[2612] DBG1 new_yaml.py:780->[zmes:api create: ZM API created]
11/12/21 10:58:42.391695 zmesdetect_m4[2612] DBG1 zm_detect.py:631->[perf:zmes: Monitor ID (4) verified! pausing to wait for verification took 0.331749 seconds -=- api creation took 0.544558 seconds]
11/12/21 10:58:42.814745 zmesdetect_m4[2612] DBG1 ZMLog:336->[zmes: Setting up signal handlers for log 'rotation' and log 'interrupt']
11/12/21 10:58:42.489609 zmesdetect_m4[2612] DBG1 zm_detect.py:698->[zmes: this is a 'PAST' (debugging?) event!]
11/12/21 10:58:42.817679 zmesdetect_m4[2612] DBG1 ZMLog:336->[|----------= Encrypted Route Name: 'mlapi_one' | Gateway URL: 'http://localhost:5000/api/v1' | Weight: 0 =----------|]
11/12/21 10:58:42.495306 zmesdetect_m4[2612] DBG1 zm_detect.py:103->[zmes:mlapi:login: No need to login, access token is valid for 1229.599796295166 sec]
11/12/21 10:58:42.501951 zmesdetect_m4[2612] DBG1 zm_detect.py:1578->[zmes: no predictions returned from detections]
11/12/21 10:58:42.505428 zmesdetect_m4[2612] DBG1 zm_detect.py:1646->[perf:zmes:FINAL: 'Monitor': Vinnys Room (4)->'Event': 66 [PAST event] [total:0.817021] [detection:0.005708] [after core detection: 0.001668] ]
11/12/21 10:58:42.822629 zmesdetect_m4[2612] DBG1 ZMLog:336->[Connected to ZoneMinder Logging system with user 'www-data' -> '/var/log/zm/zmesdetect_m4.log']
Re: Event Server Object Detection not working
One moment i will review that section of code and see whats going on
Re: Event Server Object Detection not working
Please open the zm_detect.py script in a text editor and goto line 798. Line 798 should be the "BASE EXCEPTION" line and add 1 line after it - ->
Opening zm_detect.py ->
To ->
If you are uncomfortable with editing the file I can prepare the file for you and send it. This will just print a traceback out to understand the error better, I haven't encountered that one before. After editing the file re run the detections and post the error with traceback please.
Opening zm_detect.py ->
Code: Select all
sudo -u www-data nano /var/lib/zmeventnotification/bin/zm_detect.py
Code: Select all
print(f"BASE EXCEPTION-> {all_ex}")
Code: Select all
print(f"BASE EXCEPTION-> {all_ex}")
print(format_exc())
Re: Event Server Object Detection not working
Err, actually I think I may know whats going on. Your system is hella faster than mine and the ZM API is not created by the time the remote detection si ready to be sent off. Ill fix this and push to repo ASAP.
Re: Event Server Object Detection not working
Awesome, I'll wait for your reply. I'm running on bare metal with nothing else running on it so that may be the difference.
Re: Event Server Object Detection not working
I pushed just now, let me know if that does the trick.
Im a bit slower for sure, older hardware and I am virtualized but still.... that's a big difference lol.
If my suspicion is correct that your system was getting to the remote detection before the API was fully initialized you should see a logging line that says something to this effect ->
Im a bit slower for sure, older hardware and I am virtualized but still.... that's a big difference lol.
Code: Select all
11/12/21 10:21:29.042393 zmesdetect_m1[3211] DBG1 zm_detect.py:596 [perf:zmes: building the intial config took 0.252425 ]
Code: Select all
waiting for the ZM API to fully initialize before creating a credential dump to be encrypted.
Re: Event Server Object Detection not working
No dice 
This is not a very fast system BTW. I threw it together from the junk we had in the back at work.
i5-2310 CPU @ 2.90GHz
2x4Gb DDR3 1333
512Gb Samsung Evo 850 SSD
2x4TB Seagate Constellation 7200rpm in Raid 1
NVIDIA GeForce GT 730 2GB Video Card
Love the comments BTW 
Any other throughts?

This is not a very fast system BTW. I threw it together from the junk we had in the back at work.
i5-2310 CPU @ 2.90GHz
2x4Gb DDR3 1333
512Gb Samsung Evo 850 SSD
2x4TB Seagate Constellation 7200rpm in Raid 1
NVIDIA GeForce GT 730 2GB Video Card
Code: Select all
root@NVR:/var/lib/zmeventnotification/bin# es.debug.objdet 83
11/12/21 13:54:40.716765 zmesdetect_m3[8782] DBG1 new_yaml.py:242->[config:init: the supplied config file exists -> '/etc/zm/objectconfig.yml']
11/12/21 13:54:40.837344 zmesdetect_m3[8782] DBG1 new_yaml.py:265->[config::init: default configuration built (no secrets or substitution vars replaced, yet!)]
11/12/21 13:54:40.838987 zmesdetect_m3[8782] DBG1 new_yaml.py:170->[config:zmes:proc: 35 built in default keys added to the 'base' config -> ['custom_push', 'force_mpd', 'same_model_high_conf', 'skip_mons', 'force_live', 'sanitize_str', 'basic_user', 'basic_password', 'image_path', 'max_detection_size', 'contained_area', 'hass_enabled', 'hass_notify', 'hass_cooldown', 'push_jpg', 'push_jpg_key', 'push_gif', 'push_gif_key', 'push_debug_device', 'push_cooldown', 'mqtt_topic', 'mqtt_broker', 'mqtt_port', 'tls_cert', 'tls_key', 'fp16_target', 'alpr_api_type', 'alpr_url', 'openalpr_recognize_vehicle', 'openalpr_country', 'openalpr_state', 'openalpr_min_confidence', 'smart_fs_thresh', 'frame_strategy', 'same_model_sequence_strategy']]
11/12/21 13:54:40.839883 zmesdetect_m3[8782] DBG1 new_yaml.py:114->[config:zmes:proc: substituting '{{variables}}' for the 'base' config keys]
11/12/21 13:54:40.841332 zmesdetect_m3[8782] DBG1 new_yaml.py:136->[config:zmes: successfully replaced 3 default sub vars in the base config -> ['base_data_path', 'coral_models', 'yolo_models']]
11/12/21 13:54:40.84202 zmesdetect_m3[8782] DBG1 new_yaml.py:285->[config:zmes: the configured secrets file exists and is a file -> '/etc/zm/zm_secrets.yml']
11/12/21 13:54:40.842638 zmesdetect_m3[8782] DBG1 new_yaml.py:291->[config:zmes: starting '{[secrets]}' substitution]
11/12/21 13:54:40.852088 zmesdetect_m3[8782] DBG1 new_yaml.py:324->[config:zmes: successfully replaced 19 secrets in the base config -> ['ML_PASSWORD', 'PUSHOVER_PASS', 'ZM_ML_USER', 'ZM_PORTAL', 'HA_TOKEN', 'MQTT_USERNAME', 'ZM_API_PORTAL', 'ZM_PASSWORD', 'ML_USER', 'mlapi_one_key', 'PUSHOVER_APP_TOKEN', 'PUSHOVER_ERR_TOKEN', 'PLATEREC_ALPR_KEY', 'PUSHOVER_USER', 'PUSHOVER_USER_KEY', 'MQTT_PASSWORD', 'ZM_ML_PASSWORD', 'HA_SERVER', 'ZM_USER']]
11/12/21 13:54:40.852773 zmesdetect_m3[8782] DBG1 new_yaml.py:329->[config:zmes: there are 2 secrets configured that have no substitution candidates in the base config or the secrets file -> ['AWS_ACCESS_KEY_ID', 'AWS_SECRET_ACCESS_KEY']]
11/12/21 13:54:40.85514 zmesdetect_m3[8782] DBG1 new_yaml.py:358->[config:zmes: starting '{{variable}}' substitution]
11/12/21 13:54:40.861826 zmesdetect_m3[8782] DBG1 new_yaml.py:375->[config:zmes: successfully replaced 51 sub vars in the base config -> ['yolo4_object_weights', 'yolo4_object_framework', 'same_model_sequence_strategy', 'openalpr_cmdline_binary', 'known_images_path', 'object_min_confidence', 'cpu_max_lock_wait', 'alpr_detection_pattern', 'save_unknown_faces_leeway_pixels', 'yolo4_object_config', 'tpu_max_processes', 'tpu_tf2_mobilenetv2', 'gpu_max_lock_wait', 'frame_strategy', 'yolo4_object_processor', 'tpu_object_weights_mobiledet', 'face_model', 'max_detection_size', 'face_recog_dist_threshold', 'tpu_object_framework', 'disable_locks', 'tpu_face_weights_mobilenetv2', 'tpu_object_weights_mobilenetv2', 'past_det_max_diff_area', 'contained_area', 'yolo4_object_labels', 'alpr_key', 'platerec_min_score', 'platerec_stats', 'smart_fps_thresh', 'face_train_model', 'unknown_images_path', 'match_past_detections', 'tpu_efficientdet_lite3', 'openalpr_cmdline_params', 'platerec_min_dscore', 'object_detection_pattern', 'face_detection_pattern', 'tpu_max_lock_wait', 'save_unknown_faces', 'tpu_object_labels', 'model_sequence', 'openalpr_cmdline_min_confidence', 'tpu_min_confidence', 'face_num_jitters', 'gpu_max_processes', 'show_models', 'face_upsample_times', 'face_detection_framework', 'cpu_max_processes', 'frame_set']]
11/12/21 13:54:40.865245 zmesdetect_m3[8782] DBG1 new_yaml.py:187->[config:zmes:proc: Base config has been built, all properly configured {[secrets]} and {{vars}} have been replaced! Remember you must manually build per monitor overrode configurations]
11/12/21 13:54:40.865981 zmesdetect_m3[8782] DBG1 zm_detect.py:598->[perf:zmes: building the intial config took 0.149303 ]
11/12/21 13:54:40.866759 zmesdetect_m3[8782] DBG1 new_yaml.py:747->[zmes:api create: building ZM API Session]
11/12/21 13:54:40.873659 zmesdetect_m3[8782] DBG1 api.py:112->[api: SSL certificate verification disabled (encryption enabled, vulnerable to MITM attacks)]
11/12/21 13:54:40.87499 zmesdetect_m3[8782] DBG1 api.py:281->[api: no token found, trying user/pass for login]
11/12/21 13:54:41.730185 zmesdetect_m3[8782] DBG1 ZMLog:336->[------| FORKED NEO --- app->Hooks: 7.0.2 - pyzm: 1.0.2 - ES: 7.0.0 - OpenCV:4.5.4 |------]
11/12/21 13:54:41.082593 zmesdetect_m3[8782] DBG1 zm_detect.py:629->[zmes: waiting for the monitor ID to be verified! This happens on PAST events because the api double checks to make sure its the correct monitor ID]
11/12/21 13:54:41.218199 zmesdetect_m3[8782] DBG1 api.py:318->[api: detected API ver 2.0+, using token system]
11/12/21 13:54:41.262891 zmesdetect_m3[8782] DBG1 new_yaml.py:780->[zmes:api create: ZM API created]
11/12/21 13:54:41.281848 zmesdetect_m3[8782] DBG1 zm_detect.py:643->[perf:zmes: Monitor ID (3) verified! pausing to wait for verification took 0.199186 seconds -=- api creation took 0.415296 seconds]
11/12/21 13:54:41.736265 zmesdetect_m3[8782] DBG1 ZMLog:336->[zmes: Setting up signal handlers for log 'rotation' and log 'interrupt']
11/12/21 13:54:41.403982 zmesdetect_m3[8782] DBG1 zm_detect.py:710->[zmes: this is a 'PAST' (debugging?) event!]
11/12/21 13:54:41.738408 zmesdetect_m3[8782] DBG1 ZMLog:336->[|----------= Encrypted Route Name: 'mlapi_one' | Gateway URL: 'http://localhost:5000/api/v1' | Weight: 0 =----------|]
11/12/21 13:54:41.406215 zmesdetect_m3[8782] DBG1 zm_detect.py:103->[zmes:mlapi:login: No need to login, access token is valid for 552.6180748939514 sec]
11/12/21 13:54:41.408381 zmesdetect_m3[8782] DBG1 zm_detect.py:258->[zmes:mlapi: waiting for the ZM API to fully initialize before creating a credential dump to be encrypted.]
11/12/21 13:54:41.742242 zmesdetect_m3[8782] DBG1 ZMLog:336->[Connected to ZoneMinder Logging system with user 'www-data' -> '/var/log/zm/zmesdetect_m3.log']
11/12/21 13:54:46.696156 zmesdetect_m3[8782] ERR zm_detect:264->[zmes:mlapi: Something is very wrong, waited for 5+ seconds for the g.api object to initialize fully. no dice. come inspect]
exiting with prejudice!

Any other throughts?
Re: Event Server Object Detection not working
It seems to me that maybe the credentials are incorrect? Or maybe ZM isn't setup to authorize correctly? ZM is not replying with an auth token.
Here are my logs for that section ->
You can see that the script logs when the tokens expire, that's how you can tell that ZM replied with tokens. I just copied the repo zm_detect.py so I am running the same code base as you. It is super weird that it replies that it is using API version 2.0 but doesn't include any tokens. I just looked at the code and added an exception for that exact case but honestly I have never seen that. I am trying to recreate this error by turning authentication options on and off.
Im running ZM on an old R710 I crammed a 1660ti into with a USB TPU. Proxmox with other containers and VM's using resources so I guess that's not so bad. Makes me want to upgrade though.
Here are my logs for that section ->
Code: Select all
11/12/21 12:10:18.525296 zmesdetect_m1[15366] DBG1 zm_detect.py:598 [perf:zmes: building the intial config took 0.24846 ]
11/12/21 12:10:18.526316 zmesdetect_m1[15366] DBG1 new_yaml.py:747 [zmes:api create: building ZM API Session]
11/12/21 12:10:18.535032 zmesdetect_m1[15366] DBG1 api.py:112 [api: SSL certificate verification disabled (encryption enabled, vulnerable to MITM attacks)]
11/12/21 12:10:18.537023 zmesdetect_m1[15366] DBG1 api.py:280 [api: no token found, trying user/pass for login]
11/12/21 12:10:18.658525 zmesdetect_m1[15366] DBG1 api.py:317 [api: detected API ver 2.0+, using token system]
11/12/21 12:10:18.659863 zmesdetect_m1[15366] DBG1 api.py:332 [api: access token expires on: 2021-11-12 18:10:18.659817 (21600s)]
11/12/21 12:10:18.661063 zmesdetect_m1[15366] DBG1 api.py:344 [api: refresh token expires on: 2021-11-13 12:10:18.661039 (86400s)]
11/12/21 12:10:18.662286 zmesdetect_m1[15366] DBG1 new_yaml.py:772 [zmes:api create: ZM API created, grabbing event and frmae buffer info from the API]
11/12/21 12:10:20.043491 zmesdetect_m1[15366] DBG1 ZMLog:336 [------| FORKED NEO --- app->Hooks: 7.0.2 - pyzm: 1.0.2 - ES: 7.0.0 - OpenCV:4.5.1 |------]
11/12/21 12:10:18.796577 zmesdetect_m1[15366] DBG1 zm_detect.py:629 [zmes: waiting for the monitor ID to be verified! This happens on PAST events because the api double checks to make sure its the correct monito
r ID]
Im running ZM on an old R710 I crammed a 1660ti into with a USB TPU. Proxmox with other containers and VM's using resources so I guess that's not so bad. Makes me want to upgrade though.
Last edited by tsp84 on Fri Nov 12, 2021 7:45 pm, edited 1 time in total.
Re: Event Server Object Detection not working
Good call man. I've reinstalled so many times it's hard to remember what I have and haven't done at this point. Checked OPT_USE_AUTH and now I am getting the stupid 'convolve' error again which I believe earlier you attributed to the old video card and possibly switching to fp16 instead of fp32. A little googling and it is definitely over my head as I don't do much in the way of python programming.
I think at this point I need a better video card unless you can think of anything else?
Any idea what the minimum requirements are for the video card?
I think at this point I need a better video card unless you can think of anything else?
Any idea what the minimum requirements are for the video card?
Code: Select all
root@NVR:/var/lib/zmeventnotification/bin# es.debug.objdet 83
encrypting kickstart key 'access_token'
encrypting kickstart key 'refresh_token'
encrypting kickstart key 'access_token_expires'
encrypting kickstart key 'refresh_token_expires'
encrypting kickstart key 'api_version'
encrypting kickstart key 'zm_version'
encrypting kickstart key 'timezone'
11/12/21 14:34:02.448106 zm_mlapi[2133] DBG1 mlapi:336->[mlapi:detect: The detection request is for MLAPI DB user 'mlapiuser' using IP address -> 127.0.0.1]
11/12/21 14:34:02.457798 zm_mlapi[2133] DBG1 mlapi:394->[mlapi:detect: the config file has not changed since it was last read!]
11/12/21 14:34:02.465888 zm_mlapi[2133] DBG1 mlapi:397->[mlapi:detect: the secrets file has not changed since it was last read!]
11/12/21 14:34:02.472639 zm_mlapi[2133] DBG1 mlapi:407->[perf:mlapi:detect: total time to hash config/secrets -> 0.016098]
11/12/21 14:34:02.478791 zm_mlapi[2133] DBG1 mlapi:415->[mlapi:detect: monitor 3 has no overrode configuration built, using 'base' config...]
11/12/21 14:34:02.485242 zm_mlapi[2133] DBG2 mlapi:422->[mlapi:detect: encrypted credentials received, checking keystore for 'mlapi_one']
11/12/21 14:34:02.494821 zm_mlapi[2133] DBG2 mlapi:477->[mlapi:detect: credentials have been decrypted, attempting to login to the ZoneMinder API for 'mlapi_one']
11/12/21 14:34:02.501216 zm_mlapi[2133] DBG2 mlapi:524->[api: SSL certificate verification disabled (encryption enabled, vulnerable to MITM attacks)]
11/12/21 14:34:02.515225 zm_mlapi[2133] DBG1 mlapi:524->[api: no token found, trying user/pass for login]
11/12/21 14:34:01.251915 zmesdetect_m3[9963] DBG1 new_yaml.py:242->[config:init: the supplied config file exists -> '/etc/zm/objectconfig.yml']
11/12/21 14:34:01.37587 zmesdetect_m3[9963] DBG1 new_yaml.py:265->[config::init: default configuration built (no secrets or substitution vars replaced, yet!)]
11/12/21 14:34:01.377118 zmesdetect_m3[9963] DBG1 new_yaml.py:170->[config:zmes:proc: 35 built in default keys added to the 'base' config -> ['custom_push', 'force_mpd', 'same_model_high_conf', 'skip_mons', 'force_live', 'sanitize_str', 'basic_user', 'basic_password', 'image_path', 'max_detection_size', 'contained_area', 'hass_enabled', 'hass_notify', 'hass_cooldown', 'push_jpg', 'push_jpg_key', 'push_gif', 'push_gif_key', 'push_debug_device', 'push_cooldown', 'mqtt_topic', 'mqtt_broker', 'mqtt_port', 'tls_cert', 'tls_key', 'fp16_target', 'alpr_api_type', 'alpr_url', 'openalpr_recognize_vehicle', 'openalpr_country', 'openalpr_state', 'openalpr_min_confidence', 'smart_fs_thresh', 'frame_strategy', 'same_model_sequence_strategy']]
11/12/21 14:34:01.377709 zmesdetect_m3[9963] DBG1 new_yaml.py:114->[config:zmes:proc: substituting '{{variables}}' for the 'base' config keys]
11/12/21 14:34:01.379272 zmesdetect_m3[9963] DBG1 new_yaml.py:136->[config:zmes: successfully replaced 3 default sub vars in the base config -> ['coral_models', 'base_data_path', 'yolo_models']]
11/12/21 14:34:01.379983 zmesdetect_m3[9963] DBG1 new_yaml.py:285->[config:zmes: the configured secrets file exists and is a file -> '/etc/zm/zm_secrets.yml']
11/12/21 14:34:01.380591 zmesdetect_m3[9963] DBG1 new_yaml.py:291->[config:zmes: starting '{[secrets]}' substitution]
11/12/21 14:34:01.391046 zmesdetect_m3[9963] DBG1 new_yaml.py:324->[config:zmes: successfully replaced 19 secrets in the base config -> ['ZM_ML_USER', 'MQTT_USERNAME', 'mlapi_one_key', 'PUSHOVER_ERR_TOKEN', 'ZM_ML_PASSWORD', 'ML_PASSWORD', 'ZM_USER', 'PLATEREC_ALPR_KEY', 'PUSHOVER_APP_TOKEN', 'ZM_API_PORTAL', 'PUSHOVER_PASS', 'HA_TOKEN', 'PUSHOVER_USER_KEY', 'HA_SERVER', 'MQTT_PASSWORD', 'PUSHOVER_USER', 'ML_USER', 'ZM_PORTAL', 'ZM_PASSWORD']]
11/12/21 14:34:01.391914 zmesdetect_m3[9963] DBG1 new_yaml.py:329->[config:zmes: there are 2 secrets configured that have no substitution candidates in the base config or the secrets file -> ['AWS_SECRET_ACCESS_KEY', 'AWS_ACCESS_KEY_ID']]
11/12/21 14:34:01.3953 zmesdetect_m3[9963] DBG1 new_yaml.py:358->[config:zmes: starting '{{variable}}' substitution]
11/12/21 14:34:01.40278 zmesdetect_m3[9963] DBG1 new_yaml.py:375->[config:zmes: successfully replaced 51 sub vars in the base config -> ['openalpr_cmdline_params', 'face_model', 'save_unknown_faces_leeway_pixels', 'alpr_detection_pattern', 'platerec_min_score', 'tpu_efficientdet_lite3', 'smart_fps_thresh', 'openalpr_cmdline_min_confidence', 'unknown_images_path', 'openalpr_cmdline_binary', 'yolo4_object_weights', 'known_images_path', 'cpu_max_processes', 'face_num_jitters', 'tpu_tf2_mobilenetv2', 'match_past_detections', 'disable_locks', 'show_models', 'face_recog_dist_threshold', 'object_detection_pattern', 'platerec_stats', 'face_upsample_times', 'face_detection_pattern', 'gpu_max_lock_wait', 'yolo4_object_framework', 'model_sequence', 'tpu_object_weights_mobiledet', 'past_det_max_diff_area', 'same_model_sequence_strategy', 'object_min_confidence', 'tpu_face_weights_mobilenetv2', 'tpu_object_framework', 'yolo4_object_processor', 'face_train_model', 'frame_set', 'alpr_key', 'tpu_max_processes', 'cpu_max_lock_wait', 'tpu_object_labels', 'tpu_object_weights_mobilenetv2', 'gpu_max_processes', 'save_unknown_faces', 'yolo4_object_labels', 'tpu_min_confidence', 'max_detection_size', 'yolo4_object_config', 'frame_strategy', 'face_detection_framework', 'tpu_max_lock_wait', 'platerec_min_dscore', 'contained_area']]
11/12/21 14:34:01.40539 zmesdetect_m3[9963] DBG1 new_yaml.py:187->[config:zmes:proc: Base config has been built, all properly configured {[secrets]} and {{vars}} have been replaced! Remember you must manually build per monitor overrode configurations]
11/12/21 14:34:02.660465 zm_mlapi[2133] DBG2 mlapi:524->[api: detected API ver 2.0+, using token system]
11/12/21 14:34:01.405972 zmesdetect_m3[9963] DBG1 zm_detect.py:598->[perf:zmes: building the intial config took 0.154114 ]
11/12/21 14:34:01.406574 zmesdetect_m3[9963] DBG1 new_yaml.py:747->[zmes:api create: building ZM API Session]
11/12/21 14:34:01.412894 zmesdetect_m3[9963] DBG1 api.py:112->[api: SSL certificate verification disabled (encryption enabled, vulnerable to MITM attacks)]
11/12/21 14:34:02.665405 zm_mlapi[2133] DBG1 mlapi:524->[api: access token expires on: 2021-11-12 16:34:02.665371 (7200s)]
11/12/21 14:34:01.414163 zmesdetect_m3[9963] DBG1 api.py:281->[api: no token found, trying user/pass for login]
11/12/21 14:34:02.672095 zmesdetect_m3[9963] DBG1 ZMLog:336->[------| FORKED NEO --- app->Hooks: 7.0.2 - pyzm: 1.0.2 - ES: 7.0.0 - OpenCV:4.5.4 |------]
11/12/21 14:34:01.693265 zmesdetect_m3[9963] DBG1 zm_detect.py:629->[zmes: waiting for the monitor ID to be verified! This happens on PAST events because the api double checks to make sure its the correct monitor ID]
11/12/21 14:34:02.043416 zmesdetect_m3[9963] DBG1 api.py:318->[api: detected API ver 2.0+, using token system]
11/12/21 14:34:02.044211 zmesdetect_m3[9963] DBG1 api.py:333->[api: access token expires on: 2021-11-12 16:34:02.044184 (7200s)]
11/12/21 14:34:02.044909 zmesdetect_m3[9963] DBG1 api.py:345->[api: refresh token expires on: 2021-11-13 14:34:02.044892 (86400s)]
11/12/21 14:34:02.670534 zm_mlapi[2133] DBG1 mlapi:524->[api: refresh token expires on: 2021-11-13 14:34:02.670483 (86400s)]
11/12/21 14:34:02.098187 zmesdetect_m3[9963] DBG1 new_yaml.py:780->[zmes:api create: ZM API created]
11/12/21 14:34:02.124387 zmesdetect_m3[9963] DBG1 zm_detect.py:643->[perf:zmes: Monitor ID (3) verified! pausing to wait for verification took 0.431072 seconds -=- api creation took 0.717951 seconds]
11/12/21 14:34:02.680969 zmesdetect_m3[9963] DBG1 ZMLog:336->[zmes: Setting up signal handlers for log 'rotation' and log 'interrupt']
11/12/21 14:34:02.254789 zmesdetect_m3[9963] DBG1 zm_detect.py:710->[zmes: this is a 'PAST' (debugging?) event!]
11/12/21 14:34:02.683004 zmesdetect_m3[9963] DBG1 ZMLog:336->[|----------= Encrypted Route Name: 'mlapi_one' | Gateway URL: 'http://localhost:5000/api/v1' | Weight: 0 =----------|]
11/12/21 14:34:02.258319 zmesdetect_m3[9963] DBG1 zm_detect.py:103->[zmes:mlapi:login: No need to login, access token is valid for 2913.470135450363 sec]
11/12/21 14:34:02.421678 zmesdetect_m3[9963] DBG1 zm_detect.py:377->[
** Gateway URL: 'http://localhost:5000/api/v1/detect/object?type=object' using auth_header={'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGc......'}
**** params={'delete': True, 'response_format': 'zm_detect'}
****** JSON: stream: 83 - mid: 3 - reason: None - stream options: {'frame_strategy': 'first', 'frame_set': 'snapshot,70,snapshot,120,150,alarm', 'contig_frames_before_error': 2, 'delay_between_attempts': 2, 'max_attempts': 3, 'delay_between_frames': 0.4, 'delay_between_snapshots': 1, 'smart_fps_thresh': '5', 'save_frames': 'no', 'save_frames_dir': None, 'PAST_EVENT': True, 'resize': 800} - files: {}
]
11/12/21 14:34:02.68687 zmesdetect_m3[9963] DBG1 ZMLog:336->[Connected to ZoneMinder Logging system with user 'www-data' -> '/var/log/zm/zmesdetect_m3.log']
11/12/21 14:34:02.727769 zm_mlapi[2133] DBG2 mlapi:535->[mlapi:detect: found 'stream_sequence' in '/var/lib/zmeventnotification/mlapi/mlapiconfig.yml']
11/12/21 14:34:02.734426 zm_mlapi[2133] DBG1 mlapi:553->[mlapi:detect: ZMES has resize=800 configured, propagating...]
11/12/21 14:34:02.746227 zm_mlapi[2133] DBG1 detect_sequence:855->[detect: this is a past event, optimizing settings and workflow for speed]
11/12/21 14:34:02.752486 zm_mlapi[2133] DBG2 Media:117->[media: setting 'image' as type for event -> '83']
11/12/21 14:34:02.76036 zm_mlapi[2133] DBG2 Media:149->[media: processing a maximum of 2 frames-> ['snapshot', 'alarm']]
11/12/21 14:34:02.770228 zm_mlapi[2133] DBG2 Media:180->[media: using API calls for stream -> 83]
11/12/21 14:34:02.776358 zm_mlapi[2133] DBG2 detect_sequence:898->[detect:portalocker: using automatic locking for switching between models]
11/12/21 14:34:02.78454 zm_mlapi[2133] DBG1 Media:420->[media:read:image: 'delay_between_frames' is configured but this is a past event, ignoring delay...]
11/12/21 14:34:02.790487 zm_mlapi[2133] DBG1 Media:453->[media:read:image: about to process first frame!]
11/12/21 14:34:02.797761 zm_mlapi[2133] DBG2 Media:488->[media:read:image: Event: 83 - converting 'snapshot' to a frame ID -> s-153]
11/12/21 14:34:02.804489 zm_mlapi[2133] DBG2 Media:617->[api:make_req: 'get'->https://access.thatpcguru.com/zm/index.php?view=image&eid=83&fid=153 query={'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjM2NzQ1NjQyLCJleHAiOjE2MzY3NTI4NDIsInVzZXIiOiJqcm9zZXR0byIsInR5cGUiOiJhY2Nlc3MifQ.HLfc4jN7XBUPmEUZ2utvjD5XP9zX7wOS-W79tIc_5R8...'}]
11/12/21 14:34:02.867866 zm_mlapi[2133] DBG2 pyzm_utils:387->[resize:img: success using resize=800.0 - original dimensions: 2048*1536 - resized dimensions: 600*800]
11/12/21 14:34:02.874381 zm_mlapi[2133] DBG2 detect_sequence:945->[detect: no polygons/zones specified, adding 'full_image' as polygon @ [(0, 0), (2048, 0), (2048, 1536), (0, 1536)]]
11/12/21 14:34:02.881922 zm_mlapi[2133] DBG2 detect_sequence:283->[detect: rescaled polygons ('down') using factors: x=0.3906 y=0.3906
*** OLD: [[{'name': 'full_image', 'value': [(0, 0), (2048, 0), (2048, 1536), (0, 1536)], 'pattern': None}]]
****** NEW:[[{'name': 'full_image', 'value': [(0, 0), (800, 0), (800, 600), (0, 600)], 'pattern': None}]]]
11/12/21 14:34:02.891389 zm_mlapi[2133] DBG2 detect_sequence:1045->[frame: s-153 [strategy:'first'] (1 of 2) - model: 'object' [strategy:'first'] (1 of 3) - sequence: 'DarkNet::v4 Pre-Trained' [strategy:'most'] (1 of 1)]
11/12/21 14:34:02.897319 zm_mlapi[2133] DBG2 object:34->[yolo:portalock: Waiting for 'pyzm_uid33_GPU_lock' portalock...]
11/12/21 14:34:02.90435 zm_mlapi[2133] DBG2 object:37->[yolo:portalock: got 'pyzm_uid33_GPU_lock']
11/12/21 14:34:02.915747 zm_mlapi[2133] DBG1 yolo:196->[yolo: 'DarkNet::v4 Pre-Trained' (GPU) - input image 800*600 - resized by model_width/height to: 416*416]
11/12/21 14:34:02.931654 zm_mlapi[2133] ERR yolo:239->[yolo: exception during blobFromImage -> OpenCV(4.5.4) /root/opencv-4.5.4/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/cudnn/convolution.hpp:420: error: (-217:Gpu API call) CUDNN_STATUS_EXECUTION_FAILED in function 'convolve'
]
inside custom YoloException init args=()
kwargs={}
11/12/21 14:34:02.942314 zm_mlapi[2133] DBG2 object:57->[yolo:portalock: released 'pyzm_uid33_GPU_lock']
11/12/21 14:34:02.947008 zm_mlapi[2133] ERR detect_sequence:1094->[detect: error running sequence 'DarkNet::v4 Pre-Trained']
11/12/21 14:34:02.95247 zm_mlapi[2133] ERR detect_sequence:1095->[detect: ERR_MSG--> blobFromImage]
11/12/21 14:34:02.962912 zm_mlapi[2133] DBG2 detect_sequence:1395->[detect: no 'object' matches at all in frame: s-153]
11/12/21 14:34:02.96987 zm_mlapi[2133] DBG2 detect_sequence:1045->[frame: s-153 [strategy:'first'] (1 of 2) - model: 'face' [strategy:'first'] (2 of 3) - sequence: 'DLib::Face Detection/Recognition' [strategy:'union'] (1 of 1)]
11/12/21 14:34:02.977918 zm_mlapi[2133] DBG1 face_dlib:174->[|---------- D-lib Face Detection and Recognition (input image: 800*600) ----------|]
11/12/21 14:34:02.984512 zm_mlapi[2133] ERR detect_sequence:1094->[detect: error running sequence 'DLib::Face Detection/Recognition']
11/12/21 14:34:02.99048 zm_mlapi[2133] ERR detect_sequence:1095->[detect: ERR_MSG--> 'ZMLog' object has no attribute 'Debug']
11/12/21 14:34:02.997967 zm_mlapi[2133] DBG2 detect_sequence:1395->[detect: no 'face' matches at all in frame: s-153]
11/12/21 14:34:03.005616 zm_mlapi[2133] DBG2 detect_sequence:1045->[frame: s-153 [strategy:'first'] (1 of 2) - model: 'alpr' [strategy:'first'] (3 of 3) - sequence: 'openALPR Command Line' [strategy:'first'] (1 of 1)]
11/12/21 14:34:03.011296 zm_mlapi[2133] ERR detect_sequence:1094->[detect: error running sequence 'openALPR Command Line']
11/12/21 14:34:03.0174 zm_mlapi[2133] ERR detect_sequence:1095->[detect: ERR_MSG--> 'NoneType' object has no attribute 'logger']
11/12/21 14:34:03.02641 zm_mlapi[2133] DBG2 detect_sequence:1395->[detect: no 'alpr' matches at all in frame: s-153]
11/12/21 14:34:03.03248 zm_mlapi[2133] DBG2 detect_sequence:1415->[perf:frame: s-153 took 157.88 ms]
11/12/21 14:34:03.040219 zm_mlapi[2133] DBG1 Media:420->[media:read:image: 'delay_between_frames' is configured but this is a past event, ignoring delay...]
11/12/21 14:34:03.045214 zm_mlapi[2133] DBG1 Media:446->[media:read:image: [1 frames processed: ['153']] - [0 Frames skipped: []] - [Requested FID: alarm] [Last Requested Frame ID: 153] [Maximum # of frames to process: 2]]
11/12/21 14:34:03.052683 zm_mlapi[2133] DBG2 Media:482->[media:read:image: Event: 83 - converting 'alarm' to a frame ID -> a-8]
11/12/21 14:34:03.06053 zm_mlapi[2133] DBG2 Media:617->[api:make_req: 'get'->https://access.thatpcguru.com/zm/index.php?view=image&eid=83&fid=8 query={'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjM2NzQ1NjQyLCJleHAiOjE2MzY3NTI4NDIsInVzZXIiOiJqcm9zZXR0byIsInR5cGUiOiJhY2Nlc3MifQ.HLfc4jN7XBUPmEUZ2utvjD5XP9zX7wOS-W79tIc_5R8...'}]
11/12/21 14:34:03.123357 zm_mlapi[2133] DBG2 pyzm_utils:387->[resize:img: success using resize=800.0 - original dimensions: 2048*1536 - resized dimensions: 600*800]
11/12/21 14:34:03.13243 zm_mlapi[2133] DBG2 detect_sequence:1045->[frame: a-8 [strategy:'first'] (1 of 2) - model: 'object' [strategy:'first'] (1 of 3) - sequence: 'DarkNet::v4 Pre-Trained' [strategy:'most'] (1 of 1)]
11/12/21 14:34:03.143385 zm_mlapi[2133] DBG2 object:34->[yolo:portalock: Waiting for 'pyzm_uid33_GPU_lock' portalock...]
11/12/21 14:34:03.15453 zm_mlapi[2133] DBG2 object:37->[yolo:portalock: got 'pyzm_uid33_GPU_lock']
11/12/21 14:34:03.171682 zm_mlapi[2133] DBG1 yolo:196->[yolo: 'DarkNet::v4 Pre-Trained' (GPU) - input image 800*600 - resized by model_width/height to: 416*416]
11/12/21 14:34:03.185647 zm_mlapi[2133] ERR yolo:239->[yolo: exception during blobFromImage -> OpenCV(4.5.4) /root/opencv-4.5.4/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/cudnn/convolution.hpp:420: error: (-217:Gpu API call) CUDNN_STATUS_EXECUTION_FAILED in function 'convolve'
]
inside custom YoloException init args=()
kwargs={}
11/12/21 14:34:03.195634 zm_mlapi[2133] DBG2 object:57->[yolo:portalock: released 'pyzm_uid33_GPU_lock']
11/12/21 14:34:03.201042 zm_mlapi[2133] ERR detect_sequence:1094->[detect: error running sequence 'DarkNet::v4 Pre-Trained']
11/12/21 14:34:03.206985 zm_mlapi[2133] ERR detect_sequence:1095->[detect: ERR_MSG--> blobFromImage]
11/12/21 14:34:03.213382 zm_mlapi[2133] DBG2 detect_sequence:1395->[detect: no 'object' matches at all in frame: a-8]
11/12/21 14:34:03.21923 zm_mlapi[2133] DBG2 detect_sequence:1045->[frame: a-8 [strategy:'first'] (1 of 2) - model: 'face' [strategy:'first'] (2 of 3) - sequence: 'DLib::Face Detection/Recognition' [strategy:'union'] (1 of 1)]
11/12/21 14:34:03.228171 zm_mlapi[2133] DBG1 face_dlib:174->[|---------- D-lib Face Detection and Recognition (input image: 800*600) ----------|]
11/12/21 14:34:03.237699 zm_mlapi[2133] ERR detect_sequence:1094->[detect: error running sequence 'DLib::Face Detection/Recognition']
11/12/21 14:34:03.247126 zm_mlapi[2133] ERR detect_sequence:1095->[detect: ERR_MSG--> 'ZMLog' object has no attribute 'Debug']
11/12/21 14:34:03.253796 zm_mlapi[2133] DBG2 detect_sequence:1395->[detect: no 'face' matches at all in frame: a-8]
11/12/21 14:34:03.259576 zm_mlapi[2133] DBG2 detect_sequence:1045->[frame: a-8 [strategy:'first'] (1 of 2) - model: 'alpr' [strategy:'first'] (3 of 3) - sequence: 'openALPR Command Line' [strategy:'first'] (1 of 1)]
11/12/21 14:34:03.26576 zm_mlapi[2133] ERR detect_sequence:1094->[detect: error running sequence 'openALPR Command Line']
11/12/21 14:34:03.273025 zm_mlapi[2133] ERR detect_sequence:1095->[detect: ERR_MSG--> 'NoneType' object has no attribute 'logger']
11/12/21 14:34:03.282894 zm_mlapi[2133] DBG2 detect_sequence:1395->[detect: no 'alpr' matches at all in frame: a-8]
11/12/21 14:34:03.288869 zm_mlapi[2133] DBG2 detect_sequence:1415->[perf:frame: a-8 took 156.72 ms]
11/12/21 14:34:03.298753 zm_mlapi[2133] DBG1 detect_sequence:1513->[perf:detect:FINAL: 'Monitor': Kitchen (3)->'Event': 83 -> complete detection sequence took: 545.80 ms]
11/12/21 14:34:03.304136 zm_mlapi[2133] INF mlapi:655->[mlapi:detect: no detection data to return]
11/12/21 14:34:03.312171 zmesdetect_m3[9963] DBG1 zm_detect:440->[zmes:mlapi: parsed JSON detection data in multipart response]
11/12/21 14:34:03.312775 zmesdetect_m3[9963] DBG1 zm_detect:821->[perf:zmes:mlapi: Monitor: Kitchen (3)->'Event': 83 mlapi detection took: 1.056202]
11/12/21 14:34:03.313169 zmesdetect_m3[9963] DBG1 zm_detect:1590->[zmes: no predictions returned from detections]
11/12/21 14:34:03.314354 zmesdetect_m3[9963] DBG1 zm_detect:1658->[perf:zmes:FINAL: 'Monitor': Kitchen (3)->'Event': 83 [PAST event] [total:2.069314] [detection:1.056202] [after core detection: 0.000378] ]
11/12/21 14:34:03.315307 zmesdetect_m3[9963] DBG1 zm_detect:1659->[ZM Log: Closing all log handlers NOW]
Re: Event Server Object Detection not working
In the object options section of the objectconfig.yml or mlapiconfig.yml (whichever is using your GPU) there is an option to use fp16.
uncomment that and also uncomment the section in ml_sequence that enables it inside the yolo sequence.
ml_sequence ->
I don't know if it will work or not as its experimental, but it might. The GPU might be too old to be used for yolo and CNN's though.
Ill have to search a bit to get a concrete answer on what CC you need at a minimum to run yolo. You can also run it on CPU, it works but isn't as fast.
uncomment that and also uncomment the section in ml_sequence that enables it inside the yolo sequence.
Code: Select all
# ** NOTE THIS IS EXPERIMENTAL **
#fp16_target: no
uncomment and change the no to yes ->
fp16_target: yes
Code: Select all
cpu_max_processes: '{{cpu_max_processes}}'
cpu_max_lock_wait: '{{cpu_max_lock_wait}}'
# only applies to opencv framework and GPU , default is FP32 TURN OFF IF YOU SEE 'NaN' errors in YOLOv4
# make sure this is uncommented in the yolo sequence
fp16_target: '{{fp16_target}}'
# at current moment this is a global setting turned on by just setting it to : yes
show_models: '{{show_models}}'
Ill have to search a bit to get a concrete answer on what CC you need at a minimum to run yolo. You can also run it on CPU, it works but isn't as fast.