neo-ZMES - Public Beta

Discussion topics related to mobile applications and ZoneMinder Event Server (including machine learning)
tsp84
Posts: 227
Joined: Thu Dec 24, 2020 4:04 am

Re: neo-ZMES - Public Beta

Post by tsp84 »

Theres a formatting error in zm_secrets.yml ? Im not sure as the logs provided don't really tell me much. Make sure that all the keys in zm_secrets are formatted properly. Sanitize the secrets file and post it to see if there are any formatting errors, I have tried to recreate that error and I cant, even with messed up keys and values in the file.
tsp84
Posts: 227
Joined: Thu Dec 24, 2020 4:04 am

Re: neo-ZMES - Public Beta

Post by tsp84 »

zmeventnotification can not read YAML. You are feeding zm_secrets.yml into zmeventnotification.pl. zmeventnotification.pl needs zmeventnotfication.ini and secrets.ini to function. zmeventnotification.pl is the actual program that scans the memory looking for new events created by ZM. The object detection is separate from that part of ZMES. secrets.ini is the secrets file for zmeventnotfication.ini

My bad as I don't have my config files on the same disk so I don't accidentally push them to github. I have recreated secrets.ini in repo. Its confusing I know, once its configured it should just work though.

I am going to try and write up a 'first configuration' article to help iron out all these bugs because it is a PITA to get it all correct. Ive been balls deep in the code for a few months so I just instinctually fix errors as they happen and forget to patch them up properly :(
juan11perez
Posts: 64
Joined: Tue Apr 27, 2021 3:41 am

Re: neo-ZMES - Public Beta

Post by juan11perez »

ok, so i changed to secrets.ini and zmevent started.
now how do i get it to detect? i'm running a test unit so cpu only.
so I pressume i just enable this:

Code: Select all

      - name: 'DarkNet::v4 Pre-Trained'
        enabled: 'yes'
in objectconfig.yaml ?

I did and no detection. any other setting?
tsp84
Posts: 227
Joined: Thu Dec 24, 2020 4:04 am

Re: neo-ZMES - Public Beta

Post by tsp84 »

I need to see the debug log output to know what's going on before I can say for sure.
juan11perez
Posts: 64
Joined: Tue Apr 27, 2021 3:41 am

Re: neo-ZMES - Public Beta

Post by juan11perez »

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.
next I tried this

Code: Select all

sudo -u www-data /var/lib/zmeventnotification/bin/zm_detect.py --config /etc/zm/objectconfig.yml --debug --eventid 123
and get

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

how do i pull debug output?
thank you

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 >>

Code: Select all

docker pull juan11perez/neozmesml
But if you prefer you can build your own:
git clone -b neozmesml https://github.com/juan11perez/zmesml.git && cd zmesml && docker build . -t neozmesml -f Dockerfile.neozmesml

docker run

Code: Select all

    docker run -d --name="neozmesml" --net="bridge" --shm-size="4G" -p 8089:80/tcp -p 5003:5000 -e TZ="Asia/Dubai" \
    -e PUID="99" -e PGID="100" -e MULTI_PORT_START="0" -e MULTI_PORT_END="0" -v "./neozmesml/config":"/config":rw \
    -v "./neozmesml/data":"/var/cache/zoneminder":rw neozmesml
create your db user:
docker exec -it neozmesml /bin/bash
cd /config && python3 /var/lib/zmeventnotification/mlapi_dbuser.py -u mlapitest -p test123

all your config files will be in config dir

EDIT:
never mind. also traced the error to leaving uncommented your example for ZM_ML_USER/PASS IN zm_secrets.yml.
I commented it out and it all now runs without error.

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.

Very nice!!!!!!!!!
tsp84
Posts: 227
Joined: Thu Dec 24, 2020 4:04 am

Re: neo-ZMES - Public Beta

Post by tsp84 »

Super glad you got it going. I made some more optimizations and I have gotten it down to 1.2 seconds for zmes to send the detection off to mlapi. It's amazing.

I am going to be rewriting some things so that mlapi is the only way to process object detection and instead of using TCP sockets on the same host it will use Unix sockets to communicate which should speed things up even more. I'll review the config files today and make them nicer. Theyre messed up because I've just been adding new options and not grouping them together to make them concise.

I will also wrote up an article on what all the new options do and an in depth explanation on how to configure things for different results.
juan11perez
Posts: 64
Joined: Tue Apr 27, 2021 3:41 am

Re: neo-ZMES - Public Beta

Post by juan11perez »

Looking at cpu usage..... I have the original zmesml and neozmesml running concurrently. The original is using a coral, whilst neo is not and neo cpu usage is lower!
Seems your optimisations are more far reaching than just speed.

Will wait for your next update to build another docker image and test.

Looking forward to the homeassistant integration.........

Very nice work...... Thank you for producing and sharing
tsp84
Posts: 227
Joined: Thu Dec 24, 2020 4:04 am

Re: neo-ZMES - Public Beta

Post by tsp84 »

juan11perez wrote: Sat Nov 13, 2021 6:26 pm Looking at cpu usage..... I have the original zmesml and neozmesml running concurrently. The original is using a coral, whilst neo is not and neo cpu usage is lower!
Seems your optimisations are more far reaching than just speed.

Will wait for your next update to build another docker image and test.

Looking forward to the homeassistant integration.........

Very nice work...... Thank you for producing and sharing
You're welcome! That's surprising! I've been changing things for months and didn't really get a baseline with the source repos, so I never noticed that. I haven't used the CPU for detections much, so I didn't bother benchmarking on the CPU, but that's great news. I am still optimizing things as I go and will be reworking logic where I can.

The HA framework is coming I have just started to read and study on building a HACS plugin, I'll start co-developing that this week. I may need testers for that if anyone is interested.

One big enhancement for performance, if you are using mp4 storage for your events in ZM, is to switch back to the JPEG storage method. It takes more space, so I am looking at making a ZM filter rule that will convert the jpegs to MP4 and purge the JPEGs every day or week or whenever the user wants. The detections and animation creation are 10x faster when using jpeg storage vs mp4, I switched a few days ago and it is night and day difference for speed.
juan11perez
Posts: 64
Joined: Tue Apr 27, 2021 3:41 am

Re: neo-ZMES - Public Beta

Post by juan11perez »

I'll test HA integration when ready.

Will change to jpeg storage and test.

Sorry, which option analysis or frames + analysis?

Thank you again
tsp84
Posts: 227
Joined: Thu Dec 24, 2020 4:04 am

Re: neo-ZMES - Public Beta

Post by tsp84 »

just frames is fine unless you want the analysis images as well (they are the images with the red blobs when viewing alarm frames).
juan11perez
Posts: 64
Joined: Tue Apr 27, 2021 3:41 am

Re: neo-ZMES - Public Beta

Post by juan11perez »

small question, do you know why the picture in the neo gotify message (bottom snap) has (off) colours when compared to the standard gotify message?
Attachments
Screenshot_20211114_062217.png
Screenshot_20211114_062217.png (333.71 KiB) Viewed 113113 times
tsp84
Posts: 227
Joined: Thu Dec 24, 2020 4:04 am

Re: neo-ZMES - Public Beta

Post by tsp84 »

Ok so someone else has it happen too. It's weird because it was working fine and then I noticed I was getting BGar colored frames too. It's an easy fix I'll do here right away.

Edit: the really weird thing is it would happen 8n gotify web app and when I refreshed they were proper color so I wasn't sure what was the culprit.
tsp84
Posts: 227
Joined: Thu Dec 24, 2020 4:04 am

Re: neo-ZMES - Public Beta

Post by tsp84 »

Ok so I narrowed it down. I have animations enabled and when animations are enabled they right color frame comes through. I'm just testing a few things and then I will push that fix.
tsp84
Posts: 227
Joined: Thu Dec 24, 2020 4:04 am

Re: neo-ZMES - Public Beta

Post by tsp84 »

Just pushed, I tested before pushing and frames were coming out as RGB. Thanks for finding that!
juan11perez
Posts: 64
Joined: Tue Apr 27, 2021 3:41 am

Re: neo-ZMES - Public Beta

Post by juan11perez »

Ok I rebuild with the latest fix. Updated gotify.sh and it now produces a correct image.

However, I just realised that i wasn't using mlapi. I had not enabled it in objectconfig.yml.

I enabled it and get this error

Code: Select all

root@9e8fa0dfe7dc:/var/lib/zmeventnotification# sudo -u www-data /var/lib/zmeventnotification/bin/zm_detect.py --config /etc/zm/objectconfig.yml --debug --eventid 107
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/14/21 13:46:36.14088 zmesdetect_m6[1082] DBG1 new_yaml.py:242->[config:init: the supplied config file exists -> '/etc/zm/objectconfig.yml']
11/14/21 13:46:36.21141 zmesdetect_m6[1082] DBG1 new_yaml.py:265->[config::init: default configuration built (no secrets or substitution vars replaced, yet!)]
11/14/21 13:46:36.212124 zmesdetect_m6[1082] DBG1 new_yaml.py:170->[config:zmes:proc: 34 built in default keys added to the 'base' config -> ['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/14/21 13:46:36.21242 zmesdetect_m6[1082] DBG1 new_yaml.py:114->[config:zmes:proc: substituting '{{variables}}' for the 'base' config keys]
11/14/21 13:46:36.21317 zmesdetect_m6[1082] DBG1 new_yaml.py:136->[config:zmes: successfully replaced 3 default sub vars in the base config -> ['coral_models', 'yolo_models', 'base_data_path']]
11/14/21 13:46:36.213539 zmesdetect_m6[1082] DBG1 new_yaml.py:285->[config:zmes: the configured secrets file exists and is a file -> '/etc/zm/zm_secrets.yml']
11/14/21 13:46:36.21387 zmesdetect_m6[1082] DBG1 new_yaml.py:291->[config:zmes: starting '{[secrets]}' substitution]
11/14/21 13:46:36.219842 zmesdetect_m6[1082] DBG1 new_yaml.py:324->[config:zmes: successfully replaced 19 secrets in the base config -> ['HA_TOKEN', 'ML_USER', 'ZM_ML_USER', 'PUSHOVER_USER', 'ZM_ML_PASSWORD', 'PLATEREC_ALPR_KEY', 'ZM_PORTAL', 'ZM_USER', 'ZM_PASSWORD', 'HA_SERVER', 'PUSHOVER_APP_TOKEN', 'MQTT_PASSWORD', 'PUSHOVER_USER_KEY', 'MQTT_USERNAME', 'mlapi_one_key', 'PUSHOVER_ERR_TOKEN', 'ML_PASSWORD', 'PUSHOVER_PASS', 'ZM_API_PORTAL']]
11/14/21 13:46:36.220193 zmesdetect_m6[1082] 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/14/21 13:46:36.221702 zmesdetect_m6[1082] DBG1 new_yaml.py:358->[config:zmes: starting '{{variable}}' substitution]
11/14/21 13:46:36.226096 zmesdetect_m6[1082] DBG1 new_yaml.py:375->[config:zmes: successfully replaced 51 sub vars in the base config -> ['platerec_min_dscore', 'match_past_detections', 'cpu_max_processes', 'tpu_object_labels', 'gpu_max_processes', 'yolo4_object_processor', 'same_model_sequence_strategy', 'yolo4_object_weights', 'openalpr_cmdline_params', 'gpu_max_lock_wait', 'yolo4_object_labels', 'known_images_path', 'face_detection_framework', 'frame_strategy', 'face_upsample_times', 'openalpr_cmdline_min_confidence', 'platerec_stats', 'disable_locks', 'frame_set', 'past_det_max_diff_area', 'tpu_efficientdet_lite3', 'cpu_max_lock_wait', 'face_detection_pattern', 'face_recog_dist_threshold', 'yolo4_object_config', 'object_detection_pattern', 'tpu_object_weights_mobiledet', 'max_detection_size', 'save_unknown_faces', 'smart_fps_thresh', 'tpu_max_processes', 'tpu_object_weights_mobilenetv2', 'alpr_detection_pattern', 'save_unknown_faces_leeway_pixels', 'alpr_key', 'yolo4_object_framework', 'tpu_min_confidence', 'tpu_tf2_mobilenetv2', 'face_model', 'openalpr_cmdline_binary', 'face_num_jitters', 'platerec_min_score', 'tpu_face_weights_mobilenetv2', 'object_min_confidence', 'tpu_object_framework', 'show_models', 'contained_area', 'tpu_max_lock_wait', 'model_sequence', 'unknown_images_path', 'face_train_model']]
11/14/21 13:46:36.227956 zmesdetect_m6[1082] 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/14/21 13:46:36.228266 zmesdetect_m6[1082] DBG1 zm_detect.py:598->[perf:zmes: building the intial config took 0.087413 ]
11/14/21 13:46:36.2287 zmesdetect_m6[1082] DBG1 new_yaml.py:747->[zmes:api create: building ZM API Session]
11/14/21 13:46:36.234174 zmesdetect_m6[1082] DBG1 api.py:112->[api: SSL certificate verification disabled (encryption enabled, vulnerable to MITM attacks)]
11/14/21 13:46:36.234845 zmesdetect_m6[1082] DBG1 api.py:281->[api: no token found, trying user/pass for login]
11/14/21 13:46:36.608693 zmesdetect_m6[1082] DBG1 ZMLog:336->[------|  FORKED NEO --- app->Hooks: 7.0.2 - pyzm: 1.0.2 - ES: 7.0.0 - OpenCV:4.5.4 |------]
11/14/21 13:46:36.340098 zmesdetect_m6[1082] 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/14/21 13:46:36.346828 zmesdetect_m6[1082] DBG1 api.py:318->[api: detected API ver 2.0+, using token system]
11/14/21 13:46:36.347285 zmesdetect_m6[1082] DBG1 api.py:333->[api: access token expires on: 2021-11-14 15:46:36.347268 (7200s)]
11/14/21 13:46:36.347656 zmesdetect_m6[1082] DBG1 api.py:345->[api: refresh token expires on: 2021-11-15 13:46:36.347648 (86400s)]
11/14/21 13:46:36.400944 zmesdetect_m6[1082] DBG1 new_yaml.py:780->[zmes:api create: ZM API created]
11/14/21 13:46:36.406607 zmesdetect_m6[1082] DBG1 zm_detect.py:643->[perf:zmes: Monitor ID (6) verified! pausing to wait for verification took 0.066485 seconds -=- api creation took 0.178088 seconds]
11/14/21 13:46:36.612824 zmesdetect_m6[1082] DBG1 ZMLog:336->[zmes: Setting up signal handlers for log 'rotation' and log 'interrupt']
11/14/21 13:46:36.455081 zmesdetect_m6[1082] DBG1 zm_detect.py:710->[zmes: this is a 'PAST' (debugging?) event!]
11/14/21 13:46:36.613757 zmesdetect_m6[1082] DBG1 ZMLog:336->[|----------= Encrypted Route Name: 'mlapi_one' | Gateway URL: 'http://192.168.1.100:5003/api/v1' | Weight: 0 =----------|]
11/14/21 13:46:36.456406 zmesdetect_m6[1082] DBG1 zm_detect.py:103->[zmes:mlapi:login: No need to login, access token is valid for 1737.890986442566 sec]
11/14/21 13:46:36.547927 zmesdetect_m6[1082] DBG1 zm_detect.py:377->[
** Gateway URL: 'http://192.168.1.100:5003/api/v1/detect/object?type=object' using auth_header={'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGc......'} 
**** params={'delete': True, 'response_format': 'zm_detect'}
****** JSON: stream: 107 - mid: 6 - 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_snapshots': 1, 'smart_fps_thresh': '5', 'save_frames': 'no', 'save_frames_dir': None, 'PAST_EVENT': True, 'resize': 800} - files: {}
]
11/14/21 13:46:36.583172 zmesdetect_m6[1082] DBG1 zm_detect.py:422->[zmes:mlapi: error during post to mlapi host-> keys must be str, int, float, bool or None, not bytes]
11/14/21 13:46:36.586015 zmesdetect_m6[1082] DBG1 zm_detect.py:821->[perf:zmes:mlapi: Monitor: office (6)->'Event': 107 mlapi detection took: 0.130095]
11/14/21 13:46:36.616502 zmesdetect_m6[1082] DBG1 ZMLog:336->[Connected to ZoneMinder Logging system with user 'www-data' -> '/var/log/zm/zmesdetect_m6.log']
11/14/21 13:46:36.586515 zmesdetect_m6[1082] DBG1 zm_detect.py:1590->[zmes: no predictions returned from detections]
11/14/21 13:46:36.588445 zmesdetect_m6[1082] DBG1 zm_detect.py:1658->[perf:zmes:FINAL: 'Monitor': office (6)->'Event': 107 [PAST event] [total:0.448699] [detection:0.130095] [after core detection: 0.000573] ]
key error. not sure i guess it's the mlapi_one_key??
i created a new one with python3 ./get_encryption_key.py but same error
Post Reply