Ok, so I found out why I couldn't create the mlapi user.
Whilst the zmeventnotification install.sh says it installs neo-pyzm, it's not installing it. I manually installed it and it worked.
Code: Select all
root@c56501336d82:/var/lib/zmeventnotification# sudo -u www-data /var/lib/zmeventnotification/bin/zm_detect.py --config /etc/zm/objectconfig.yml --debug --eventid 107
zmes: err_msg->EOF while scanning triple-quoted string literal (<unknown>, line 1)
zmes: traceback: Traceback (most recent call last):
File "/var/lib/zmeventnotification/bin/zm_detect.py", line 1648, in <module>
main_handler()
File "/var/lib/zmeventnotification/bin/zm_detect.py", line 597, in main_handler
zmes_config, g = proc_conf(args=args, conf_globals=g, type_='zmes')
File "/usr/local/lib/python3.8/dist-packages/pyzm/helpers/new_yaml.py", line 726, in process_config
config_obj.process_config()
File "/usr/local/lib/python3.8/dist-packages/pyzm/helpers/new_yaml.py", line 178, in process_config
self.config = self.parse_secrets(config=self.config, filename=self.secret_file_name)
File "/usr/local/lib/python3.8/dist-packages/pyzm/helpers/new_yaml.py", line 339, in parse_secrets
return literal_eval(new_config)
File "/usr/lib/python3.8/ast.py", line 59, in literal_eval
node_or_string = parse(node_or_string, mode='eval')
File "/usr/lib/python3.8/ast.py", line 47, in parse
return compile(source, filename, mode, flags,
File "<unknown>", line 1
{'base_data_path': '/var/lib/zmeventnotification', 'secrets': '/etc/zm/zm_secrets.yml', 'custom_push_script': '/var/lib/zmeventnotification/bin/gotify_zmes.sh', 'sanitize_logs': False, 'show_models': False, 'save_image_train': True, 'save_image_train_dir': '/nas/images/yolo_train', 'force_debug': True, 'frame_set': 'snapshot,70,snapshot,120,150,alarm', 'version': 1.2, 'cpu_max_processes': 3, 'tpu_max_processes': 1, 'gpu_max_processes': 1, 'cpu_max_lock_wait': 100, 'tpu_max_lock_wait': 100, 'gpu_max_lock_wait': 100, 'pyzm_overrides': {'log_level_syslog': 5, 'log_level_file': 5, 'log_level_debug': 5, 'log_level_db': -5, 'log_debug_file': 1, 'log_debug': True, 'log_debug_target': 'None'}, 'portal': 'http://192.168.1.100:8089/zm', 'user': 'juan', 'password': 'password', 'api_portal': 'http://192.168.1.100:8089/zm/api', 'allow_self_signed': True, 'match_past_detections': False, 'past_det_max_diff_area': '5%', 'model_sequence': 'object', 'resize': 800, 'picture_timestamp': {'enabled': False, 'date format': '%Y-%m-%d %H:%M:%S', 'monitor name': True, 'text color': '(255,255,255)', 'background': True, 'bg color': '(0,0,0)'}, 'delete_after_analyze': True, 'write_debug_image': False, 'write_image_to_zm': True, 'show_percent': True, 'draw_poly_zone': True, 'poly_color': '(100,0,255)', 'poly_thickness': 2, 'import_zm_zones': False, 'only_triggered_zm_zones': False, 'show_filtered_detections': False, 'hass_enable': False, 'hass_server': 'https://hass.Example.com:8123', 'hass_token': 'eyJ0eXAiOiJKV1QiLCJhbGc..........', 'hass_people': {'mike': 'person.mike', 'maryanne': 'person.maryanne'}, 'push_enable': False, 'push_force': False, 'push_token': 'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhh', 'push_key': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'push_url': False, 'push_user': 'view_only_username', 'push_pass': 'vbekjrhiurevfbg7438tr6yvb54r37-82', 'push_errors': False, 'push_err_token': 'kkkkkkkkkkkkkkkkkkkkkkkkkkkkkk', 'push_err_key': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'push_err_device': 'My-S21', 'push_error_sound': None, 'mqtt_enable': False, 'mqtt_force': False, 'mqtt_user': 'juan11perez', 'mqtt_pass': 'password', 'mqtt_tls_allow_self_signed': True, 'mqtt_tls_insecure': True, 'tls_ca': '/path_to/mqtt_certs/ca.crt', 'create_animation': False, 'animation_timestamp': {'enabled': False, 'date format': '%Y-%m-%d %H:%M:%S', 'monitor id': True, 'text color': '(255,255,255)', 'background': True, 'bg color': '(0,0,0)'}, 'animation_types': 'mp4,gif', 'fast_gif': False, 'animation_width': 640, 'animation_retry_sleep': 3, 'animation_max_tries': 8, 'ml_enable': False, 'ml_fallback_local': True, 'ml_routes': [{'weight': 0, 'name': 'mlapi_one', 'enabled': True, 'gateway': 'http://192.168.1.100:5003/api/v1', 'user': 'juan11perez', 'pass': 'password', 'zm_user': 'zm api user for MLAPI', 'zm_pass': 'zm api password for MLAPI *&%#%$^#%^ '''' <--- see the single quotes? ', 'enc_key': 'tlYoF3YT2vgrFPt8SHmEkw8bX0ISG4x0TwOVnbMS4oA=', 'basic_user': None, 'basic_pass': None}], 'object_detection_pattern': '(person|car|motorbike|bus|truck|boat|dog|cat)', 'object_min_confidence': 0.6, 'coral_models': '/var/lib/zmeventnotification/models/coral_edgeptu', 'tpu_efficientdet_lite3': '/var/lib/zmeventnotification/models/coral_edgeptu/efficientdet_lite3_512_ptq_edgetpu.tflite', 'tpu_tf2_mobilenetv2': '/var/lib/zmeventnotification/models/coral_edgeptu/tf2_ssd_mobilenet_v2_coco17_ptq_edgetpu.tflite', 'tpu_object_weights_mobiledet': '/var/lib/zmeventnotification/models/coral_edgeptu/ssdlite_mobiledet_coco_qat_postprocess_edgetpu.tflite', 'tpu_object_weights_mobilenetv2': '/var/lib/zmeventnotification/models/coral_edgeptu/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite', 'tpu_object_labels': '/var/lib/zmeventnotification/models/coral_edgeptu/coco_indexed.names', 'tpu_object_framework': 'coral_edgetpu', 'tpu_object_processor': 'tpu', 'tpu_min_confidence': 0.6, 'yolo_models': '/var/lib/zmeventnotification/models/yolov4', 'yolo4_object_weights': '/var/lib/zmeventnotification/models/yolov4/yolov4.weights', 'yolo4_object_labels': '/var/lib/zmeventnotification/models/yolov4/coco.names', 'yolo4_object_config': '/var/lib/zmeventnotification/models/yolov4/yolov4.cfg', 'yolo4_object_framework': 'opencv', 'yolo4_object_processor': 'gpu', 'yolo3_object_weights': '/var/lib/zmeventnotification/models/yolov3/yolov3.weights', 'yolo3_object_labels': '/var/lib/zmeventnotification/models/yolov3/coco.names', 'yolo3_object_config': '/var/lib/zmeventnotification/models/yolov3/yolov3.cfg', 'yolo3_object_framework': 'opencv', 'yolo3_object_processor': 'gpu', 'tinyyolo_object_config': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'tinyyolo_object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights', 'tinyyolo_object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'tinyyolo_object_framework': 'opencv', 'tinyyolo_object_processor': 'gpu', 'tpu_face_weights_mobilenetv2': '/var/lib/zmeventnotification/models/coral_edgeptu/ssd_mobilenet_v2_face_quant_postprocess_edgetpu.tflite', 'face_detection_pattern': '.*', 'face_dlib_processor': 'gpu', 'face_detection_framework': 'dlib', 'face_recognition_framework': 'dlib', 'face_num_jitters': 0, 'face_upsample_times': 0, 'face_model': 'cnn', 'face_train_model': 'cnn', 'face_recog_dist_threshold': 0.6, 'face_recog_knn_algo': 'ball_tree', 'known_images_path': '/var/lib/zmeventnotification/known_faces', 'unknown_images_path': '/var/lib/zmeventnotification/unknown_faces', 'unknown_face_name': 'Unknown_Face', 'save_unknown_faces': False, 'save_unknown_faces_leeway_pixels': 100, 'alpr_detection_pattern': '.*', 'alpr_service': 'plate_recognizer', 'alpr_key': 'abracadabra', 'platerec_stats': True, 'platerec_regions': ['ca'], 'platerec_min_dscore': 0.1, 'platerec_min_score': 0.2, 'openalpr_cmdline_binary': 'alpr', 'openalpr_cmdline_params': '-j -d', 'openalpr_cmdline_min_confidence': 0.3, 'monitors': {6942069: {'front_yard_polygonzone': '0,877 2170,553 3822,1131 3822,2141 0,2159', 'front_yard_zone_detection_pattern': '(person|dog|cat)', 'object_detection_pattern': '(person|dog|cat)', 'frame_set': 'snapshot,70,snapshot,140,210,alarm,280,350,430', 'model_sequence': 'object', 'person_max_detection_size': '65%', 'person_min_confidence': 0.4732, 'hass_notify': 'input_boolean.front_switch', 'hass_cooldown': 'input_number.front_cooldown', 'push_sound': 'motion_frontyard', 'push_sound_person': 'person_frontyard', 'push_sound_car': None, 'push_sound_truck': None, 'push_sound_motorbike': None, 'push_sound_dog': None, 'push_sound_cat': None, 'defined zones': {'front_walkway': {'pattern': '(person|dog|cat)', 'polygon_hw': 'h,w', '3840x2160': '0,877 2170,553 3822,1131 3822,2141 0,2159', '1920x1080': '0,427 1085,261 1075,200 1912,448 1912,1071 0,1079', '1280x720': None, 480: None, 320: None}, 'front_porch': {1080: None, 720: {320: None}}}}}, 'smart_fps_thresh': 5, 'disable_locks': False, 'stream_sequence': {'frame_strategy': '{{frame_strategy}}', 'frame_set': '{{frame_set}}', 'contig_frames_before_error': 2, 'delay_between_attempts': 2, 'max_attempts': 3, 'delay_between_snapshots': 1, 'smart_fps_thresh': '{{smart_fps_thresh}}', 'save_frames': 'no', 'save_frames_dir': None}, 'ml_sequence': {'general': {'model_sequence': '{{model_sequence}}', 'disable_locks': '{{disable_locks}}', 'match_past_detections': '{{match_past_detections}}', 'past_det_max_diff_area': '{{past_det_max_diff_area}}', 'aliases': {'vehicles': ['car', 'bus', 'truck', 'boat', 'motorcycle'], 'plants': ['broccoli', 'pottedplant', 'potted_plant'], 'animals': ['dog', 'cat', 'mouse', 'horse']}}, 'object': {'general': {'object_detection_pattern': '{{object_detection_pattern}}', 'same_model_sequence_strategy': '{{same_model_sequence_strategy}}', 'contained_area': '{{contained_area}}'}, 'sequence': [{'name': 'coral::SSD-Lite MobileDet 312x312', 'enabled': 'no', 'object_weights': '{{tpu_object_weights_mobiledet}}', 'object_labels': '{{tpu_object_labels}}', 'object_min_confidence': '{{tpu_min_confidence}}', 'object_framework': '{{tpu_object_framework}}', 'tpu_max_processes': '{{tpu_max_processes}}', 'tpu_max_lock_wait': '{{tpu_max_lock_wait}}', 'max_detection_size': '{{max_detection_size}}'}, {'name': 'coral::MobileNETv2-SSD 300x300', 'enabled': 'no', 'object_weights': '{{tpu_object_weights_mobilenetv2}}', 'object_labels': '{{tpu_object_labels}}', 'object_min_confidence': '{{tpu_min_confidence}}', 'object_framework': '{{tpu_object_framework}}', 'tpu_max_processes': '{{tpu_max_processes}}', 'tpu_max_lock_wait': '{{tpu_max_lock_wait}}', 'max_detection_size': '{{max_detection_size}}', 'model_height': 300, 'model_width': 300}, {'name': 'coral::MobileNETv2-SSD TensorFlow 2.0 300x300', 'enabled': 'no', 'object_weights': '{{tpu_tf2_mobilenetv2}}', 'object_labels': '{{tpu_object_labels}}', 'object_min_confidence': '{{tpu_min_confidence}}', 'object_framework': '{{tpu_object_framework}}', 'tpu_max_processes': '{{tpu_max_processes}}', 'tpu_max_lock_wait': '{{tpu_max_lock_wait}}', 'max_detection_size': '{{max_detection_size}}', 'model_height': 300, 'model_width': 300}, {'name': 'coral::EfficientDet-Lite 3 512x512', 'enabled': 'no', 'object_weights': '{{tpu_efficientdet_lite3}}', 'object_labels': '{{tpu_object_labels}}', 'object_min_confidence': '{{tpu_min_confidence}}', 'object_framework': '{{tpu_object_framework}}', 'tpu_max_processes': '{{tpu_max_processes}}', 'tpu_max_lock_wait': '{{tpu_max_lock_wait}}', 'max_detection_size': '{{max_detection_size}}', 'model_height': 512, 'model_width': 512}, {'name': 'DarkNet::v4 Pre-Trained', 'enabled': 'yes', 'object_config': '{{yolo4_object_config}}', 'object_weights': '{{yolo4_object_weights}}', 'object_labels': '{{yolo4_object_labels}}', 'object_min_confidence': '{{object_min_confidence}}', 'object_framework': '{{yolo4_object_framework}}', 'object_processor': '{{yolo4_object_processor}}', 'gpu_max_processes': '{{gpu_max_processes}}', 'gpu_max_lock_wait': '{{gpu_max_lock_wait}}', 'cpu_max_processes': '{{cpu_max_processes}}', 'cpu_max_lock_wait': '{{cpu_max_lock_wait}}', 'show_models': '{{show_models}}'}, {'name': 'AWS rekognition (PAID)', 'enabled': 'no', 'object_framework': 'aws_rekognition', 'object_min_confidence': '0.7', 'aws_region': 'us-east-1', 'aws_access_key_id': '{[AWS_ACCESS_KEY_ID]}', 'aws_secret_access_key': '{[AWS_SECRET_ACCESS_KEY]}'}]}, 'alpr': {'general': {'same_model_sequence_strategy': 'first', 'alpr_detection_pattern': '{{alpr_detection_pattern}}'}, 'sequence': [{'name': 'openALPR Command Line', 'alpr_service': 'open_alpr_cmdline', 'openalpr_cmdline_binary': '{{openalpr_cmdline_binary}}', 'openalpr_cmdline_params': '{{openalpr_cmdline_params}}', 'openalpr_cmdline_min_confidence': '{{openalpr_cmdline_min_confidence}}', 'max_size': '1600'}, {'name': 'Platerecognizer Cloud Service', 'enabled': 'no', 'alpr_api_type': 'cloud', 'alpr_service': 'plate_recognizer', 'alpr_key': '{{alpr_key}}', 'platrec_stats': '{{platerec_stats}}', 'platerec_min_dscore': '{{platerec_min_dscore}}', 'platerec_min_score': '{{platerec_min_score}}', 'platerec_payload': {'regions': ['ca']}}]}, 'face': {'general': {'face_detection_pattern': '{{face_detection_pattern}}', 'same_model_sequence_strategy': 'union'}, 'sequence': [{'name': 'Face Detection -> coral::MobileNETv2-SSD 320x320', 'enabled': 'no', 'face_detection_framework': 'tpu', 'face_weights': '{{tpu_face_weights_mobilenetv2}}', 'face_min_confidence': 0.3, 'model_height': 320, 'model_width': 320}, {'name': 'DLib::Face Detection/Recognition', 'save_unknown_faces': '{{save_unknown_faces}}', 'save_unknown_faces_leeway_pixels': '{{save_unknown_faces_leeway_pixels}}', 'face_detection_framework': '{{face_detection_framework}}', 'known_images_path': '{{known_images_path}}', 'unknown_images_path': '{{unknown_images_path}}', 'face_model': '{{face_model}}', 'face_train_model': '{{face_train_model}}', 'face_recog_dist_threshold': '{{face_recog_dist_threshold}}', 'face_num_jitters': '{{face_num_jitters}}', 'face_upsample_times': '{{face_upsample_times}}', 'gpu_max_processes': '{{gpu_max_processes}}', 'gpu_max_lock_wait': '{{gpu_max_lock_wait}}', 'cpu_max_processes': '{{cpu_max_processes}}', 'cpu_max_lock_wait': '{{cpu_max_lock_wait}}', 'max_size': 800}]}}, 'custom_push': False, 'force_mpd': False, 'same_model_high_conf': False, 'skip_mons': None, 'force_live': False, 'sanitize_str': '<sanitized>', 'basic_user': '', 'basic_password': '', 'image_path': '/var/lib/zmeventnotification/images', 'max_detection_size': '', 'contained_area': '1px', 'hass_enabled': False, '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': False, 'alpr_api_type': '', 'alpr_url': '', 'openalpr_recognize_vehicle': 0, 'openalpr_country': '', 'openalpr_state': '', 'openalpr_min_confidence': 0.3, 'smart_fs_thresh': 5, 'frame_strategy': 'first', 'same_model_sequence_strategy': 'most'}
^
SyntaxError: EOF while scanning triple-quoted string literal
My image seems to be correct now. zmevent is running, created mlapi user and mlapi is running, but object detection is not working.
If you have a chance you can maybe give my image a spin. I created one at >>
&& cd zmesml && docker build . -t neozmesml -f Dockerfile.neozmesml
cd /config && python3 /var/lib/zmeventnotification/mlapi_dbuser.py -u mlapitest -p test123
never mind. also traced the error to leaving uncommented your example for ZM_ML_USER/PASS IN zm_secrets.yml.
Code: Select all
root@c56501336d82:/var/lib/zmeventnotification# sudo -u www-data /var/lib/zmeventnotification/bin/zm_detect.py --config /etc/zm/objectconfig.yml --debug --eventid 107
11/13/21 20:35:48.985628 zmesdetect_m6[3115] DBG1 new_yaml.py:242->[config:init: the supplied config file exists -> '/etc/zm/objectconfig.yml']
11/13/21 20:35:49.056068 zmesdetect_m6[3115] DBG1 new_yaml.py:265->[config::init: default configuration built (no secrets or substitution vars replaced, yet!)]
11/13/21 20:35:49.056853 zmesdetect_m6[3115] 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/13/21 20:35:49.057152 zmesdetect_m6[3115] DBG1 new_yaml.py:114->[config:zmes:proc: substituting '{{variables}}' for the 'base' config keys]
11/13/21 20:35:49.057936 zmesdetect_m6[3115] 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/13/21 20:35:49.058303 zmesdetect_m6[3115] DBG1 new_yaml.py:285->[config:zmes: the configured secrets file exists and is a file -> '/etc/zm/zm_secrets.yml']
11/13/21 20:35:49.058632 zmesdetect_m6[3115] DBG1 new_yaml.py:291->[config:zmes: starting '{[secrets]}' substitution]
11/13/21 20:35:49.064243 zmesdetect_m6[3115] DBG1 new_yaml.py:324->[config:zmes: successfully replaced 17 secrets in the base config -> ['ML_PASSWORD', 'PUSHOVER_ERR_TOKEN', 'MQTT_PASSWORD', 'ML_USER', 'PLATEREC_ALPR_KEY', 'PUSHOVER_PASS', 'HA_TOKEN', 'ZM_USER', 'PUSHOVER_USER_KEY', 'ZM_PASSWORD', 'MQTT_USERNAME', 'ZM_API_PORTAL', 'PUSHOVER_APP_TOKEN', 'mlapi_one_key', 'ZM_PORTAL', 'PUSHOVER_USER', 'HA_SERVER']]
11/13/21 20:35:49.06459 zmesdetect_m6[3115] DBG1 new_yaml.py:329->[config:zmes: there are 4 secrets configured that have no substitution candidates in the base config or the secrets file -> ['ZM_ML_PASSWORD', 'AWS_ACCESS_KEY_ID', 'AWS_SECRET_ACCESS_KEY', 'ZM_ML_USER']]
11/13/21 20:35:49.066187 zmesdetect_m6[3115] DBG1 new_yaml.py:358->[config:zmes: starting '{{variable}}' substitution]
11/13/21 20:35:49.070452 zmesdetect_m6[3115] DBG1 new_yaml.py:375->[config:zmes: successfully replaced 51 sub vars in the base config -> ['platerec_min_score', 'disable_locks', 'tpu_efficientdet_lite3', 'yolo4_object_framework', 'gpu_max_processes', 'show_models', 'face_model', 'face_upsample_times', 'alpr_detection_pattern', 'openalpr_cmdline_binary', 'face_detection_pattern', 'openalpr_cmdline_min_confidence', 'tpu_min_confidence', 'object_detection_pattern', 'tpu_tf2_mobilenetv2', 'max_detection_size', 'yolo4_object_config', 'known_images_path', 'yolo4_object_processor', 'yolo4_object_weights', 'platerec_stats', 'openalpr_cmdline_params', 'tpu_face_weights_mobilenetv2', 'frame_set', 'smart_fps_thresh', 'platerec_min_dscore', 'match_past_detections', 'tpu_object_weights_mobiledet', 'cpu_max_lock_wait', 'face_num_jitters', 'alpr_key', 'tpu_max_lock_wait', 'face_detection_framework', 'frame_strategy', 'tpu_object_labels', 'tpu_object_weights_mobilenetv2', 'save_unknown_faces', 'contained_area', 'gpu_max_lock_wait', 'past_det_max_diff_area', 'cpu_max_processes', 'model_sequence', 'tpu_object_framework', 'unknown_images_path', 'object_min_confidence', 'face_train_model', 'save_unknown_faces_leeway_pixels', 'face_recog_dist_threshold', 'yolo4_object_labels', 'tpu_max_processes', 'same_model_sequence_strategy']]
11/13/21 20:35:49.072102 zmesdetect_m6[3115] 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/13/21 20:35:49.072413 zmesdetect_m6[3115] DBG1 zm_detect.py:598->[perf:zmes: building the intial config took 0.086803 ]
11/13/21 20:35:49.072813 zmesdetect_m6[3115] DBG1 new_yaml.py:747->[zmes:api create: building ZM API Session]
11/13/21 20:35:49.076915 zmesdetect_m6[3115] DBG1 api.py:112->[api: SSL certificate verification disabled (encryption enabled, vulnerable to MITM attacks)]
11/13/21 20:35:49.07758 zmesdetect_m6[3115] DBG1 api.py:281->[api: no token found, trying user/pass for login]
11/13/21 20:35:49.137267 zmesdetect_m6[3115] DBG1 api.py:318->[api: detected API ver 2.0+, using token system]
11/13/21 20:35:49.137732 zmesdetect_m6[3115] DBG1 api.py:333->[api: access token expires on: 2021-11-13 22:35:49.137717 (7200s)]
11/13/21 20:35:49.138104 zmesdetect_m6[3115] DBG1 api.py:345->[api: refresh token expires on: 2021-11-14 20:35:49.138095 (86400s)]
11/13/21 20:35:49.153026 zmesdetect_m6[3115] DBG1 new_yaml.py:780->[zmes:api create: ZM API created]
11/13/21 20:35:49.390294 zmesdetect_m6[3115] DBG1 ZMLog:336->[------| FORKED NEO --- app->Hooks: 7.0.2 - pyzm: 1.0.2 - ES: 7.0.0 - OpenCV:4.5.4 |------]
11/13/21 20:35:49.390765 zmesdetect_m6[3115] DBG1 ZMLog:336->[zmes: Setting up signal handlers for log 'rotation' and log 'interrupt']
11/13/21 20:35:49.223866 zmesdetect_m6[3115] DBG1 zm_detect.py:710->[zmes: this is a 'PAST' (debugging?) event!]
11/13/21 20:35:49.263205 zmesdetect_m6[3115] DBG1 detect_sequence.py:855->[detect: this is a past event, optimizing settings and workflow for speed]
11/13/21 20:35:49.280802 zmesdetect_m6[3115] DBG1 detect_sequence.py:862->[detect: optimized frame_set from snapshot,70,snapshot,120,150,alarm -> ['snapshot', '70', '120', '150', 'alarm']]
11/13/21 20:35:49.28121 zmesdetect_m6[3115] DBG1 Media.py:117->[media: setting 'image' as type for event -> '107']
11/13/21 20:35:49.281919 zmesdetect_m6[3115] DBG1 Media.py:149->[media: processing a maximum of 5 frames-> ['snapshot', '70', '120', '150', 'alarm']]
11/13/21 20:35:49.28375 zmesdetect_m6[3115] DBG1 Media.py:180->[media: using API calls for stream -> 107]
11/13/21 20:35:49.284567 zmesdetect_m6[3115] DBG1 detect_sequence.py:904->[detect:portalocker: using manual locking for single model -> 'object']
11/13/21 20:35:49.285554 zmesdetect_m6[3115] DBG1 Media.py:453->[media:read:image: about to process first frame!]
11/13/21 20:35:49.286689 zmesdetect_m6[3115] DBG1 Media.py:488->[media:read:image: Event: 107 - converting 'snapshot' to a frame ID -> s-46]
11/13/21 20:35:49.288063 zmesdetect_m6[3115] DBG1 api.py:470->[api:make_req: 'get'->http://192.168.1.100:8089/zm/index.php?view=image&eid=107&fid=46 query={'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjM2ODIxMzQ5LCJleHAiOjE2MzY4Mjg1NDksInVzZXIiOiJqdWFuIiwidHlwZSI6ImFjY2VzcyJ9.uLg_p3H5ig-SL-yMtaS07Cln3xQK0_jIZtPuZgV2iUc...'}]
11/13/21 20:35:49.307645 zmesdetect_m6[3115] DBG1 Media.py:678->[media:read:image: Image returned from ZM API dimensions: (1080, 1920)]
11/13/21 20:35:49.314658 zmesdetect_m6[3115] DBG1 detect_sequence.py:945->[detect: no polygons/zones specified, adding 'full_image' as polygon @ [(0, 0), (1920, 0), (1920, 1080), (0, 1080)]]
11/13/21 20:35:49.320614 zmesdetect_m6[3115] DBG1 detect_sequence.py:227->[detect: skipping sequence 'coral::SSD-Lite MobileDet 312x312' (1 of 6) as it is disabled]
11/13/21 20:35:49.322333 zmesdetect_m6[3115] DBG1 detect_sequence.py:227->[detect: skipping sequence 'coral::MobileNETv2-SSD 300x300' (2 of 6) as it is disabled]
11/13/21 20:35:49.325778 zmesdetect_m6[3115] DBG1 detect_sequence.py:227->[detect: skipping sequence 'coral::MobileNETv2-SSD TensorFlow 2.0 300x300' (3 of 6) as it is disabled]
11/13/21 20:35:49.33398 zmesdetect_m6[3115] DBG1 detect_sequence.py:227->[detect: skipping sequence 'coral::EfficientDet-Lite 3 512x512' (4 of 6) as it is disabled]
11/13/21 20:35:49.336463 zmesdetect_m6[3115] DBG1 detect_sequence.py:235->[detect: loading 'object' sequence 'DarkNet::v4 Pre-Trained' (5 of 6]
11/13/21 20:35:49.405685 zmesdetect_m6[3115] DBG1 ZMLog:336->[Connected to ZoneMinder Logging system with user 'www-data' -> '/var/log/zm/zmesdetect_m6.log']
11/13/21 20:35:49.359523 zmesdetect_m6[3115] DBG1 yolo.py:49->[yolo: initialization params: {'name': 'DarkNet::v4 Pre-Trained', 'enabled': 'yes', 'object_config': '/var/lib/zmeventnotification/models/yolov4/yolov4.cfg', 'object_weights': '/var/lib/zmeventnotification/models/yolov4/yolov4.weights', 'object_labels': '/var/lib/zmeventnotification/models/yolov4/coco.names', 'object_min_confidence': '0.6', 'object_framework': 'opencv', 'object_processor': 'gpu', 'gpu_max_processes': '1', 'gpu_max_lock_wait': '100', 'cpu_max_processes': '3', 'cpu_max_lock_wait': '100', 'show_models': 'False', 'disable_locks': 'False'}]
11/13/21 20:35:49.371655 zmesdetect_m6[3115] DBG1 object.py:15->[yolo:portalock: [name: pyzm_uid33_GPU_lock] [max: 1] - [timeout: 100]]
11/13/21 20:35:49.373218 zmesdetect_m6[3115] DBG1 detect_sequence.py:227->[detect: skipping sequence 'AWS rekognition (PAID)' (6 of 6) as it is disabled]
11/13/21 20:35:49.374234 zmesdetect_m6[3115] DBG1 object.py:34->[yolo:portalock: Waiting for 'pyzm_uid33_GPU_lock' portalock...]
11/13/21 20:35:49.376163 zmesdetect_m6[3115] DBG1 object.py:37->[yolo:portalock: got 'pyzm_uid33_GPU_lock']
11/13/21 20:35:49.377571 zmesdetect_m6[3115] DBG1 detect_sequence.py:1045->[frame: s-46 [strategy:'first'] (1 of 5) - model: 'object' [strategy:'first'] (1 of 1) - sequence: 'DarkNet::v4 Pre-Trained' [strategy:'most'] (1 of 1)]
11/13/21 20:35:49.381007 zmesdetect_m6[3115] DBG1 object.py:31->[yolo:portalock: 'pyzm_uid33_GPU_lock' already acquired]
11/13/21 20:35:49.382184 zmesdetect_m6[3115] DBG1 yolo.py:98->[yolo: loading model data from sequence 'DarkNet::v4 Pre-Trained']
11/13/21 20:35:49.490693 zmesdetect_m6[3115] DBG1 yolo:106->[perf:yolo: 'DarkNet::v4 Pre-Trained' initialization -> loading 'yolov4.weights' took: 107.01 ms]
11/13/21 20:35:49.490829 zmesdetect_m6[3115] INF yolo:119->[yolo: OpenCV (4.5.4+) fix for getUnconnectedOutLayers() API (Non nested structure)]
11/13/21 20:35:49.491482 zmesdetect_m6[3115] DBG1 yolo:138->[yolo: using GPU for detection, set CUDA/cuDNN backend and target]
11/13/21 20:35:49.491904 zmesdetect_m6[3115] DBG1 yolo:196->[yolo: 'DarkNet::v4 Pre-Trained' (GPU) - input image 1920*1080 - resized by model_width/height to: 416*416]
[ WARN:0] global /root/opencv/modules/dnn/src/dnn.cpp (1447) setUpNet DNN module was not built with CUDA backend; switching to CPU
11/13/21 20:35:49.826831 zmesdetect_m6[3115] DBG2 object:57->[yolo:portalock: released 'pyzm_uid33_GPU_lock']
11/13/21 20:35:49.946356 zmesdetect_m6[3115] DBG2 yolo:309->[perf:yolo:GPU: 'DarkNet::v4 Pre-Trained' detection took: 453.94 ms]
11/13/21 20:35:49.946873 zmesdetect_m6[3115] DBG1 yolo:318->[yolo: ['person', 'bottle'] -- [[14, 230, 1922, 1062], [870, 826, 926, 938]] -- [0.6964279413223267, 0.21165093779563904]]
11/13/21 20:35:49.947885 zmesdetect_m6[3115] DBG2 detect_sequence:1098->[detect: model: 'object' seq: 'DarkNet::v4 Pre-Trained' found 2 detections -> person, bottle]
11/13/21 20:35:49.948186 zmesdetect_m6[3115] DBG1 detect_sequence:339->[>>> detected 'person (1/2)' confidence: 0.70]
11/13/21 20:35:49.948583 zmesdetect_m6[3115] DBG1 detect_sequence:387->['person (1/2)' minimum confidence found: (object_min_conf:sequence->DarkNet::v4 Pre-Trained) -> '0.6']
11/13/21 20:35:49.948898 zmesdetect_m6[3115] DBG2 detect_sequence:433->[checking if 'person (1/2)' @ [(14, 230), (1922, 230), (1922, 1062), (14, 1062)] is inside polygon/zone 'full_image' located at [(0, 0), (1920, 0), (1920, 1080), (0, 1080)]]
11/13/21 20:35:49.949213 zmesdetect_m6[3115] DBG1 detect_sequence:438->['person (1/2)' INTERSECTS polygon/zone 'full_image']
11/13/21 20:35:49.949708 zmesdetect_m6[3115] DBG2 detect_sequence:506->[match pattern: (person|car|motorbike|bus|truck|boat|dog|cat)]
11/13/21 20:35:49.950212 zmesdetect_m6[3115] DBG2 detect_sequence:812->[detection: 'person (1/2)' has PASSED filtering]
11/13/21 20:35:49.950497 zmesdetect_m6[3115] DBG1 detect_sequence:339->[>>> detected 'bottle (2/2)' confidence: 0.21]
11/13/21 20:35:49.950825 zmesdetect_m6[3115] DBG1 detect_sequence:387->['bottle (2/2)' minimum confidence found: (object_min_conf:sequence->DarkNet::v4 Pre-Trained) -> '0.6']
11/13/21 20:35:49.951117 zmesdetect_m6[3115] DBG2 detect_sequence:391->[confidence: 21.17 is lower than minimum of 60.00, removing...]
11/13/21 20:35:49.9514 zmesdetect_m6[3115] DBG2 detect_sequence:815->[detection: 'bottle (2/2)' has FAILED filtering]
11/13/21 20:35:49.9517 zmesdetect_m6[3115] DBG2 detect_sequence:1131->[detect:strategy: '1' filtered label: ['person'] [0.6964279413223267] ['yolo[GPU]'] [[14, 230, 1922, 1062]]]
11/13/21 20:35:49.951952 zmesdetect_m6[3115] DBG2 detect_sequence:1387->[detect: breaking out of MODEL loop as 'frame_strategy' is 'first']
11/13/21 20:35:49.952186 zmesdetect_m6[3115] DBG2 detect_sequence:1415->[perf:frame: s-46 took 637.35 ms]
11/13/21 20:35:49.953102 zmesdetect_m6[3115] DBG2 detect_sequence:1436->[detect: breaking out of frame loop as 'frame_strategy' is 'first']
11/13/21 20:35:49.9534 zmesdetect_m6[3115] DBG2 object:52->[yolo:portalock: already released 'pyzm_uid33_GPU_lock']
11/13/21 20:35:49.953647 zmesdetect_m6[3115] DBG1 detect_sequence:1513->[perf:detect:FINAL: 'Monitor': office (6)->'Event': 107 -> complete detection sequence took: 672.26 ms]
11/13/21 20:35:49.953992 zmesdetect_m6[3115] DBG1 zm_detect:869->[perf:zmes:local: detection took: 0.729117]
11/13/21 20:35:49.954057 zmesdetect_m6[3115] INF zm_detect:920->[zmes:prediction: '[s-46] person(70%)']
11/13/21 20:35:49.954478 zmesdetect_m6[3115] DBG1 zm_detect:922->[zmes:prediction:JSON: {"frame_id": "46", "labels": ["person"], "confidences": [0.6964279413223267], "boxes": [[14, 230, 1922, 1062]], "image_dimensions": {"original": [1080, 1920], "resized": null}}]
11/13/21 20:35:49.976109 zmesdetect_m6[3115] DBG1 zm_detect:1275->[zmes:FORCE: writing objects.json and objdetect.jpg to '/var/cache/zoneminder/events/6/2021-11-13/107']
11/13/21 20:35:49.984982 zmesdetect_m6[3115] ERR zm_detect:1428->[zmes:training images: the directory '/nas/images/yolo_train' does not exist! can't save the model training and compare images! Please re-configure...]
11/13/21 20:35:49.985656 zmesdetect_m6[3115] DBG1 zm_detect:1462->[zmes: PAST EVENT -> new notes are the same as old notes -> [s-46] :detected:person(70%) Motion: All]
11/13/21 20:35:49.995008 zmesdetect_m6[3115] DBG1 zm_detect:1658->[perf:zmes:FINAL: 'Monitor': office (6)->'Event': 107-->'Frame ID':46 [PAST event] [total:1.00278] [detection:0.729117] [after core detection: 0.031669] ]
11/13/21 20:35:49.99586 zmesdetect_m6[3115] DBG1 zm_detect:1659->[ZM Log: Closing all log handlers NOW]
seems pretty quick for cpu detection only. Will later try with tpu and nvidia
Docker images works well.
tested gotify notifications, also working great.