yessss !!! it works..... and following the model_sequence : object, face
but frame_strategy: most needs to be like this. if set to first it doesnt work
Code: Select all
root@UNRAID:/var/lib/zmeventnotification# sudo -u www-data /var/lib/zmeventnotification/bin/zm_detect.py --config /etc/zm/objectconfig.yml --debug --eventid 294
encrypted_data = {'gAAAAABhmhC8ybGJ8v9Z0Mb0fBaw34eKF5tB-E0zuh0kRfAdemPXN1nablT5s8zv7eBZfSzhrcs-8K0ZSI-90cknlXlrjCxgiw==': 'gAAAAABhmhC81KHEIr01qe-_rej0T9SW7MjSZe5VXH939OXNxvQiKhHRjXDDWMX-u4LdHkercPQsnk1Hs6Uu7OGPzcNldR86uQ==', 'gAAAAABhmhC8LKmqe-KRAc24FkznApt6CEUAM8VUyKvh0aiCa1k0EeRl1jVVd-dAuWo7WFakcof9j-zU47Xbb1_Leyqu4bj7Dw==': 'gAAAAABhmhC8NbAk7F2KoIVOScDikugsx9ZXXzXM1JDW6e6ZtxYWS2sewAnlBcVeDyThegENYfDsmZdjEMpszMneX5xjWpW1iw==', 'gAAAAABhmhC8SGWWHDWB-EHmbN_uD1KET-PXGhJrtH6ZKTxG1Zu9K31wla83i_44xFKtLWqN-GNRMw8P2v_mhgt5t9ieIZAod3m64LciHFn404LWqAvi7i4=': 'gAAAAABhmhC845sQqP-nhDLON3l15mbLfJcegUVAWdXN015d3MkZCHCQTkvIsZW8_eoFPLGzq7oLPGvvOfz_UMFcFI2eF8dadA==', 'gAAAAABhmhC8BSHvCclGLM_qEXuTVLhxgJLf4mElCX1kQysgU2QU7bK4QTa26nbp8bcLyo-CL3p19AoZhYfquC44LtwYOFD7MA==': 'gAAAAABhmhC82VBR2srbRhcpy724Q_VjqHCMv2CBDKI4gOd4gdBKaBtruCGpaVNsvShuJw03CnVxeH0TX5jvL5p0DSzDNqFC2jQuxoYXRd9-1p9LYYVm_jOwiF4wDm9KffK36LKAPaF6MJhksK_YPeEe7Miq5t-iNhbOQ-i1tG7p0JLsbWR_07G7wK754jlC6smRFwVrB5DS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FDCgHKwoVRJn2c5tLskYjrSvG9kHCVM=', 'gAAAAABhmhC8Vaz93NWu0FXUax9PKmRF3VY78blEU9AtOtWtDK5xCxPLCrJhA0h4zj0mQeAa-1ze4gKpiDZTqJgO32CC8MX8sw==': 'gAAAAABhmhC89vhWwWlI2Kgt9o1kLHXWSXeMTRVHeNhzwiRipbQI9PlzLEJ7Ooj9BEgxIXQBvaJDhMbZa6qZb4G8YuYfIJt4RQ==', 'gAAAAABhmhC8wWRjDiWzG89LTsOaRhe_3j0cpCxuSjWQ_ley1Kduf58PkJLzw-25xc6h2WAVCoHT0yZbtc0RFFIwtm-h-lb2GA==': 'gAAAAABhmhC8GvzAjXQxrbAh-9F8H4Q90Q4dd360wmvb4JUGeSXgiP3_zJsxKLg68ekXT7OMLmNlHHdxhEQhBkHewxkKJ7lFgw==', 'gAAAAABhmhC8Nm7pnt6TpefBwiakwBpDT7wD440TyH1_zJCIeZ81jX2U96psKDZVtNPqV2fq-3TZtkgqTDa9d6cgNI5Dtqic8A==': 'gAAAAABhmhC8dkjMOMbJ0pKfsRlwnV4IyKCx7ejFSGqo7Zt-ZWLQkiwt5vuw1x-pc2xHpPrrMwNFICO8x6Etslk6b2I8JDmxoBMNNs5QHd4yXONcDoQ6DUL8FPGVanZwv9Cr0rgkEBik', 'gAAAAABhmhC8CzddoMP8sAYvwl8jG8w3fZnztO_u-8cdi5qqM57Zcg18VS8_nw247T_ZT_Heplx5g6gElew2L32cxhSOl0Jvmw==': 'gAAAAABhmhC8AThnNoJ323QF_LZd41iRKm4U7mLfLgWcQ2rKzyUXVWykc8jBbhwXfjdctqtJI7_xLdU-7kKOpg3ZTaMtLyz2gLSpwQeE2FfywgDWqdgl5-I=', 'name': 'mlapi_one'}
11/21/21 13:26:19.835217 zmesdetect_m6[5442] DBG1 new_yaml.py:242->[config:init: the supplied config file exists -> '/etc/zm/objectconfig.yml']
11/21/21 13:26:19.916129 zmesdetect_m6[5442] DBG1 new_yaml.py:265->[config::init: default configuration built (no secrets or substitution vars replaced, yet!)]
11/21/21 13:26:19.917029 zmesdetect_m6[5442] DBG1 new_yaml.py:170->[config:zmes:proc: 38 built in default keys added to the 'base' config -> ['force_mpd', 'same_model_high_conf', 'skip_mons', 'force_live', 'sanitize_str', 'version', 'basic_user', 'basic_password', 'image_path', 'max_detection_size', 'delete_after_analyze', 'write_debug_image', 'write_image_to_zm', 'hass_enabled', 'hass_people', 'hass_notify', 'hass_cooldown', 'push_err_device', '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', 'same_model_sequence_strategy']]
11/21/21 13:26:19.917339 zmesdetect_m6[5442] DBG1 new_yaml.py:114->[config:zmes:proc: substituting '{{variables}}' for the 'base' config keys]
11/21/21 13:26:19.91821 zmesdetect_m6[5442] DBG1 new_yaml.py:136->[config:zmes: successfully replaced 3 default sub vars in the base config -> ['yolo4_models', 'base_data_path', 'coral_models']]
11/21/21 13:26:19.918594 zmesdetect_m6[5442] DBG1 new_yaml.py:285->[config:zmes: the configured secrets file exists and is a file -> '/etc/zm/zm_secrets.yml']
11/21/21 13:26:19.918934 zmesdetect_m6[5442] DBG1 new_yaml.py:291->[config:zmes: starting '{[secrets]}' substitution]
11/21/21 13:26:19.924849 zmesdetect_m6[5442] DBG1 new_yaml.py:324->[config:zmes: successfully replaced 17 secrets in the base config -> ['ML_PASSWORD', 'ZM_PASSWORD', 'HA_SERVER', 'ML_USER', 'MQTT_USERNAME', 'PUSHOVER_USER_KEY', 'ZM_API_PORTAL', 'HA_TOKEN', 'ZM_PORTAL', 'MQTT_PASSWORD', 'mlapi_one_key', 'ZM_USER', 'PLATEREC_ALPR_KEY', 'PUSHOVER_ERR_TOKEN', 'PUSHOVER_APP_TOKEN', 'PUSHOVER_USER', 'PUSHOVER_PASS']]
11/21/21 13:26:19.925291 zmesdetect_m6[5442] 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/21/21 13:26:19.926922 zmesdetect_m6[5442] DBG1 new_yaml.py:358->[config:zmes: starting '{{variable}}' substitution]
11/21/21 13:26:19.932408 zmesdetect_m6[5442] DBG1 new_yaml.py:375->[config:zmes: successfully replaced 51 sub vars in the base config -> ['contained_area', 'face_detection_pattern', 'tpu_efficientdet_lite3', 'platerec_min_dscore', 'yolo4_object_weights', 'cpu_max_processes', 'yolo4_object_config', 'tpu_tf2_mobilenetv2', 'save_unknown_faces', 'tpu_object_weights_mobiledet', 'cpu_max_lock_wait', 'gpu_max_processes', 'object_detection_pattern', 'face_upsample_times', 'alpr_key', 'openalpr_cmdline_min_confidence', 'tpu_max_processes', 'disable_locks', 'gpu_max_lock_wait', 'same_model_sequence_strategy', 'tpu_max_lock_wait', 'face_model', 'yolo4_object_labels', 'alpr_detection_pattern', 'save_unknown_faces_leeway_pixels', 'tpu_face_weights_mobilenetv2', 'tpu_object_framework', 'max_detection_size', 'yolo4_object_processor', 'face_recog_dist_threshold', 'face_num_jitters', 'show_models', 'tpu_object_labels', 'known_images_path', 'frame_strategy', 'smart_fps_thresh', 'frame_set', 'object_min_confidence', 'model_sequence', 'face_detection_framework', 'match_past_detections', 'openalpr_cmdline_params', 'face_train_model', 'platerec_min_score', 'unknown_images_path', 'tpu_min_confidence', 'tpu_object_weights_mobilenetv2', 'openalpr_cmdline_binary', 'platerec_stats', 'past_det_max_diff_area', 'yolo4_object_framework']]
11/21/21 13:26:19.934226 zmesdetect_m6[5442] 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/21/21 13:26:19.934644 zmesdetect_m6[5442] DBG1 zm_detect.py:540->[perf:zmes: building the intial config took 0.099448 ]
11/21/21 13:26:19.935158 zmesdetect_m6[5442] DBG1 new_yaml.py:762->[zmes:api create: building ZM API Session]
11/21/21 13:26:19.940661 zmesdetect_m6[5442] DBG1 api.py:114->[api: SSL certificate verification disabled (encryption enabled, vulnerable to MITM attacks)]
11/21/21 13:26:19.941506 zmesdetect_m6[5442] DBG1 api.py:283->[api: no token found, trying user/pass for login]
11/21/21 13:26:20.003337 zmesdetect_m6[5442] DBG1 api.py:320->[api: detected API ver 2.0+, using token system]
11/21/21 13:26:20.004059 zmesdetect_m6[5442] DBG1 api.py:335->[api: access token expires on: 2021-11-21 15:26:20.004030 (7200s)]
11/21/21 13:26:20.004432 zmesdetect_m6[5442] DBG1 api.py:347->[api: refresh token expires on: 2021-11-22 13:26:20.004421 (86400s)]
11/21/21 13:26:20.02595 zmesdetect_m6[5442] DBG1 new_yaml.py:795->[zmes:api create: ZM API created]
11/21/21 13:26:20.261976 zmesdetect_m6[5442] DBG1 ZMLog:336->[------| FORKED NEO --- app->Hooks: 7.0.3 - pyzm: 1.0.3 - ES: 7.0.3 - OpenCV:4.5.4 |------]
11/21/21 13:26:20.262335 zmesdetect_m6[5442] DBG1 ZMLog:336->[zmes: Setting up signal handlers for log 'rotation' and log 'interrupt']
11/21/21 13:26:20.104863 zmesdetect_m6[5442] DBG1 zm_detect.py:652->[zmes: this is a 'PAST' (debugging?) event!]
11/21/21 13:26:20.26331 zmesdetect_m6[5442] DBG1 ZMLog:336->[|----------= Encrypted Route Name: 'mlapi_one' | Gateway URL: 'http://192.168.1.100:5002/api/v1' | Weight: 0 =----------|]
11/21/21 13:26:20.107171 zmesdetect_m6[5442] DBG1 zm_detect.py:103->[zmes:mlapi:login: No need to login, access token is valid for 292.2192554473877 sec]
11/21/21 13:26:20.211154 zmesdetect_m6[5442] DBG1 zm_detect.py:318->[
** Gateway URL: 'http://192.168.1.100:5002/api/v1/detect/object?type=object' using auth_header={'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGc......'}
**** params={'delete': True, 'response_format': 'zm_detect'}
****** JSON: stream: 294 - mid: 6 - reason: None - stream options: {'frame_strategy': 'most', 'frame_set': 'snapshot, alarm, snapshot', 'contig_frames_before_error': 2, 'delay_between_attempts': 2.143256, 'max_attempts': 3, 'delay_between_snapshots': 1, 'smart_fps_thresh': '5', 'save_frames': 'no', 'save_frames_dir': None, 'PAST_EVENT': True} - files: {}
]
11/21/21 13:26:20.264989 zmesdetect_m6[5442] DBG1 ZMLog:336->[Connected to ZoneMinder Logging system with user 'www-data' -> '/var/log/zm/zmesdetect_m6.log']
11/21/21 13:26:24.584147 zmesdetect_m6[5442] DBG1 zm_detect:383->[zmes:mlapi: parsed JSON detection data in multipart response]
11/21/21 13:26:24.584468 zmesdetect_m6[5442] DBG1 zm_detect:379->[zmes:mlapi: parsed the matched image from bytes to a jpeg encoded array in multipart response]
11/21/21 13:26:24.595984 zmesdetect_m6[5442] DBG1 zm_detect:763->[perf:zmes:mlapi: Monitor: office (6)->'Event': 294 mlapi detection took: 4.488341]
11/21/21 13:26:24.596385 zmesdetect_m6[5442] DBG1 pyzm_utils:1336->['success'-> True ]
11/21/21 13:26:24.596684 zmesdetect_m6[5442] DBG1 pyzm_utils:1297->[--- --- ---]
11/21/21 13:26:24.596983 zmesdetect_m6[5442] DBG1 pyzm_utils:1298->['matched_data'-> labels-->['person', 'Juan'] ]
11/21/21 13:26:24.59725 zmesdetect_m6[5442] DBG1 pyzm_utils:1298->['matched_data'-> model_names-->['coral', 'face_dlib'] ]
11/21/21 13:26:24.597541 zmesdetect_m6[5442] DBG1 pyzm_utils:1298->['matched_data'-> confidences-->[0.66796875, 1] ]
11/21/21 13:26:24.597838 zmesdetect_m6[5442] DBG1 pyzm_utils:1298->['matched_data'-> frame_id-->s-68 ]
11/21/21 13:26:24.598078 zmesdetect_m6[5442] DBG1 pyzm_utils:1298->['matched_data'-> type-->['object', 'face'] ]
11/21/21 13:26:24.598307 zmesdetect_m6[5442] DBG1 pyzm_utils:1298->['matched_data'-> boxes-->[[256, 446, 1798, 1062], [818, 554, 1210, 948]] ]
11/21/21 13:26:24.598533 zmesdetect_m6[5442] DBG1 pyzm_utils:1298->['matched_data'-> image_dimensions-->{'original': [1080, 1920], 'resized': None} ]
11/21/21 13:26:24.598878 zmesdetect_m6[5442] DBG1 pyzm_utils:1298->['matched_data'-> polygons-->[{'name': 'full_image', 'value': [[0, 0], [1920, 0], [1920, 1080], [0, 1080]], 'pattern': None}] ]
11/21/21 13:26:24.599162 zmesdetect_m6[5442] DBG1 pyzm_utils:1298->['matched_data'-> image--><uint-8 encoded jpg> ]
11/21/21 13:26:24.599222 zmesdetect_m6[5442] INF zm_detect:862->[zmes:prediction: '[s-68] person(67%), Juan(100%)']
11/21/21 13:26:24.599719 zmesdetect_m6[5442] DBG1 zm_detect:864->[zmes:prediction:JSON: {"frame_id": "68", "labels": ["person", "Juan"], "confidences": [0.66796875, 1], "boxes": [[256, 446, 1798, 1062], [818, 554, 1210, 948]], "image_dimensions": {"original": [1080, 1920], "resized": null}}]
11/21/21 13:26:24.602135 zmesdetect_m6[5442] DBG1 zm_detect:1223->[zmes: writing objects.json and objdetect.jpg to '/var/cache/zoneminder/events/6/2021-11-21/294']
11/21/21 13:26:24.609647 zmesdetect_m6[5442] DBG2 zm_detect:1395->[api:make_req: 'put'->http://192.168.1.100:8088/zm/api/events/294.json payload={'Event[Notes]': '[s-68] :detected:person(67%), Juan(100%) Motion: All'} query={'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjM3NDg2NzgwLCJleHAiOjE2Mzc0OTM5ODAsInVzZXIiOiJqdWFuIiwidHlwZSI6ImFjY2VzcyJ9.kP2yXHy1rQcBm8lLLXFi-TwubY1AhstQmCAkp632Xvw...'}]
11/21/21 13:26:24.618519 zmesdetect_m6[5442] DBG1 zm_detect:1406->[zmes: replaced old note -> '[s-63] :detected:person(65%), Juan(100%) Motion: All' with new note -> '[s-68] :detected:person(67%), Juan(100%) Motion: All']
11/21/21 13:26:24.618939 zmesdetect_m6[5442] DBG1 zm_detect:1606->[perf:zmes:FINAL: 'Monitor': office (6)->'Event': 294-->'Frame ID':68 [PAST event] [total:4.784413] [detection:4.488341] [after core detection: 0.022493] ]
11/21/21 13:26:24.619442 zmesdetect_m6[5442] DBG1 zm_detect:1607->[ZM Log: Closing all log handlers NOW]
root@UNRAID:/var/lib/zmeventnotification#