ZoneMinder / pyzm

Python API, Log, Event Server and Memory wrapper for ZoneMinder
GNU General Public License v2.0
31 stars 20 forks source link

Jetson Nano: Timeout waiting for gpu lock #22

Closed klutchell closed 3 years ago

klutchell commented 3 years ago

Event Server version

6.0.7 (currently testing commit 534c0b595e3c07d6a5a9ed285884532c4d3b0ee7)

Hooks version (if you are using Object Detection)

hooks:6.0.7 pyzm:0.3.8

The version of ZoneMinder you are using:

v1.34.22.

What is the nature of your issue

Question(s)

Details

TL;DR Can you suggest a way to determine if and where pyzm/yolo is getting stuck? The first event or two is processed, so it seems like the lock is never released after the first events. Is there a proc I can look for to see if it's actually still processing?

I maintain a docker-compose stack that runs ZoneMinder and Event Notification Server in a container on a Jetson Nano. I'm testing with 3 RTSP cameras at 4fps x 720p.

The issue I'm having is the gpu lock appears to get stuck when running basic object (no face or alpr) detection via tinyyolov4 and I've opened this issue against my repo for tracking:

https://github.com/klutchell/balena-zoneminder/issues/2

On startup, the first 1 or 2 events are processed correctly and shows detected objects and boxed images in ZM and all of that. So know the basic gpu detection is working. However following the first couple events, most if not all future events are not processed and I receive fatal logs Timeout waiting for gpu lock for 100 seconds. I also see some CUBLAS_STATUS_NOT_INITIALIZED errors but I don't know if they are related and they only happen on first startup.

OpenCV seems to be correctly compiled for the platform with CUDA and CUDNN, I've tried compiling it myself and using alwaysai/edgeiq base images with the same result.

My current, default objectconfig is available here:

https://github.com/klutchell/balena-zoneminder/blob/main/zm/objectconfig.ini

I've looked into the pyzm code a bit but it's not obvious to me where it could be getting stuck that the locks are not released. I'm hoping this is where you can help with the investigation next steps! Do you think the CUBLAS_STATUS_NOT_INITIALIZED errors are related to the locks?

Debug Logs

root@3ac69193ff00:/var/log/zm# more zmesdetect_m1.log 
12/29/20 11:34:25 zmesdetect_m1[153] INF zm_detect.py:208 [---------| pyzm version:0.3.8, hook version:6.0.7,  ES version:6.0.7 , OpenCV version:4.4.0|------------]
12/29/20 11:34:25 zmesdetect_m1[153] DBG1 utils.py:405 [secret filename: /etc/zm/secrets.ini]
12/29/20 11:34:25 zmesdetect_m1[153] DBG2 utils.py:378 [Secret token found in config: !ZM_PORTAL]
12/29/20 11:34:25 zmesdetect_m1[153] DBG2 utils.py:378 [Secret token found in config: !ZM_USER]
12/29/20 11:34:25 zmesdetect_m1[153] DBG2 utils.py:378 [Secret token found in config: !ZM_PASSWORD]
12/29/20 11:34:25 zmesdetect_m1[153] DBG2 utils.py:378 [Secret token found in config: !ZM_API_PORTAL]
12/29/20 11:34:25 zmesdetect_m1[153] DBG2 utils.py:378 [Secret token found in config: !ML_USER]
12/29/20 11:34:25 zmesdetect_m1[153] DBG2 utils.py:378 [Secret token found in config: !ML_PASSWORD]
12/29/20 11:34:25 zmesdetect_m1[153] DBG2 utils.py:378 [Secret token found in config: !PLATEREC_ALPR_KEY]
12/29/20 11:34:25 zmesdetect_m1[153] DBG1 utils.py:440 [allowing self-signed certs to work...]
12/29/20 11:34:25 zmesdetect_m1[153] DBG4 utils.py:450 [Now checking for monitor overrides]
12/29/20 11:34:25 zmesdetect_m1[153] DBG4 utils.py:513 [Finally, doing parameter substitution]
12/29/20 11:34:25 zmesdetect_m1[153] INF zm_detect.py:234 [Importing local classes for Object/Face]
12/29/20 11:34:25 zmesdetect_m1[153] DBG1 utils.py:280 [Trying to download http://localhost/zm/index.php?view=image&eid=886&fid=alarm&username=admin&password=*****]
12/29/20 11:34:26 zmesdetect_m1[153] DBG1 utils.py:299 [Trying to download http://localhost/zm/index.php?view=image&eid=886&fid=snapshot&username=admin&password=*****]
12/29/20 11:34:26 zmesdetect_m1[153] DBG1 zm_detect.py:295 [No polygon area specfied, so adding a full image polygon:[{'name': 'full_image', 'value': [(0, 0), (1280, 0), (1280, 720), (0, 720)], 'patter
n': None}]]
12/29/20 11:34:26 zmesdetect_m1[153] DBG1 zm_detect.py:298 [resizing to 800 before analysis...]
12/29/20 11:34:26 zmesdetect_m1[153] DBG2 utils.py:138 [resized polygons x=0.625/y=0.625: [{'name': 'full_image', 'value': [(0, 0), (800, 0), (800, 450), (0, 450)], 'pattern': None}]]
12/29/20 11:34:26 zmesdetect_m1[153] DBG1 zm_detect.py:319 [User ALPR if vehicle found: False]
12/29/20 11:34:26 zmesdetect_m1[153] DBG4 yolo.py:26 [Yolo init params: {'pyzm_overrides': {'log_level_debug': 5}, 'secrets': '/etc/zm/secrets.ini', 'version': '1.2', 'cpu_max_processes': 3, 'gpu_max_p
rocesses': 1, 'tpu_max_processes': 1, 'cpu_max_lock_wait': 100, 'gpu_max_lock_wait': 100, 'tpu_max_lock_wait': 100, 'base_data_path': '/var/lib/zmeventnotification', 'portal': 'http://localhost/zm', 'a
pi_portal': 'http://localhost/zm/api', 'user': 'admin', 'password': 'plexnchi11', 'basic_user': '', 'basic_password': '', 'image_path': '/var/lib/zmeventnotification/images', 'match_past_detections': '
no', 'past_det_max_diff_area': '5%', 'max_detection_size': '90%', 'frame_id': 'bestmatch', 'bestmatch_order': 'a,s', 'wait': '0', 'resize': '800', 'delete_after_analyze': 'yes', 'show_percent': 'yes', 
'allow_self_signed': 'yes', 'write_image_to_zm': 'yes', 'write_debug_image': 'no', 'detection_sequence': ['object'], 'detection_mode': 'all', 'import_zm_zones': 'no', 'only_triggered_zm_zones': 'no', '
poly_color': (255, 255, 255), 'poly_thickness': 2, 'create_animation': 'no', 'animation_types': "'mp4,gif'", 'animation_width': 640, 'animation_retry_sleep': 15, 'animation_max_tries': 4, 'fast_gif': '
no', 'ml_gateway': None, 'ml_fallback_local': 'no', 'ml_user': '"your_mlapi_user"', 'ml_password': '"your_mlapi_password"', 'use_sequence': 'yes', 'ml_sequence': '{\n\'general\': {\n\'model_sequence\':
 \'object\',\n\n},\n\'object\': {\n\'general\':{\n\'pattern\':\'.*\',\n\'same_model_sequence_strategy\': \'first\' # also \'most\', \'most_unique\'s\n},\n\'sequence\': [{\n\'object_config\':\'/var/lib/
zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg\',\n\'object_weights\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights\',\n\'object_labels\': \'/var/lib/zmeventnotification/m
odels/tinyyolov4/coco.names\',\n\'object_min_confidence\': 0.3,\n\'object_framework\':\'opencv\',\n\'object_processor\': \'gpu\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_proc
esses\': 3,\n\'cpu_max_lock_wait\': 100\n}]\n},\n\'face\': {\n\'general\':{\n\'pattern\': \'.*\',\n\'same_model_sequence_strategy\': \'first\'\n},\n\'sequence\': [{\n\'save_unknown_faces\':\'yes\',\n\'
save_unknown_faces_leeway_pixels\':100,\n\'face_detection_framework\': \'dlib\',\n\'known_images_path\': \'/var/lib/zmeventnotification/known_faces\',\n\'unknown_images_path\': \'/var/lib/zmeventnotifi
cation/unknown_faces\',\n\'face_model\': \'cnn\',\n\'face_train_model\': \'cnn\',\n\'face_recog_dist_threshold\': \'0.6\',\n\'face_num_jitters\': \'1\',\n\'face_upsample_times\':\'1\',\n\'gpu_max_proce
sses\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100,\n\'max_size\':800\n}]\n},\n\n\'alpr\': {\n\'general\':{\n\'same_model_sequence_strategy\': \'first\',\n\'
pre_existing_labels\':[\'car\', \'motorbike\', \'bus\', \'truck\', \'boat\'],\n\'pattern\': \'.*\'\n\n},\n\'sequence\': [{\n\'alpr_api_type\': \'cloud\',\n\'alpr_service\': \'plate_recognizer\',\n\'alp
r_key\': \'"your_plate_recognizer_api_key"\',\n\'platrec_stats\': \'yes\',\n\'platerec_min_dscore\': 0.1,\n\'platerec_min_score\': 0.2,\n\'max_size\':1600\n}]\n}\n}', 'stream_sequence': "{\n'frame_stra
tegy': 'most_models',\n'frame_set': 'snapshot,alarm',\n'resize':800\n\n}", 'object_detection_pattern': '.*', 'object_framework': 'opencv', 'object_processor': 'gpu', 'object_config': '/var/lib/zmeventn
otification/models/tinyyolov4/yolov4-tiny.cfg', 'object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights', 'object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/
coco.names', 'object_min_confidence': 0.3, 'face_detection_pattern': '.*', 'face_detection_framework': 'dlib', 'face_recognition_framework': 'dlib', 'face_processor': 'cpu', 'face_num_jitters': 1, 'fac
e_upsample_times': 1, '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_face
s', 'unknown_images_path': '/var/lib/zmeventnotification/unknown_faces', 'unknown_face_name': 'unknown face', 'save_unknown_faces': 'yes', 'save_unknown_faces_leeway_pixels': 100, 'alpr_service': 'plat
e_recognizer', 'alpr_detection_pattern': '.*', 'alpr_url': None, 'alpr_key': '"your_plate_recognizer_api_key"', 'alpr_use_after_detection_only': 'yes', 'alpr_api_type': 'cloud', 'platerec_stats': 'yes'
, 'platerec_regions': None, 'platerec_min_dscore': 0.1, 'platerec_min_score': 0.2, 'openalpr_recognize_vehicle': '0', 'openalpr_country': 'us', 'openalpr_state': None, 'openalpr_min_confidence': '0.3',
 'openalpr_cmdline_binary': 'alpr', 'openalpr_cmdline_params': '-j -d', 'openalpr_cmdline_min_confidence': 0.3, 'tpu_object_weights': '/var/lib/zmeventnotification/models/coral_edgetpu/ssd_mobilenet_v2
_coco_quant_postprocess_edgetpu.tflite', 'tpu_object_labels': '/var/lib/zmeventnotification/models/coral_edgetpu/coco_indexed.names', 'tpu_object_framework': 'coral_edgetpu', 'tpu_object_processor': 't
pu', 'tpu_min_confidence': '0.6', 'yolo4_object_weights': '/var/lib/zmeventnotification/models/yolov4/yolov4.weights', 'yolo4_object_labels': '/var/lib/zmeventnotification/models/yolov4/coco.names', 'y
olo4_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_obj
ect_framework': 'opencv', 'yolo3_object_processor': 'gpu', 'tinyyolo_object_config': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'tinyyolo_object_weights': '/var/lib/zmeventnotifi
cation/models/tinyyolov4/yolov4-tiny.weights', 'tinyyolo_object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'tinyyolo_object_framework': 'opencv', 'tinyyolo_object_processor':
 'gpu'}]
12/29/20 11:34:26 zmesdetect_m1[153] DBG2 yolo.py:35 [Semaphore: max:1, name:pyzm_uid33_gpu_lock, timeout:100]
12/29/20 11:34:26 zmesdetect_m1[153] DBG2 zm_detect.py:370 [using g.config['object_detection_pattern']=.*]
12/29/20 11:34:26 zmesdetect_m1[153] DBG1 zm_detect.py:403 [Using model: object with /var/lib/zmeventnotification/images/886-alarm.jpg]
12/29/20 11:34:26 zmesdetect_m1[153] DBG2 yolo.py:45 [Waiting for gpu lock...]
12/29/20 11:34:26 zmesdetect_m1[153] DBG2 yolo.py:47 [Got gpu lock ..]
12/29/20 11:34:26 zmesdetect_m1[153] DBG1 yolo.py:74 [|--------- Loading Yolo model from disk ---------|]
12/29/20 11:34:26 zmesdetect_m1[153] DBG1 yolo.py:82 [Yolo initialization (loading model from disk) took: 0:00:00.271814]
12/29/20 11:34:26 zmesdetect_m1[153] DBG2 yolo.py:96 [Setting CUDA backend for OpenCV]
12/29/20 11:34:26 zmesdetect_m1[153] DBG3 yolo.py:97 [If you did not set your CUDA_ARCH_BIN correctly during OpenCV compilation, you will get errors during detection related to invalid device/make_poli
cy]
12/29/20 11:34:26 zmesdetect_m1[153] DBG1 yolo.py:135 [|---------- YOLO (input image: 800w*450h, model resize dimensions: 416w*416h) ----------|]
12/29/20 11:34:37 zmesdetect_m1[153] DBG2 yolo.py:61 [Released lock]
12/29/20 11:34:37 zmesdetect_m1[153] DBG2 yolo.py:153 [detect lock released]
12/29/20 11:34:37 zmesdetect_m1[153] DBG1 yolo.py:156 [YOLO detection took: 0:00:10.821964 milliseconds]
12/29/20 11:34:38 zmesdetect_m1[153] DBG2 yolo.py:190 [YOLO NMS filtering took: 0:00:00.000979]
12/29/20 11:34:38 zmesdetect_m1[153] DBG3 object.py:55 [core model detection over, got 9 objects. Now filtering]
12/29/20 11:34:38 zmesdetect_m1[153] DBG3 object.py:59 [Max object size found to be: 90%]
12/29/20 11:34:38 zmesdetect_m1[153] DBG2 object.py:67 [Converted 90% to 324000.0]
12/29/20 11:34:38 zmesdetect_m1[153] DBG2 object.py:88 [Ignoring chair [89, 344, 209, 448] as conf. level 0.2591783404350281 is lower than 0.3]
12/29/20 11:34:38 zmesdetect_m1[153] DBG2 object.py:90 [Returning filtered list of 8 objects.]
12/29/20 11:34:38 zmesdetect_m1[153] DBG2 image_manip.py:294 [intersection: polygon in process=[(388, 2), (458, 2), (458, 84), (388, 84)]]
12/29/20 11:34:38 zmesdetect_m1[153] DBG2 image_manip.py:308 [full_image intersects object:tvmonitor[[(388, 2), (458, 2), (458, 84), (388, 84)]]]
12/29/20 11:34:38 zmesdetect_m1[153] DBG2 image_manip.py:294 [intersection: polygon in process=[(527, 158), (725, 158), (725, 446), (527, 446)]]
12/29/20 11:34:38 zmesdetect_m1[153] DBG2 image_manip.py:308 [full_image intersects object:person[[(527, 158), (725, 158), (725, 446), (527, 446)]]]
12/29/20 11:34:38 zmesdetect_m1[153] DBG2 image_manip.py:294 [intersection: polygon in process=[(372, 194), (472, 194), (472, 348), (372, 348)]]
12/29/20 11:34:38 zmesdetect_m1[153] DBG2 image_manip.py:308 [full_image intersects object:chair[[(372, 194), (472, 194), (472, 348), (372, 348)]]]
12/29/20 11:34:38 zmesdetect_m1[153] DBG2 image_manip.py:294 [intersection: polygon in process=[(640, 50), (684, 50), (684, 138), (640, 138)]]
12/29/20 11:34:38 zmesdetect_m1[153] DBG2 image_manip.py:308 [full_image intersects object:pottedplant[[(640, 50), (684, 50), (684, 138), (640, 138)]]]
12/29/20 11:34:38 zmesdetect_m1[153] DBG2 image_manip.py:294 [intersection: polygon in process=[(510, 51), (592, 51), (592, 109), (510, 109)]]
12/29/20 11:34:38 zmesdetect_m1[153] DBG2 image_manip.py:308 [full_image intersects object:tvmonitor[[(510, 51), (592, 51), (592, 109), (510, 109)]]]
12/29/20 11:34:38 zmesdetect_m1[153] DBG2 image_manip.py:294 [intersection: polygon in process=[(570, 134), (688, 134), (688, 256), (570, 256)]]
12/29/20 11:34:38 zmesdetect_m1[153] DBG2 image_manip.py:308 [full_image intersects object:chair[[(570, 134), (688, 134), (688, 256), (570, 256)]]]
12/29/20 11:34:38 zmesdetect_m1[153] DBG2 image_manip.py:294 [intersection: polygon in process=[(73, 262), (497, 262), (497, 454), (73, 454)]]
12/29/20 11:34:38 zmesdetect_m1[153] DBG2 image_manip.py:308 [full_image intersects object:diningtable[[(73, 262), (497, 262), (497, 454), (73, 454)]]]
12/29/20 11:34:38 zmesdetect_m1[153] DBG2 image_manip.py:294 [intersection: polygon in process=[(212, 295), (250, 295), (250, 319), (212, 319)]]
12/29/20 11:34:38 zmesdetect_m1[153] DBG2 image_manip.py:308 [full_image intersects object:bowl[[(212, 295), (250, 295), (250, 319), (212, 319)]]]
12/29/20 11:34:38 zmesdetect_m1[153] DBG2 zm_detect.py:618 [ALPR not in use, no need for look aheads in processing]
12/29/20 11:34:38 zmesdetect_m1[153] INF zm_detect.py:635 [labels found: ['tvmonitor', 'person', 'chair', 'pottedplant', 'tvmonitor', 'chair', 'diningtable', 'bowl']]
12/29/20 11:34:38 zmesdetect_m1[153] DBG2 zm_detect.py:638 [match found in /var/lib/zmeventnotification/images/886-alarm.jpg, breaking file loop...]
12/29/20 11:34:38 zmesdetect_m1[153] DBG2 zm_detect.py:703 [Drawing boxes around objects]
12/29/20 11:34:38 zmesdetect_m1[153] DBG1 zm_detect.py:728 [Writing detected image to /var/cache/zoneminder/events/1/2020-12-29/886/objdetect.jpg]
12/29/20 11:34:38 zmesdetect_m1[153] DBG1 zm_detect.py:732 [Writing JSON output to /var/cache/zoneminder/events/1/2020-12-29/886/objects.json]
12/29/20 11:34:38 zmesdetect_m1[153] INF zm_detect.py:784 [Prediction string:[a] detected:tvmonitor:91% person:87% chair:80% pottedplant:65% diningtable:40% bowl:33% ]
12/29/20 11:34:38 zmesdetect_m1[153] DBG1 zm_detect.py:787 [Prediction string JSON:[{"type": "object", "label": "tvmonitor", "box": [388, 2, 458, 84], "confidence": "91.12%"}, {"type": "object", "label
": "person", "box": [527, 158, 725, 446], "confidence": "86.71%"}, {"type": "object", "label": "chair", "box": [372, 194, 472, 348], "confidence": "79.73%"}, {"type": "object", "label": "pottedplant", 
"box": [640, 50, 684, 138], "confidence": "64.56%"}, {"type": "object", "label": "tvmonitor", "box": [510, 51, 592, 109], "confidence": "64.55%"}, {"type": "object", "label": "chair", "box": [570, 134,
 688, 256], "confidence": "58.50%"}, {"type": "object", "label": "diningtable", "box": [73, 262, 497, 454], "confidence": "39.99%"}, {"type": "object", "label": "bowl", "box": [212, 295, 250, 319], "co
nfidence": "32.81%"}]]
12/29/20 11:36:00 zmesdetect_m1[248] INF zm_detect.py:208 [---------| pyzm version:0.3.8, hook version:6.0.7,  ES version:6.0.7 , OpenCV version:4.4.0|------------]
12/29/20 11:36:01 zmesdetect_m1[248] DBG1 utils.py:405 [secret filename: /etc/zm/secrets.ini]
12/29/20 11:36:01 zmesdetect_m1[248] DBG2 utils.py:378 [Secret token found in config: !ZM_PORTAL]
12/29/20 11:36:01 zmesdetect_m1[248] DBG2 utils.py:378 [Secret token found in config: !ZM_USER]
12/29/20 11:36:01 zmesdetect_m1[248] DBG2 utils.py:378 [Secret token found in config: !ZM_PASSWORD]
12/29/20 11:36:01 zmesdetect_m1[248] DBG2 utils.py:378 [Secret token found in config: !ZM_API_PORTAL]
12/29/20 11:36:01 zmesdetect_m1[248] DBG2 utils.py:378 [Secret token found in config: !ML_USER]
12/29/20 11:36:01 zmesdetect_m1[248] DBG2 utils.py:378 [Secret token found in config: !ML_PASSWORD]
12/29/20 11:36:01 zmesdetect_m1[248] DBG2 utils.py:378 [Secret token found in config: !PLATEREC_ALPR_KEY]
12/29/20 11:36:01 zmesdetect_m1[248] DBG1 utils.py:440 [allowing self-signed certs to work...]
12/29/20 11:36:01 zmesdetect_m1[248] DBG4 utils.py:450 [Now checking for monitor overrides]
12/29/20 11:36:01 zmesdetect_m1[248] DBG4 utils.py:513 [Finally, doing parameter substitution]
12/29/20 11:36:01 zmesdetect_m1[248] INF zm_detect.py:234 [Importing local classes for Object/Face]
12/29/20 11:36:01 zmesdetect_m1[248] DBG1 utils.py:280 [Trying to download http://localhost/zm/index.php?view=image&eid=887&fid=alarm&username=admin&password=*****]
12/29/20 11:36:01 zmesdetect_m1[248] DBG1 utils.py:299 [Trying to download http://localhost/zm/index.php?view=image&eid=887&fid=snapshot&username=admin&password=*****]
12/29/20 11:36:01 zmesdetect_m1[248] DBG1 zm_detect.py:295 [No polygon area specfied, so adding a full image polygon:[{'name': 'full_image', 'value': [(0, 0), (1280, 0), (1280, 720), (0, 720)], 'patter
n': None}]]
12/29/20 11:36:01 zmesdetect_m1[248] DBG1 zm_detect.py:298 [resizing to 800 before analysis...]
12/29/20 11:36:01 zmesdetect_m1[248] DBG2 utils.py:138 [resized polygons x=0.625/y=0.625: [{'name': 'full_image', 'value': [(0, 0), (800, 0), (800, 450), (0, 450)], 'pattern': None}]]
12/29/20 11:36:01 zmesdetect_m1[248] DBG1 zm_detect.py:319 [User ALPR if vehicle found: False]
12/29/20 11:36:01 zmesdetect_m1[248] DBG4 yolo.py:26 [Yolo init params: {'pyzm_overrides': {'log_level_debug': 5}, 'secrets': '/etc/zm/secrets.ini', 'version': '1.2', 'cpu_max_processes': 3, 'gpu_max_p
rocesses': 1, 'tpu_max_processes': 1, 'cpu_max_lock_wait': 100, 'gpu_max_lock_wait': 100, 'tpu_max_lock_wait': 100, 'base_data_path': '/var/lib/zmeventnotification', 'portal': 'http://localhost/zm', 'a
pi_portal': 'http://localhost/zm/api', 'user': 'admin', 'password': 'plexnchi11', 'basic_user': '', 'basic_password': '', 'image_path': '/var/lib/zmeventnotification/images', 'match_past_detections': '
no', 'past_det_max_diff_area': '5%', 'max_detection_size': '90%', 'frame_id': 'bestmatch', 'bestmatch_order': 'a,s', 'wait': '0', 'resize': '800', 'delete_after_analyze': 'yes', 'show_percent': 'yes', 
'allow_self_signed': 'yes', 'write_image_to_zm': 'yes', 'write_debug_image': 'no', 'detection_sequence': ['object'], 'detection_mode': 'all', 'import_zm_zones': 'no', 'only_triggered_zm_zones': 'no', '
poly_color': (255, 255, 255), 'poly_thickness': 2, 'create_animation': 'no', 'animation_types': "'mp4,gif'", 'animation_width': 640, 'animation_retry_sleep': 15, 'animation_max_tries': 4, 'fast_gif': '
no', 'ml_gateway': None, 'ml_fallback_local': 'no', 'ml_user': '"your_mlapi_user"', 'ml_password': '"your_mlapi_password"', 'use_sequence': 'yes', 'ml_sequence': '{\n\'general\': {\n\'model_sequence\':
 \'object\',\n\n},\n\'object\': {\n\'general\':{\n\'pattern\':\'.*\',\n\'same_model_sequence_strategy\': \'first\' # also \'most\', \'most_unique\'s\n},\n\'sequence\': [{\n\'object_config\':\'/var/lib/
zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg\',\n\'object_weights\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights\',\n\'object_labels\': \'/var/lib/zmeventnotification/m
odels/tinyyolov4/coco.names\',\n\'object_min_confidence\': 0.3,\n\'object_framework\':\'opencv\',\n\'object_processor\': \'gpu\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_proc
esses\': 3,\n\'cpu_max_lock_wait\': 100\n}]\n},\n\'face\': {\n\'general\':{\n\'pattern\': \'.*\',\n\'same_model_sequence_strategy\': \'first\'\n},\n\'sequence\': [{\n\'save_unknown_faces\':\'yes\',\n\'
save_unknown_faces_leeway_pixels\':100,\n\'face_detection_framework\': \'dlib\',\n\'known_images_path\': \'/var/lib/zmeventnotification/known_faces\',\n\'unknown_images_path\': \'/var/lib/zmeventnotifi
cation/unknown_faces\',\n\'face_model\': \'cnn\',\n\'face_train_model\': \'cnn\',\n\'face_recog_dist_threshold\': \'0.6\',\n\'face_num_jitters\': \'1\',\n\'face_upsample_times\':\'1\',\n\'gpu_max_proce
sses\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100,\n\'max_size\':800\n}]\n},\n\n\'alpr\': {\n\'general\':{\n\'same_model_sequence_strategy\': \'first\',\n\'
pre_existing_labels\':[\'car\', \'motorbike\', \'bus\', \'truck\', \'boat\'],\n\'pattern\': \'.*\'\n\n},\n\'sequence\': [{\n\'alpr_api_type\': \'cloud\',\n\'alpr_service\': \'plate_recognizer\',\n\'alp
r_key\': \'"your_plate_recognizer_api_key"\',\n\'platrec_stats\': \'yes\',\n\'platerec_min_dscore\': 0.1,\n\'platerec_min_score\': 0.2,\n\'max_size\':1600\n}]\n}\n}', 'stream_sequence': "{\n'frame_stra
tegy': 'most_models',\n'frame_set': 'snapshot,alarm',\n'resize':800\n\n}", 'object_detection_pattern': '.*', 'object_framework': 'opencv', 'object_processor': 'gpu', 'object_config': '/var/lib/zmeventn
otification/models/tinyyolov4/yolov4-tiny.cfg', 'object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights', 'object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/
coco.names', 'object_min_confidence': 0.3, 'face_detection_pattern': '.*', 'face_detection_framework': 'dlib', 'face_recognition_framework': 'dlib', 'face_processor': 'cpu', 'face_num_jitters': 1, 'fac
e_upsample_times': 1, '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_face
s', 'unknown_images_path': '/var/lib/zmeventnotification/unknown_faces', 'unknown_face_name': 'unknown face', 'save_unknown_faces': 'yes', 'save_unknown_faces_leeway_pixels': 100, 'alpr_service': 'plat
e_recognizer', 'alpr_detection_pattern': '.*', 'alpr_url': None, 'alpr_key': '"your_plate_recognizer_api_key"', 'alpr_use_after_detection_only': 'yes', 'alpr_api_type': 'cloud', 'platerec_stats': 'yes'
, 'platerec_regions': None, 'platerec_min_dscore': 0.1, 'platerec_min_score': 0.2, 'openalpr_recognize_vehicle': '0', 'openalpr_country': 'us', 'openalpr_state': None, 'openalpr_min_confidence': '0.3',
 'openalpr_cmdline_binary': 'alpr', 'openalpr_cmdline_params': '-j -d', 'openalpr_cmdline_min_confidence': 0.3, 'tpu_object_weights': '/var/lib/zmeventnotification/models/coral_edgetpu/ssd_mobilenet_v2
_coco_quant_postprocess_edgetpu.tflite', 'tpu_object_labels': '/var/lib/zmeventnotification/models/coral_edgetpu/coco_indexed.names', 'tpu_object_framework': 'coral_edgetpu', 'tpu_object_processor': 't
pu', 'tpu_min_confidence': '0.6', 'yolo4_object_weights': '/var/lib/zmeventnotification/models/yolov4/yolov4.weights', 'yolo4_object_labels': '/var/lib/zmeventnotification/models/yolov4/coco.names', 'y
olo4_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_obj
ect_framework': 'opencv', 'yolo3_object_processor': 'gpu', 'tinyyolo_object_config': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'tinyyolo_object_weights': '/var/lib/zmeventnotifi
cation/models/tinyyolov4/yolov4-tiny.weights', 'tinyyolo_object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'tinyyolo_object_framework': 'opencv', 'tinyyolo_object_processor':
 'gpu'}]
12/29/20 11:36:01 zmesdetect_m1[248] DBG2 yolo.py:35 [Semaphore: max:1, name:pyzm_uid33_gpu_lock, timeout:100]
12/29/20 11:36:01 zmesdetect_m1[248] DBG2 zm_detect.py:370 [using g.config['object_detection_pattern']=.*]
12/29/20 11:36:01 zmesdetect_m1[248] DBG1 zm_detect.py:403 [Using model: object with /var/lib/zmeventnotification/images/887-alarm.jpg]
12/29/20 11:36:01 zmesdetect_m1[248] DBG2 yolo.py:45 [Waiting for gpu lock...]
12/29/20 11:36:01 zmesdetect_m1[248] DBG2 yolo.py:47 [Got gpu lock ..]
12/29/20 11:36:01 zmesdetect_m1[248] DBG1 yolo.py:74 [|--------- Loading Yolo model from disk ---------|]
12/29/20 11:36:01 zmesdetect_m1[248] DBG1 yolo.py:82 [Yolo initialization (loading model from disk) took: 0:00:00.029805]
12/29/20 11:36:01 zmesdetect_m1[248] DBG2 yolo.py:96 [Setting CUDA backend for OpenCV]
12/29/20 11:36:01 zmesdetect_m1[248] DBG3 yolo.py:97 [If you did not set your CUDA_ARCH_BIN correctly during OpenCV compilation, you will get errors during detection related to invalid device/make_poli
cy]
12/29/20 11:36:01 zmesdetect_m1[248] DBG1 yolo.py:135 [|---------- YOLO (input image: 800w*450h, model resize dimensions: 416w*416h) ----------|]
12/29/20 11:36:05 zmesdetect_m1[248] FAT zm_detect.py:860 [Unrecoverable error:OpenCV(4.4.0) /opencv-build/build/opencv-4.4.0/modules/dnn/src/cuda4dnn/csl/cublas.hpp:78: error: (-217:Gpu API call) CUBL
AS_STATUS_NOT_INITIALIZED in function 'UniqueHandle'
 Traceback:Traceback (most recent call last):
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 857, in <module>
    main_handler()
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 432, in main_handler
    b, l, c = m.detect(original_image)
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/object.py", line 54, in detect
    b,l,c = self.model.detect(image)
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/yolo.py", line 149, in detect
    outs = self.net.forward(ln)
cv2.error: OpenCV(4.4.0) /opencv-build/build/opencv-4.4.0/modules/dnn/src/cuda4dnn/csl/cublas.hpp:78: error: (-217:Gpu API call) CUBLAS_STATUS_NOT_INITIALIZED in function 'UniqueHandle'

]
12/29/20 11:37:00 zmesdetect_m1[307] INF zm_detect.py:208 [---------| pyzm version:0.3.8, hook version:6.0.7,  ES version:6.0.7 , OpenCV version:4.4.0|------------]
12/29/20 11:37:01 zmesdetect_m1[307] DBG1 utils.py:405 [secret filename: /etc/zm/secrets.ini]
12/29/20 11:37:01 zmesdetect_m1[307] DBG2 utils.py:378 [Secret token found in config: !ZM_PORTAL]
12/29/20 11:37:01 zmesdetect_m1[307] DBG2 utils.py:378 [Secret token found in config: !ZM_USER]
12/29/20 11:37:01 zmesdetect_m1[307] DBG2 utils.py:378 [Secret token found in config: !ZM_PASSWORD]
12/29/20 11:37:01 zmesdetect_m1[307] DBG2 utils.py:378 [Secret token found in config: !ZM_API_PORTAL]
12/29/20 11:37:01 zmesdetect_m1[307] DBG2 utils.py:378 [Secret token found in config: !ML_USER]
12/29/20 11:37:01 zmesdetect_m1[307] DBG2 utils.py:378 [Secret token found in config: !ML_PASSWORD]
12/29/20 11:37:01 zmesdetect_m1[307] DBG2 utils.py:378 [Secret token found in config: !PLATEREC_ALPR_KEY]
12/29/20 11:37:01 zmesdetect_m1[307] DBG1 utils.py:440 [allowing self-signed certs to work...]
12/29/20 11:37:01 zmesdetect_m1[307] DBG4 utils.py:450 [Now checking for monitor overrides]
12/29/20 11:37:01 zmesdetect_m1[307] DBG4 utils.py:513 [Finally, doing parameter substitution]
12/29/20 11:37:01 zmesdetect_m1[307] INF zm_detect.py:234 [Importing local classes for Object/Face]
12/29/20 11:37:01 zmesdetect_m1[307] DBG1 utils.py:280 [Trying to download http://localhost/zm/index.php?view=image&eid=888&fid=alarm&username=admin&password=*****]
12/29/20 11:37:01 zmesdetect_m1[307] DBG1 utils.py:299 [Trying to download http://localhost/zm/index.php?view=image&eid=888&fid=snapshot&username=admin&password=*****]
12/29/20 11:37:01 zmesdetect_m1[307] DBG1 zm_detect.py:295 [No polygon area specfied, so adding a full image polygon:[{'name': 'full_image', 'value': [(0, 0), (1280, 0), (1280, 720), (0, 720)], 'patter
n': None}]]
12/29/20 11:37:01 zmesdetect_m1[307] DBG1 zm_detect.py:298 [resizing to 800 before analysis...]
12/29/20 11:37:01 zmesdetect_m1[307] DBG2 utils.py:138 [resized polygons x=0.625/y=0.625: [{'name': 'full_image', 'value': [(0, 0), (800, 0), (800, 450), (0, 450)], 'pattern': None}]]
12/29/20 11:37:01 zmesdetect_m1[307] DBG1 zm_detect.py:319 [User ALPR if vehicle found: False]
12/29/20 11:37:01 zmesdetect_m1[307] DBG4 yolo.py:26 [Yolo init params: {'pyzm_overrides': {'log_level_debug': 5}, 'secrets': '/etc/zm/secrets.ini', 'version': '1.2', 'cpu_max_processes': 3, 'gpu_max_p
rocesses': 1, 'tpu_max_processes': 1, 'cpu_max_lock_wait': 100, 'gpu_max_lock_wait': 100, 'tpu_max_lock_wait': 100, 'base_data_path': '/var/lib/zmeventnotification', 'portal': 'http://localhost/zm', 'a
pi_portal': 'http://localhost/zm/api', 'user': 'admin', 'password': 'plexnchi11', 'basic_user': '', 'basic_password': '', 'image_path': '/var/lib/zmeventnotification/images', 'match_past_detections': '
no', 'past_det_max_diff_area': '5%', 'max_detection_size': '90%', 'frame_id': 'bestmatch', 'bestmatch_order': 'a,s', 'wait': '0', 'resize': '800', 'delete_after_analyze': 'yes', 'show_percent': 'yes', 
'allow_self_signed': 'yes', 'write_image_to_zm': 'yes', 'write_debug_image': 'no', 'detection_sequence': ['object'], 'detection_mode': 'all', 'import_zm_zones': 'no', 'only_triggered_zm_zones': 'no', '
poly_color': (255, 255, 255), 'poly_thickness': 2, 'create_animation': 'no', 'animation_types': "'mp4,gif'", 'animation_width': 640, 'animation_retry_sleep': 15, 'animation_max_tries': 4, 'fast_gif': '
no', 'ml_gateway': None, 'ml_fallback_local': 'no', 'ml_user': '"your_mlapi_user"', 'ml_password': '"your_mlapi_password"', 'use_sequence': 'yes', 'ml_sequence': '{\n\'general\': {\n\'model_sequence\':
 \'object\',\n\n},\n\'object\': {\n\'general\':{\n\'pattern\':\'.*\',\n\'same_model_sequence_strategy\': \'first\' # also \'most\', \'most_unique\'s\n},\n\'sequence\': [{\n\'object_config\':\'/var/lib/
zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg\',\n\'object_weights\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights\',\n\'object_labels\': \'/var/lib/zmeventnotification/m
odels/tinyyolov4/coco.names\',\n\'object_min_confidence\': 0.3,\n\'object_framework\':\'opencv\',\n\'object_processor\': \'gpu\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_proc
esses\': 3,\n\'cpu_max_lock_wait\': 100\n}]\n},\n\'face\': {\n\'general\':{\n\'pattern\': \'.*\',\n\'same_model_sequence_strategy\': \'first\'\n},\n\'sequence\': [{\n\'save_unknown_faces\':\'yes\',\n\'
save_unknown_faces_leeway_pixels\':100,\n\'face_detection_framework\': \'dlib\',\n\'known_images_path\': \'/var/lib/zmeventnotification/known_faces\',\n\'unknown_images_path\': \'/var/lib/zmeventnotifi
cation/unknown_faces\',\n\'face_model\': \'cnn\',\n\'face_train_model\': \'cnn\',\n\'face_recog_dist_threshold\': \'0.6\',\n\'face_num_jitters\': \'1\',\n\'face_upsample_times\':\'1\',\n\'gpu_max_proce
sses\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100,\n\'max_size\':800\n}]\n},\n\n\'alpr\': {\n\'general\':{\n\'same_model_sequence_strategy\': \'first\',\n\'
pre_existing_labels\':[\'car\', \'motorbike\', \'bus\', \'truck\', \'boat\'],\n\'pattern\': \'.*\'\n\n},\n\'sequence\': [{\n\'alpr_api_type\': \'cloud\',\n\'alpr_service\': \'plate_recognizer\',\n\'alp
r_key\': \'"your_plate_recognizer_api_key"\',\n\'platrec_stats\': \'yes\',\n\'platerec_min_dscore\': 0.1,\n\'platerec_min_score\': 0.2,\n\'max_size\':1600\n}]\n}\n}', 'stream_sequence': "{\n'frame_stra
tegy': 'most_models',\n'frame_set': 'snapshot,alarm',\n'resize':800\n\n}", 'object_detection_pattern': '.*', 'object_framework': 'opencv', 'object_processor': 'gpu', 'object_config': '/var/lib/zmeventn
otification/models/tinyyolov4/yolov4-tiny.cfg', 'object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights', 'object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/
coco.names', 'object_min_confidence': 0.3, 'face_detection_pattern': '.*', 'face_detection_framework': 'dlib', 'face_recognition_framework': 'dlib', 'face_processor': 'cpu', 'face_num_jitters': 1, 'fac
e_upsample_times': 1, '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_face
s', 'unknown_images_path': '/var/lib/zmeventnotification/unknown_faces', 'unknown_face_name': 'unknown face', 'save_unknown_faces': 'yes', 'save_unknown_faces_leeway_pixels': 100, 'alpr_service': 'plat
e_recognizer', 'alpr_detection_pattern': '.*', 'alpr_url': None, 'alpr_key': '"your_plate_recognizer_api_key"', 'alpr_use_after_detection_only': 'yes', 'alpr_api_type': 'cloud', 'platerec_stats': 'yes'
, 'platerec_regions': None, 'platerec_min_dscore': 0.1, 'platerec_min_score': 0.2, 'openalpr_recognize_vehicle': '0', 'openalpr_country': 'us', 'openalpr_state': None, 'openalpr_min_confidence': '0.3',
 'openalpr_cmdline_binary': 'alpr', 'openalpr_cmdline_params': '-j -d', 'openalpr_cmdline_min_confidence': 0.3, 'tpu_object_weights': '/var/lib/zmeventnotification/models/coral_edgetpu/ssd_mobilenet_v2
_coco_quant_postprocess_edgetpu.tflite', 'tpu_object_labels': '/var/lib/zmeventnotification/models/coral_edgetpu/coco_indexed.names', 'tpu_object_framework': 'coral_edgetpu', 'tpu_object_processor': 't
pu', 'tpu_min_confidence': '0.6', 'yolo4_object_weights': '/var/lib/zmeventnotification/models/yolov4/yolov4.weights', 'yolo4_object_labels': '/var/lib/zmeventnotification/models/yolov4/coco.names', 'y
olo4_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_obj
ect_framework': 'opencv', 'yolo3_object_processor': 'gpu', 'tinyyolo_object_config': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'tinyyolo_object_weights': '/var/lib/zmeventnotifi
cation/models/tinyyolov4/yolov4-tiny.weights', 'tinyyolo_object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'tinyyolo_object_framework': 'opencv', 'tinyyolo_object_processor':
 'gpu'}]
12/29/20 11:37:01 zmesdetect_m1[307] DBG2 yolo.py:35 [Semaphore: max:1, name:pyzm_uid33_gpu_lock, timeout:100]
12/29/20 11:37:01 zmesdetect_m1[307] DBG2 zm_detect.py:370 [using g.config['object_detection_pattern']=.*]
12/29/20 11:37:01 zmesdetect_m1[307] DBG1 zm_detect.py:403 [Using model: object with /var/lib/zmeventnotification/images/888-alarm.jpg]
12/29/20 11:37:01 zmesdetect_m1[307] DBG2 yolo.py:45 [Waiting for gpu lock...]
12/29/20 11:37:01 zmesdetect_m1[307] DBG2 yolo.py:47 [Got gpu lock ..]
12/29/20 11:37:01 zmesdetect_m1[307] DBG1 yolo.py:74 [|--------- Loading Yolo model from disk ---------|]
12/29/20 11:37:01 zmesdetect_m1[307] DBG1 yolo.py:82 [Yolo initialization (loading model from disk) took: 0:00:00.035648]
12/29/20 11:37:01 zmesdetect_m1[307] DBG2 yolo.py:96 [Setting CUDA backend for OpenCV]
12/29/20 11:37:01 zmesdetect_m1[307] DBG3 yolo.py:97 [If you did not set your CUDA_ARCH_BIN correctly during OpenCV compilation, you will get errors during detection related to invalid device/make_poli
cy]
12/29/20 11:37:01 zmesdetect_m1[307] DBG1 yolo.py:135 [|---------- YOLO (input image: 800w*450h, model resize dimensions: 416w*416h) ----------|]
12/29/20 11:37:05 zmesdetect_m1[307] DBG2 yolo.py:61 [Released lock]
12/29/20 11:37:05 zmesdetect_m1[307] DBG2 yolo.py:153 [detect lock released]
12/29/20 11:37:05 zmesdetect_m1[307] DBG1 yolo.py:156 [YOLO detection took: 0:00:03.795119 milliseconds]
12/29/20 11:37:05 zmesdetect_m1[307] DBG2 yolo.py:190 [YOLO NMS filtering took: 0:00:00.000881]
12/29/20 11:37:05 zmesdetect_m1[307] DBG3 object.py:55 [core model detection over, got 9 objects. Now filtering]
12/29/20 11:37:05 zmesdetect_m1[307] DBG3 object.py:59 [Max object size found to be: 90%]
12/29/20 11:37:05 zmesdetect_m1[307] DBG2 object.py:67 [Converted 90% to 324000.0]
12/29/20 11:37:05 zmesdetect_m1[307] DBG2 object.py:90 [Returning filtered list of 9 objects.]
12/29/20 11:37:05 zmesdetect_m1[307] DBG2 image_manip.py:294 [intersection: polygon in process=[(388, 1), (458, 1), (458, 87), (388, 87)]]
12/29/20 11:37:05 zmesdetect_m1[307] DBG2 image_manip.py:308 [full_image intersects object:tvmonitor[[(388, 1), (458, 1), (458, 87), (388, 87)]]]
12/29/20 11:37:05 zmesdetect_m1[307] DBG2 image_manip.py:294 [intersection: polygon in process=[(373, 191), (469, 191), (469, 351), (373, 351)]]
12/29/20 11:37:05 zmesdetect_m1[307] DBG2 image_manip.py:308 [full_image intersects object:chair[[(373, 191), (469, 191), (469, 351), (373, 351)]]]
12/29/20 11:37:05 zmesdetect_m1[307] DBG2 image_manip.py:294 [intersection: polygon in process=[(520, 248), (732, 248), (732, 452), (520, 452)]]
12/29/20 11:37:05 zmesdetect_m1[307] DBG2 image_manip.py:308 [full_image intersects object:person[[(520, 248), (732, 248), (732, 452), (520, 452)]]]
12/29/20 11:37:05 zmesdetect_m1[307] DBG2 image_manip.py:294 [intersection: polygon in process=[(509, 52), (591, 52), (591, 108), (509, 108)]]
12/29/20 11:37:05 zmesdetect_m1[307] DBG2 image_manip.py:308 [full_image intersects object:tvmonitor[[(509, 52), (591, 52), (591, 108), (509, 108)]]]
12/29/20 11:37:05 zmesdetect_m1[307] DBG2 image_manip.py:294 [intersection: polygon in process=[(576, 136), (672, 136), (672, 266), (576, 266)]]
12/29/20 11:37:05 zmesdetect_m1[307] DBG2 image_manip.py:308 [full_image intersects object:chair[[(576, 136), (672, 136), (672, 266), (576, 266)]]]
12/29/20 11:37:05 zmesdetect_m1[307] DBG2 image_manip.py:294 [intersection: polygon in process=[(642, 48), (682, 48), (682, 140), (642, 140)]]
12/29/20 11:37:05 zmesdetect_m1[307] DBG2 image_manip.py:308 [full_image intersects object:pottedplant[[(642, 48), (682, 48), (682, 140), (642, 140)]]]
12/29/20 11:37:05 zmesdetect_m1[307] DBG2 image_manip.py:294 [intersection: polygon in process=[(92, 342), (216, 342), (216, 448), (92, 448)]]
12/29/20 11:37:05 zmesdetect_m1[307] DBG2 image_manip.py:308 [full_image intersects object:chair[[(92, 342), (216, 342), (216, 448), (92, 448)]]]
12/29/20 11:37:05 zmesdetect_m1[307] DBG2 image_manip.py:294 [intersection: polygon in process=[(75, 266), (495, 266), (495, 452), (75, 452)]]
12/29/20 11:37:05 zmesdetect_m1[307] DBG2 image_manip.py:308 [full_image intersects object:diningtable[[(75, 266), (495, 266), (495, 452), (75, 452)]]]
12/29/20 11:37:05 zmesdetect_m1[307] DBG2 image_manip.py:294 [intersection: polygon in process=[(210, 296), (250, 296), (250, 318), (210, 318)]]
12/29/20 11:37:05 zmesdetect_m1[307] DBG2 image_manip.py:308 [full_image intersects object:bowl[[(210, 296), (250, 296), (250, 318), (210, 318)]]]
12/29/20 11:37:05 zmesdetect_m1[307] DBG2 zm_detect.py:618 [ALPR not in use, no need for look aheads in processing]
12/29/20 11:37:05 zmesdetect_m1[307] INF zm_detect.py:635 [labels found: ['tvmonitor', 'chair', 'person', 'tvmonitor', 'chair', 'pottedplant', 'chair', 'diningtable', 'bowl']]
12/29/20 11:37:05 zmesdetect_m1[307] DBG2 zm_detect.py:638 [match found in /var/lib/zmeventnotification/images/888-alarm.jpg, breaking file loop...]
12/29/20 11:37:05 zmesdetect_m1[307] DBG2 zm_detect.py:703 [Drawing boxes around objects]
12/29/20 11:37:05 zmesdetect_m1[307] DBG1 zm_detect.py:728 [Writing detected image to /var/cache/zoneminder/events/1/2020-12-29/888/objdetect.jpg]
12/29/20 11:37:05 zmesdetect_m1[307] DBG1 zm_detect.py:732 [Writing JSON output to /var/cache/zoneminder/events/1/2020-12-29/888/objects.json]
12/29/20 11:37:05 zmesdetect_m1[307] INF zm_detect.py:784 [Prediction string:[a] detected:tvmonitor:90% chair:88% person:72% pottedplant:53% diningtable:43% bowl:37% ]
12/29/20 11:37:05 zmesdetect_m1[307] DBG1 zm_detect.py:787 [Prediction string JSON:[{"type": "object", "label": "tvmonitor", "box": [388, 1, 458, 87], "confidence": "89.50%"}, {"type": "object", "label
": "chair", "box": [373, 191, 469, 351], "confidence": "88.35%"}, {"type": "object", "label": "person", "box": [520, 248, 732, 452], "confidence": "72.38%"}, {"type": "object", "label": "tvmonitor", "b
ox": [509, 52, 591, 108], "confidence": "66.28%"}, {"type": "object", "label": "chair", "box": [576, 136, 672, 266], "confidence": "64.83%"}, {"type": "object", "label": "pottedplant", "box": [642, 48,
 682, 140], "confidence": "52.99%"}, {"type": "object", "label": "chair", "box": [92, 342, 216, 448], "confidence": "49.84%"}, {"type": "object", "label": "diningtable", "box": [75, 266, 495, 452], "co
nfidence": "43.46%"}, {"type": "object", "label": "bowl", "box": [210, 296, 250, 318], "confidence": "37.20%"}]]
12/29/20 11:37:26 zmesdetect_m1[348] INF zm_detect.py:208 [---------| pyzm version:0.3.8, hook version:6.0.7,  ES version:6.0.7 , OpenCV version:4.4.0|------------]
12/29/20 11:37:26 zmesdetect_m1[348] DBG1 utils.py:405 [secret filename: /etc/zm/secrets.ini]
12/29/20 11:37:26 zmesdetect_m1[348] DBG2 utils.py:378 [Secret token found in config: !ZM_PORTAL]
12/29/20 11:37:26 zmesdetect_m1[348] DBG2 utils.py:378 [Secret token found in config: !ZM_USER]
12/29/20 11:37:26 zmesdetect_m1[348] DBG2 utils.py:378 [Secret token found in config: !ZM_PASSWORD]
12/29/20 11:37:26 zmesdetect_m1[348] DBG2 utils.py:378 [Secret token found in config: !ZM_API_PORTAL]
12/29/20 11:37:26 zmesdetect_m1[348] DBG2 utils.py:378 [Secret token found in config: !ML_USER]
12/29/20 11:37:26 zmesdetect_m1[348] DBG2 utils.py:378 [Secret token found in config: !ML_PASSWORD]
12/29/20 11:37:26 zmesdetect_m1[348] DBG2 utils.py:378 [Secret token found in config: !PLATEREC_ALPR_KEY]
12/29/20 11:37:26 zmesdetect_m1[348] DBG1 utils.py:440 [allowing self-signed certs to work...]
12/29/20 11:37:26 zmesdetect_m1[348] DBG4 utils.py:450 [Now checking for monitor overrides]
12/29/20 11:37:26 zmesdetect_m1[348] DBG4 utils.py:513 [Finally, doing parameter substitution]
12/29/20 11:37:26 zmesdetect_m1[348] INF zm_detect.py:234 [Importing local classes for Object/Face]
12/29/20 11:37:26 zmesdetect_m1[348] DBG1 utils.py:280 [Trying to download http://localhost/zm/index.php?view=image&eid=889&fid=alarm&username=admin&password=*****]
12/29/20 11:37:26 zmesdetect_m1[348] DBG1 utils.py:299 [Trying to download http://localhost/zm/index.php?view=image&eid=889&fid=snapshot&username=admin&password=*****]
12/29/20 11:37:26 zmesdetect_m1[348] DBG1 zm_detect.py:295 [No polygon area specfied, so adding a full image polygon:[{'name': 'full_image', 'value': [(0, 0), (1280, 0), (1280, 720), (0, 720)], 'patter
n': None}]]
12/29/20 11:37:26 zmesdetect_m1[348] DBG1 zm_detect.py:298 [resizing to 800 before analysis...]
12/29/20 11:37:26 zmesdetect_m1[348] DBG2 utils.py:138 [resized polygons x=0.625/y=0.625: [{'name': 'full_image', 'value': [(0, 0), (800, 0), (800, 450), (0, 450)], 'pattern': None}]]
12/29/20 11:37:26 zmesdetect_m1[348] DBG1 zm_detect.py:319 [User ALPR if vehicle found: False]
12/29/20 11:37:26 zmesdetect_m1[348] DBG4 yolo.py:26 [Yolo init params: {'pyzm_overrides': {'log_level_debug': 5}, 'secrets': '/etc/zm/secrets.ini', 'version': '1.2', 'cpu_max_processes': 3, 'gpu_max_p
rocesses': 1, 'tpu_max_processes': 1, 'cpu_max_lock_wait': 100, 'gpu_max_lock_wait': 100, 'tpu_max_lock_wait': 100, 'base_data_path': '/var/lib/zmeventnotification', 'portal': 'http://localhost/zm', 'a
pi_portal': 'http://localhost/zm/api', 'user': 'admin', 'password': 'plexnchi11', 'basic_user': '', 'basic_password': '', 'image_path': '/var/lib/zmeventnotification/images', 'match_past_detections': '
no', 'past_det_max_diff_area': '5%', 'max_detection_size': '90%', 'frame_id': 'bestmatch', 'bestmatch_order': 'a,s', 'wait': '0', 'resize': '800', 'delete_after_analyze': 'yes', 'show_percent': 'yes', 
'allow_self_signed': 'yes', 'write_image_to_zm': 'yes', 'write_debug_image': 'no', 'detection_sequence': ['object'], 'detection_mode': 'all', 'import_zm_zones': 'no', 'only_triggered_zm_zones': 'no', '
poly_color': (255, 255, 255), 'poly_thickness': 2, 'create_animation': 'no', 'animation_types': "'mp4,gif'", 'animation_width': 640, 'animation_retry_sleep': 15, 'animation_max_tries': 4, 'fast_gif': '
no', 'ml_gateway': None, 'ml_fallback_local': 'no', 'ml_user': '"your_mlapi_user"', 'ml_password': '"your_mlapi_password"', 'use_sequence': 'yes', 'ml_sequence': '{\n\'general\': {\n\'model_sequence\':
 \'object\',\n\n},\n\'object\': {\n\'general\':{\n\'pattern\':\'.*\',\n\'same_model_sequence_strategy\': \'first\' # also \'most\', \'most_unique\'s\n},\n\'sequence\': [{\n\'object_config\':\'/var/lib/
zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg\',\n\'object_weights\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights\',\n\'object_labels\': \'/var/lib/zmeventnotification/m
odels/tinyyolov4/coco.names\',\n\'object_min_confidence\': 0.3,\n\'object_framework\':\'opencv\',\n\'object_processor\': \'gpu\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_proc
esses\': 3,\n\'cpu_max_lock_wait\': 100\n}]\n},\n\'face\': {\n\'general\':{\n\'pattern\': \'.*\',\n\'same_model_sequence_strategy\': \'first\'\n},\n\'sequence\': [{\n\'save_unknown_faces\':\'yes\',\n\'
save_unknown_faces_leeway_pixels\':100,\n\'face_detection_framework\': \'dlib\',\n\'known_images_path\': \'/var/lib/zmeventnotification/known_faces\',\n\'unknown_images_path\': \'/var/lib/zmeventnotifi
cation/unknown_faces\',\n\'face_model\': \'cnn\',\n\'face_train_model\': \'cnn\',\n\'face_recog_dist_threshold\': \'0.6\',\n\'face_num_jitters\': \'1\',\n\'face_upsample_times\':\'1\',\n\'gpu_max_proce
sses\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100,\n\'max_size\':800\n}]\n},\n\n\'alpr\': {\n\'general\':{\n\'same_model_sequence_strategy\': \'first\',\n\'
pre_existing_labels\':[\'car\', \'motorbike\', \'bus\', \'truck\', \'boat\'],\n\'pattern\': \'.*\'\n\n},\n\'sequence\': [{\n\'alpr_api_type\': \'cloud\',\n\'alpr_service\': \'plate_recognizer\',\n\'alp
r_key\': \'"your_plate_recognizer_api_key"\',\n\'platrec_stats\': \'yes\',\n\'platerec_min_dscore\': 0.1,\n\'platerec_min_score\': 0.2,\n\'max_size\':1600\n}]\n}\n}', 'stream_sequence': "{\n'frame_stra
tegy': 'most_models',\n'frame_set': 'snapshot,alarm',\n'resize':800\n\n}", 'object_detection_pattern': '.*', 'object_framework': 'opencv', 'object_processor': 'gpu', 'object_config': '/var/lib/zmeventn
otification/models/tinyyolov4/yolov4-tiny.cfg', 'object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights', 'object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/
coco.names', 'object_min_confidence': 0.3, 'face_detection_pattern': '.*', 'face_detection_framework': 'dlib', 'face_recognition_framework': 'dlib', 'face_processor': 'cpu', 'face_num_jitters': 1, 'fac
e_upsample_times': 1, '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_face
s', 'unknown_images_path': '/var/lib/zmeventnotification/unknown_faces', 'unknown_face_name': 'unknown face', 'save_unknown_faces': 'yes', 'save_unknown_faces_leeway_pixels': 100, 'alpr_service': 'plat
e_recognizer', 'alpr_detection_pattern': '.*', 'alpr_url': None, 'alpr_key': '"your_plate_recognizer_api_key"', 'alpr_use_after_detection_only': 'yes', 'alpr_api_type': 'cloud', 'platerec_stats': 'yes'
, 'platerec_regions': None, 'platerec_min_dscore': 0.1, 'platerec_min_score': 0.2, 'openalpr_recognize_vehicle': '0', 'openalpr_country': 'us', 'openalpr_state': None, 'openalpr_min_confidence': '0.3',
 'openalpr_cmdline_binary': 'alpr', 'openalpr_cmdline_params': '-j -d', 'openalpr_cmdline_min_confidence': 0.3, 'tpu_object_weights': '/var/lib/zmeventnotification/models/coral_edgetpu/ssd_mobilenet_v2
_coco_quant_postprocess_edgetpu.tflite', 'tpu_object_labels': '/var/lib/zmeventnotification/models/coral_edgetpu/coco_indexed.names', 'tpu_object_framework': 'coral_edgetpu', 'tpu_object_processor': 't
pu', 'tpu_min_confidence': '0.6', 'yolo4_object_weights': '/var/lib/zmeventnotification/models/yolov4/yolov4.weights', 'yolo4_object_labels': '/var/lib/zmeventnotification/models/yolov4/coco.names', 'y
olo4_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_obj
ect_framework': 'opencv', 'yolo3_object_processor': 'gpu', 'tinyyolo_object_config': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'tinyyolo_object_weights': '/var/lib/zmeventnotifi
cation/models/tinyyolov4/yolov4-tiny.weights', 'tinyyolo_object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'tinyyolo_object_framework': 'opencv', 'tinyyolo_object_processor':
 'gpu'}]
12/29/20 11:37:26 zmesdetect_m1[348] DBG2 yolo.py:35 [Semaphore: max:1, name:pyzm_uid33_gpu_lock, timeout:100]
12/29/20 11:37:26 zmesdetect_m1[348] DBG2 zm_detect.py:370 [using g.config['object_detection_pattern']=.*]
12/29/20 11:37:26 zmesdetect_m1[348] DBG1 zm_detect.py:403 [Using model: object with /var/lib/zmeventnotification/images/889-alarm.jpg]
12/29/20 11:37:26 zmesdetect_m1[348] DBG2 yolo.py:45 [Waiting for gpu lock...]
12/29/20 11:37:26 zmesdetect_m1[348] DBG2 yolo.py:47 [Got gpu lock ..]
12/29/20 11:37:26 zmesdetect_m1[348] DBG1 yolo.py:74 [|--------- Loading Yolo model from disk ---------|]
12/29/20 11:37:26 zmesdetect_m1[348] DBG1 yolo.py:82 [Yolo initialization (loading model from disk) took: 0:00:00.033018]
12/29/20 11:37:26 zmesdetect_m1[348] DBG2 yolo.py:96 [Setting CUDA backend for OpenCV]
12/29/20 11:37:26 zmesdetect_m1[348] DBG3 yolo.py:97 [If you did not set your CUDA_ARCH_BIN correctly during OpenCV compilation, you will get errors during detection related to invalid device/make_poli
cy]
12/29/20 11:37:26 zmesdetect_m1[348] DBG1 yolo.py:135 [|---------- YOLO (input image: 800w*450h, model resize dimensions: 416w*416h) ----------|]
12/29/20 11:37:30 zmesdetect_m1[348] DBG2 yolo.py:61 [Released lock]
12/29/20 11:37:30 zmesdetect_m1[348] DBG2 yolo.py:153 [detect lock released]
12/29/20 11:37:30 zmesdetect_m1[348] DBG1 yolo.py:156 [YOLO detection took: 0:00:03.470702 milliseconds]
12/29/20 11:37:30 zmesdetect_m1[348] DBG2 yolo.py:190 [YOLO NMS filtering took: 0:00:00.001017]
12/29/20 11:37:30 zmesdetect_m1[348] DBG3 object.py:55 [core model detection over, got 9 objects. Now filtering]
12/29/20 11:37:30 zmesdetect_m1[348] DBG3 object.py:59 [Max object size found to be: 90%]
12/29/20 11:37:30 zmesdetect_m1[348] DBG2 object.py:67 [Converted 90% to 324000.0]
12/29/20 11:37:30 zmesdetect_m1[348] DBG2 object.py:88 [Ignoring book [612, 404, 698, 450] as conf. level 0.21228188276290894 is lower than 0.3]
12/29/20 11:37:30 zmesdetect_m1[348] DBG2 object.py:90 [Returning filtered list of 8 objects.]
12/29/20 11:37:30 zmesdetect_m1[348] DBG2 image_manip.py:294 [intersection: polygon in process=[(374, 191), (468, 191), (468, 353), (374, 353)]]
12/29/20 11:37:30 zmesdetect_m1[348] DBG2 image_manip.py:308 [full_image intersects object:chair[[(374, 191), (468, 191), (468, 353), (374, 353)]]]
12/29/20 11:37:30 zmesdetect_m1[348] DBG2 image_manip.py:294 [intersection: polygon in process=[(389, 2), (459, 2), (459, 84), (389, 84)]]
12/29/20 11:37:30 zmesdetect_m1[348] DBG2 image_manip.py:308 [full_image intersects object:tvmonitor[[(389, 2), (459, 2), (459, 84), (389, 84)]]]
12/29/20 11:37:30 zmesdetect_m1[348] DBG2 image_manip.py:294 [intersection: polygon in process=[(524, 223), (692, 223), (692, 457), (524, 457)]]
12/29/20 11:37:30 zmesdetect_m1[348] DBG2 image_manip.py:308 [full_image intersects object:person[[(524, 223), (692, 223), (692, 457), (524, 457)]]]
12/29/20 11:37:30 zmesdetect_m1[348] DBG2 image_manip.py:294 [intersection: polygon in process=[(508, 52), (592, 52), (592, 108), (508, 108)]]
12/29/20 11:37:30 zmesdetect_m1[348] DBG2 image_manip.py:308 [full_image intersects object:tvmonitor[[(508, 52), (592, 52), (592, 108), (508, 108)]]]
12/29/20 11:37:30 zmesdetect_m1[348] DBG2 image_manip.py:294 [intersection: polygon in process=[(88, 344), (212, 344), (212, 448), (88, 448)]]
12/29/20 11:37:30 zmesdetect_m1[348] DBG2 image_manip.py:308 [full_image intersects object:chair[[(88, 344), (212, 344), (212, 448), (88, 448)]]]
12/29/20 11:37:30 zmesdetect_m1[348] DBG2 image_manip.py:294 [intersection: polygon in process=[(639, 47), (683, 47), (683, 139), (639, 139)]]
12/29/20 11:37:30 zmesdetect_m1[348] DBG2 image_manip.py:308 [full_image intersects object:pottedplant[[(639, 47), (683, 47), (683, 139), (639, 139)]]]
12/29/20 11:37:30 zmesdetect_m1[348] DBG2 image_manip.py:294 [intersection: polygon in process=[(72, 268), (500, 268), (500, 452), (72, 452)]]
12/29/20 11:37:30 zmesdetect_m1[348] DBG2 image_manip.py:308 [full_image intersects object:diningtable[[(72, 268), (500, 268), (500, 452), (72, 452)]]]
12/29/20 11:37:30 zmesdetect_m1[348] DBG2 image_manip.py:294 [intersection: polygon in process=[(212, 296), (250, 296), (250, 318), (212, 318)]]
12/29/20 11:37:30 zmesdetect_m1[348] DBG2 image_manip.py:308 [full_image intersects object:bowl[[(212, 296), (250, 296), (250, 318), (212, 318)]]]
12/29/20 11:37:30 zmesdetect_m1[348] DBG2 zm_detect.py:618 [ALPR not in use, no need for look aheads in processing]
12/29/20 11:37:30 zmesdetect_m1[348] INF zm_detect.py:635 [labels found: ['chair', 'tvmonitor', 'person', 'tvmonitor', 'chair', 'pottedplant', 'diningtable', 'bowl']]
12/29/20 11:37:30 zmesdetect_m1[348] DBG2 zm_detect.py:638 [match found in /var/lib/zmeventnotification/images/889-alarm.jpg, breaking file loop...]
12/29/20 11:37:30 zmesdetect_m1[348] DBG2 zm_detect.py:703 [Drawing boxes around objects]
12/29/20 11:37:30 zmesdetect_m1[348] DBG1 zm_detect.py:728 [Writing detected image to /var/cache/zoneminder/events/1/2020-12-29/889/objdetect.jpg]
12/29/20 11:37:30 zmesdetect_m1[348] DBG1 zm_detect.py:732 [Writing JSON output to /var/cache/zoneminder/events/1/2020-12-29/889/objects.json]
12/29/20 11:37:30 zmesdetect_m1[348] INF zm_detect.py:784 [Prediction string:[a] detected:chair:90% tvmonitor:82% person:80% pottedplant:57% diningtable:47% bowl:33% ]
12/29/20 11:37:30 zmesdetect_m1[348] DBG1 zm_detect.py:787 [Prediction string JSON:[{"type": "object", "label": "chair", "box": [374, 191, 468, 353], "confidence": "90.26%"}, {"type": "object", "label"
: "tvmonitor", "box": [389, 2, 459, 84], "confidence": "81.72%"}, {"type": "object", "label": "person", "box": [524, 223, 692, 457], "confidence": "79.69%"}, {"type": "object", "label": "tvmonitor", "b
ox": [508, 52, 592, 108], "confidence": "71.82%"}, {"type": "object", "label": "chair", "box": [88, 344, 212, 448], "confidence": "58.76%"}, {"type": "object", "label": "pottedplant", "box": [639, 47, 
683, 139], "confidence": "56.52%"}, {"type": "object", "label": "diningtable", "box": [72, 268, 500, 452], "confidence": "46.97%"}, {"type": "object", "label": "bowl", "box": [212, 296, 250, 318], "con
fidence": "32.56%"}]]
12/29/20 11:37:45 zmesdetect_m1[399] INF zm_detect.py:208 [---------| pyzm version:0.3.8, hook version:6.0.7,  ES version:6.0.7 , OpenCV version:4.4.0|------------]
12/29/20 11:37:46 zmesdetect_m1[399] DBG1 utils.py:405 [secret filename: /etc/zm/secrets.ini]
12/29/20 11:37:46 zmesdetect_m1[399] DBG2 utils.py:378 [Secret token found in config: !ZM_PORTAL]
12/29/20 11:37:46 zmesdetect_m1[399] DBG2 utils.py:378 [Secret token found in config: !ZM_USER]
12/29/20 11:37:46 zmesdetect_m1[399] DBG2 utils.py:378 [Secret token found in config: !ZM_PASSWORD]
12/29/20 11:37:46 zmesdetect_m1[399] DBG2 utils.py:378 [Secret token found in config: !ZM_API_PORTAL]
12/29/20 11:37:46 zmesdetect_m1[399] DBG2 utils.py:378 [Secret token found in config: !ML_USER]
12/29/20 11:37:46 zmesdetect_m1[399] DBG2 utils.py:378 [Secret token found in config: !ML_PASSWORD]
12/29/20 11:37:46 zmesdetect_m1[399] DBG2 utils.py:378 [Secret token found in config: !PLATEREC_ALPR_KEY]
12/29/20 11:37:46 zmesdetect_m1[399] DBG1 utils.py:440 [allowing self-signed certs to work...]
12/29/20 11:37:46 zmesdetect_m1[399] DBG4 utils.py:450 [Now checking for monitor overrides]
12/29/20 11:37:46 zmesdetect_m1[399] DBG4 utils.py:513 [Finally, doing parameter substitution]
12/29/20 11:37:46 zmesdetect_m1[399] INF zm_detect.py:234 [Importing local classes for Object/Face]
12/29/20 11:37:46 zmesdetect_m1[399] DBG1 utils.py:280 [Trying to download http://localhost/zm/index.php?view=image&eid=890&fid=alarm&username=admin&password=*****]
12/29/20 11:37:46 zmesdetect_m1[399] DBG1 utils.py:299 [Trying to download http://localhost/zm/index.php?view=image&eid=890&fid=snapshot&username=admin&password=*****]
12/29/20 11:37:46 zmesdetect_m1[399] DBG1 zm_detect.py:295 [No polygon area specfied, so adding a full image polygon:[{'name': 'full_image', 'value': [(0, 0), (1280, 0), (1280, 720), (0, 720)], 'patter
n': None}]]
12/29/20 11:37:46 zmesdetect_m1[399] DBG1 zm_detect.py:298 [resizing to 800 before analysis...]
12/29/20 11:37:46 zmesdetect_m1[399] DBG2 utils.py:138 [resized polygons x=0.625/y=0.625: [{'name': 'full_image', 'value': [(0, 0), (800, 0), (800, 450), (0, 450)], 'pattern': None}]]
12/29/20 11:37:46 zmesdetect_m1[399] DBG1 zm_detect.py:319 [User ALPR if vehicle found: False]
12/29/20 11:37:46 zmesdetect_m1[399] DBG4 yolo.py:26 [Yolo init params: {'pyzm_overrides': {'log_level_debug': 5}, 'secrets': '/etc/zm/secrets.ini', 'version': '1.2', 'cpu_max_processes': 3, 'gpu_max_p
rocesses': 1, 'tpu_max_processes': 1, 'cpu_max_lock_wait': 100, 'gpu_max_lock_wait': 100, 'tpu_max_lock_wait': 100, 'base_data_path': '/var/lib/zmeventnotification', 'portal': 'http://localhost/zm', 'a
pi_portal': 'http://localhost/zm/api', 'user': 'admin', 'password': 'plexnchi11', 'basic_user': '', 'basic_password': '', 'image_path': '/var/lib/zmeventnotification/images', 'match_past_detections': '
no', 'past_det_max_diff_area': '5%', 'max_detection_size': '90%', 'frame_id': 'bestmatch', 'bestmatch_order': 'a,s', 'wait': '0', 'resize': '800', 'delete_after_analyze': 'yes', 'show_percent': 'yes', 
'allow_self_signed': 'yes', 'write_image_to_zm': 'yes', 'write_debug_image': 'no', 'detection_sequence': ['object'], 'detection_mode': 'all', 'import_zm_zones': 'no', 'only_triggered_zm_zones': 'no', '
poly_color': (255, 255, 255), 'poly_thickness': 2, 'create_animation': 'no', 'animation_types': "'mp4,gif'", 'animation_width': 640, 'animation_retry_sleep': 15, 'animation_max_tries': 4, 'fast_gif': '
no', 'ml_gateway': None, 'ml_fallback_local': 'no', 'ml_user': '"your_mlapi_user"', 'ml_password': '"your_mlapi_password"', 'use_sequence': 'yes', 'ml_sequence': '{\n\'general\': {\n\'model_sequence\':
 \'object\',\n\n},\n\'object\': {\n\'general\':{\n\'pattern\':\'.*\',\n\'same_model_sequence_strategy\': \'first\' # also \'most\', \'most_unique\'s\n},\n\'sequence\': [{\n\'object_config\':\'/var/lib/
zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg\',\n\'object_weights\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights\',\n\'object_labels\': \'/var/lib/zmeventnotification/m
odels/tinyyolov4/coco.names\',\n\'object_min_confidence\': 0.3,\n\'object_framework\':\'opencv\',\n\'object_processor\': \'gpu\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_proc
esses\': 3,\n\'cpu_max_lock_wait\': 100\n}]\n},\n\'face\': {\n\'general\':{\n\'pattern\': \'.*\',\n\'same_model_sequence_strategy\': \'first\'\n},\n\'sequence\': [{\n\'save_unknown_faces\':\'yes\',\n\'
save_unknown_faces_leeway_pixels\':100,\n\'face_detection_framework\': \'dlib\',\n\'known_images_path\': \'/var/lib/zmeventnotification/known_faces\',\n\'unknown_images_path\': \'/var/lib/zmeventnotifi
cation/unknown_faces\',\n\'face_model\': \'cnn\',\n\'face_train_model\': \'cnn\',\n\'face_recog_dist_threshold\': \'0.6\',\n\'face_num_jitters\': \'1\',\n\'face_upsample_times\':\'1\',\n\'gpu_max_proce
sses\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100,\n\'max_size\':800\n}]\n},\n\n\'alpr\': {\n\'general\':{\n\'same_model_sequence_strategy\': \'first\',\n\'
pre_existing_labels\':[\'car\', \'motorbike\', \'bus\', \'truck\', \'boat\'],\n\'pattern\': \'.*\'\n\n},\n\'sequence\': [{\n\'alpr_api_type\': \'cloud\',\n\'alpr_service\': \'plate_recognizer\',\n\'alp
r_key\': \'"your_plate_recognizer_api_key"\',\n\'platrec_stats\': \'yes\',\n\'platerec_min_dscore\': 0.1,\n\'platerec_min_score\': 0.2,\n\'max_size\':1600\n}]\n}\n}', 'stream_sequence': "{\n'frame_stra
tegy': 'most_models',\n'frame_set': 'snapshot,alarm',\n'resize':800\n\n}", 'object_detection_pattern': '.*', 'object_framework': 'opencv', 'object_processor': 'gpu', 'object_config': '/var/lib/zmeventn
otification/models/tinyyolov4/yolov4-tiny.cfg', 'object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights', 'object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/
coco.names', 'object_min_confidence': 0.3, 'face_detection_pattern': '.*', 'face_detection_framework': 'dlib', 'face_recognition_framework': 'dlib', 'face_processor': 'cpu', 'face_num_jitters': 1, 'fac
e_upsample_times': 1, '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_face
s', 'unknown_images_path': '/var/lib/zmeventnotification/unknown_faces', 'unknown_face_name': 'unknown face', 'save_unknown_faces': 'yes', 'save_unknown_faces_leeway_pixels': 100, 'alpr_service': 'plat
e_recognizer', 'alpr_detection_pattern': '.*', 'alpr_url': None, 'alpr_key': '"your_plate_recognizer_api_key"', 'alpr_use_after_detection_only': 'yes', 'alpr_api_type': 'cloud', 'platerec_stats': 'yes'
, 'platerec_regions': None, 'platerec_min_dscore': 0.1, 'platerec_min_score': 0.2, 'openalpr_recognize_vehicle': '0', 'openalpr_country': 'us', 'openalpr_state': None, 'openalpr_min_confidence': '0.3',
 'openalpr_cmdline_binary': 'alpr', 'openalpr_cmdline_params': '-j -d', 'openalpr_cmdline_min_confidence': 0.3, 'tpu_object_weights': '/var/lib/zmeventnotification/models/coral_edgetpu/ssd_mobilenet_v2
_coco_quant_postprocess_edgetpu.tflite', 'tpu_object_labels': '/var/lib/zmeventnotification/models/coral_edgetpu/coco_indexed.names', 'tpu_object_framework': 'coral_edgetpu', 'tpu_object_processor': 't
pu', 'tpu_min_confidence': '0.6', 'yolo4_object_weights': '/var/lib/zmeventnotification/models/yolov4/yolov4.weights', 'yolo4_object_labels': '/var/lib/zmeventnotification/models/yolov4/coco.names', 'y
olo4_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_obj
ect_framework': 'opencv', 'yolo3_object_processor': 'gpu', 'tinyyolo_object_config': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'tinyyolo_object_weights': '/var/lib/zmeventnotifi
cation/models/tinyyolov4/yolov4-tiny.weights', 'tinyyolo_object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'tinyyolo_object_framework': 'opencv', 'tinyyolo_object_processor':
 'gpu'}]
12/29/20 11:37:46 zmesdetect_m1[399] DBG2 yolo.py:35 [Semaphore: max:1, name:pyzm_uid33_gpu_lock, timeout:100]
12/29/20 11:37:46 zmesdetect_m1[399] DBG2 zm_detect.py:370 [using g.config['object_detection_pattern']=.*]
12/29/20 11:37:46 zmesdetect_m1[399] DBG1 zm_detect.py:403 [Using model: object with /var/lib/zmeventnotification/images/890-alarm.jpg]
12/29/20 11:37:46 zmesdetect_m1[399] DBG2 yolo.py:45 [Waiting for gpu lock...]
12/29/20 11:37:46 zmesdetect_m1[399] DBG2 yolo.py:47 [Got gpu lock ..]
12/29/20 11:37:46 zmesdetect_m1[399] DBG1 yolo.py:74 [|--------- Loading Yolo model from disk ---------|]
12/29/20 11:37:46 zmesdetect_m1[399] DBG1 yolo.py:82 [Yolo initialization (loading model from disk) took: 0:00:00.033025]
12/29/20 11:37:46 zmesdetect_m1[399] DBG2 yolo.py:96 [Setting CUDA backend for OpenCV]
12/29/20 11:37:46 zmesdetect_m1[399] DBG3 yolo.py:97 [If you did not set your CUDA_ARCH_BIN correctly during OpenCV compilation, you will get errors during detection related to invalid device/make_poli
cy]
12/29/20 11:37:46 zmesdetect_m1[399] DBG1 yolo.py:135 [|---------- YOLO (input image: 800w*450h, model resize dimensions: 416w*416h) ----------|]
12/29/20 11:37:51 zmesdetect_m1[399] FAT zm_detect.py:860 [Unrecoverable error:OpenCV(4.4.0) /opencv-build/build/opencv-4.4.0/modules/dnn/src/cuda4dnn/csl/cublas.hpp:78: error: (-217:Gpu API call) CUBL
AS_STATUS_NOT_INITIALIZED in function 'UniqueHandle'
 Traceback:Traceback (most recent call last):
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 857, in <module>
    main_handler()
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 432, in main_handler
    b, l, c = m.detect(original_image)
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/object.py", line 54, in detect
    b,l,c = self.model.detect(image)
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/yolo.py", line 149, in detect
    outs = self.net.forward(ln)
cv2.error: OpenCV(4.4.0) /opencv-build/build/opencv-4.4.0/modules/dnn/src/cuda4dnn/csl/cublas.hpp:78: error: (-217:Gpu API call) CUBLAS_STATUS_NOT_INITIALIZED in function 'UniqueHandle'

]
12/29/20 11:37:56 zmesdetect_m1[420] INF zm_detect.py:208 [---------| pyzm version:0.3.8, hook version:6.0.7,  ES version:6.0.7 , OpenCV version:4.4.0|------------]
12/29/20 11:37:56 zmesdetect_m1[420] DBG1 utils.py:405 [secret filename: /etc/zm/secrets.ini]
12/29/20 11:37:56 zmesdetect_m1[420] DBG2 utils.py:378 [Secret token found in config: !ZM_PORTAL]
12/29/20 11:37:56 zmesdetect_m1[420] DBG2 utils.py:378 [Secret token found in config: !ZM_USER]
12/29/20 11:37:56 zmesdetect_m1[420] DBG2 utils.py:378 [Secret token found in config: !ZM_PASSWORD]
12/29/20 11:37:56 zmesdetect_m1[420] DBG2 utils.py:378 [Secret token found in config: !ZM_API_PORTAL]
12/29/20 11:37:56 zmesdetect_m1[420] DBG2 utils.py:378 [Secret token found in config: !ML_USER]
12/29/20 11:37:56 zmesdetect_m1[420] DBG2 utils.py:378 [Secret token found in config: !ML_PASSWORD]
12/29/20 11:37:56 zmesdetect_m1[420] DBG2 utils.py:378 [Secret token found in config: !PLATEREC_ALPR_KEY]
12/29/20 11:37:56 zmesdetect_m1[420] DBG1 utils.py:440 [allowing self-signed certs to work...]
12/29/20 11:37:56 zmesdetect_m1[420] DBG4 utils.py:450 [Now checking for monitor overrides]
12/29/20 11:37:56 zmesdetect_m1[420] DBG4 utils.py:513 [Finally, doing parameter substitution]
12/29/20 11:37:56 zmesdetect_m1[420] INF zm_detect.py:234 [Importing local classes for Object/Face]
12/29/20 11:37:56 zmesdetect_m1[420] DBG1 utils.py:280 [Trying to download http://localhost/zm/index.php?view=image&eid=891&fid=alarm&username=admin&password=*****]
12/29/20 11:37:56 zmesdetect_m1[420] DBG1 utils.py:299 [Trying to download http://localhost/zm/index.php?view=image&eid=891&fid=snapshot&username=admin&password=*****]
12/29/20 11:37:56 zmesdetect_m1[420] DBG1 zm_detect.py:295 [No polygon area specfied, so adding a full image polygon:[{'name': 'full_image', 'value': [(0, 0), (1280, 0), (1280, 720), (0, 720)], 'patter
n': None}]]
12/29/20 11:37:56 zmesdetect_m1[420] DBG1 zm_detect.py:298 [resizing to 800 before analysis...]
12/29/20 11:37:56 zmesdetect_m1[420] DBG2 utils.py:138 [resized polygons x=0.625/y=0.625: [{'name': 'full_image', 'value': [(0, 0), (800, 0), (800, 450), (0, 450)], 'pattern': None}]]
12/29/20 11:37:56 zmesdetect_m1[420] DBG1 zm_detect.py:319 [User ALPR if vehicle found: False]
12/29/20 11:37:56 zmesdetect_m1[420] DBG4 yolo.py:26 [Yolo init params: {'pyzm_overrides': {'log_level_debug': 5}, 'secrets': '/etc/zm/secrets.ini', 'version': '1.2', 'cpu_max_processes': 3, 'gpu_max_p
rocesses': 1, 'tpu_max_processes': 1, 'cpu_max_lock_wait': 100, 'gpu_max_lock_wait': 100, 'tpu_max_lock_wait': 100, 'base_data_path': '/var/lib/zmeventnotification', 'portal': 'http://localhost/zm', 'a
pi_portal': 'http://localhost/zm/api', 'user': 'admin', 'password': 'plexnchi11', 'basic_user': '', 'basic_password': '', 'image_path': '/var/lib/zmeventnotification/images', 'match_past_detections': '
no', 'past_det_max_diff_area': '5%', 'max_detection_size': '90%', 'frame_id': 'bestmatch', 'bestmatch_order': 'a,s', 'wait': '0', 'resize': '800', 'delete_after_analyze': 'yes', 'show_percent': 'yes', 
'allow_self_signed': 'yes', 'write_image_to_zm': 'yes', 'write_debug_image': 'no', 'detection_sequence': ['object'], 'detection_mode': 'all', 'import_zm_zones': 'no', 'only_triggered_zm_zones': 'no', '
poly_color': (255, 255, 255), 'poly_thickness': 2, 'create_animation': 'no', 'animation_types': "'mp4,gif'", 'animation_width': 640, 'animation_retry_sleep': 15, 'animation_max_tries': 4, 'fast_gif': '
no', 'ml_gateway': None, 'ml_fallback_local': 'no', 'ml_user': '"your_mlapi_user"', 'ml_password': '"your_mlapi_password"', 'use_sequence': 'yes', 'ml_sequence': '{\n\'general\': {\n\'model_sequence\':
 \'object\',\n\n},\n\'object\': {\n\'general\':{\n\'pattern\':\'.*\',\n\'same_model_sequence_strategy\': \'first\' # also \'most\', \'most_unique\'s\n},\n\'sequence\': [{\n\'object_config\':\'/var/lib/
zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg\',\n\'object_weights\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights\',\n\'object_labels\': \'/var/lib/zmeventnotification/m
odels/tinyyolov4/coco.names\',\n\'object_min_confidence\': 0.3,\n\'object_framework\':\'opencv\',\n\'object_processor\': \'gpu\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_proc
esses\': 3,\n\'cpu_max_lock_wait\': 100\n}]\n},\n\'face\': {\n\'general\':{\n\'pattern\': \'.*\',\n\'same_model_sequence_strategy\': \'first\'\n},\n\'sequence\': [{\n\'save_unknown_faces\':\'yes\',\n\'
save_unknown_faces_leeway_pixels\':100,\n\'face_detection_framework\': \'dlib\',\n\'known_images_path\': \'/var/lib/zmeventnotification/known_faces\',\n\'unknown_images_path\': \'/var/lib/zmeventnotifi
cation/unknown_faces\',\n\'face_model\': \'cnn\',\n\'face_train_model\': \'cnn\',\n\'face_recog_dist_threshold\': \'0.6\',\n\'face_num_jitters\': \'1\',\n\'face_upsample_times\':\'1\',\n\'gpu_max_proce
sses\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100,\n\'max_size\':800\n}]\n},\n\n\'alpr\': {\n\'general\':{\n\'same_model_sequence_strategy\': \'first\',\n\'
pre_existing_labels\':[\'car\', \'motorbike\', \'bus\', \'truck\', \'boat\'],\n\'pattern\': \'.*\'\n\n},\n\'sequence\': [{\n\'alpr_api_type\': \'cloud\',\n\'alpr_service\': \'plate_recognizer\',\n\'alp
r_key\': \'"your_plate_recognizer_api_key"\',\n\'platrec_stats\': \'yes\',\n\'platerec_min_dscore\': 0.1,\n\'platerec_min_score\': 0.2,\n\'max_size\':1600\n}]\n}\n}', 'stream_sequence': "{\n'frame_stra
tegy': 'most_models',\n'frame_set': 'snapshot,alarm',\n'resize':800\n\n}", 'object_detection_pattern': '.*', 'object_framework': 'opencv', 'object_processor': 'gpu', 'object_config': '/var/lib/zmeventn
otification/models/tinyyolov4/yolov4-tiny.cfg', 'object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights', 'object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/
coco.names', 'object_min_confidence': 0.3, 'face_detection_pattern': '.*', 'face_detection_framework': 'dlib', 'face_recognition_framework': 'dlib', 'face_processor': 'cpu', 'face_num_jitters': 1, 'fac
e_upsample_times': 1, '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_face
s', 'unknown_images_path': '/var/lib/zmeventnotification/unknown_faces', 'unknown_face_name': 'unknown face', 'save_unknown_faces': 'yes', 'save_unknown_faces_leeway_pixels': 100, 'alpr_service': 'plat
e_recognizer', 'alpr_detection_pattern': '.*', 'alpr_url': None, 'alpr_key': '"your_plate_recognizer_api_key"', 'alpr_use_after_detection_only': 'yes', 'alpr_api_type': 'cloud', 'platerec_stats': 'yes'
, 'platerec_regions': None, 'platerec_min_dscore': 0.1, 'platerec_min_score': 0.2, 'openalpr_recognize_vehicle': '0', 'openalpr_country': 'us', 'openalpr_state': None, 'openalpr_min_confidence': '0.3',
 'openalpr_cmdline_binary': 'alpr', 'openalpr_cmdline_params': '-j -d', 'openalpr_cmdline_min_confidence': 0.3, 'tpu_object_weights': '/var/lib/zmeventnotification/models/coral_edgetpu/ssd_mobilenet_v2
_coco_quant_postprocess_edgetpu.tflite', 'tpu_object_labels': '/var/lib/zmeventnotification/models/coral_edgetpu/coco_indexed.names', 'tpu_object_framework': 'coral_edgetpu', 'tpu_object_processor': 't
pu', 'tpu_min_confidence': '0.6', 'yolo4_object_weights': '/var/lib/zmeventnotification/models/yolov4/yolov4.weights', 'yolo4_object_labels': '/var/lib/zmeventnotification/models/yolov4/coco.names', 'y
olo4_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_obj
ect_framework': 'opencv', 'yolo3_object_processor': 'gpu', 'tinyyolo_object_config': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'tinyyolo_object_weights': '/var/lib/zmeventnotifi
cation/models/tinyyolov4/yolov4-tiny.weights', 'tinyyolo_object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'tinyyolo_object_framework': 'opencv', 'tinyyolo_object_processor':
 'gpu'}]
12/29/20 11:37:56 zmesdetect_m1[420] DBG2 yolo.py:35 [Semaphore: max:1, name:pyzm_uid33_gpu_lock, timeout:100]
12/29/20 11:37:56 zmesdetect_m1[420] DBG2 zm_detect.py:370 [using g.config['object_detection_pattern']=.*]
12/29/20 11:37:56 zmesdetect_m1[420] DBG1 zm_detect.py:403 [Using model: object with /var/lib/zmeventnotification/images/891-alarm.jpg]
12/29/20 11:37:56 zmesdetect_m1[420] DBG2 yolo.py:45 [Waiting for gpu lock...]
12/29/20 11:37:56 zmesdetect_m1[420] DBG2 yolo.py:47 [Got gpu lock ..]
12/29/20 11:37:56 zmesdetect_m1[420] DBG1 yolo.py:74 [|--------- Loading Yolo model from disk ---------|]
12/29/20 11:37:56 zmesdetect_m1[420] DBG1 yolo.py:82 [Yolo initialization (loading model from disk) took: 0:00:00.034711]
12/29/20 11:37:56 zmesdetect_m1[420] DBG2 yolo.py:96 [Setting CUDA backend for OpenCV]
12/29/20 11:37:56 zmesdetect_m1[420] DBG3 yolo.py:97 [If you did not set your CUDA_ARCH_BIN correctly during OpenCV compilation, you will get errors during detection related to invalid device/make_poli
cy]
12/29/20 11:37:56 zmesdetect_m1[420] DBG1 yolo.py:135 [|---------- YOLO (input image: 800w*450h, model resize dimensions: 416w*416h) ----------|]
12/29/20 11:38:10 zmesdetect_m1[462] INF zm_detect.py:208 [---------| pyzm version:0.3.8, hook version:6.0.7,  ES version:6.0.7 , OpenCV version:4.4.0|------------]
12/29/20 11:38:10 zmesdetect_m1[462] DBG1 utils.py:405 [secret filename: /etc/zm/secrets.ini]
12/29/20 11:38:10 zmesdetect_m1[462] DBG2 utils.py:378 [Secret token found in config: !ZM_PORTAL]
12/29/20 11:38:10 zmesdetect_m1[462] DBG2 utils.py:378 [Secret token found in config: !ZM_USER]
12/29/20 11:38:10 zmesdetect_m1[462] DBG2 utils.py:378 [Secret token found in config: !ZM_PASSWORD]
12/29/20 11:38:10 zmesdetect_m1[462] DBG2 utils.py:378 [Secret token found in config: !ZM_API_PORTAL]
12/29/20 11:38:10 zmesdetect_m1[462] DBG2 utils.py:378 [Secret token found in config: !ML_USER]
12/29/20 11:38:10 zmesdetect_m1[462] DBG2 utils.py:378 [Secret token found in config: !ML_PASSWORD]
12/29/20 11:38:10 zmesdetect_m1[462] DBG2 utils.py:378 [Secret token found in config: !PLATEREC_ALPR_KEY]
12/29/20 11:38:10 zmesdetect_m1[462] DBG1 utils.py:440 [allowing self-signed certs to work...]
12/29/20 11:38:10 zmesdetect_m1[462] DBG4 utils.py:450 [Now checking for monitor overrides]
12/29/20 11:38:10 zmesdetect_m1[462] DBG4 utils.py:513 [Finally, doing parameter substitution]
12/29/20 11:38:10 zmesdetect_m1[462] INF zm_detect.py:234 [Importing local classes for Object/Face]
12/29/20 11:38:10 zmesdetect_m1[462] DBG1 utils.py:280 [Trying to download http://localhost/zm/index.php?view=image&eid=892&fid=alarm&username=admin&password=*****]
12/29/20 11:38:10 zmesdetect_m1[462] DBG1 utils.py:299 [Trying to download http://localhost/zm/index.php?view=image&eid=892&fid=snapshot&username=admin&password=*****]
12/29/20 11:38:11 zmesdetect_m1[462] DBG1 zm_detect.py:295 [No polygon area specfied, so adding a full image polygon:[{'name': 'full_image', 'value': [(0, 0), (1280, 0), (1280, 720), (0, 720)], 'patter
n': None}]]
12/29/20 11:38:11 zmesdetect_m1[462] DBG1 zm_detect.py:298 [resizing to 800 before analysis...]
12/29/20 11:38:11 zmesdetect_m1[462] DBG2 utils.py:138 [resized polygons x=0.625/y=0.625: [{'name': 'full_image', 'value': [(0, 0), (800, 0), (800, 450), (0, 450)], 'pattern': None}]]
12/29/20 11:38:11 zmesdetect_m1[462] DBG1 zm_detect.py:319 [User ALPR if vehicle found: False]
12/29/20 11:38:11 zmesdetect_m1[462] DBG4 yolo.py:26 [Yolo init params: {'pyzm_overrides': {'log_level_debug': 5}, 'secrets': '/etc/zm/secrets.ini', 'version': '1.2', 'cpu_max_processes': 3, 'gpu_max_p
rocesses': 1, 'tpu_max_processes': 1, 'cpu_max_lock_wait': 100, 'gpu_max_lock_wait': 100, 'tpu_max_lock_wait': 100, 'base_data_path': '/var/lib/zmeventnotification', 'portal': 'http://localhost/zm', 'a
pi_portal': 'http://localhost/zm/api', 'user': 'admin', 'password': 'plexnchi11', 'basic_user': '', 'basic_password': '', 'image_path': '/var/lib/zmeventnotification/images', 'match_past_detections': '
no', 'past_det_max_diff_area': '5%', 'max_detection_size': '90%', 'frame_id': 'bestmatch', 'bestmatch_order': 'a,s', 'wait': '0', 'resize': '800', 'delete_after_analyze': 'yes', 'show_percent': 'yes', 
'allow_self_signed': 'yes', 'write_image_to_zm': 'yes', 'write_debug_image': 'no', 'detection_sequence': ['object'], 'detection_mode': 'all', 'import_zm_zones': 'no', 'only_triggered_zm_zones': 'no', '
poly_color': (255, 255, 255), 'poly_thickness': 2, 'create_animation': 'no', 'animation_types': "'mp4,gif'", 'animation_width': 640, 'animation_retry_sleep': 15, 'animation_max_tries': 4, 'fast_gif': '
no', 'ml_gateway': None, 'ml_fallback_local': 'no', 'ml_user': '"your_mlapi_user"', 'ml_password': '"your_mlapi_password"', 'use_sequence': 'yes', 'ml_sequence': '{\n\'general\': {\n\'model_sequence\':
 \'object\',\n\n},\n\'object\': {\n\'general\':{\n\'pattern\':\'.*\',\n\'same_model_sequence_strategy\': \'first\' # also \'most\', \'most_unique\'s\n},\n\'sequence\': [{\n\'object_config\':\'/var/lib/
zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg\',\n\'object_weights\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights\',\n\'object_labels\': \'/var/lib/zmeventnotification/m
odels/tinyyolov4/coco.names\',\n\'object_min_confidence\': 0.3,\n\'object_framework\':\'opencv\',\n\'object_processor\': \'gpu\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_proc
esses\': 3,\n\'cpu_max_lock_wait\': 100\n}]\n},\n\'face\': {\n\'general\':{\n\'pattern\': \'.*\',\n\'same_model_sequence_strategy\': \'first\'\n},\n\'sequence\': [{\n\'save_unknown_faces\':\'yes\',\n\'
save_unknown_faces_leeway_pixels\':100,\n\'face_detection_framework\': \'dlib\',\n\'known_images_path\': \'/var/lib/zmeventnotification/known_faces\',\n\'unknown_images_path\': \'/var/lib/zmeventnotifi
cation/unknown_faces\',\n\'face_model\': \'cnn\',\n\'face_train_model\': \'cnn\',\n\'face_recog_dist_threshold\': \'0.6\',\n\'face_num_jitters\': \'1\',\n\'face_upsample_times\':\'1\',\n\'gpu_max_proce
sses\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100,\n\'max_size\':800\n}]\n},\n\n\'alpr\': {\n\'general\':{\n\'same_model_sequence_strategy\': \'first\',\n\'
pre_existing_labels\':[\'car\', \'motorbike\', \'bus\', \'truck\', \'boat\'],\n\'pattern\': \'.*\'\n\n},\n\'sequence\': [{\n\'alpr_api_type\': \'cloud\',\n\'alpr_service\': \'plate_recognizer\',\n\'alp
r_key\': \'"your_plate_recognizer_api_key"\',\n\'platrec_stats\': \'yes\',\n\'platerec_min_dscore\': 0.1,\n\'platerec_min_score\': 0.2,\n\'max_size\':1600\n}]\n}\n}', 'stream_sequence': "{\n'frame_stra
tegy': 'most_models',\n'frame_set': 'snapshot,alarm',\n'resize':800\n\n}", 'object_detection_pattern': '.*', 'object_framework': 'opencv', 'object_processor': 'gpu', 'object_config': '/var/lib/zmeventn
otification/models/tinyyolov4/yolov4-tiny.cfg', 'object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights', 'object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/
coco.names', 'object_min_confidence': 0.3, 'face_detection_pattern': '.*', 'face_detection_framework': 'dlib', 'face_recognition_framework': 'dlib', 'face_processor': 'cpu', 'face_num_jitters': 1, 'fac
e_upsample_times': 1, '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_face
s', 'unknown_images_path': '/var/lib/zmeventnotification/unknown_faces', 'unknown_face_name': 'unknown face', 'save_unknown_faces': 'yes', 'save_unknown_faces_leeway_pixels': 100, 'alpr_service': 'plat
e_recognizer', 'alpr_detection_pattern': '.*', 'alpr_url': None, 'alpr_key': '"your_plate_recognizer_api_key"', 'alpr_use_after_detection_only': 'yes', 'alpr_api_type': 'cloud', 'platerec_stats': 'yes'
, 'platerec_regions': None, 'platerec_min_dscore': 0.1, 'platerec_min_score': 0.2, 'openalpr_recognize_vehicle': '0', 'openalpr_country': 'us', 'openalpr_state': None, 'openalpr_min_confidence': '0.3',
 'openalpr_cmdline_binary': 'alpr', 'openalpr_cmdline_params': '-j -d', 'openalpr_cmdline_min_confidence': 0.3, 'tpu_object_weights': '/var/lib/zmeventnotification/models/coral_edgetpu/ssd_mobilenet_v2
_coco_quant_postprocess_edgetpu.tflite', 'tpu_object_labels': '/var/lib/zmeventnotification/models/coral_edgetpu/coco_indexed.names', 'tpu_object_framework': 'coral_edgetpu', 'tpu_object_processor': 't
pu', 'tpu_min_confidence': '0.6', 'yolo4_object_weights': '/var/lib/zmeventnotification/models/yolov4/yolov4.weights', 'yolo4_object_labels': '/var/lib/zmeventnotification/models/yolov4/coco.names', 'y
olo4_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_obj
ect_framework': 'opencv', 'yolo3_object_processor': 'gpu', 'tinyyolo_object_config': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'tinyyolo_object_weights': '/var/lib/zmeventnotifi
cation/models/tinyyolov4/yolov4-tiny.weights', 'tinyyolo_object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'tinyyolo_object_framework': 'opencv', 'tinyyolo_object_processor':
 'gpu'}]
12/29/20 11:38:11 zmesdetect_m1[462] DBG2 yolo.py:35 [Semaphore: max:1, name:pyzm_uid33_gpu_lock, timeout:100]
12/29/20 11:38:11 zmesdetect_m1[462] DBG2 zm_detect.py:370 [using g.config['object_detection_pattern']=.*]
12/29/20 11:38:11 zmesdetect_m1[462] DBG1 zm_detect.py:403 [Using model: object with /var/lib/zmeventnotification/images/892-alarm.jpg]
12/29/20 11:38:11 zmesdetect_m1[462] DBG2 yolo.py:45 [Waiting for gpu lock...]
12/29/20 11:38:45 zmesdetect_m1[502] INF zm_detect.py:208 [---------| pyzm version:0.3.8, hook version:6.0.7,  ES version:6.0.7 , OpenCV version:4.4.0|------------]
12/29/20 11:38:45 zmesdetect_m1[502] DBG1 utils.py:405 [secret filename: /etc/zm/secrets.ini]
12/29/20 11:38:45 zmesdetect_m1[502] DBG2 utils.py:378 [Secret token found in config: !ZM_PORTAL]
12/29/20 11:38:45 zmesdetect_m1[502] DBG2 utils.py:378 [Secret token found in config: !ZM_USER]
12/29/20 11:38:45 zmesdetect_m1[502] DBG2 utils.py:378 [Secret token found in config: !ZM_PASSWORD]
12/29/20 11:38:45 zmesdetect_m1[502] DBG2 utils.py:378 [Secret token found in config: !ZM_API_PORTAL]
12/29/20 11:38:45 zmesdetect_m1[502] DBG2 utils.py:378 [Secret token found in config: !ML_USER]
12/29/20 11:38:45 zmesdetect_m1[502] DBG2 utils.py:378 [Secret token found in config: !ML_PASSWORD]
12/29/20 11:38:45 zmesdetect_m1[502] DBG2 utils.py:378 [Secret token found in config: !PLATEREC_ALPR_KEY]
12/29/20 11:38:45 zmesdetect_m1[502] DBG1 utils.py:440 [allowing self-signed certs to work...]
12/29/20 11:38:45 zmesdetect_m1[502] DBG4 utils.py:450 [Now checking for monitor overrides]
12/29/20 11:38:45 zmesdetect_m1[502] DBG4 utils.py:513 [Finally, doing parameter substitution]
12/29/20 11:38:45 zmesdetect_m1[502] INF zm_detect.py:234 [Importing local classes for Object/Face]
12/29/20 11:38:45 zmesdetect_m1[502] DBG1 utils.py:280 [Trying to download http://localhost/zm/index.php?view=image&eid=893&fid=alarm&username=admin&password=*****]
12/29/20 11:38:46 zmesdetect_m1[502] DBG1 utils.py:299 [Trying to download http://localhost/zm/index.php?view=image&eid=893&fid=snapshot&username=admin&password=*****]
12/29/20 11:38:46 zmesdetect_m1[502] DBG1 zm_detect.py:295 [No polygon area specfied, so adding a full image polygon:[{'name': 'full_image', 'value': [(0, 0), (1280, 0), (1280, 720), (0, 720)], 'patter
n': None}]]
12/29/20 11:38:46 zmesdetect_m1[502] DBG1 zm_detect.py:298 [resizing to 800 before analysis...]
12/29/20 11:38:46 zmesdetect_m1[502] DBG2 utils.py:138 [resized polygons x=0.625/y=0.625: [{'name': 'full_image', 'value': [(0, 0), (800, 0), (800, 450), (0, 450)], 'pattern': None}]]
12/29/20 11:38:46 zmesdetect_m1[502] DBG1 zm_detect.py:319 [User ALPR if vehicle found: False]
12/29/20 11:38:46 zmesdetect_m1[502] DBG4 yolo.py:26 [Yolo init params: {'pyzm_overrides': {'log_level_debug': 5}, 'secrets': '/etc/zm/secrets.ini', 'version': '1.2', 'cpu_max_processes': 3, 'gpu_max_p
rocesses': 1, 'tpu_max_processes': 1, 'cpu_max_lock_wait': 100, 'gpu_max_lock_wait': 100, 'tpu_max_lock_wait': 100, 'base_data_path': '/var/lib/zmeventnotification', 'portal': 'http://localhost/zm', 'a
pi_portal': 'http://localhost/zm/api', 'user': 'admin', 'password': 'plexnchi11', 'basic_user': '', 'basic_password': '', 'image_path': '/var/lib/zmeventnotification/images', 'match_past_detections': '
no', 'past_det_max_diff_area': '5%', 'max_detection_size': '90%', 'frame_id': 'bestmatch', 'bestmatch_order': 'a,s', 'wait': '0', 'resize': '800', 'delete_after_analyze': 'yes', 'show_percent': 'yes', 
'allow_self_signed': 'yes', 'write_image_to_zm': 'yes', 'write_debug_image': 'no', 'detection_sequence': ['object'], 'detection_mode': 'all', 'import_zm_zones': 'no', 'only_triggered_zm_zones': 'no', '
poly_color': (255, 255, 255), 'poly_thickness': 2, 'create_animation': 'no', 'animation_types': "'mp4,gif'", 'animation_width': 640, 'animation_retry_sleep': 15, 'animation_max_tries': 4, 'fast_gif': '
no', 'ml_gateway': None, 'ml_fallback_local': 'no', 'ml_user': '"your_mlapi_user"', 'ml_password': '"your_mlapi_password"', 'use_sequence': 'yes', 'ml_sequence': '{\n\'general\': {\n\'model_sequence\':
 \'object\',\n\n},\n\'object\': {\n\'general\':{\n\'pattern\':\'.*\',\n\'same_model_sequence_strategy\': \'first\' # also \'most\', \'most_unique\'s\n},\n\'sequence\': [{\n\'object_config\':\'/var/lib/
zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg\',\n\'object_weights\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights\',\n\'object_labels\': \'/var/lib/zmeventnotification/m
odels/tinyyolov4/coco.names\',\n\'object_min_confidence\': 0.3,\n\'object_framework\':\'opencv\',\n\'object_processor\': \'gpu\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_proc
esses\': 3,\n\'cpu_max_lock_wait\': 100\n}]\n},\n\'face\': {\n\'general\':{\n\'pattern\': \'.*\',\n\'same_model_sequence_strategy\': \'first\'\n},\n\'sequence\': [{\n\'save_unknown_faces\':\'yes\',\n\'
save_unknown_faces_leeway_pixels\':100,\n\'face_detection_framework\': \'dlib\',\n\'known_images_path\': \'/var/lib/zmeventnotification/known_faces\',\n\'unknown_images_path\': \'/var/lib/zmeventnotifi
cation/unknown_faces\',\n\'face_model\': \'cnn\',\n\'face_train_model\': \'cnn\',\n\'face_recog_dist_threshold\': \'0.6\',\n\'face_num_jitters\': \'1\',\n\'face_upsample_times\':\'1\',\n\'gpu_max_proce
sses\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100,\n\'max_size\':800\n}]\n},\n\n\'alpr\': {\n\'general\':{\n\'same_model_sequence_strategy\': \'first\',\n\'
pre_existing_labels\':[\'car\', \'motorbike\', \'bus\', \'truck\', \'boat\'],\n\'pattern\': \'.*\'\n\n},\n\'sequence\': [{\n\'alpr_api_type\': \'cloud\',\n\'alpr_service\': \'plate_recognizer\',\n\'alp
r_key\': \'"your_plate_recognizer_api_key"\',\n\'platrec_stats\': \'yes\',\n\'platerec_min_dscore\': 0.1,\n\'platerec_min_score\': 0.2,\n\'max_size\':1600\n}]\n}\n}', 'stream_sequence': "{\n'frame_stra
tegy': 'most_models',\n'frame_set': 'snapshot,alarm',\n'resize':800\n\n}", 'object_detection_pattern': '.*', 'object_framework': 'opencv', 'object_processor': 'gpu', 'object_config': '/var/lib/zmeventn
otification/models/tinyyolov4/yolov4-tiny.cfg', 'object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights', 'object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/
coco.names', 'object_min_confidence': 0.3, 'face_detection_pattern': '.*', 'face_detection_framework': 'dlib', 'face_recognition_framework': 'dlib', 'face_processor': 'cpu', 'face_num_jitters': 1, 'fac
e_upsample_times': 1, '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_face
s', 'unknown_images_path': '/var/lib/zmeventnotification/unknown_faces', 'unknown_face_name': 'unknown face', 'save_unknown_faces': 'yes', 'save_unknown_faces_leeway_pixels': 100, 'alpr_service': 'plat
e_recognizer', 'alpr_detection_pattern': '.*', 'alpr_url': None, 'alpr_key': '"your_plate_recognizer_api_key"', 'alpr_use_after_detection_only': 'yes', 'alpr_api_type': 'cloud', 'platerec_stats': 'yes'
, 'platerec_regions': None, 'platerec_min_dscore': 0.1, 'platerec_min_score': 0.2, 'openalpr_recognize_vehicle': '0', 'openalpr_country': 'us', 'openalpr_state': None, 'openalpr_min_confidence': '0.3',
 'openalpr_cmdline_binary': 'alpr', 'openalpr_cmdline_params': '-j -d', 'openalpr_cmdline_min_confidence': 0.3, 'tpu_object_weights': '/var/lib/zmeventnotification/models/coral_edgetpu/ssd_mobilenet_v2
_coco_quant_postprocess_edgetpu.tflite', 'tpu_object_labels': '/var/lib/zmeventnotification/models/coral_edgetpu/coco_indexed.names', 'tpu_object_framework': 'coral_edgetpu', 'tpu_object_processor': 't
pu', 'tpu_min_confidence': '0.6', 'yolo4_object_weights': '/var/lib/zmeventnotification/models/yolov4/yolov4.weights', 'yolo4_object_labels': '/var/lib/zmeventnotification/models/yolov4/coco.names', 'y
olo4_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_obj
ect_framework': 'opencv', 'yolo3_object_processor': 'gpu', 'tinyyolo_object_config': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'tinyyolo_object_weights': '/var/lib/zmeventnotifi
cation/models/tinyyolov4/yolov4-tiny.weights', 'tinyyolo_object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'tinyyolo_object_framework': 'opencv', 'tinyyolo_object_processor':
 'gpu'}]
12/29/20 11:38:46 zmesdetect_m1[502] DBG2 yolo.py:35 [Semaphore: max:1, name:pyzm_uid33_gpu_lock, timeout:100]
12/29/20 11:38:46 zmesdetect_m1[502] DBG2 zm_detect.py:370 [using g.config['object_detection_pattern']=.*]
12/29/20 11:38:46 zmesdetect_m1[502] DBG1 zm_detect.py:403 [Using model: object with /var/lib/zmeventnotification/images/893-alarm.jpg]
12/29/20 11:38:46 zmesdetect_m1[502] DBG2 yolo.py:45 [Waiting for gpu lock...]
12/29/20 11:39:05 zmesdetect_m1[540] INF zm_detect.py:208 [---------| pyzm version:0.3.8, hook version:6.0.7,  ES version:6.0.7 , OpenCV version:4.4.0|------------]
12/29/20 11:39:05 zmesdetect_m1[540] DBG1 utils.py:405 [secret filename: /etc/zm/secrets.ini]
12/29/20 11:39:05 zmesdetect_m1[540] DBG2 utils.py:378 [Secret token found in config: !ZM_PORTAL]
12/29/20 11:39:05 zmesdetect_m1[540] DBG2 utils.py:378 [Secret token found in config: !ZM_USER]
12/29/20 11:39:05 zmesdetect_m1[540] DBG2 utils.py:378 [Secret token found in config: !ZM_PASSWORD]
12/29/20 11:39:05 zmesdetect_m1[540] DBG2 utils.py:378 [Secret token found in config: !ZM_API_PORTAL]
12/29/20 11:39:05 zmesdetect_m1[540] DBG2 utils.py:378 [Secret token found in config: !ML_USER]
12/29/20 11:39:05 zmesdetect_m1[540] DBG2 utils.py:378 [Secret token found in config: !ML_PASSWORD]
12/29/20 11:39:05 zmesdetect_m1[540] DBG2 utils.py:378 [Secret token found in config: !PLATEREC_ALPR_KEY]
12/29/20 11:39:05 zmesdetect_m1[540] DBG1 utils.py:440 [allowing self-signed certs to work...]
12/29/20 11:39:05 zmesdetect_m1[540] DBG4 utils.py:450 [Now checking for monitor overrides]
12/29/20 11:39:05 zmesdetect_m1[540] DBG4 utils.py:513 [Finally, doing parameter substitution]
12/29/20 11:39:05 zmesdetect_m1[540] INF zm_detect.py:234 [Importing local classes for Object/Face]
12/29/20 11:39:05 zmesdetect_m1[540] DBG1 utils.py:280 [Trying to download http://localhost/zm/index.php?view=image&eid=894&fid=alarm&username=admin&password=*****]
12/29/20 11:39:05 zmesdetect_m1[540] DBG1 utils.py:299 [Trying to download http://localhost/zm/index.php?view=image&eid=894&fid=snapshot&username=admin&password=*****]
12/29/20 11:39:06 zmesdetect_m1[540] DBG1 zm_detect.py:295 [No polygon area specfied, so adding a full image polygon:[{'name': 'full_image', 'value': [(0, 0), (1280, 0), (1280, 720), (0, 720)], 'patter
n': None}]]
12/29/20 11:39:06 zmesdetect_m1[540] DBG1 zm_detect.py:298 [resizing to 800 before analysis...]
12/29/20 11:39:06 zmesdetect_m1[540] DBG2 utils.py:138 [resized polygons x=0.625/y=0.625: [{'name': 'full_image', 'value': [(0, 0), (800, 0), (800, 450), (0, 450)], 'pattern': None}]]
12/29/20 11:39:06 zmesdetect_m1[540] DBG1 zm_detect.py:319 [User ALPR if vehicle found: False]
12/29/20 11:39:06 zmesdetect_m1[540] DBG4 yolo.py:26 [Yolo init params: {'pyzm_overrides': {'log_level_debug': 5}, 'secrets': '/etc/zm/secrets.ini', 'version': '1.2', 'cpu_max_processes': 3, 'gpu_max_p
rocesses': 1, 'tpu_max_processes': 1, 'cpu_max_lock_wait': 100, 'gpu_max_lock_wait': 100, 'tpu_max_lock_wait': 100, 'base_data_path': '/var/lib/zmeventnotification', 'portal': 'http://localhost/zm', 'a
pi_portal': 'http://localhost/zm/api', 'user': 'admin', 'password': 'plexnchi11', 'basic_user': '', 'basic_password': '', 'image_path': '/var/lib/zmeventnotification/images', 'match_past_detections': '
no', 'past_det_max_diff_area': '5%', 'max_detection_size': '90%', 'frame_id': 'bestmatch', 'bestmatch_order': 'a,s', 'wait': '0', 'resize': '800', 'delete_after_analyze': 'yes', 'show_percent': 'yes', 
'allow_self_signed': 'yes', 'write_image_to_zm': 'yes', 'write_debug_image': 'no', 'detection_sequence': ['object'], 'detection_mode': 'all', 'import_zm_zones': 'no', 'only_triggered_zm_zones': 'no', '
poly_color': (255, 255, 255), 'poly_thickness': 2, 'create_animation': 'no', 'animation_types': "'mp4,gif'", 'animation_width': 640, 'animation_retry_sleep': 15, 'animation_max_tries': 4, 'fast_gif': '
no', 'ml_gateway': None, 'ml_fallback_local': 'no', 'ml_user': '"your_mlapi_user"', 'ml_password': '"your_mlapi_password"', 'use_sequence': 'yes', 'ml_sequence': '{\n\'general\': {\n\'model_sequence\':
 \'object\',\n\n},\n\'object\': {\n\'general\':{\n\'pattern\':\'.*\',\n\'same_model_sequence_strategy\': \'first\' # also \'most\', \'most_unique\'s\n},\n\'sequence\': [{\n\'object_config\':\'/var/lib/
zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg\',\n\'object_weights\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights\',\n\'object_labels\': \'/var/lib/zmeventnotification/m
odels/tinyyolov4/coco.names\',\n\'object_min_confidence\': 0.3,\n\'object_framework\':\'opencv\',\n\'object_processor\': \'gpu\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_proc
esses\': 3,\n\'cpu_max_lock_wait\': 100\n}]\n},\n\'face\': {\n\'general\':{\n\'pattern\': \'.*\',\n\'same_model_sequence_strategy\': \'first\'\n},\n\'sequence\': [{\n\'save_unknown_faces\':\'yes\',\n\'
save_unknown_faces_leeway_pixels\':100,\n\'face_detection_framework\': \'dlib\',\n\'known_images_path\': \'/var/lib/zmeventnotification/known_faces\',\n\'unknown_images_path\': \'/var/lib/zmeventnotifi
cation/unknown_faces\',\n\'face_model\': \'cnn\',\n\'face_train_model\': \'cnn\',\n\'face_recog_dist_threshold\': \'0.6\',\n\'face_num_jitters\': \'1\',\n\'face_upsample_times\':\'1\',\n\'gpu_max_proce
sses\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100,\n\'max_size\':800\n}]\n},\n\n\'alpr\': {\n\'general\':{\n\'same_model_sequence_strategy\': \'first\',\n\'
pre_existing_labels\':[\'car\', \'motorbike\', \'bus\', \'truck\', \'boat\'],\n\'pattern\': \'.*\'\n\n},\n\'sequence\': [{\n\'alpr_api_type\': \'cloud\',\n\'alpr_service\': \'plate_recognizer\',\n\'alp
r_key\': \'"your_plate_recognizer_api_key"\',\n\'platrec_stats\': \'yes\',\n\'platerec_min_dscore\': 0.1,\n\'platerec_min_score\': 0.2,\n\'max_size\':1600\n}]\n}\n}', 'stream_sequence': "{\n'frame_stra
tegy': 'most_models',\n'frame_set': 'snapshot,alarm',\n'resize':800\n\n}", 'object_detection_pattern': '.*', 'object_framework': 'opencv', 'object_processor': 'gpu', 'object_config': '/var/lib/zmeventn
otification/models/tinyyolov4/yolov4-tiny.cfg', 'object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights', 'object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/
coco.names', 'object_min_confidence': 0.3, 'face_detection_pattern': '.*', 'face_detection_framework': 'dlib', 'face_recognition_framework': 'dlib', 'face_processor': 'cpu', 'face_num_jitters': 1, 'fac
e_upsample_times': 1, '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_face
s', 'unknown_images_path': '/var/lib/zmeventnotification/unknown_faces', 'unknown_face_name': 'unknown face', 'save_unknown_faces': 'yes', 'save_unknown_faces_leeway_pixels': 100, 'alpr_service': 'plat
e_recognizer', 'alpr_detection_pattern': '.*', 'alpr_url': None, 'alpr_key': '"your_plate_recognizer_api_key"', 'alpr_use_after_detection_only': 'yes', 'alpr_api_type': 'cloud', 'platerec_stats': 'yes'
, 'platerec_regions': None, 'platerec_min_dscore': 0.1, 'platerec_min_score': 0.2, 'openalpr_recognize_vehicle': '0', 'openalpr_country': 'us', 'openalpr_state': None, 'openalpr_min_confidence': '0.3',
 'openalpr_cmdline_binary': 'alpr', 'openalpr_cmdline_params': '-j -d', 'openalpr_cmdline_min_confidence': 0.3, 'tpu_object_weights': '/var/lib/zmeventnotification/models/coral_edgetpu/ssd_mobilenet_v2
_coco_quant_postprocess_edgetpu.tflite', 'tpu_object_labels': '/var/lib/zmeventnotification/models/coral_edgetpu/coco_indexed.names', 'tpu_object_framework': 'coral_edgetpu', 'tpu_object_processor': 't
pu', 'tpu_min_confidence': '0.6', 'yolo4_object_weights': '/var/lib/zmeventnotification/models/yolov4/yolov4.weights', 'yolo4_object_labels': '/var/lib/zmeventnotification/models/yolov4/coco.names', 'y
olo4_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_obj
ect_framework': 'opencv', 'yolo3_object_processor': 'gpu', 'tinyyolo_object_config': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'tinyyolo_object_weights': '/var/lib/zmeventnotifi
cation/models/tinyyolov4/yolov4-tiny.weights', 'tinyyolo_object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'tinyyolo_object_framework': 'opencv', 'tinyyolo_object_processor':
 'gpu'}]
12/29/20 11:39:06 zmesdetect_m1[540] DBG2 yolo.py:35 [Semaphore: max:1, name:pyzm_uid33_gpu_lock, timeout:100]
12/29/20 11:39:06 zmesdetect_m1[540] DBG2 zm_detect.py:370 [using g.config['object_detection_pattern']=.*]
12/29/20 11:39:06 zmesdetect_m1[540] DBG1 zm_detect.py:403 [Using model: object with /var/lib/zmeventnotification/images/894-alarm.jpg]
12/29/20 11:39:06 zmesdetect_m1[540] DBG2 yolo.py:45 [Waiting for gpu lock...]
12/29/20 11:39:30 zmesdetect_m1[562] INF zm_detect.py:208 [---------| pyzm version:0.3.8, hook version:6.0.7,  ES version:6.0.7 , OpenCV version:4.4.0|------------]
12/29/20 11:39:30 zmesdetect_m1[562] DBG1 utils.py:405 [secret filename: /etc/zm/secrets.ini]
12/29/20 11:39:30 zmesdetect_m1[562] DBG2 utils.py:378 [Secret token found in config: !ZM_PORTAL]
12/29/20 11:39:30 zmesdetect_m1[562] DBG2 utils.py:378 [Secret token found in config: !ZM_USER]
12/29/20 11:39:30 zmesdetect_m1[562] DBG2 utils.py:378 [Secret token found in config: !ZM_PASSWORD]
12/29/20 11:39:30 zmesdetect_m1[562] DBG2 utils.py:378 [Secret token found in config: !ZM_API_PORTAL]
12/29/20 11:39:30 zmesdetect_m1[562] DBG2 utils.py:378 [Secret token found in config: !ML_USER]
12/29/20 11:39:30 zmesdetect_m1[562] DBG2 utils.py:378 [Secret token found in config: !ML_PASSWORD]
12/29/20 11:39:30 zmesdetect_m1[562] DBG2 utils.py:378 [Secret token found in config: !PLATEREC_ALPR_KEY]
12/29/20 11:39:30 zmesdetect_m1[562] DBG1 utils.py:440 [allowing self-signed certs to work...]
12/29/20 11:39:30 zmesdetect_m1[562] DBG4 utils.py:450 [Now checking for monitor overrides]
12/29/20 11:39:30 zmesdetect_m1[562] DBG4 utils.py:513 [Finally, doing parameter substitution]
12/29/20 11:39:30 zmesdetect_m1[562] INF zm_detect.py:234 [Importing local classes for Object/Face]
12/29/20 11:39:30 zmesdetect_m1[562] DBG1 utils.py:280 [Trying to download http://localhost/zm/index.php?view=image&eid=895&fid=alarm&username=admin&password=*****]
12/29/20 11:39:31 zmesdetect_m1[562] DBG1 utils.py:299 [Trying to download http://localhost/zm/index.php?view=image&eid=895&fid=snapshot&username=admin&password=*****]
12/29/20 11:39:31 zmesdetect_m1[562] DBG1 zm_detect.py:295 [No polygon area specfied, so adding a full image polygon:[{'name': 'full_image', 'value': [(0, 0), (1280, 0), (1280, 720), (0, 720)], 'patter
n': None}]]
12/29/20 11:39:31 zmesdetect_m1[562] DBG1 zm_detect.py:298 [resizing to 800 before analysis...]
12/29/20 11:39:31 zmesdetect_m1[562] DBG2 utils.py:138 [resized polygons x=0.625/y=0.625: [{'name': 'full_image', 'value': [(0, 0), (800, 0), (800, 450), (0, 450)], 'pattern': None}]]
12/29/20 11:39:31 zmesdetect_m1[562] DBG1 zm_detect.py:319 [User ALPR if vehicle found: False]
12/29/20 11:39:31 zmesdetect_m1[562] DBG4 yolo.py:26 [Yolo init params: {'pyzm_overrides': {'log_level_debug': 5}, 'secrets': '/etc/zm/secrets.ini', 'version': '1.2', 'cpu_max_processes': 3, 'gpu_max_p
rocesses': 1, 'tpu_max_processes': 1, 'cpu_max_lock_wait': 100, 'gpu_max_lock_wait': 100, 'tpu_max_lock_wait': 100, 'base_data_path': '/var/lib/zmeventnotification', 'portal': 'http://localhost/zm', 'a
pi_portal': 'http://localhost/zm/api', 'user': 'admin', 'password': 'plexnchi11', 'basic_user': '', 'basic_password': '', 'image_path': '/var/lib/zmeventnotification/images', 'match_past_detections': '
no', 'past_det_max_diff_area': '5%', 'max_detection_size': '90%', 'frame_id': 'bestmatch', 'bestmatch_order': 'a,s', 'wait': '0', 'resize': '800', 'delete_after_analyze': 'yes', 'show_percent': 'yes', 
'allow_self_signed': 'yes', 'write_image_to_zm': 'yes', 'write_debug_image': 'no', 'detection_sequence': ['object'], 'detection_mode': 'all', 'import_zm_zones': 'no', 'only_triggered_zm_zones': 'no', '
poly_color': (255, 255, 255), 'poly_thickness': 2, 'create_animation': 'no', 'animation_types': "'mp4,gif'", 'animation_width': 640, 'animation_retry_sleep': 15, 'animation_max_tries': 4, 'fast_gif': '
no', 'ml_gateway': None, 'ml_fallback_local': 'no', 'ml_user': '"your_mlapi_user"', 'ml_password': '"your_mlapi_password"', 'use_sequence': 'yes', 'ml_sequence': '{\n\'general\': {\n\'model_sequence\':
 \'object\',\n\n},\n\'object\': {\n\'general\':{\n\'pattern\':\'.*\',\n\'same_model_sequence_strategy\': \'first\' # also \'most\', \'most_unique\'s\n},\n\'sequence\': [{\n\'object_config\':\'/var/lib/
zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg\',\n\'object_weights\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights\',\n\'object_labels\': \'/var/lib/zmeventnotification/m
odels/tinyyolov4/coco.names\',\n\'object_min_confidence\': 0.3,\n\'object_framework\':\'opencv\',\n\'object_processor\': \'gpu\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_proc
esses\': 3,\n\'cpu_max_lock_wait\': 100\n}]\n},\n\'face\': {\n\'general\':{\n\'pattern\': \'.*\',\n\'same_model_sequence_strategy\': \'first\'\n},\n\'sequence\': [{\n\'save_unknown_faces\':\'yes\',\n\'
save_unknown_faces_leeway_pixels\':100,\n\'face_detection_framework\': \'dlib\',\n\'known_images_path\': \'/var/lib/zmeventnotification/known_faces\',\n\'unknown_images_path\': \'/var/lib/zmeventnotifi
cation/unknown_faces\',\n\'face_model\': \'cnn\',\n\'face_train_model\': \'cnn\',\n\'face_recog_dist_threshold\': \'0.6\',\n\'face_num_jitters\': \'1\',\n\'face_upsample_times\':\'1\',\n\'gpu_max_proce
sses\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100,\n\'max_size\':800\n}]\n},\n\n\'alpr\': {\n\'general\':{\n\'same_model_sequence_strategy\': \'first\',\n\'
pre_existing_labels\':[\'car\', \'motorbike\', \'bus\', \'truck\', \'boat\'],\n\'pattern\': \'.*\'\n\n},\n\'sequence\': [{\n\'alpr_api_type\': \'cloud\',\n\'alpr_service\': \'plate_recognizer\',\n\'alp
r_key\': \'"your_plate_recognizer_api_key"\',\n\'platrec_stats\': \'yes\',\n\'platerec_min_dscore\': 0.1,\n\'platerec_min_score\': 0.2,\n\'max_size\':1600\n}]\n}\n}', 'stream_sequence': "{\n'frame_stra
tegy': 'most_models',\n'frame_set': 'snapshot,alarm',\n'resize':800\n\n}", 'object_detection_pattern': '.*', 'object_framework': 'opencv', 'object_processor': 'gpu', 'object_config': '/var/lib/zmeventn
otification/models/tinyyolov4/yolov4-tiny.cfg', 'object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights', 'object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/
coco.names', 'object_min_confidence': 0.3, 'face_detection_pattern': '.*', 'face_detection_framework': 'dlib', 'face_recognition_framework': 'dlib', 'face_processor': 'cpu', 'face_num_jitters': 1, 'fac
e_upsample_times': 1, '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_face
s', 'unknown_images_path': '/var/lib/zmeventnotification/unknown_faces', 'unknown_face_name': 'unknown face', 'save_unknown_faces': 'yes', 'save_unknown_faces_leeway_pixels': 100, 'alpr_service': 'plat
e_recognizer', 'alpr_detection_pattern': '.*', 'alpr_url': None, 'alpr_key': '"your_plate_recognizer_api_key"', 'alpr_use_after_detection_only': 'yes', 'alpr_api_type': 'cloud', 'platerec_stats': 'yes'
, 'platerec_regions': None, 'platerec_min_dscore': 0.1, 'platerec_min_score': 0.2, 'openalpr_recognize_vehicle': '0', 'openalpr_country': 'us', 'openalpr_state': None, 'openalpr_min_confidence': '0.3',
 'openalpr_cmdline_binary': 'alpr', 'openalpr_cmdline_params': '-j -d', 'openalpr_cmdline_min_confidence': 0.3, 'tpu_object_weights': '/var/lib/zmeventnotification/models/coral_edgetpu/ssd_mobilenet_v2
_coco_quant_postprocess_edgetpu.tflite', 'tpu_object_labels': '/var/lib/zmeventnotification/models/coral_edgetpu/coco_indexed.names', 'tpu_object_framework': 'coral_edgetpu', 'tpu_object_processor': 't
pu', 'tpu_min_confidence': '0.6', 'yolo4_object_weights': '/var/lib/zmeventnotification/models/yolov4/yolov4.weights', 'yolo4_object_labels': '/var/lib/zmeventnotification/models/yolov4/coco.names', 'y
olo4_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_obj
ect_framework': 'opencv', 'yolo3_object_processor': 'gpu', 'tinyyolo_object_config': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'tinyyolo_object_weights': '/var/lib/zmeventnotifi
cation/models/tinyyolov4/yolov4-tiny.weights', 'tinyyolo_object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'tinyyolo_object_framework': 'opencv', 'tinyyolo_object_processor':
 'gpu'}]
12/29/20 11:39:31 zmesdetect_m1[562] DBG2 yolo.py:35 [Semaphore: max:1, name:pyzm_uid33_gpu_lock, timeout:100]
12/29/20 11:39:31 zmesdetect_m1[562] DBG2 zm_detect.py:370 [using g.config['object_detection_pattern']=.*]
12/29/20 11:39:31 zmesdetect_m1[562] DBG1 zm_detect.py:403 [Using model: object with /var/lib/zmeventnotification/images/895-alarm.jpg]
12/29/20 11:39:31 zmesdetect_m1[562] DBG2 yolo.py:45 [Waiting for gpu lock...]
12/29/20 11:39:40 zmesdetect_m1[604] INF zm_detect.py:208 [---------| pyzm version:0.3.8, hook version:6.0.7,  ES version:6.0.7 , OpenCV version:4.4.0|------------]
12/29/20 11:39:41 zmesdetect_m1[604] DBG1 utils.py:405 [secret filename: /etc/zm/secrets.ini]
12/29/20 11:39:41 zmesdetect_m1[604] DBG2 utils.py:378 [Secret token found in config: !ZM_PORTAL]
12/29/20 11:39:41 zmesdetect_m1[604] DBG2 utils.py:378 [Secret token found in config: !ZM_USER]
12/29/20 11:39:41 zmesdetect_m1[604] DBG2 utils.py:378 [Secret token found in config: !ZM_PASSWORD]
12/29/20 11:39:41 zmesdetect_m1[604] DBG2 utils.py:378 [Secret token found in config: !ZM_API_PORTAL]
12/29/20 11:39:41 zmesdetect_m1[604] DBG2 utils.py:378 [Secret token found in config: !ML_USER]
12/29/20 11:39:41 zmesdetect_m1[604] DBG2 utils.py:378 [Secret token found in config: !ML_PASSWORD]
12/29/20 11:39:41 zmesdetect_m1[604] DBG2 utils.py:378 [Secret token found in config: !PLATEREC_ALPR_KEY]
12/29/20 11:39:41 zmesdetect_m1[604] DBG1 utils.py:440 [allowing self-signed certs to work...]
12/29/20 11:39:41 zmesdetect_m1[604] DBG4 utils.py:450 [Now checking for monitor overrides]
12/29/20 11:39:41 zmesdetect_m1[604] DBG4 utils.py:513 [Finally, doing parameter substitution]
12/29/20 11:39:41 zmesdetect_m1[604] INF zm_detect.py:234 [Importing local classes for Object/Face]
12/29/20 11:39:41 zmesdetect_m1[604] DBG1 utils.py:280 [Trying to download http://localhost/zm/index.php?view=image&eid=896&fid=alarm&username=admin&password=*****]
12/29/20 11:39:41 zmesdetect_m1[604] DBG1 utils.py:299 [Trying to download http://localhost/zm/index.php?view=image&eid=896&fid=snapshot&username=admin&password=*****]
12/29/20 11:39:41 zmesdetect_m1[604] DBG1 zm_detect.py:295 [No polygon area specfied, so adding a full image polygon:[{'name': 'full_image', 'value': [(0, 0), (1280, 0), (1280, 720), (0, 720)], 'patter
n': None}]]
12/29/20 11:39:41 zmesdetect_m1[604] DBG1 zm_detect.py:298 [resizing to 800 before analysis...]
12/29/20 11:39:41 zmesdetect_m1[604] DBG2 utils.py:138 [resized polygons x=0.625/y=0.625: [{'name': 'full_image', 'value': [(0, 0), (800, 0), (800, 450), (0, 450)], 'pattern': None}]]
12/29/20 11:39:41 zmesdetect_m1[604] DBG1 zm_detect.py:319 [User ALPR if vehicle found: False]
12/29/20 11:39:41 zmesdetect_m1[604] DBG4 yolo.py:26 [Yolo init params: {'pyzm_overrides': {'log_level_debug': 5}, 'secrets': '/etc/zm/secrets.ini', 'version': '1.2', 'cpu_max_processes': 3, 'gpu_max_p
rocesses': 1, 'tpu_max_processes': 1, 'cpu_max_lock_wait': 100, 'gpu_max_lock_wait': 100, 'tpu_max_lock_wait': 100, 'base_data_path': '/var/lib/zmeventnotification', 'portal': 'http://localhost/zm', 'a
pi_portal': 'http://localhost/zm/api', 'user': 'admin', 'password': 'plexnchi11', 'basic_user': '', 'basic_password': '', 'image_path': '/var/lib/zmeventnotification/images', 'match_past_detections': '
no', 'past_det_max_diff_area': '5%', 'max_detection_size': '90%', 'frame_id': 'bestmatch', 'bestmatch_order': 'a,s', 'wait': '0', 'resize': '800', 'delete_after_analyze': 'yes', 'show_percent': 'yes', 
'allow_self_signed': 'yes', 'write_image_to_zm': 'yes', 'write_debug_image': 'no', 'detection_sequence': ['object'], 'detection_mode': 'all', 'import_zm_zones': 'no', 'only_triggered_zm_zones': 'no', '
poly_color': (255, 255, 255), 'poly_thickness': 2, 'create_animation': 'no', 'animation_types': "'mp4,gif'", 'animation_width': 640, 'animation_retry_sleep': 15, 'animation_max_tries': 4, 'fast_gif': '
no', 'ml_gateway': None, 'ml_fallback_local': 'no', 'ml_user': '"your_mlapi_user"', 'ml_password': '"your_mlapi_password"', 'use_sequence': 'yes', 'ml_sequence': '{\n\'general\': {\n\'model_sequence\':
 \'object\',\n\n},\n\'object\': {\n\'general\':{\n\'pattern\':\'.*\',\n\'same_model_sequence_strategy\': \'first\' # also \'most\', \'most_unique\'s\n},\n\'sequence\': [{\n\'object_config\':\'/var/lib/
zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg\',\n\'object_weights\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights\',\n\'object_labels\': \'/var/lib/zmeventnotification/m
odels/tinyyolov4/coco.names\',\n\'object_min_confidence\': 0.3,\n\'object_framework\':\'opencv\',\n\'object_processor\': \'gpu\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_proc
esses\': 3,\n\'cpu_max_lock_wait\': 100\n}]\n},\n\'face\': {\n\'general\':{\n\'pattern\': \'.*\',\n\'same_model_sequence_strategy\': \'first\'\n},\n\'sequence\': [{\n\'save_unknown_faces\':\'yes\',\n\'
save_unknown_faces_leeway_pixels\':100,\n\'face_detection_framework\': \'dlib\',\n\'known_images_path\': \'/var/lib/zmeventnotification/known_faces\',\n\'unknown_images_path\': \'/var/lib/zmeventnotifi
cation/unknown_faces\',\n\'face_model\': \'cnn\',\n\'face_train_model\': \'cnn\',\n\'face_recog_dist_threshold\': \'0.6\',\n\'face_num_jitters\': \'1\',\n\'face_upsample_times\':\'1\',\n\'gpu_max_proce
sses\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100,\n\'max_size\':800\n}]\n},\n\n\'alpr\': {\n\'general\':{\n\'same_model_sequence_strategy\': \'first\',\n\'
pre_existing_labels\':[\'car\', \'motorbike\', \'bus\', \'truck\', \'boat\'],\n\'pattern\': \'.*\'\n\n},\n\'sequence\': [{\n\'alpr_api_type\': \'cloud\',\n\'alpr_service\': \'plate_recognizer\',\n\'alp
r_key\': \'"your_plate_recognizer_api_key"\',\n\'platrec_stats\': \'yes\',\n\'platerec_min_dscore\': 0.1,\n\'platerec_min_score\': 0.2,\n\'max_size\':1600\n}]\n}\n}', 'stream_sequence': "{\n'frame_stra
tegy': 'most_models',\n'frame_set': 'snapshot,alarm',\n'resize':800\n\n}", 'object_detection_pattern': '.*', 'object_framework': 'opencv', 'object_processor': 'gpu', 'object_config': '/var/lib/zmeventn
otification/models/tinyyolov4/yolov4-tiny.cfg', 'object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights', 'object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/
coco.names', 'object_min_confidence': 0.3, 'face_detection_pattern': '.*', 'face_detection_framework': 'dlib', 'face_recognition_framework': 'dlib', 'face_processor': 'cpu', 'face_num_jitters': 1, 'fac
e_upsample_times': 1, '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_face
s', 'unknown_images_path': '/var/lib/zmeventnotification/unknown_faces', 'unknown_face_name': 'unknown face', 'save_unknown_faces': 'yes', 'save_unknown_faces_leeway_pixels': 100, 'alpr_service': 'plat
e_recognizer', 'alpr_detection_pattern': '.*', 'alpr_url': None, 'alpr_key': '"your_plate_recognizer_api_key"', 'alpr_use_after_detection_only': 'yes', 'alpr_api_type': 'cloud', 'platerec_stats': 'yes'
, 'platerec_regions': None, 'platerec_min_dscore': 0.1, 'platerec_min_score': 0.2, 'openalpr_recognize_vehicle': '0', 'openalpr_country': 'us', 'openalpr_state': None, 'openalpr_min_confidence': '0.3',
 'openalpr_cmdline_binary': 'alpr', 'openalpr_cmdline_params': '-j -d', 'openalpr_cmdline_min_confidence': 0.3, 'tpu_object_weights': '/var/lib/zmeventnotification/models/coral_edgetpu/ssd_mobilenet_v2
_coco_quant_postprocess_edgetpu.tflite', 'tpu_object_labels': '/var/lib/zmeventnotification/models/coral_edgetpu/coco_indexed.names', 'tpu_object_framework': 'coral_edgetpu', 'tpu_object_processor': 't
pu', 'tpu_min_confidence': '0.6', 'yolo4_object_weights': '/var/lib/zmeventnotification/models/yolov4/yolov4.weights', 'yolo4_object_labels': '/var/lib/zmeventnotification/models/yolov4/coco.names', 'y
olo4_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_obj
ect_framework': 'opencv', 'yolo3_object_processor': 'gpu', 'tinyyolo_object_config': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'tinyyolo_object_weights': '/var/lib/zmeventnotifi
cation/models/tinyyolov4/yolov4-tiny.weights', 'tinyyolo_object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'tinyyolo_object_framework': 'opencv', 'tinyyolo_object_processor':
 'gpu'}]
12/29/20 11:39:41 zmesdetect_m1[604] DBG2 yolo.py:35 [Semaphore: max:1, name:pyzm_uid33_gpu_lock, timeout:100]
12/29/20 11:39:41 zmesdetect_m1[604] DBG2 zm_detect.py:370 [using g.config['object_detection_pattern']=.*]
12/29/20 11:39:41 zmesdetect_m1[604] DBG1 zm_detect.py:403 [Using model: object with /var/lib/zmeventnotification/images/896-alarm.jpg]
12/29/20 11:39:41 zmesdetect_m1[604] DBG2 yolo.py:45 [Waiting for gpu lock...]
12/29/20 11:39:51 zmesdetect_m1[462] ERR yolo.py:51 [Timeout waiting for gpu lock for 100 seconds]
12/29/20 11:39:51 zmesdetect_m1[462] FAT zm_detect.py:860 [Unrecoverable error:Timeout waiting for gpu lock for 100 seconds Traceback:Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/yolo.py", line 46, in acquire_lock
    self.lock.acquire()
  File "/usr/local/lib/python3.6/dist-packages/portalocker/utils.py", line 343, in acquire
    raise exceptions.AlreadyLocked()
portalocker.exceptions.AlreadyLocked

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 857, in <module>
    main_handler()
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 432, in main_handler
    b, l, c = m.detect(original_image)
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/object.py", line 54, in detect
    b,l,c = self.model.detect(image)
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/yolo.py", line 128, in detect
    self.acquire_lock()
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/yolo.py", line 52, in acquire_lock
    raise ValueError ('Timeout waiting for {} lock for {} seconds'.format(self.processor, self.lock_timeout))
ValueError: Timeout waiting for gpu lock for 100 seconds
]

**CUDA Devices***

Found 1 device(s).
Device: 0
  Name: NVIDIA Tegra X1
  Compute Capability: 5.3
  Multiprocessors: 1
  CUDA Cores: 128
  Concurrent threads: 2048
  GPU clock: 921.6 MHz
  Memory clock: 1600 MHz
  Total Memory: 3961 MiB
  Free Memory: 1041 MiB

OpenCV Configuration

General configuration for OpenCV 4.4.0 =====================================
  Version control:               4.4.0

  Extra modules:
    Location (extra):            /opencv-build/build/opencv_contrib-4.4.0/modules
    Version control (extra):     unknown

  Platform:
    Timestamp:                   2020-07-24T23:54:38Z
    Host:                        Linux 4.9.140-tegra aarch64
    CMake:                       3.10.2
    CMake generator:             Unix Makefiles
    CMake build tool:            /usr/bin/make
    Configuration:               RELEASE

  CPU/HW features:
    Baseline:
      requested:                 NEON FP16
      disabled:                  VFPV3 NEON

  C/C++:
    Built as dynamic libs?:      YES
    C++ standard:                11
    C++ Compiler:                /usr/bin/c++  (ver 7.5.0)
    C++ flags (Release):         -fsigned-char -ffast-math -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
    C++ flags (Debug):           -fsigned-char -ffast-math -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
    C Compiler:                  /usr/bin/cc
    C flags (Release):           -fsigned-char -ffast-math -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
    C flags (Debug):             -fsigned-char -ffast-math -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
    Linker flags (Release):      -Wl,--gc-sections -Wl,--as-needed  
    Linker flags (Debug):        -Wl,--gc-sections -Wl,--as-needed  
    ccache:                      YES
    Precompiled headers:         NO
    Extra dependencies:          m pthread cudart_static -lpthread dl rt nppc nppial nppicc nppicom nppidei nppif nppig nppim nppist nppisu nppitc npps cublas cudnn cufft -L/usr/local/cuda/lib64 -L/usr/lib/aarch64-linux-gnu
    3rdparty dependencies:

  OpenCV modules:
    To be built:                 alphamat aruco bgsegm bioinspired calib3d ccalib core cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev datasets dnn dnn_objdetect dnn_superres dpm face features2d flann freetype fuzzy gapi hfs highgui img_hash imgcodecs imgproc intensity_transform line_descriptor ml objdetect optflow phase_unwrapping photo plot python3 quality rapid reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab xfeatures2d ximgproc xobjdetect xphoto
    Disabled:                    world
    Disabled by dependency:      -
    Unavailable:                 cnn_3dobj cvv hdf java js julia matlab ovis python2 sfm viz
    Applications:                perf_tests apps
    Documentation:               NO
    Non-free algorithms:         NO

  GUI: 
    GTK+:                        YES (ver 3.22.30)
      GThread :                  YES (ver 2.56.4)
      GtkGlExt:                  NO
    VTK support:                 NO

  Media I/O: 
    ZLib:                        /usr/lib/aarch64-linux-gnu/libz.so (ver 1.2.11)
    JPEG:                        /usr/lib/aarch64-linux-gnu/libjpeg.so (ver 80)
    WEBP:                        build (ver encoder: 0x020f)
    PNG:                         /usr/lib/aarch64-linux-gnu/libpng.so (ver 1.6.34)
    TIFF:                        /usr/lib/aarch64-linux-gnu/libtiff.so (ver 42 / 4.0.9)
    JPEG 2000:                   build Jasper (ver 1.900.1)
    OpenEXR:                     build (ver 2.3.0)
    HDR:                         YES
    SUNRASTER:                   YES
    PXM:                         YES
    PFM:                         YES

  Video I/O:
    DC1394:                      NO
    FFMPEG:                      YES
      avcodec:                   YES (57.107.100)
      avformat:                  YES (57.83.100)
      avutil:                    YES (55.78.100)
      swscale:                   YES (4.8.100)
      avresample:                NO
    GStreamer:                   YES (1.14.5)
    v4l/v4l2:                    YES (linux/videodev2.h)

  Parallel framework:            pthreads

  Trace:                         YES (with Intel ITT)

  Other third-party libraries:
    Lapack:                      NO
    Eigen:                       YES (ver 3.3.4)
    Custom HAL:                  NO
    Protobuf:                    build (3.5.1)

  NVIDIA CUDA:                   YES (ver 10.0, CUFFT CUBLAS FAST_MATH)
    NVIDIA GPU arch:             53 62 72
    NVIDIA PTX archs:

  cuDNN:                         YES (ver 7.6.3)

  OpenCL:                        YES (no extra features)
    Include path:                /opencv-build/build/opencv-4.4.0/3rdparty/include/opencl/1.2
    Link libraries:              Dynamic load

  Python 3:
    Interpreter:                 /usr/bin/python3 (ver 3.6.9)
    Libraries:                   /usr/lib/aarch64-linux-gnu/libpython3.6m.so (ver 3.6.9)
    numpy:                       /usr/local/lib/python3.6/dist-packages/numpy/core/include (ver 1.18.1)
    install path:                /usr/local/lib/python3.6/dist-packages/cv2/python-3.6

  Python (for build):            /usr/bin/python3

  Java:                          
    ant:                         NO
    JNI:                         NO
    Java wrappers:               NO
    Java tests:                  NO

  Install to:                    /usr
-----------------------------------------------------------------

Thanks!

pliablepixels commented 3 years ago

Yes, it is very likely related to the crash, but its a little surprising, as the lock should be released if the process exits.

  1. I'd recommend you update to the latest versions (including pyzm 0.3.11)
  2. Stop all ES processes
  3. Remove /tmp/pyzm*
  4. Try again
klutchell commented 3 years ago

Thanks for the suggestions, I moved to the latest commit, stopped ES processes and removed the lock file.

As usual it seemed to be working for a few minutes, but after some successful detections it became stuck again. New logs are below but they haven't changed much.

As part of this I noticed that /tmp in my container isn't a true tmpfs so I may fix that on my next push to make sure /tmp is empty on container restart. However even after removing the lock file manually it reappeared when I started ES and the detection became stuck again.

12/29/20 17:04:44 zmesdetect_m2[2221] INF zm_detect.py:208 [---------| pyzm version:0.3.11, hook version:6.0.7,  ES version:6.0.7 , OpenCV version:4.4.0|------------]
12/29/20 17:04:44 zmesdetect_m2[2221] DBG1 utils.py:405 [secret filename: /etc/zm/secrets.ini]
12/29/20 17:04:44 zmesdetect_m2[2221] DBG2 utils.py:378 [Secret token found in config: !ZM_PORTAL]
12/29/20 17:04:44 zmesdetect_m2[2221] DBG2 utils.py:378 [Secret token found in config: !ZM_USER]
12/29/20 17:04:44 zmesdetect_m2[2221] DBG2 utils.py:378 [Secret token found in config: !ZM_PASSWORD]
12/29/20 17:04:44 zmesdetect_m2[2221] DBG2 utils.py:378 [Secret token found in config: !ZM_API_PORTAL]
12/29/20 17:04:44 zmesdetect_m2[2221] DBG2 utils.py:378 [Secret token found in config: !ML_USER]
12/29/20 17:04:44 zmesdetect_m2[2221] DBG2 utils.py:378 [Secret token found in config: !ML_PASSWORD]
12/29/20 17:04:44 zmesdetect_m2[2221] DBG2 utils.py:378 [Secret token found in config: !PLATEREC_ALPR_KEY]
12/29/20 17:04:44 zmesdetect_m2[2221] DBG1 utils.py:440 [allowing self-signed certs to work...]
12/29/20 17:04:44 zmesdetect_m2[2221] DBG4 utils.py:450 [Now checking for monitor overrides]
12/29/20 17:04:44 zmesdetect_m2[2221] DBG4 utils.py:513 [Finally, doing parameter substitution]
12/29/20 17:04:44 zmesdetect_m2[2221] INF zm_detect.py:234 [Importing local classes for Object/Face]
12/29/20 17:04:44 zmesdetect_m2[2221] DBG1 utils.py:280 [Trying to download http://localhost/zm/index.php?view=image&eid=1146&fid=alarm&username=admin&password=*****]
12/29/20 17:04:44 zmesdetect_m2[2221] DBG1 utils.py:299 [Trying to download http://localhost/zm/index.php?view=image&eid=1146&fid=snapshot&username=admin&password=*****]
12/29/20 17:04:44 zmesdetect_m2[2221] DBG1 zm_detect.py:295 [No polygon area specfied, so adding a full image polygon:[{'name': 'full_image', 'value': [(0, 0), (1280, 0), (1280, 720), (0, 720)], 'pattern': None}]]
12/29/20 17:04:44 zmesdetect_m2[2221] DBG1 zm_detect.py:298 [resizing to 800 before analysis...]
12/29/20 17:04:44 zmesdetect_m2[2221] DBG2 utils.py:138 [resized polygons x=0.625/y=0.625: [{'name': 'full_image', 'value': [(0, 0), (800, 0), (800, 450), (0, 450)], 'pattern': None}]]
12/29/20 17:04:44 zmesdetect_m2[2221] DBG1 zm_detect.py:319 [User ALPR if vehicle found: False]
12/29/20 17:04:44 zmesdetect_m2[2221] DBG4 yolo.py:26 [Yolo init params: {'pyzm_overrides': {'log_level_debug': 5}, 'secrets': '/etc/zm/secrets.ini', 'version': '1.2', 'cpu_max_processes': 3, 'gpu_max_processes': 1, 'tpu_max_processes': 1, 'cpu_max_lock_wait': 100, 'gpu_max_lock_wait': 600, 'tpu_max_lock_wait': 100,
 'base_data_path': '/var/lib/zmeventnotification', 'portal': 'http://localhost/zm', 'api_portal': 'http://localhost/zm/api', 'user': 'admin', 'password': 'plexnchi11', 'basic_user': '', 'basic_password': '', 'image_path': '/var/lib/zmeventnotification/images', 'match_past_detections': 'no', 'past_det_max_diff_area':
 '5%', 'max_detection_size': '90%', 'frame_id': 'bestmatch', 'bestmatch_order': 'a,s', 'wait': '0', 'resize': '800', 'delete_after_analyze': 'yes', 'show_percent': 'yes', 'allow_self_signed': 'yes', 'write_image_to_zm': 'yes', 'write_debug_image': 'no', 'detection_sequence': ['object'], 'detection_mode': 'all', 'imp
ort_zm_zones': 'no', 'only_triggered_zm_zones': 'no', 'poly_color': (255, 255, 255), 'poly_thickness': 2, 'create_animation': 'no', 'animation_types': "'mp4,gif'", 'animation_width': 640, 'animation_retry_sleep': 15, 'animation_max_tries': 4, 'fast_gif': 'no', 'ml_gateway': None, 'ml_fallback_local': 'no', 'ml_user'
: '"your_mlapi_user"', 'ml_password': '"your_mlapi_password"', 'use_sequence': 'yes', 'ml_sequence': '{\n\'general\': {\n\'model_sequence\': \'object\',\n\n},\n\'object\': {\n\'general\':{\n\'pattern\':\'.*\',\n\'same_model_sequence_strategy\': \'first\' # also \'most\', \'most_unique\'s\n},\n\'sequence\': [{\n\'obj
ect_config\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg\',\n\'object_weights\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights\',\n\'object_labels\': \'/var/lib/zmeventnotification/models/tinyyolov4/coco.names\',\n\'object_min_confidence\': 0.3,\n\'object_framework\':\'open
cv\',\n\'object_processor\': \'gpu\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 600,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100\n}]\n},\n\'face\': {\n\'general\':{\n\'pattern\': \'.*\',\n\'same_model_sequence_strategy\': \'first\'\n},\n\'sequence\': [{\n\'save_unknown_faces\':\'yes\',\n\'save_un
known_faces_leeway_pixels\':100,\n\'face_detection_framework\': \'dlib\',\n\'known_images_path\': \'/var/lib/zmeventnotification/known_faces\',\n\'unknown_images_path\': \'/var/lib/zmeventnotification/unknown_faces\',\n\'face_model\': \'cnn\',\n\'face_train_model\': \'cnn\',\n\'face_recog_dist_threshold\': \'0.6\',\
n\'face_num_jitters\': \'1\',\n\'face_upsample_times\':\'1\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 600,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100,\n\'max_size\':800\n}]\n},\n\n\'alpr\': {\n\'general\':{\n\'same_model_sequence_strategy\': \'first\',\n\'pre_existing_labels\':[\'car\', \'moto
rbike\', \'bus\', \'truck\', \'boat\'],\n\'pattern\': \'.*\'\n\n},\n\'sequence\': [{\n\'alpr_api_type\': \'cloud\',\n\'alpr_service\': \'plate_recognizer\',\n\'alpr_key\': \'"your_plate_recognizer_api_key"\',\n\'platrec_stats\': \'yes\',\n\'platerec_min_dscore\': 0.1,\n\'platerec_min_score\': 0.2,\n\'max_size\':1600
\n}]\n}\n}', 'stream_sequence': "{\n'frame_strategy': 'most_models',\n'frame_set': 'snapshot,alarm',\n'resize':800\n\n}", 'object_detection_pattern': '.*', 'object_framework': 'opencv', 'object_processor': 'gpu', 'object_config': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'object_weights': '/v
ar/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights', 'object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'object_min_confidence': 0.3, 'face_detection_pattern': '.*', 'face_detection_framework': 'dlib', 'face_recognition_framework': 'dlib', 'face_processor': 'cpu', 'face_num_j
itters': 1, 'face_upsample_times': 1, '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': 'unkno
wn face', 'save_unknown_faces': 'yes', 'save_unknown_faces_leeway_pixels': 100, 'alpr_service': 'plate_recognizer', 'alpr_detection_pattern': '.*', 'alpr_url': None, 'alpr_key': '"your_plate_recognizer_api_key"', 'alpr_use_after_detection_only': 'yes', 'alpr_api_type': 'cloud', 'platerec_stats': 'yes', 'platerec_reg
ions': None, 'platerec_min_dscore': 0.1, 'platerec_min_score': 0.2, 'openalpr_recognize_vehicle': '0', 'openalpr_country': 'us', 'openalpr_state': None, 'openalpr_min_confidence': '0.3', 'openalpr_cmdline_binary': 'alpr', 'openalpr_cmdline_params': '-j -d', 'openalpr_cmdline_min_confidence': 0.3, 'tpu_object_weights
': '/var/lib/zmeventnotification/models/coral_edgetpu/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite', 'tpu_object_labels': '/var/lib/zmeventnotification/models/coral_edgetpu/coco_indexed.names', 'tpu_object_framework': 'coral_edgetpu', 'tpu_object_processor': 'tpu', 'tpu_min_confidence': '0.6', 'yolo4_objec
t_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_w
eights': '/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_c
onfig': '/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_pro
cessor': 'gpu'}]
12/29/20 17:04:44 zmesdetect_m2[2221] DBG2 yolo.py:35 [portalock: max:1, name:pyzm_uid33_gpu_lock, timeout:600]
12/29/20 17:04:44 zmesdetect_m2[2221] DBG2 zm_detect.py:370 [using g.config['object_detection_pattern']=.*]
12/29/20 17:04:44 zmesdetect_m2[2221] DBG1 zm_detect.py:403 [Using model: object with /var/lib/zmeventnotification/images/1146-alarm.jpg]
12/29/20 17:04:44 zmesdetect_m2[2221] DBG2 yolo.py:45 [Waiting for pyzm_uid33_gpu_lock portalock...]
12/29/20 17:04:54 zmesdetect_m2[2245] INF zm_detect.py:208 [---------| pyzm version:0.3.11, hook version:6.0.7,  ES version:6.0.7 , OpenCV version:4.4.0|------------]
12/29/20 17:04:54 zmesdetect_m2[2245] DBG1 utils.py:405 [secret filename: /etc/zm/secrets.ini]
12/29/20 17:04:54 zmesdetect_m2[2245] DBG2 utils.py:378 [Secret token found in config: !ZM_PORTAL]
12/29/20 17:04:54 zmesdetect_m2[2245] DBG2 utils.py:378 [Secret token found in config: !ZM_USER]
12/29/20 17:04:54 zmesdetect_m2[2245] DBG2 utils.py:378 [Secret token found in config: !ZM_PASSWORD]
12/29/20 17:04:54 zmesdetect_m2[2245] DBG2 utils.py:378 [Secret token found in config: !ZM_API_PORTAL]
12/29/20 17:04:54 zmesdetect_m2[2245] DBG2 utils.py:378 [Secret token found in config: !ML_USER]
12/29/20 17:04:54 zmesdetect_m2[2245] DBG2 utils.py:378 [Secret token found in config: !ML_PASSWORD]
12/29/20 17:04:54 zmesdetect_m2[2245] DBG2 utils.py:378 [Secret token found in config: !PLATEREC_ALPR_KEY]
12/29/20 17:04:54 zmesdetect_m2[2245] DBG1 utils.py:440 [allowing self-signed certs to work...]
12/29/20 17:04:54 zmesdetect_m2[2245] DBG4 utils.py:450 [Now checking for monitor overrides]
12/29/20 17:04:54 zmesdetect_m2[2245] DBG4 utils.py:513 [Finally, doing parameter substitution]
12/29/20 17:04:54 zmesdetect_m2[2245] INF zm_detect.py:234 [Importing local classes for Object/Face]
12/29/20 17:04:54 zmesdetect_m2[2245] DBG1 utils.py:280 [Trying to download http://localhost/zm/index.php?view=image&eid=1147&fid=alarm&username=admin&password=*****]
12/29/20 17:04:54 zmesdetect_m2[2245] DBG1 utils.py:299 [Trying to download http://localhost/zm/index.php?view=image&eid=1147&fid=snapshot&username=admin&password=*****]
12/29/20 17:04:54 zmesdetect_m2[2245] DBG1 zm_detect.py:295 [No polygon area specfied, so adding a full image polygon:[{'name': 'full_image', 'value': [(0, 0), (1280, 0), (1280, 720), (0, 720)], 'pattern': None}]]
12/29/20 17:04:54 zmesdetect_m2[2245] DBG1 zm_detect.py:298 [resizing to 800 before analysis...]
12/29/20 17:04:54 zmesdetect_m2[2245] DBG2 utils.py:138 [resized polygons x=0.625/y=0.625: [{'name': 'full_image', 'value': [(0, 0), (800, 0), (800, 450), (0, 450)], 'pattern': None}]]
12/29/20 17:04:54 zmesdetect_m2[2245] DBG1 zm_detect.py:319 [User ALPR if vehicle found: False]
12/29/20 17:04:54 zmesdetect_m2[2245] DBG4 yolo.py:26 [Yolo init params: {'pyzm_overrides': {'log_level_debug': 5}, 'secrets': '/etc/zm/secrets.ini', 'version': '1.2', 'cpu_max_processes': 3, 'gpu_max_processes': 1, 'tpu_max_processes': 1, 'cpu_max_lock_wait': 100, 'gpu_max_lock_wait': 600, 'tpu_max_lock_wait': 100,
 'base_data_path': '/var/lib/zmeventnotification', 'portal': 'http://localhost/zm', 'api_portal': 'http://localhost/zm/api', 'user': 'admin', 'password': 'plexnchi11', 'basic_user': '', 'basic_password': '', 'image_path': '/var/lib/zmeventnotification/images', 'match_past_detections': 'no', 'past_det_max_diff_area':
 '5%', 'max_detection_size': '90%', 'frame_id': 'bestmatch', 'bestmatch_order': 'a,s', 'wait': '0', 'resize': '800', 'delete_after_analyze': 'yes', 'show_percent': 'yes', 'allow_self_signed': 'yes', 'write_image_to_zm': 'yes', 'write_debug_image': 'no', 'detection_sequence': ['object'], 'detection_mode': 'all', 'imp
ort_zm_zones': 'no', 'only_triggered_zm_zones': 'no', 'poly_color': (255, 255, 255), 'poly_thickness': 2, 'create_animation': 'no', 'animation_types': "'mp4,gif'", 'animation_width': 640, 'animation_retry_sleep': 15, 'animation_max_tries': 4, 'fast_gif': 'no', 'ml_gateway': None, 'ml_fallback_local': 'no', 'ml_user'
: '"your_mlapi_user"', 'ml_password': '"your_mlapi_password"', 'use_sequence': 'yes', 'ml_sequence': '{\n\'general\': {\n\'model_sequence\': \'object\',\n\n},\n\'object\': {\n\'general\':{\n\'pattern\':\'.*\',\n\'same_model_sequence_strategy\': \'first\' # also \'most\', \'most_unique\'s\n},\n\'sequence\': [{\n\'obj
ect_config\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg\',\n\'object_weights\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights\',\n\'object_labels\': \'/var/lib/zmeventnotification/models/tinyyolov4/coco.names\',\n\'object_min_confidence\': 0.3,\n\'object_framework\':\'open
cv\',\n\'object_processor\': \'gpu\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 600,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100\n}]\n},\n\'face\': {\n\'general\':{\n\'pattern\': \'.*\',\n\'same_model_sequence_strategy\': \'first\'\n},\n\'sequence\': [{\n\'save_unknown_faces\':\'yes\',\n\'save_un
known_faces_leeway_pixels\':100,\n\'face_detection_framework\': \'dlib\',\n\'known_images_path\': \'/var/lib/zmeventnotification/known_faces\',\n\'unknown_images_path\': \'/var/lib/zmeventnotification/unknown_faces\',\n\'face_model\': \'cnn\',\n\'face_train_model\': \'cnn\',\n\'face_recog_dist_threshold\': \'0.6\',\
n\'face_num_jitters\': \'1\',\n\'face_upsample_times\':\'1\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 600,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100,\n\'max_size\':800\n}]\n},\n\n\'alpr\': {\n\'general\':{\n\'same_model_sequence_strategy\': \'first\',\n\'pre_existing_labels\':[\'car\', \'moto
rbike\', \'bus\', \'truck\', \'boat\'],\n\'pattern\': \'.*\'\n\n},\n\'sequence\': [{\n\'alpr_api_type\': \'cloud\',\n\'alpr_service\': \'plate_recognizer\',\n\'alpr_key\': \'"your_plate_recognizer_api_key"\',\n\'platrec_stats\': \'yes\',\n\'platerec_min_dscore\': 0.1,\n\'platerec_min_score\': 0.2,\n\'max_size\':1600
\n}]\n}\n}', 'stream_sequence': "{\n'frame_strategy': 'most_models',\n'frame_set': 'snapshot,alarm',\n'resize':800\n\n}", 'object_detection_pattern': '.*', 'object_framework': 'opencv', 'object_processor': 'gpu', 'object_config': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'object_weights': '/v
ar/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights', 'object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'object_min_confidence': 0.3, 'face_detection_pattern': '.*', 'face_detection_framework': 'dlib', 'face_recognition_framework': 'dlib', 'face_processor': 'cpu', 'face_num_j
itters': 1, 'face_upsample_times': 1, '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': 'unkno
wn face', 'save_unknown_faces': 'yes', 'save_unknown_faces_leeway_pixels': 100, 'alpr_service': 'plate_recognizer', 'alpr_detection_pattern': '.*', 'alpr_url': None, 'alpr_key': '"your_plate_recognizer_api_key"', 'alpr_use_after_detection_only': 'yes', 'alpr_api_type': 'cloud', 'platerec_stats': 'yes', 'platerec_reg
ions': None, 'platerec_min_dscore': 0.1, 'platerec_min_score': 0.2, 'openalpr_recognize_vehicle': '0', 'openalpr_country': 'us', 'openalpr_state': None, 'openalpr_min_confidence': '0.3', 'openalpr_cmdline_binary': 'alpr', 'openalpr_cmdline_params': '-j -d', 'openalpr_cmdline_min_confidence': 0.3, 'tpu_object_weights
': '/var/lib/zmeventnotification/models/coral_edgetpu/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite', 'tpu_object_labels': '/var/lib/zmeventnotification/models/coral_edgetpu/coco_indexed.names', 'tpu_object_framework': 'coral_edgetpu', 'tpu_object_processor': 'tpu', 'tpu_min_confidence': '0.6', 'yolo4_objec
t_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_w
eights': '/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_c
onfig': '/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_pro
cessor': 'gpu'}]
12/29/20 17:04:54 zmesdetect_m2[2245] DBG2 yolo.py:35 [portalock: max:1, name:pyzm_uid33_gpu_lock, timeout:600]
12/29/20 17:04:54 zmesdetect_m2[2245] DBG2 zm_detect.py:370 [using g.config['object_detection_pattern']=.*]
12/29/20 17:04:54 zmesdetect_m2[2245] DBG1 zm_detect.py:403 [Using model: object with /var/lib/zmeventnotification/images/1147-alarm.jpg]
12/29/20 17:04:54 zmesdetect_m2[2245] DBG2 yolo.py:45 [Waiting for pyzm_uid33_gpu_lock portalock...]
12/29/20 17:06:35 zmesdetect_m2[1468] ERR yolo.py:51 [Timeout waiting for pyzm_uid33_gpu_lock portalock for 600 seconds]
12/29/20 17:06:35 zmesdetect_m2[1468] FAT zm_detect.py:860 [Unrecoverable error:Timeout waiting for pyzm_uid33_gpu_lock portallock for 600 seconds Traceback:Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/yolo.py", line 46, in acquire_lock
    self.lock.acquire()
  File "/usr/local/lib/python3.6/dist-packages/portalocker/utils.py", line 343, in acquire
    raise exceptions.AlreadyLocked()
portalocker.exceptions.AlreadyLocked

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 857, in <module>
    main_handler()
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 432, in main_handler
    b, l, c = m.detect(original_image)
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/object.py", line 54, in detect
    b,l,c = self.model.detect(image)
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/yolo.py", line 129, in detect
    self.acquire_lock()
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/yolo.py", line 52, in acquire_lock
    raise ValueError ('Timeout waiting for {} portallock for {} seconds'.format(self.lock_name, self.lock_timeout))
ValueError: Timeout waiting for pyzm_uid33_gpu_lock portallock for 600 seconds
]
12/29/20 17:08:00 zmesdetect_m2[1559] ERR yolo.py:51 [Timeout waiting for pyzm_uid33_gpu_lock portalock for 600 seconds]
12/29/20 17:08:00 zmesdetect_m2[1559] FAT zm_detect.py:860 [Unrecoverable error:Timeout waiting for pyzm_uid33_gpu_lock portallock for 600 seconds Traceback:Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/yolo.py", line 46, in acquire_lock
    self.lock.acquire()
  File "/usr/local/lib/python3.6/dist-packages/portalocker/utils.py", line 343, in acquire
    raise exceptions.AlreadyLocked()
portalocker.exceptions.AlreadyLocked

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 857, in <module>
    main_handler()
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 432, in main_handler
    b, l, c = m.detect(original_image)
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/object.py", line 54, in detect
    b,l,c = self.model.detect(image)
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/yolo.py", line 129, in detect
    self.acquire_lock()
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/yolo.py", line 52, in acquire_lock
    raise ValueError ('Timeout waiting for {} portallock for {} seconds'.format(self.lock_name, self.lock_timeout))
ValueError: Timeout waiting for pyzm_uid33_gpu_lock portallock for 600 seconds
]
12/29/20 17:08:04 zmesdetect_m2[2410] INF zm_detect.py:208 [---------| pyzm version:0.3.11, hook version:6.0.7,  ES version:6.0.7 , OpenCV version:4.4.0|------------]
12/29/20 17:08:04 zmesdetect_m2[2410] DBG1 utils.py:405 [secret filename: /etc/zm/secrets.ini]
12/29/20 17:08:04 zmesdetect_m2[2410] DBG2 utils.py:378 [Secret token found in config: !ZM_PORTAL]
12/29/20 17:08:04 zmesdetect_m2[2410] DBG2 utils.py:378 [Secret token found in config: !ZM_USER]
12/29/20 17:08:04 zmesdetect_m2[2410] DBG2 utils.py:378 [Secret token found in config: !ZM_PASSWORD]
12/29/20 17:08:04 zmesdetect_m2[2410] DBG2 utils.py:378 [Secret token found in config: !ZM_API_PORTAL]
12/29/20 17:08:04 zmesdetect_m2[2410] DBG2 utils.py:378 [Secret token found in config: !ML_USER]
12/29/20 17:08:04 zmesdetect_m2[2410] DBG2 utils.py:378 [Secret token found in config: !ML_PASSWORD]
12/29/20 17:08:04 zmesdetect_m2[2410] DBG2 utils.py:378 [Secret token found in config: !PLATEREC_ALPR_KEY]
12/29/20 17:08:04 zmesdetect_m2[2410] DBG1 utils.py:440 [allowing self-signed certs to work...]
12/29/20 17:08:04 zmesdetect_m2[2410] DBG4 utils.py:450 [Now checking for monitor overrides]
12/29/20 17:08:04 zmesdetect_m2[2410] DBG4 utils.py:513 [Finally, doing parameter substitution]
12/29/20 17:08:04 zmesdetect_m2[2410] INF zm_detect.py:234 [Importing local classes for Object/Face]
12/29/20 17:08:04 zmesdetect_m2[2410] DBG1 utils.py:280 [Trying to download http://localhost/zm/index.php?view=image&eid=1148&fid=alarm&username=admin&password=*****]
12/29/20 17:08:04 zmesdetect_m2[2410] DBG1 utils.py:299 [Trying to download http://localhost/zm/index.php?view=image&eid=1148&fid=snapshot&username=admin&password=*****]
12/29/20 17:08:05 zmesdetect_m2[2410] DBG1 zm_detect.py:295 [No polygon area specfied, so adding a full image polygon:[{'name': 'full_image', 'value': [(0, 0), (1280, 0), (1280, 720), (0, 720)], 'pattern': None}]]
12/29/20 17:08:05 zmesdetect_m2[2410] DBG1 zm_detect.py:298 [resizing to 800 before analysis...]
12/29/20 17:08:05 zmesdetect_m2[2410] DBG2 utils.py:138 [resized polygons x=0.625/y=0.625: [{'name': 'full_image', 'value': [(0, 0), (800, 0), (800, 450), (0, 450)], 'pattern': None}]]
12/29/20 17:08:05 zmesdetect_m2[2410] DBG1 zm_detect.py:319 [User ALPR if vehicle found: False]
12/29/20 17:08:05 zmesdetect_m2[2410] DBG4 yolo.py:26 [Yolo init params: {'pyzm_overrides': {'log_level_debug': 5}, 'secrets': '/etc/zm/secrets.ini', 'version': '1.2', 'cpu_max_processes': 3, 'gpu_max_processes': 1, 'tpu_max_processes': 1, 'cpu_max_lock_wait': 100, 'gpu_max_lock_wait': 600, 'tpu_max_lock_wait': 100,
 'base_data_path': '/var/lib/zmeventnotification', 'portal': 'http://localhost/zm', 'api_portal': 'http://localhost/zm/api', 'user': 'admin', 'password': 'plexnchi11', 'basic_user': '', 'basic_password': '', 'image_path': '/var/lib/zmeventnotification/images', 'match_past_detections': 'no', 'past_det_max_diff_area':
 '5%', 'max_detection_size': '90%', 'frame_id': 'bestmatch', 'bestmatch_order': 'a,s', 'wait': '0', 'resize': '800', 'delete_after_analyze': 'yes', 'show_percent': 'yes', 'allow_self_signed': 'yes', 'write_image_to_zm': 'yes', 'write_debug_image': 'no', 'detection_sequence': ['object'], 'detection_mode': 'all', 'imp
ort_zm_zones': 'no', 'only_triggered_zm_zones': 'no', 'poly_color': (255, 255, 255), 'poly_thickness': 2, 'create_animation': 'no', 'animation_types': "'mp4,gif'", 'animation_width': 640, 'animation_retry_sleep': 15, 'animation_max_tries': 4, 'fast_gif': 'no', 'ml_gateway': None, 'ml_fallback_local': 'no', 'ml_user'
: '"your_mlapi_user"', 'ml_password': '"your_mlapi_password"', 'use_sequence': 'yes', 'ml_sequence': '{\n\'general\': {\n\'model_sequence\': \'object\',\n\n},\n\'object\': {\n\'general\':{\n\'pattern\':\'.*\',\n\'same_model_sequence_strategy\': \'first\' # also \'most\', \'most_unique\'s\n},\n\'sequence\': [{\n\'obj
ect_config\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg\',\n\'object_weights\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights\',\n\'object_labels\': \'/var/lib/zmeventnotification/models/tinyyolov4/coco.names\',\n\'object_min_confidence\': 0.3,\n\'object_framework\':\'open
cv\',\n\'object_processor\': \'gpu\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 600,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100\n}]\n},\n\'face\': {\n\'general\':{\n\'pattern\': \'.*\',\n\'same_model_sequence_strategy\': \'first\'\n},\n\'sequence\': [{\n\'save_unknown_faces\':\'yes\',\n\'save_un
known_faces_leeway_pixels\':100,\n\'face_detection_framework\': \'dlib\',\n\'known_images_path\': \'/var/lib/zmeventnotification/known_faces\',\n\'unknown_images_path\': \'/var/lib/zmeventnotification/unknown_faces\',\n\'face_model\': \'cnn\',\n\'face_train_model\': \'cnn\',\n\'face_recog_dist_threshold\': \'0.6\',\
n\'face_num_jitters\': \'1\',\n\'face_upsample_times\':\'1\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 600,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100,\n\'max_size\':800\n}]\n},\n\n\'alpr\': {\n\'general\':{\n\'same_model_sequence_strategy\': \'first\',\n\'pre_existing_labels\':[\'car\', \'moto
rbike\', \'bus\', \'truck\', \'boat\'],\n\'pattern\': \'.*\'\n\n},\n\'sequence\': [{\n\'alpr_api_type\': \'cloud\',\n\'alpr_service\': \'plate_recognizer\',\n\'alpr_key\': \'"your_plate_recognizer_api_key"\',\n\'platrec_stats\': \'yes\',\n\'platerec_min_dscore\': 0.1,\n\'platerec_min_score\': 0.2,\n\'max_size\':1600
\n}]\n}\n}', 'stream_sequence': "{\n'frame_strategy': 'most_models',\n'frame_set': 'snapshot,alarm',\n'resize':800\n\n}", 'object_detection_pattern': '.*', 'object_framework': 'opencv', 'object_processor': 'gpu', 'object_config': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'object_weights': '/v
ar/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights', 'object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'object_min_confidence': 0.3, 'face_detection_pattern': '.*', 'face_detection_framework': 'dlib', 'face_recognition_framework': 'dlib', 'face_processor': 'cpu', 'face_num_j
itters': 1, 'face_upsample_times': 1, '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': 'unkno
wn face', 'save_unknown_faces': 'yes', 'save_unknown_faces_leeway_pixels': 100, 'alpr_service': 'plate_recognizer', 'alpr_detection_pattern': '.*', 'alpr_url': None, 'alpr_key': '"your_plate_recognizer_api_key"', 'alpr_use_after_detection_only': 'yes', 'alpr_api_type': 'cloud', 'platerec_stats': 'yes', 'platerec_reg
ions': None, 'platerec_min_dscore': 0.1, 'platerec_min_score': 0.2, 'openalpr_recognize_vehicle': '0', 'openalpr_country': 'us', 'openalpr_state': None, 'openalpr_min_confidence': '0.3', 'openalpr_cmdline_binary': 'alpr', 'openalpr_cmdline_params': '-j -d', 'openalpr_cmdline_min_confidence': 0.3, 'tpu_object_weights
': '/var/lib/zmeventnotification/models/coral_edgetpu/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite', 'tpu_object_labels': '/var/lib/zmeventnotification/models/coral_edgetpu/coco_indexed.names', 'tpu_object_framework': 'coral_edgetpu', 'tpu_object_processor': 'tpu', 'tpu_min_confidence': '0.6', 'yolo4_objec
t_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_w
eights': '/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_c
onfig': '/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_pro
cessor': 'gpu'}]
12/29/20 17:08:05 zmesdetect_m2[2410] DBG2 yolo.py:35 [portalock: max:1, name:pyzm_uid33_gpu_lock, timeout:600]
12/29/20 17:08:05 zmesdetect_m2[2410] DBG2 zm_detect.py:370 [using g.config['object_detection_pattern']=.*]
12/29/20 17:08:05 zmesdetect_m2[2410] DBG1 zm_detect.py:403 [Using model: object with /var/lib/zmeventnotification/images/1148-alarm.jpg]
12/29/20 17:08:05 zmesdetect_m2[2410] DBG2 yolo.py:45 [Waiting for pyzm_uid33_gpu_lock portalock...]
12/29/20 17:08:15 zmesdetect_m2[1597] ERR yolo.py:51 [Timeout waiting for pyzm_uid33_gpu_lock portalock for 600 seconds]
12/29/20 17:08:15 zmesdetect_m2[1597] FAT zm_detect.py:860 [Unrecoverable error:Timeout waiting for pyzm_uid33_gpu_lock portallock for 600 seconds Traceback:Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/yolo.py", line 46, in acquire_lock
    self.lock.acquire()
  File "/usr/local/lib/python3.6/dist-packages/portalocker/utils.py", line 343, in acquire
    raise exceptions.AlreadyLocked()
portalocker.exceptions.AlreadyLocked

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 857, in <module>
    main_handler()
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 432, in main_handler
    b, l, c = m.detect(original_image)
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/object.py", line 54, in detect
    b,l,c = self.model.detect(image)
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/yolo.py", line 129, in detect
    self.acquire_lock()
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/yolo.py", line 52, in acquire_lock
    raise ValueError ('Timeout waiting for {} portallock for {} seconds'.format(self.lock_name, self.lock_timeout))
ValueError: Timeout waiting for pyzm_uid33_gpu_lock portallock for 600 seconds
]
12/29/20 17:08:24 zmesdetect_m2[2452] INF zm_detect.py:208 [---------| pyzm version:0.3.11, hook version:6.0.7,  ES version:6.0.7 , OpenCV version:4.4.0|------------]
12/29/20 17:08:24 zmesdetect_m2[2452] DBG1 utils.py:405 [secret filename: /etc/zm/secrets.ini]
12/29/20 17:08:24 zmesdetect_m2[2452] DBG2 utils.py:378 [Secret token found in config: !ZM_PORTAL]
12/29/20 17:08:24 zmesdetect_m2[2452] DBG2 utils.py:378 [Secret token found in config: !ZM_USER]
12/29/20 17:08:24 zmesdetect_m2[2452] DBG2 utils.py:378 [Secret token found in config: !ZM_PASSWORD]
12/29/20 17:08:24 zmesdetect_m2[2452] DBG2 utils.py:378 [Secret token found in config: !ZM_API_PORTAL]
12/29/20 17:08:24 zmesdetect_m2[2452] DBG2 utils.py:378 [Secret token found in config: !ML_USER]
12/29/20 17:08:24 zmesdetect_m2[2452] DBG2 utils.py:378 [Secret token found in config: !ML_PASSWORD]
12/29/20 17:08:24 zmesdetect_m2[2452] DBG2 utils.py:378 [Secret token found in config: !PLATEREC_ALPR_KEY]
12/29/20 17:08:24 zmesdetect_m2[2452] DBG1 utils.py:440 [allowing self-signed certs to work...]
12/29/20 17:08:24 zmesdetect_m2[2452] DBG4 utils.py:450 [Now checking for monitor overrides]
12/29/20 17:08:24 zmesdetect_m2[2452] DBG4 utils.py:513 [Finally, doing parameter substitution]
12/29/20 17:08:24 zmesdetect_m2[2452] INF zm_detect.py:234 [Importing local classes for Object/Face]
12/29/20 17:08:24 zmesdetect_m2[2452] DBG1 utils.py:280 [Trying to download http://localhost/zm/index.php?view=image&eid=1149&fid=alarm&username=admin&password=*****]
12/29/20 17:08:24 zmesdetect_m2[2452] DBG1 utils.py:299 [Trying to download http://localhost/zm/index.php?view=image&eid=1149&fid=snapshot&username=admin&password=*****]
12/29/20 17:08:24 zmesdetect_m2[2452] DBG1 zm_detect.py:295 [No polygon area specfied, so adding a full image polygon:[{'name': 'full_image', 'value': [(0, 0), (1280, 0), (1280, 720), (0, 720)], 'pattern': None}]]
12/29/20 17:08:24 zmesdetect_m2[2452] DBG1 zm_detect.py:298 [resizing to 800 before analysis...]
12/29/20 17:08:24 zmesdetect_m2[2452] DBG2 utils.py:138 [resized polygons x=0.625/y=0.625: [{'name': 'full_image', 'value': [(0, 0), (800, 0), (800, 450), (0, 450)], 'pattern': None}]]
12/29/20 17:08:24 zmesdetect_m2[2452] DBG1 zm_detect.py:319 [User ALPR if vehicle found: False]
12/29/20 17:08:24 zmesdetect_m2[2452] DBG4 yolo.py:26 [Yolo init params: {'pyzm_overrides': {'log_level_debug': 5}, 'secrets': '/etc/zm/secrets.ini', 'version': '1.2', 'cpu_max_processes': 3, 'gpu_max_processes': 1, 'tpu_max_processes': 1, 'cpu_max_lock_wait': 100, 'gpu_max_lock_wait': 600, 'tpu_max_lock_wait': 100,
 'base_data_path': '/var/lib/zmeventnotification', 'portal': 'http://localhost/zm', 'api_portal': 'http://localhost/zm/api', 'user': 'admin', 'password': 'plexnchi11', 'basic_user': '', 'basic_password': '', 'image_path': '/var/lib/zmeventnotification/images', 'match_past_detections': 'no', 'past_det_max_diff_area':
 '5%', 'max_detection_size': '90%', 'frame_id': 'bestmatch', 'bestmatch_order': 'a,s', 'wait': '0', 'resize': '800', 'delete_after_analyze': 'yes', 'show_percent': 'yes', 'allow_self_signed': 'yes', 'write_image_to_zm': 'yes', 'write_debug_image': 'no', 'detection_sequence': ['object'], 'detection_mode': 'all', 'imp
ort_zm_zones': 'no', 'only_triggered_zm_zones': 'no', 'poly_color': (255, 255, 255), 'poly_thickness': 2, 'create_animation': 'no', 'animation_types': "'mp4,gif'", 'animation_width': 640, 'animation_retry_sleep': 15, 'animation_max_tries': 4, 'fast_gif': 'no', 'ml_gateway': None, 'ml_fallback_local': 'no', 'ml_user'
: '"your_mlapi_user"', 'ml_password': '"your_mlapi_password"', 'use_sequence': 'yes', 'ml_sequence': '{\n\'general\': {\n\'model_sequence\': \'object\',\n\n},\n\'object\': {\n\'general\':{\n\'pattern\':\'.*\',\n\'same_model_sequence_strategy\': \'first\' # also \'most\', \'most_unique\'s\n},\n\'sequence\': [{\n\'obj
ect_config\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg\',\n\'object_weights\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights\',\n\'object_labels\': \'/var/lib/zmeventnotification/models/tinyyolov4/coco.names\',\n\'object_min_confidence\': 0.3,\n\'object_framework\':\'open
cv\',\n\'object_processor\': \'gpu\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 600,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100\n}]\n},\n\'face\': {\n\'general\':{\n\'pattern\': \'.*\',\n\'same_model_sequence_strategy\': \'first\'\n},\n\'sequence\': [{\n\'save_unknown_faces\':\'yes\',\n\'save_un
known_faces_leeway_pixels\':100,\n\'face_detection_framework\': \'dlib\',\n\'known_images_path\': \'/var/lib/zmeventnotification/known_faces\',\n\'unknown_images_path\': \'/var/lib/zmeventnotification/unknown_faces\',\n\'face_model\': \'cnn\',\n\'face_train_model\': \'cnn\',\n\'face_recog_dist_threshold\': \'0.6\',\
n\'face_num_jitters\': \'1\',\n\'face_upsample_times\':\'1\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 600,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100,\n\'max_size\':800\n}]\n},\n\n\'alpr\': {\n\'general\':{\n\'same_model_sequence_strategy\': \'first\',\n\'pre_existing_labels\':[\'car\', \'moto
rbike\', \'bus\', \'truck\', \'boat\'],\n\'pattern\': \'.*\'\n\n},\n\'sequence\': [{\n\'alpr_api_type\': \'cloud\',\n\'alpr_service\': \'plate_recognizer\',\n\'alpr_key\': \'"your_plate_recognizer_api_key"\',\n\'platrec_stats\': \'yes\',\n\'platerec_min_dscore\': 0.1,\n\'platerec_min_score\': 0.2,\n\'max_size\':1600
\n}]\n}\n}', 'stream_sequence': "{\n'frame_strategy': 'most_models',\n'frame_set': 'snapshot,alarm',\n'resize':800\n\n}", 'object_detection_pattern': '.*', 'object_framework': 'opencv', 'object_processor': 'gpu', 'object_config': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'object_weights': '/v
ar/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights', 'object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'object_min_confidence': 0.3, 'face_detection_pattern': '.*', 'face_detection_framework': 'dlib', 'face_recognition_framework': 'dlib', 'face_processor': 'cpu', 'face_num_j
itters': 1, 'face_upsample_times': 1, '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': 'unkno
wn face', 'save_unknown_faces': 'yes', 'save_unknown_faces_leeway_pixels': 100, 'alpr_service': 'plate_recognizer', 'alpr_detection_pattern': '.*', 'alpr_url': None, 'alpr_key': '"your_plate_recognizer_api_key"', 'alpr_use_after_detection_only': 'yes', 'alpr_api_type': 'cloud', 'platerec_stats': 'yes', 'platerec_reg
ions': None, 'platerec_min_dscore': 0.1, 'platerec_min_score': 0.2, 'openalpr_recognize_vehicle': '0', 'openalpr_country': 'us', 'openalpr_state': None, 'openalpr_min_confidence': '0.3', 'openalpr_cmdline_binary': 'alpr', 'openalpr_cmdline_params': '-j -d', 'openalpr_cmdline_min_confidence': 0.3, 'tpu_object_weights
': '/var/lib/zmeventnotification/models/coral_edgetpu/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite', 'tpu_object_labels': '/var/lib/zmeventnotification/models/coral_edgetpu/coco_indexed.names', 'tpu_object_framework': 'coral_edgetpu', 'tpu_object_processor': 'tpu', 'tpu_min_confidence': '0.6', 'yolo4_objec
t_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_w
eights': '/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_c
onfig': '/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_pro
cessor': 'gpu'}]
12/29/20 17:08:24 zmesdetect_m2[2452] DBG2 yolo.py:35 [portalock: max:1, name:pyzm_uid33_gpu_lock, timeout:600]
12/29/20 17:08:24 zmesdetect_m2[2452] DBG2 zm_detect.py:370 [using g.config['object_detection_pattern']=.*]
12/29/20 17:08:24 zmesdetect_m2[2452] DBG1 zm_detect.py:403 [Using model: object with /var/lib/zmeventnotification/images/1149-alarm.jpg]
12/29/20 17:08:24 zmesdetect_m2[2452] DBG2 yolo.py:45 [Waiting for pyzm_uid33_gpu_lock portalock...]
12/29/20 17:08:25 zmesdetect_m2[1616] ERR yolo.py:51 [Timeout waiting for pyzm_uid33_gpu_lock portalock for 600 seconds]
12/29/20 17:08:25 zmesdetect_m2[1616] FAT zm_detect.py:860 [Unrecoverable error:Timeout waiting for pyzm_uid33_gpu_lock portallock for 600 seconds Traceback:Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/yolo.py", line 46, in acquire_lock
    self.lock.acquire()
  File "/usr/local/lib/python3.6/dist-packages/portalocker/utils.py", line 343, in acquire
    raise exceptions.AlreadyLocked()
portalocker.exceptions.AlreadyLocked

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 857, in <module>
    main_handler()
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 432, in main_handler
    b, l, c = m.detect(original_image)
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/object.py", line 54, in detect
    b,l,c = self.model.detect(image)
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/yolo.py", line 129, in detect
    self.acquire_lock()
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/yolo.py", line 52, in acquire_lock
    raise ValueError ('Timeout waiting for {} portallock for {} seconds'.format(self.lock_name, self.lock_timeout))
ValueError: Timeout waiting for pyzm_uid33_gpu_lock portallock for 600 seconds
]
pliablepixels commented 3 years ago

Is Yolo still crashing? If so, I'd like to see logs at that point. I added code to manually release the lock.

klutchell commented 3 years ago

Yeah, I still see a couple of the CUBLAS crashes on startup, but after that it appears to have a a bunch of successful detections before the gpu lock gets stuck again. Here are the logs of the first few CUBLAS_STATUS_NOT_INITIALIZED crashes followed by some successful detections. The second set of logs is a successful detection followed by the gpu lock. I truncated the successful logs in the middle but I can start attaching entire files if it helps.

12/29/20 17:53:10 zmesdetect_m1[555] INF zm_detect.py:208 [---------| pyzm version:0.3.11, hook version:6.0.7,  ES version:6.0.7 , OpenCV version:4.4.0|------------]
12/29/20 17:53:11 zmesdetect_m1[555] DBG1 utils.py:405 [secret filename: /etc/zm/secrets.ini]
12/29/20 17:53:11 zmesdetect_m1[555] DBG2 utils.py:378 [Secret token found in config: !ZM_PORTAL]
12/29/20 17:53:11 zmesdetect_m1[555] DBG2 utils.py:378 [Secret token found in config: !ZM_USER]
12/29/20 17:53:11 zmesdetect_m1[555] DBG2 utils.py:378 [Secret token found in config: !ZM_PASSWORD]
12/29/20 17:53:11 zmesdetect_m1[555] DBG2 utils.py:378 [Secret token found in config: !ZM_API_PORTAL]
12/29/20 17:53:11 zmesdetect_m1[555] DBG2 utils.py:378 [Secret token found in config: !ML_USER]
12/29/20 17:53:11 zmesdetect_m1[555] DBG2 utils.py:378 [Secret token found in config: !ML_PASSWORD]
12/29/20 17:53:11 zmesdetect_m1[555] DBG2 utils.py:378 [Secret token found in config: !PLATEREC_ALPR_KEY]
12/29/20 17:53:11 zmesdetect_m1[555] DBG1 utils.py:440 [allowing self-signed certs to work...]
12/29/20 17:53:11 zmesdetect_m1[555] DBG4 utils.py:450 [Now checking for monitor overrides]
12/29/20 17:53:11 zmesdetect_m1[555] DBG4 utils.py:513 [Finally, doing parameter substitution]
12/29/20 17:53:11 zmesdetect_m1[555] INF zm_detect.py:234 [Importing local classes for Object/Face]
12/29/20 17:53:11 zmesdetect_m1[555] DBG1 utils.py:280 [Trying to download http://localhost/zm/index.php?view=image&eid=1195&fid=alarm&username=admin&password=*****]
12/29/20 17:53:11 zmesdetect_m1[555] DBG1 utils.py:299 [Trying to download http://localhost/zm/index.php?view=image&eid=1195&fid=snapshot&username=admin&password=*****]
12/29/20 17:53:11 zmesdetect_m1[555] DBG1 zm_detect.py:295 [No polygon area specfied, so adding a full image polygon:[{'name': 'full_image', 'value': [(0, 0), (1280, 0), (1280, 720), (0, 72
0)], 'pattern': None}]]
12/29/20 17:53:11 zmesdetect_m1[555] DBG1 zm_detect.py:298 [resizing to 800 before analysis...]
12/29/20 17:53:11 zmesdetect_m1[555] DBG2 utils.py:138 [resized polygons x=0.625/y=0.625: [{'name': 'full_image', 'value': [(0, 0), (800, 0), (800, 450), (0, 450)], 'pattern': None}]]
12/29/20 17:53:11 zmesdetect_m1[555] DBG1 zm_detect.py:319 [User ALPR if vehicle found: False]
12/29/20 17:53:11 zmesdetect_m1[555] DBG4 yolo.py:26 [Yolo init params: {'pyzm_overrides': {'log_level_debug': 5}, 'secrets': '/etc/zm/secrets.ini', 'version': '1.2', 'cpu_max_processes': 3
, 'gpu_max_processes': 1, 'tpu_max_processes': 1, 'cpu_max_lock_wait': 100, 'gpu_max_lock_wait': 600, 'tpu_max_lock_wait': 100, 'base_data_path': '/var/lib/zmeventnotification', 'portal': '
http://localhost/zm', 'api_portal': 'http://localhost/zm/api', 'user': 'admin', 'password': 'plexnchi11', 'basic_user': '', 'basic_password': '', 'image_path': '/var/lib/zmeventnotification
/images', 'match_past_detections': 'no', 'past_det_max_diff_area': '5%', 'max_detection_size': '90%', 'frame_id': 'bestmatch', 'bestmatch_order': 'a,s', 'wait': '0', 'resize': '800', 'delet
e_after_analyze': 'yes', 'show_percent': 'yes', 'allow_self_signed': 'yes', 'write_image_to_zm': 'yes', 'write_debug_image': 'no', 'detection_sequence': ['object'], 'detection_mode': 'all',
 'import_zm_zones': 'no', 'only_triggered_zm_zones': 'no', 'poly_color': (255, 255, 255), 'poly_thickness': 2, 'create_animation': 'no', 'animation_types': "'mp4,gif'", 'animation_width': 6
40, 'animation_retry_sleep': 15, 'animation_max_tries': 4, 'fast_gif': 'no', 'ml_gateway': None, 'ml_fallback_local': 'no', 'ml_user': '"your_mlapi_user"', 'ml_password': '"your_mlapi_passw
ord"', 'use_sequence': 'yes', 'ml_sequence': '{\n\'general\': {\n\'model_sequence\': \'object\',\n\n},\n\'object\': {\n\'general\':{\n\'pattern\':\'.*\',\n\'same_model_sequence_strategy\': 
\'first\' # also \'most\', \'most_unique\'s\n},\n\'sequence\': [{\n\'object_config\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg\',\n\'object_weights\':\'/var/lib/zmeve
ntnotification/models/tinyyolov4/yolov4-tiny.weights\',\n\'object_labels\': \'/var/lib/zmeventnotification/models/tinyyolov4/coco.names\',\n\'object_min_confidence\': 0.3,\n\'object_framewo
rk\':\'opencv\',\n\'object_processor\': \'gpu\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 600,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100\n}]\n},\n\'face\': {\n\'gener
al\':{\n\'pattern\': \'.*\',\n\'same_model_sequence_strategy\': \'first\'\n},\n\'sequence\': [{\n\'save_unknown_faces\':\'yes\',\n\'save_unknown_faces_leeway_pixels\':100,\n\'face_detection
_framework\': \'dlib\',\n\'known_images_path\': \'/var/lib/zmeventnotification/known_faces\',\n\'unknown_images_path\': \'/var/lib/zmeventnotification/unknown_faces\',\n\'face_model\': \'cn
n\',\n\'face_train_model\': \'cnn\',\n\'face_recog_dist_threshold\': \'0.6\',\n\'face_num_jitters\': \'1\',\n\'face_upsample_times\':\'1\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\'
: 600,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100,\n\'max_size\':800\n}]\n},\n\n\'alpr\': {\n\'general\':{\n\'same_model_sequence_strategy\': \'first\',\n\'pre_existing_labels\'
:[\'car\', \'motorbike\', \'bus\', \'truck\', \'boat\'],\n\'pattern\': \'.*\'\n\n},\n\'sequence\': [{\n\'alpr_api_type\': \'cloud\',\n\'alpr_service\': \'plate_recognizer\',\n\'alpr_key\': 
\'"your_plate_recognizer_api_key"\',\n\'platrec_stats\': \'yes\',\n\'platerec_min_dscore\': 0.1,\n\'platerec_min_score\': 0.2,\n\'max_size\':1600\n}]\n}\n}', 'stream_sequence': "{\n'frame_s
trategy': 'most_models',\n'frame_set': 'snapshot,alarm',\n'resize':800\n\n}", 'object_detection_pattern': '.*', 'object_framework': 'opencv', 'object_processor': 'gpu', 'object_config': '/v
ar/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights', 'object_labels': '/var/lib/zmeventnoti
fication/models/tinyyolov4/coco.names', 'object_min_confidence': 0.3, 'face_detection_pattern': '.*', 'face_detection_framework': 'dlib', 'face_recognition_framework': 'dlib', 'face_process
or': 'cpu', 'face_num_jitters': 1, 'face_upsample_times': 1, 'face_model': 'cnn', 'face_train_model': 'cnn', 'face_recog_dist_threshold': 0.6, 'face_recog_knn_algo': 'ball_tree', 'known_ima
ges_path': '/var/lib/zmeventnotification/known_faces', 'unknown_images_path': '/var/lib/zmeventnotification/unknown_faces', 'unknown_face_name': 'unknown face', 'save_unknown_faces': 'yes',
 'save_unknown_faces_leeway_pixels': 100, 'alpr_service': 'plate_recognizer', 'alpr_detection_pattern': '.*', 'alpr_url': None, 'alpr_key': '"your_plate_recognizer_api_key"', 'alpr_use_afte
r_detection_only': 'yes', 'alpr_api_type': 'cloud', 'platerec_stats': 'yes', 'platerec_regions': None, 'platerec_min_dscore': 0.1, 'platerec_min_score': 0.2, 'openalpr_recognize_vehicle': '
0', 'openalpr_country': 'us', 'openalpr_state': None, 'openalpr_min_confidence': '0.3', 'openalpr_cmdline_binary': 'alpr', 'openalpr_cmdline_params': '-j -d', 'openalpr_cmdline_min_confiden
ce': 0.3, 'tpu_object_weights': '/var/lib/zmeventnotification/models/coral_edgetpu/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite', 'tpu_object_labels': '/var/lib/zmeventnotificatio
n/models/coral_edgetpu/coco_indexed.names', 'tpu_object_framework': 'coral_edgetpu', 'tpu_object_processor': 'tpu', 'tpu_min_confidence': '0.6', 'yolo4_object_weights': '/var/lib/zmeventnot
ification/models/yolov4/yolov4.weights', 'yolo4_object_labels': '/var/lib/zmeventnotification/models/yolov4/coco.names', 'yolo4_object_config': '/var/lib/zmeventnotification/models/yolov4/y
olov4.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_pr
ocessor': 'gpu', 'tinyyolo_object_config': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'tinyyolo_object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolov
4-tiny.weights', 'tinyyolo_object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'tinyyolo_object_framework': 'opencv', 'tinyyolo_object_processor': 'gpu'}]
12/29/20 17:53:11 zmesdetect_m1[555] DBG2 yolo.py:35 [portalock: max:1, name:pyzm_uid33_gpu_lock, timeout:600]
12/29/20 17:53:11 zmesdetect_m1[555] DBG2 zm_detect.py:370 [using g.config['object_detection_pattern']=.*]
12/29/20 17:53:11 zmesdetect_m1[555] DBG1 zm_detect.py:403 [Using model: object with /var/lib/zmeventnotification/images/1195-alarm.jpg]
12/29/20 17:53:11 zmesdetect_m1[555] DBG2 yolo.py:45 [Waiting for pyzm_uid33_gpu_lock portalock...]
12/29/20 17:53:11 zmesdetect_m1[555] DBG2 yolo.py:47 [Got pyzm_uid33_gpu_lock portalock]
12/29/20 17:53:11 zmesdetect_m1[555] DBG1 yolo.py:74 [|--------- Loading Yolo model from disk ---------|]
12/29/20 17:53:11 zmesdetect_m1[555] DBG1 yolo.py:82 [Yolo initialization (loading model from disk) took: 0:00:00.027816]
12/29/20 17:53:11 zmesdetect_m1[555] DBG2 yolo.py:96 [Setting CUDA backend for OpenCV]
12/29/20 17:53:11 zmesdetect_m1[555] DBG3 yolo.py:97 [If you did not set your CUDA_ARCH_BIN correctly during OpenCV compilation, you will get errors during detection related to invalid devi
ce/make_policy]
12/29/20 17:53:11 zmesdetect_m1[555] DBG1 yolo.py:137 [|---------- YOLO (input image: 800w*450h, model resize dimensions: 416w*416h) ----------|]
12/29/20 17:53:15 zmesdetect_m1[555] DBG2 yolo.py:61 [Released pyzm_uid33_gpu_lock portalock]
12/29/20 17:53:15 zmesdetect_m1[555] DBG1 yolo.py:162 [YOLO detection took: 0:00:03.627552 milliseconds]
12/29/20 17:53:15 zmesdetect_m1[555] DBG2 yolo.py:196 [YOLO NMS filtering took: 0:00:00.001440]
12/29/20 17:53:15 zmesdetect_m1[555] DBG3 object.py:55 [core model detection over, got 7 objects. Now filtering]
12/29/20 17:53:15 zmesdetect_m1[555] DBG3 object.py:59 [Max object size found to be: 90%]
12/29/20 17:53:15 zmesdetect_m1[555] DBG2 object.py:67 [Converted 90% to 324000.0]
12/29/20 17:53:15 zmesdetect_m1[555] DBG2 object.py:88 [Ignoring cup [621, 261, 653, 305] as conf. level 0.28146952390670776 is lower than 0.3]
12/29/20 17:53:15 zmesdetect_m1[555] DBG2 object.py:88 [Ignoring tvmonitor [390, 0, 458, 82] as conf. level 0.27053093910217285 is lower than 0.3]
12/29/20 17:53:15 zmesdetect_m1[555] DBG2 object.py:88 [Ignoring cell phone [612, 386, 692, 436] as conf. level 0.20806238055229187 is lower than 0.3]
12/29/20 17:53:15 zmesdetect_m1[555] DBG2 object.py:90 [Returning filtered list of 4 objects.]
12/29/20 17:53:15 zmesdetect_m1[555] DBG2 image_manip.py:294 [intersection: polygon in process=[(509, 50), (589, 50), (589, 110), (509, 110)]]
12/29/20 17:53:15 zmesdetect_m1[555] DBG2 image_manip.py:308 [full_image intersects object:tvmonitor[[(509, 50), (589, 50), (589, 110), (509, 110)]]]
12/29/20 17:53:15 zmesdetect_m1[555] DBG2 image_manip.py:294 [intersection: polygon in process=[(376, 204), (470, 204), (470, 340), (376, 340)]]
12/29/20 17:53:15 zmesdetect_m1[555] DBG2 image_manip.py:308 [full_image intersects object:chair[[(376, 204), (470, 204), (470, 340), (376, 340)]]]
12/29/20 17:53:15 zmesdetect_m1[555] DBG2 image_manip.py:294 [intersection: polygon in process=[(641, 46), (683, 46), (683, 138), (641, 138)]]
12/29/20 17:53:15 zmesdetect_m1[555] DBG2 image_manip.py:308 [full_image intersects object:pottedplant[[(641, 46), (683, 46), (683, 138), (641, 138)]]]
12/29/20 17:53:15 zmesdetect_m1[555] DBG2 image_manip.py:294 [intersection: polygon in process=[(208, 294), (252, 294), (252, 322), (208, 322)]]
12/29/20 17:53:15 zmesdetect_m1[555] DBG2 image_manip.py:308 [full_image intersects object:bowl[[(208, 294), (252, 294), (252, 322), (208, 322)]]]
12/29/20 17:53:15 zmesdetect_m1[555] DBG2 zm_detect.py:618 [ALPR not in use, no need for look aheads in processing]
12/29/20 17:53:15 zmesdetect_m1[555] INF zm_detect.py:635 [labels found: ['tvmonitor', 'chair', 'pottedplant', 'bowl']]
12/29/20 17:53:15 zmesdetect_m1[555] DBG2 zm_detect.py:638 [match found in /var/lib/zmeventnotification/images/1195-alarm.jpg, breaking file loop...]
12/29/20 17:53:15 zmesdetect_m1[555] DBG2 zm_detect.py:703 [Drawing boxes around objects]
12/29/20 17:53:15 zmesdetect_m1[555] DBG1 zm_detect.py:728 [Writing detected image to /var/cache/zoneminder/events/1/2020-12-29/1195/objdetect.jpg]
12/29/20 17:53:15 zmesdetect_m1[555] DBG1 zm_detect.py:732 [Writing JSON output to /var/cache/zoneminder/events/1/2020-12-29/1195/objects.json]
12/29/20 17:53:15 zmesdetect_m1[555] INF zm_detect.py:784 [Prediction string:[a] detected:tvmonitor:88% chair:63% pottedplant:60% bowl:46% ]
12/29/20 17:53:15 zmesdetect_m1[555] DBG1 zm_detect.py:787 [Prediction string JSON:[{"type": "object", "label": "tvmonitor", "box": [509, 50, 589, 110], "confidence": "87.64%"}, {"type": "o
bject", "label": "chair", "box": [376, 204, 470, 340], "confidence": "62.87%"}, {"type": "object", "label": "pottedplant", "box": [641, 46, 683, 138], "confidence": "59.76%"}, {"type": "obj
ect", "label": "bowl", "box": [208, 294, 252, 322], "confidence": "46.00%"}]]
12/29/20 17:57:56 zmesdetect_m1[837] INF zm_detect.py:208 [---------| pyzm version:0.3.11, hook version:6.0.7,  ES version:6.0.7 , OpenCV version:4.4.0|------------]
12/29/20 17:57:56 zmesdetect_m1[837] DBG1 utils.py:405 [secret filename: /etc/zm/secrets.ini]
12/29/20 17:57:56 zmesdetect_m1[837] DBG2 utils.py:378 [Secret token found in config: !ZM_PORTAL]
12/29/20 17:57:56 zmesdetect_m1[837] DBG2 utils.py:378 [Secret token found in config: !ZM_USER]
12/29/20 17:57:56 zmesdetect_m1[837] DBG2 utils.py:378 [Secret token found in config: !ZM_PASSWORD]
12/29/20 17:57:56 zmesdetect_m1[837] DBG2 utils.py:378 [Secret token found in config: !ZM_API_PORTAL]
12/29/20 17:57:56 zmesdetect_m1[837] DBG2 utils.py:378 [Secret token found in config: !ML_USER]
12/29/20 17:57:56 zmesdetect_m1[837] DBG2 utils.py:378 [Secret token found in config: !ML_PASSWORD]
12/29/20 17:57:56 zmesdetect_m1[837] DBG2 utils.py:378 [Secret token found in config: !PLATEREC_ALPR_KEY]
12/29/20 17:57:56 zmesdetect_m1[837] DBG1 utils.py:440 [allowing self-signed certs to work...]
12/29/20 17:57:56 zmesdetect_m1[837] DBG4 utils.py:450 [Now checking for monitor overrides]
12/29/20 17:57:56 zmesdetect_m1[837] DBG4 utils.py:513 [Finally, doing parameter substitution]
12/29/20 17:57:56 zmesdetect_m1[837] INF zm_detect.py:234 [Importing local classes for Object/Face]
12/29/20 17:57:56 zmesdetect_m1[837] DBG1 utils.py:280 [Trying to download http://localhost/zm/index.php?view=image&eid=1197&fid=alarm&username=admin&password=*****]
12/29/20 17:57:56 zmesdetect_m1[837] DBG1 utils.py:299 [Trying to download http://localhost/zm/index.php?view=image&eid=1197&fid=snapshot&username=admin&password=*****]
12/29/20 17:57:56 zmesdetect_m1[837] DBG1 zm_detect.py:295 [No polygon area specfied, so adding a full image polygon:[{'name': 'full_image', 'value': [(0, 0), (1280, 0), (1280, 720), (0, 72
0)], 'pattern': None}]]
12/29/20 17:57:56 zmesdetect_m1[837] DBG1 zm_detect.py:298 [resizing to 800 before analysis...]
12/29/20 17:57:56 zmesdetect_m1[837] DBG2 utils.py:138 [resized polygons x=0.625/y=0.625: [{'name': 'full_image', 'value': [(0, 0), (800, 0), (800, 450), (0, 450)], 'pattern': None}]]
12/29/20 17:57:56 zmesdetect_m1[837] DBG1 zm_detect.py:319 [User ALPR if vehicle found: False]
12/29/20 17:57:56 zmesdetect_m1[837] DBG4 yolo.py:26 [Yolo init params: {'pyzm_overrides': {'log_level_debug': 5}, 'secrets': '/etc/zm/secrets.ini', 'version': '1.2', 'cpu_max_processes': 3
, 'gpu_max_processes': 1, 'tpu_max_processes': 1, 'cpu_max_lock_wait': 100, 'gpu_max_lock_wait': 600, 'tpu_max_lock_wait': 100, 'base_data_path': '/var/lib/zmeventnotification', 'portal': '
http://localhost/zm', 'api_portal': 'http://localhost/zm/api', 'user': 'admin', 'password': 'plexnchi11', 'basic_user': '', 'basic_password': '', 'image_path': '/var/lib/zmeventnotification
/images', 'match_past_detections': 'no', 'past_det_max_diff_area': '5%', 'max_detection_size': '90%', 'frame_id': 'bestmatch', 'bestmatch_order': 'a,s', 'wait': '0', 'resize': '800', 'delet
e_after_analyze': 'yes', 'show_percent': 'yes', 'allow_self_signed': 'yes', 'write_image_to_zm': 'yes', 'write_debug_image': 'no', 'detection_sequence': ['object'], 'detection_mode': 'all',
 'import_zm_zones': 'no', 'only_triggered_zm_zones': 'no', 'poly_color': (255, 255, 255), 'poly_thickness': 2, 'create_animation': 'no', 'animation_types': "'mp4,gif'", 'animation_width': 6
40, 'animation_retry_sleep': 15, 'animation_max_tries': 4, 'fast_gif': 'no', 'ml_gateway': None, 'ml_fallback_local': 'no', 'ml_user': '"your_mlapi_user"', 'ml_password': '"your_mlapi_passw
ord"', 'use_sequence': 'yes', 'ml_sequence': '{\n\'general\': {\n\'model_sequence\': \'object\',\n\n},\n\'object\': {\n\'general\':{\n\'pattern\':\'.*\',\n\'same_model_sequence_strategy\': 
\'first\' # also \'most\', \'most_unique\'s\n},\n\'sequence\': [{\n\'object_config\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg\',\n\'object_weights\':\'/var/lib/zmeve
ntnotification/models/tinyyolov4/yolov4-tiny.weights\',\n\'object_labels\': \'/var/lib/zmeventnotification/models/tinyyolov4/coco.names\',\n\'object_min_confidence\': 0.3,\n\'object_framewo
rk\':\'opencv\',\n\'object_processor\': \'gpu\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 600,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100\n}]\n},\n\'face\': {\n\'gener
al\':{\n\'pattern\': \'.*\',\n\'same_model_sequence_strategy\': \'first\'\n},\n\'sequence\': [{\n\'save_unknown_faces\':\'yes\',\n\'save_unknown_faces_leeway_pixels\':100,\n\'face_detection
_framework\': \'dlib\',\n\'known_images_path\': \'/var/lib/zmeventnotification/known_faces\',\n\'unknown_images_path\': \'/var/lib/zmeventnotification/unknown_faces\',\n\'face_model\': \'cn
n\',\n\'face_train_model\': \'cnn\',\n\'face_recog_dist_threshold\': \'0.6\',\n\'face_num_jitters\': \'1\',\n\'face_upsample_times\':\'1\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\'
: 600,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100,\n\'max_size\':800\n}]\n},\n\n\'alpr\': {\n\'general\':{\n\'same_model_sequence_strategy\': \'first\',\n\'pre_existing_labels\'
:[\'car\', \'motorbike\', \'bus\', \'truck\', \'boat\'],\n\'pattern\': \'.*\'\n\n},\n\'sequence\': [{\n\'alpr_api_type\': \'cloud\',\n\'alpr_service\': \'plate_recognizer\',\n\'alpr_key\': 
\'"your_plate_recognizer_api_key"\',\n\'platrec_stats\': \'yes\',\n\'platerec_min_dscore\': 0.1,\n\'platerec_min_score\': 0.2,\n\'max_size\':1600\n}]\n}\n}', 'stream_sequence': "{\n'frame_s
trategy': 'most_models',\n'frame_set': 'snapshot,alarm',\n'resize':800\n\n}", 'object_detection_pattern': '.*', 'object_framework': 'opencv', 'object_processor': 'gpu', 'object_config': '/v
ar/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights', 'object_labels': '/var/lib/zmeventnoti
fication/models/tinyyolov4/coco.names', 'object_min_confidence': 0.3, 'face_detection_pattern': '.*', 'face_detection_framework': 'dlib', 'face_recognition_framework': 'dlib', 'face_process
or': 'cpu', 'face_num_jitters': 1, 'face_upsample_times': 1, 'face_model': 'cnn', 'face_train_model': 'cnn', 'face_recog_dist_threshold': 0.6, 'face_recog_knn_algo': 'ball_tree', 'known_ima
ges_path': '/var/lib/zmeventnotification/known_faces', 'unknown_images_path': '/var/lib/zmeventnotification/unknown_faces', 'unknown_face_name': 'unknown face', 'save_unknown_faces': 'yes',
 'save_unknown_faces_leeway_pixels': 100, 'alpr_service': 'plate_recognizer', 'alpr_detection_pattern': '.*', 'alpr_url': None, 'alpr_key': '"your_plate_recognizer_api_key"', 'alpr_use_afte
r_detection_only': 'yes', 'alpr_api_type': 'cloud', 'platerec_stats': 'yes', 'platerec_regions': None, 'platerec_min_dscore': 0.1, 'platerec_min_score': 0.2, 'openalpr_recognize_vehicle': '
0', 'openalpr_country': 'us', 'openalpr_state': None, 'openalpr_min_confidence': '0.3', 'openalpr_cmdline_binary': 'alpr', 'openalpr_cmdline_params': '-j -d', 'openalpr_cmdline_min_confiden
ce': 0.3, 'tpu_object_weights': '/var/lib/zmeventnotification/models/coral_edgetpu/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite', 'tpu_object_labels': '/var/lib/zmeventnotificatio
n/models/coral_edgetpu/coco_indexed.names', 'tpu_object_framework': 'coral_edgetpu', 'tpu_object_processor': 'tpu', 'tpu_min_confidence': '0.6', 'yolo4_object_weights': '/var/lib/zmeventnot
ification/models/yolov4/yolov4.weights', 'yolo4_object_labels': '/var/lib/zmeventnotification/models/yolov4/coco.names', 'yolo4_object_config': '/var/lib/zmeventnotification/models/yolov4/y
olov4.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_pr
ocessor': 'gpu', 'tinyyolo_object_config': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'tinyyolo_object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolov
4-tiny.weights', 'tinyyolo_object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'tinyyolo_object_framework': 'opencv', 'tinyyolo_object_processor': 'gpu'}]
12/29/20 17:57:56 zmesdetect_m1[837] DBG2 yolo.py:35 [portalock: max:1, name:pyzm_uid33_gpu_lock, timeout:600]
12/29/20 17:57:56 zmesdetect_m1[837] DBG2 zm_detect.py:370 [using g.config['object_detection_pattern']=.*]
12/29/20 17:57:56 zmesdetect_m1[837] DBG1 zm_detect.py:403 [Using model: object with /var/lib/zmeventnotification/images/1197-alarm.jpg]
12/29/20 17:57:56 zmesdetect_m1[837] DBG2 yolo.py:45 [Waiting for pyzm_uid33_gpu_lock portalock...]
12/29/20 17:57:56 zmesdetect_m1[837] DBG2 yolo.py:47 [Got pyzm_uid33_gpu_lock portalock]
12/29/20 17:57:56 zmesdetect_m1[837] DBG1 yolo.py:74 [|--------- Loading Yolo model from disk ---------|]
12/29/20 17:57:57 zmesdetect_m1[837] DBG1 yolo.py:82 [Yolo initialization (loading model from disk) took: 0:00:00.043625]
12/29/20 17:57:57 zmesdetect_m1[837] DBG2 yolo.py:96 [Setting CUDA backend for OpenCV]
12/29/20 17:57:57 zmesdetect_m1[837] DBG3 yolo.py:97 [If you did not set your CUDA_ARCH_BIN correctly during OpenCV compilation, you will get errors during detection related to invalid devi
ce/make_policy]
12/29/20 17:57:57 zmesdetect_m1[837] DBG1 yolo.py:137 [|---------- YOLO (input image: 800w*450h, model resize dimensions: 416w*416h) ----------|]
12/29/20 17:58:01 zmesdetect_m1[837] DBG2 yolo.py:61 [Released pyzm_uid33_gpu_lock portalock]
12/29/20 17:58:01 zmesdetect_m1[837] FAT zm_detect.py:860 [Unrecoverable error:OpenCV(4.4.0) /opencv-build/build/opencv-4.4.0/modules/dnn/src/cuda4dnn/csl/cublas.hpp:78: error: (-217:Gpu AP
I call) CUBLAS_STATUS_NOT_INITIALIZED in function 'UniqueHandle'
 Traceback:Traceback (most recent call last):
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 857, in <module>
    main_handler()
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 432, in main_handler
    b, l, c = m.detect(original_image)
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/object.py", line 54, in detect
    b,l,c = self.model.detect(image)
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/yolo.py", line 151, in detect
    outs = self.net.forward(ln)
cv2.error: OpenCV(4.4.0) /opencv-build/build/opencv-4.4.0/modules/dnn/src/cuda4dnn/csl/cublas.hpp:78: error: (-217:Gpu API call) CUBLAS_STATUS_NOT_INITIALIZED in function 'UniqueHandle'

]
12/29/20 18:03:26 zmesdetect_m1[1267] INF zm_detect.py:208 [---------| pyzm version:0.3.11, hook version:6.0.7,  ES version:6.0.7 , OpenCV version:4.4.0|------------]
12/29/20 18:03:26 zmesdetect_m1[1267] DBG1 utils.py:405 [secret filename: /etc/zm/secrets.ini]
12/29/20 18:03:26 zmesdetect_m1[1267] DBG2 utils.py:378 [Secret token found in config: !ZM_PORTAL]
12/29/20 18:03:26 zmesdetect_m1[1267] DBG2 utils.py:378 [Secret token found in config: !ZM_USER]
12/29/20 18:03:26 zmesdetect_m1[1267] DBG2 utils.py:378 [Secret token found in config: !ZM_PASSWORD]
12/29/20 18:03:26 zmesdetect_m1[1267] DBG2 utils.py:378 [Secret token found in config: !ZM_API_PORTAL]
12/29/20 18:03:26 zmesdetect_m1[1267] DBG2 utils.py:378 [Secret token found in config: !ML_USER]
12/29/20 18:03:26 zmesdetect_m1[1267] DBG2 utils.py:378 [Secret token found in config: !ML_PASSWORD]
12/29/20 18:03:26 zmesdetect_m1[1267] DBG2 utils.py:378 [Secret token found in config: !PLATEREC_ALPR_KEY]
12/29/20 18:03:26 zmesdetect_m1[1267] DBG1 utils.py:440 [allowing self-signed certs to work...]
12/29/20 18:03:26 zmesdetect_m1[1267] DBG4 utils.py:450 [Now checking for monitor overrides]
12/29/20 18:03:26 zmesdetect_m1[1267] DBG4 utils.py:513 [Finally, doing parameter substitution]
12/29/20 18:03:26 zmesdetect_m1[1267] INF zm_detect.py:234 [Importing local classes for Object/Face]
12/29/20 18:03:26 zmesdetect_m1[1267] DBG1 utils.py:280 [Trying to download http://localhost/zm/index.php?view=image&eid=1202&fid=alarm&username=admin&password=*****]
12/29/20 18:03:26 zmesdetect_m1[1267] DBG1 utils.py:299 [Trying to download http://localhost/zm/index.php?view=image&eid=1202&fid=snapshot&username=admin&password=*****]
12/29/20 18:03:26 zmesdetect_m1[1267] DBG1 zm_detect.py:295 [No polygon area specfied, so adding a full image polygon:[{'name': 'full_image', 'value': [(0, 0), (1280, 0), (1280, 720), (0, 7
20)], 'pattern': None}]]
12/29/20 18:03:26 zmesdetect_m1[1267] DBG1 zm_detect.py:298 [resizing to 800 before analysis...]
12/29/20 18:03:26 zmesdetect_m1[1267] DBG2 utils.py:138 [resized polygons x=0.625/y=0.625: [{'name': 'full_image', 'value': [(0, 0), (800, 0), (800, 450), (0, 450)], 'pattern': None}]]
12/29/20 18:03:26 zmesdetect_m1[1267] DBG1 zm_detect.py:319 [User ALPR if vehicle found: False]
12/29/20 18:03:26 zmesdetect_m1[1267] DBG4 yolo.py:26 [Yolo init params: {'pyzm_overrides': {'log_level_debug': 5}, 'secrets': '/etc/zm/secrets.ini', 'version': '1.2', 'cpu_max_processes': 
3, 'gpu_max_processes': 1, 'tpu_max_processes': 1, 'cpu_max_lock_wait': 100, 'gpu_max_lock_wait': 600, 'tpu_max_lock_wait': 100, 'base_data_path': '/var/lib/zmeventnotification', 'portal': 
'http://localhost/zm', 'api_portal': 'http://localhost/zm/api', 'user': 'admin', 'password': 'plexnchi11', 'basic_user': '', 'basic_password': '', 'image_path': '/var/lib/zmeventnotificatio
n/images', 'match_past_detections': 'no', 'past_det_max_diff_area': '5%', 'max_detection_size': '90%', 'frame_id': 'bestmatch', 'bestmatch_order': 'a,s', 'wait': '0', 'resize': '800', 'dele
te_after_analyze': 'yes', 'show_percent': 'yes', 'allow_self_signed': 'yes', 'write_image_to_zm': 'yes', 'write_debug_image': 'no', 'detection_sequence': ['object'], 'detection_mode': 'all'
, 'import_zm_zones': 'no', 'only_triggered_zm_zones': 'no', 'poly_color': (255, 255, 255), 'poly_thickness': 2, 'create_animation': 'no', 'animation_types': "'mp4,gif'", 'animation_width': 
640, 'animation_retry_sleep': 15, 'animation_max_tries': 4, 'fast_gif': 'no', 'ml_gateway': None, 'ml_fallback_local': 'no', 'ml_user': '"your_mlapi_user"', 'ml_password': '"your_mlapi_pass
word"', 'use_sequence': 'yes', 'ml_sequence': '{\n\'general\': {\n\'model_sequence\': \'object\',\n\n},\n\'object\': {\n\'general\':{\n\'pattern\':\'.*\',\n\'same_model_sequence_strategy\':
 \'first\' # also \'most\', \'most_unique\'s\n},\n\'sequence\': [{\n\'object_config\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg\',\n\'object_weights\':\'/var/lib/zmev
entnotification/models/tinyyolov4/yolov4-tiny.weights\',\n\'object_labels\': \'/var/lib/zmeventnotification/models/tinyyolov4/coco.names\',\n\'object_min_confidence\': 0.3,\n\'object_framew
ork\':\'opencv\',\n\'object_processor\': \'gpu\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 600,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100\n}]\n},\n\'face\': {\n\'gene
ral\':{\n\'pattern\': \'.*\',\n\'same_model_sequence_strategy\': \'first\'\n},\n\'sequence\': [{\n\'save_unknown_faces\':\'yes\',\n\'save_unknown_faces_leeway_pixels\':100,\n\'face_detectio
n_framework\': \'dlib\',\n\'known_images_path\': \'/var/lib/zmeventnotification/known_faces\',\n\'unknown_images_path\': \'/var/lib/zmeventnotification/unknown_faces\',\n\'face_model\': \'c
nn\',\n\'face_train_model\': \'cnn\',\n\'face_recog_dist_threshold\': \'0.6\',\n\'face_num_jitters\': \'1\',\n\'face_upsample_times\':\'1\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\
': 600,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100,\n\'max_size\':800\n}]\n},\n\n\'alpr\': {\n\'general\':{\n\'same_model_sequence_strategy\': \'first\',\n\'pre_existing_labels\
':[\'car\', \'motorbike\', \'bus\', \'truck\', \'boat\'],\n\'pattern\': \'.*\'\n\n},\n\'sequence\': [{\n\'alpr_api_type\': \'cloud\',\n\'alpr_service\': \'plate_recognizer\',\n\'alpr_key\':
 \'"your_plate_recognizer_api_key"\',\n\'platrec_stats\': \'yes\',\n\'platerec_min_dscore\': 0.1,\n\'platerec_min_score\': 0.2,\n\'max_size\':1600\n}]\n}\n}', 'stream_sequence': "{\n'frame_
strategy': 'most_models',\n'frame_set': 'snapshot,alarm',\n'resize':800\n\n}", 'object_detection_pattern': '.*', 'object_framework': 'opencv', 'object_processor': 'gpu', 'object_config': '/
var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights', 'object_labels': '/var/lib/zmeventnot
ification/models/tinyyolov4/coco.names', 'object_min_confidence': 0.3, 'face_detection_pattern': '.*', 'face_detection_framework': 'dlib', 'face_recognition_framework': 'dlib', 'face_proces
sor': 'cpu', 'face_num_jitters': 1, 'face_upsample_times': 1, 'face_model': 'cnn', 'face_train_model': 'cnn', 'face_recog_dist_threshold': 0.6, 'face_recog_knn_algo': 'ball_tree', 'known_im
ages_path': '/var/lib/zmeventnotification/known_faces', 'unknown_images_path': '/var/lib/zmeventnotification/unknown_faces', 'unknown_face_name': 'unknown face', 'save_unknown_faces': 'yes'
, 'save_unknown_faces_leeway_pixels': 100, 'alpr_service': 'plate_recognizer', 'alpr_detection_pattern': '.*', 'alpr_url': None, 'alpr_key': '"your_plate_recognizer_api_key"', 'alpr_use_aft
er_detection_only': 'yes', 'alpr_api_type': 'cloud', 'platerec_stats': 'yes', 'platerec_regions': None, 'platerec_min_dscore': 0.1, 'platerec_min_score': 0.2, 'openalpr_recognize_vehicle': 
'0', 'openalpr_country': 'us', 'openalpr_state': None, 'openalpr_min_confidence': '0.3', 'openalpr_cmdline_binary': 'alpr', 'openalpr_cmdline_params': '-j -d', 'openalpr_cmdline_min_confide
nce': 0.3, 'tpu_object_weights': '/var/lib/zmeventnotification/models/coral_edgetpu/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite', 'tpu_object_labels': '/var/lib/zmeventnotificati
on/models/coral_edgetpu/coco_indexed.names', 'tpu_object_framework': 'coral_edgetpu', 'tpu_object_processor': 'tpu', 'tpu_min_confidence': '0.6', 'yolo4_object_weights': '/var/lib/zmeventno
tification/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_p
rocessor': 'gpu', 'tinyyolo_object_config': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'tinyyolo_object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolo
v4-tiny.weights', 'tinyyolo_object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'tinyyolo_object_framework': 'opencv', 'tinyyolo_object_processor': 'gpu'}]
12/29/20 18:03:26 zmesdetect_m1[1267] DBG2 yolo.py:35 [portalock: max:1, name:pyzm_uid33_gpu_lock, timeout:600]
12/29/20 18:03:26 zmesdetect_m1[1267] DBG2 zm_detect.py:370 [using g.config['object_detection_pattern']=.*]
12/29/20 18:03:26 zmesdetect_m1[1267] DBG1 zm_detect.py:403 [Using model: object with /var/lib/zmeventnotification/images/1202-alarm.jpg]
12/29/20 18:03:26 zmesdetect_m1[1267] DBG2 yolo.py:45 [Waiting for pyzm_uid33_gpu_lock portalock...]
12/29/20 18:03:26 zmesdetect_m1[1267] DBG2 yolo.py:47 [Got pyzm_uid33_gpu_lock portalock]
12/29/20 18:03:26 zmesdetect_m1[1267] DBG1 yolo.py:74 [|--------- Loading Yolo model from disk ---------|]
12/29/20 18:03:26 zmesdetect_m1[1267] DBG1 yolo.py:82 [Yolo initialization (loading model from disk) took: 0:00:00.036078]
12/29/20 18:03:26 zmesdetect_m1[1267] DBG2 yolo.py:96 [Setting CUDA backend for OpenCV]
12/29/20 18:03:26 zmesdetect_m1[1267] DBG3 yolo.py:97 [If you did not set your CUDA_ARCH_BIN correctly during OpenCV compilation, you will get errors during detection related to invalid dev
ice/make_policy]
12/29/20 18:03:26 zmesdetect_m1[1267] DBG1 yolo.py:137 [|---------- YOLO (input image: 800w*450h, model resize dimensions: 416w*416h) ----------|]
12/29/20 18:03:31 zmesdetect_m1[1267] DBG2 yolo.py:61 [Released pyzm_uid33_gpu_lock portalock]
12/29/20 18:03:31 zmesdetect_m1[1267] FAT zm_detect.py:860 [Unrecoverable error:OpenCV(4.4.0) /opencv-build/build/opencv-4.4.0/modules/dnn/src/cuda4dnn/csl/cublas.hpp:78: error: (-217:Gpu A
PI call) CUBLAS_STATUS_NOT_INITIALIZED in function 'UniqueHandle'
 Traceback:Traceback (most recent call last):
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 857, in <module>
    main_handler()
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 432, in main_handler
    b, l, c = m.detect(original_image)
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/object.py", line 54, in detect
    b,l,c = self.model.detect(image)
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/yolo.py", line 151, in detect
    outs = self.net.forward(ln)
cv2.error: OpenCV(4.4.0) /opencv-build/build/opencv-4.4.0/modules/dnn/src/cuda4dnn/csl/cublas.hpp:78: error: (-217:Gpu API call) CUBLAS_STATUS_NOT_INITIALIZED in function 'UniqueHandle'

]
12/29/20 18:03:42 zmesdetect_m1[1313] INF zm_detect.py:208 [---------| pyzm version:0.3.11, hook version:6.0.7,  ES version:6.0.7 , OpenCV version:4.4.0|------------]
12/29/20 18:03:42 zmesdetect_m1[1313] DBG1 utils.py:405 [secret filename: /etc/zm/secrets.ini]
12/29/20 18:03:42 zmesdetect_m1[1313] DBG2 utils.py:378 [Secret token found in config: !ZM_PORTAL]
12/29/20 18:03:42 zmesdetect_m1[1313] DBG2 utils.py:378 [Secret token found in config: !ZM_USER]
12/29/20 18:03:42 zmesdetect_m1[1313] DBG2 utils.py:378 [Secret token found in config: !ZM_PASSWORD]
12/29/20 18:03:42 zmesdetect_m1[1313] DBG2 utils.py:378 [Secret token found in config: !ZM_API_PORTAL]
12/29/20 18:03:42 zmesdetect_m1[1313] DBG2 utils.py:378 [Secret token found in config: !ML_USER]
12/29/20 18:03:42 zmesdetect_m1[1313] DBG2 utils.py:378 [Secret token found in config: !ML_PASSWORD]
12/29/20 18:03:42 zmesdetect_m1[1313] DBG2 utils.py:378 [Secret token found in config: !PLATEREC_ALPR_KEY]
12/29/20 18:03:42 zmesdetect_m1[1313] DBG1 utils.py:440 [allowing self-signed certs to work...]
12/29/20 18:03:42 zmesdetect_m1[1313] DBG4 utils.py:450 [Now checking for monitor overrides]
12/29/20 18:03:42 zmesdetect_m1[1313] DBG4 utils.py:513 [Finally, doing parameter substitution]
12/29/20 18:03:42 zmesdetect_m1[1313] INF zm_detect.py:234 [Importing local classes for Object/Face]
12/29/20 18:03:42 zmesdetect_m1[1313] DBG1 utils.py:280 [Trying to download http://localhost/zm/index.php?view=image&eid=1204&fid=alarm&username=admin&password=*****]
12/29/20 18:03:42 zmesdetect_m1[1313] DBG1 utils.py:299 [Trying to download http://localhost/zm/index.php?view=image&eid=1204&fid=snapshot&username=admin&password=*****]
12/29/20 18:03:42 zmesdetect_m1[1313] DBG1 zm_detect.py:295 [No polygon area specfied, so adding a full image polygon:[{'name': 'full_image', 'value': [(0, 0), (1280, 0), (1280, 720), (0, 7
20)], 'pattern': None}]]
12/29/20 18:03:42 zmesdetect_m1[1313] DBG1 zm_detect.py:298 [resizing to 800 before analysis...]
12/29/20 18:03:42 zmesdetect_m1[1313] DBG2 utils.py:138 [resized polygons x=0.625/y=0.625: [{'name': 'full_image', 'value': [(0, 0), (800, 0), (800, 450), (0, 450)], 'pattern': None}]]
12/29/20 18:03:42 zmesdetect_m1[1313] DBG1 zm_detect.py:319 [User ALPR if vehicle found: False]
12/29/20 18:03:42 zmesdetect_m1[1313] DBG4 yolo.py:26 [Yolo init params: {'pyzm_overrides': {'log_level_debug': 5}, 'secrets': '/etc/zm/secrets.ini', 'version': '1.2', 'cpu_max_processes': 
3, 'gpu_max_processes': 1, 'tpu_max_processes': 1, 'cpu_max_lock_wait': 100, 'gpu_max_lock_wait': 600, 'tpu_max_lock_wait': 100, 'base_data_path': '/var/lib/zmeventnotification', 'portal': 
'http://localhost/zm', 'api_portal': 'http://localhost/zm/api', 'user': 'admin', 'password': 'plexnchi11', 'basic_user': '', 'basic_password': '', 'image_path': '/var/lib/zmeventnotificatio
n/images', 'match_past_detections': 'no', 'past_det_max_diff_area': '5%', 'max_detection_size': '90%', 'frame_id': 'bestmatch', 'bestmatch_order': 'a,s', 'wait': '0', 'resize': '800', 'dele
te_after_analyze': 'yes', 'show_percent': 'yes', 'allow_self_signed': 'yes', 'write_image_to_zm': 'yes', 'write_debug_image': 'no', 'detection_sequence': ['object'], 'detection_mode': 'all'
, 'import_zm_zones': 'no', 'only_triggered_zm_zones': 'no', 'poly_color': (255, 255, 255), 'poly_thickness': 2, 'create_animation': 'no', 'animation_types': "'mp4,gif'", 'animation_width': 
640, 'animation_retry_sleep': 15, 'animation_max_tries': 4, 'fast_gif': 'no', 'ml_gateway': None, 'ml_fallback_local': 'no', 'ml_user': '"your_mlapi_user"', 'ml_password': '"your_mlapi_pass
word"', 'use_sequence': 'yes', 'ml_sequence': '{\n\'general\': {\n\'model_sequence\': \'object\',\n\n},\n\'object\': {\n\'general\':{\n\'pattern\':\'.*\',\n\'same_model_sequence_strategy\':
 \'first\' # also \'most\', \'most_unique\'s\n},\n\'sequence\': [{\n\'object_config\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg\',\n\'object_weights\':\'/var/lib/zmev
entnotification/models/tinyyolov4/yolov4-tiny.weights\',\n\'object_labels\': \'/var/lib/zmeventnotification/models/tinyyolov4/coco.names\',\n\'object_min_confidence\': 0.3,\n\'object_framew
ork\':\'opencv\',\n\'object_processor\': \'gpu\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 600,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100\n}]\n},\n\'face\': {\n\'gene
ral\':{\n\'pattern\': \'.*\',\n\'same_model_sequence_strategy\': \'first\'\n},\n\'sequence\': [{\n\'save_unknown_faces\':\'yes\',\n\'save_unknown_faces_leeway_pixels\':100,\n\'face_detectio
n_framework\': \'dlib\',\n\'known_images_path\': \'/var/lib/zmeventnotification/known_faces\',\n\'unknown_images_path\': \'/var/lib/zmeventnotification/unknown_faces\',\n\'face_model\': \'c
nn\',\n\'face_train_model\': \'cnn\',\n\'face_recog_dist_threshold\': \'0.6\',\n\'face_num_jitters\': \'1\',\n\'face_upsample_times\':\'1\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\
': 600,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100,\n\'max_size\':800\n}]\n},\n\n\'alpr\': {\n\'general\':{\n\'same_model_sequence_strategy\': \'first\',\n\'pre_existing_labels\
':[\'car\', \'motorbike\', \'bus\', \'truck\', \'boat\'],\n\'pattern\': \'.*\'\n\n},\n\'sequence\': [{\n\'alpr_api_type\': \'cloud\',\n\'alpr_service\': \'plate_recognizer\',\n\'alpr_key\':
 \'"your_plate_recognizer_api_key"\',\n\'platrec_stats\': \'yes\',\n\'platerec_min_dscore\': 0.1,\n\'platerec_min_score\': 0.2,\n\'max_size\':1600\n}]\n}\n}', 'stream_sequence': "{\n'frame_
strategy': 'most_models',\n'frame_set': 'snapshot,alarm',\n'resize':800\n\n}", 'object_detection_pattern': '.*', 'object_framework': 'opencv', 'object_processor': 'gpu', 'object_config': '/
var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights', 'object_labels': '/var/lib/zmeventnot
ification/models/tinyyolov4/coco.names', 'object_min_confidence': 0.3, 'face_detection_pattern': '.*', 'face_detection_framework': 'dlib', 'face_recognition_framework': 'dlib', 'face_proces
sor': 'cpu', 'face_num_jitters': 1, 'face_upsample_times': 1, 'face_model': 'cnn', 'face_train_model': 'cnn', 'face_recog_dist_threshold': 0.6, 'face_recog_knn_algo': 'ball_tree', 'known_im
ages_path': '/var/lib/zmeventnotification/known_faces', 'unknown_images_path': '/var/lib/zmeventnotification/unknown_faces', 'unknown_face_name': 'unknown face', 'save_unknown_faces': 'yes'
, 'save_unknown_faces_leeway_pixels': 100, 'alpr_service': 'plate_recognizer', 'alpr_detection_pattern': '.*', 'alpr_url': None, 'alpr_key': '"your_plate_recognizer_api_key"', 'alpr_use_aft
er_detection_only': 'yes', 'alpr_api_type': 'cloud', 'platerec_stats': 'yes', 'platerec_regions': None, 'platerec_min_dscore': 0.1, 'platerec_min_score': 0.2, 'openalpr_recognize_vehicle': 
'0', 'openalpr_country': 'us', 'openalpr_state': None, 'openalpr_min_confidence': '0.3', 'openalpr_cmdline_binary': 'alpr', 'openalpr_cmdline_params': '-j -d', 'openalpr_cmdline_min_confide
nce': 0.3, 'tpu_object_weights': '/var/lib/zmeventnotification/models/coral_edgetpu/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite', 'tpu_object_labels': '/var/lib/zmeventnotificati
on/models/coral_edgetpu/coco_indexed.names', 'tpu_object_framework': 'coral_edgetpu', 'tpu_object_processor': 'tpu', 'tpu_min_confidence': '0.6', 'yolo4_object_weights': '/var/lib/zmeventno
tification/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_p
rocessor': 'gpu', 'tinyyolo_object_config': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'tinyyolo_object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolo
v4-tiny.weights', 'tinyyolo_object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'tinyyolo_object_framework': 'opencv', 'tinyyolo_object_processor': 'gpu'}]
12/29/20 18:03:42 zmesdetect_m1[1313] DBG2 yolo.py:35 [portalock: max:1, name:pyzm_uid33_gpu_lock, timeout:600]
12/29/20 18:03:42 zmesdetect_m1[1313] DBG2 zm_detect.py:370 [using g.config['object_detection_pattern']=.*]
12/29/20 18:03:42 zmesdetect_m1[1313] DBG1 zm_detect.py:403 [Using model: object with /var/lib/zmeventnotification/images/1204-alarm.jpg]
12/29/20 18:03:42 zmesdetect_m1[1313] DBG2 yolo.py:45 [Waiting for pyzm_uid33_gpu_lock portalock...]
12/29/20 18:03:42 zmesdetect_m1[1313] DBG2 yolo.py:47 [Got pyzm_uid33_gpu_lock portalock]
12/29/20 18:03:42 zmesdetect_m1[1313] DBG1 yolo.py:74 [|--------- Loading Yolo model from disk ---------|]
12/29/20 18:03:42 zmesdetect_m1[1313] DBG1 yolo.py:82 [Yolo initialization (loading model from disk) took: 0:00:00.027542]
12/29/20 18:03:42 zmesdetect_m1[1313] DBG2 yolo.py:96 [Setting CUDA backend for OpenCV]
12/29/20 18:03:42 zmesdetect_m1[1313] DBG3 yolo.py:97 [If you did not set your CUDA_ARCH_BIN correctly during OpenCV compilation, you will get errors during detection related to invalid dev
ice/make_policy]
12/29/20 18:03:42 zmesdetect_m1[1313] DBG1 yolo.py:137 [|---------- YOLO (input image: 800w*450h, model resize dimensions: 416w*416h) ----------|]
12/29/20 18:03:46 zmesdetect_m1[1313] DBG2 yolo.py:61 [Released pyzm_uid33_gpu_lock portalock]
12/29/20 18:03:46 zmesdetect_m1[1313] DBG1 yolo.py:162 [YOLO detection took: 0:00:03.275794 milliseconds]
12/29/20 18:03:46 zmesdetect_m1[1313] DBG2 yolo.py:196 [YOLO NMS filtering took: 0:00:00.000794]
12/29/20 18:03:46 zmesdetect_m1[1313] DBG3 object.py:55 [core model detection over, got 7 objects. Now filtering]
12/29/20 18:03:46 zmesdetect_m1[1313] DBG3 object.py:59 [Max object size found to be: 90%]
12/29/20 18:03:46 zmesdetect_m1[1313] DBG2 object.py:67 [Converted 90% to 324000.0]
12/29/20 18:03:46 zmesdetect_m1[1313] DBG2 object.py:88 [Ignoring diningtable [71, 254, 503, 454] as conf. level 0.27344855666160583 is lower than 0.3]
12/29/20 18:03:46 zmesdetect_m1[1313] DBG2 object.py:88 [Ignoring chair [577, 135, 675, 265] as conf. level 0.21524196863174438 is lower than 0.3]
12/29/20 18:03:46 zmesdetect_m1[1313] DBG2 object.py:88 [Ignoring person [452, 316, 714, 450] as conf. level 0.2120734006166458 is lower than 0.3]
12/29/20 18:03:46 zmesdetect_m1[1313] DBG2 object.py:90 [Returning filtered list of 4 objects.]
12/29/20 18:03:46 zmesdetect_m1[1313] DBG2 image_manip.py:294 [intersection: polygon in process=[(510, 52), (588, 52), (588, 108), (510, 108)]]
12/29/20 18:03:46 zmesdetect_m1[1313] DBG2 image_manip.py:308 [full_image intersects object:tvmonitor[[(510, 52), (588, 52), (588, 108), (510, 108)]]]
12/29/20 18:03:46 zmesdetect_m1[1313] DBG2 image_manip.py:294 [intersection: polygon in process=[(384, 211), (466, 211), (466, 349), (384, 349)]]
12/29/20 18:03:46 zmesdetect_m1[1313] DBG2 image_manip.py:308 [full_image intersects object:chair[[(384, 211), (466, 211), (466, 349), (384, 349)]]]
12/29/20 18:03:46 zmesdetect_m1[1313] DBG2 image_manip.py:294 [intersection: polygon in process=[(641, 46), (683, 46), (683, 138), (641, 138)]]
12/29/20 18:03:46 zmesdetect_m1[1313] DBG2 image_manip.py:308 [full_image intersects object:pottedplant[[(641, 46), (683, 46), (683, 138), (641, 138)]]]
12/29/20 18:03:46 zmesdetect_m1[1313] DBG2 image_manip.py:294 [intersection: polygon in process=[(211, 294), (253, 294), (253, 322), (211, 322)]]
12/29/20 18:03:46 zmesdetect_m1[1313] DBG2 image_manip.py:308 [full_image intersects object:bowl[[(211, 294), (253, 294), (253, 322), (211, 322)]]]
12/29/20 18:03:46 zmesdetect_m1[1313] DBG2 zm_detect.py:618 [ALPR not in use, no need for look aheads in processing]
12/29/20 18:03:46 zmesdetect_m1[1313] INF zm_detect.py:635 [labels found: ['tvmonitor', 'chair', 'pottedplant', 'bowl']]
12/29/20 18:03:46 zmesdetect_m1[1313] DBG2 zm_detect.py:638 [match found in /var/lib/zmeventnotification/images/1204-alarm.jpg, breaking file loop...]
12/29/20 18:03:46 zmesdetect_m1[1313] DBG2 zm_detect.py:703 [Drawing boxes around objects]
12/29/20 18:03:46 zmesdetect_m1[1313] DBG1 zm_detect.py:728 [Writing detected image to /var/cache/zoneminder/events/1/2020-12-29/1204/objdetect.jpg]
12/29/20 18:03:46 zmesdetect_m1[1313] DBG1 zm_detect.py:732 [Writing JSON output to /var/cache/zoneminder/events/1/2020-12-29/1204/objects.json]
12/29/20 18:03:46 zmesdetect_m1[1313] INF zm_detect.py:784 [Prediction string:[a] detected:tvmonitor:74% chair:68% pottedplant:60% bowl:40% ]
12/29/20 18:03:46 zmesdetect_m1[1313] DBG1 zm_detect.py:787 [Prediction string JSON:[{"type": "object", "label": "tvmonitor", "box": [510, 52, 588, 108], "confidence": "73.68%"}, {"type": "
object", "label": "chair", "box": [384, 211, 466, 349], "confidence": "67.68%"}, {"type": "object", "label": "pottedplant", "box": [641, 46, 683, 138], "confidence": "59.81%"}, {"type": "ob
ject", "label": "bowl", "box": [211, 294, 253, 322], "confidence": "39.76%"}]]
12/29/20 18:04:01 zmesdetect_m1[1370] INF zm_detect.py:208 [---------| pyzm version:0.3.11, hook version:6.0.7,  ES version:6.0.7 , OpenCV version:4.4.0|------------]
12/29/20 18:04:01 zmesdetect_m1[1370] DBG1 utils.py:405 [secret filename: /etc/zm/secrets.ini]
12/29/20 18:04:02 zmesdetect_m1[1370] DBG2 utils.py:378 [Secret token found in config: !ZM_PORTAL]
12/29/20 18:04:02 zmesdetect_m1[1370] DBG2 utils.py:378 [Secret token found in config: !ZM_USER]
12/29/20 18:04:02 zmesdetect_m1[1370] DBG2 utils.py:378 [Secret token found in config: !ZM_PASSWORD]
12/29/20 18:04:02 zmesdetect_m1[1370] DBG2 utils.py:378 [Secret token found in config: !ZM_API_PORTAL]
12/29/20 18:04:02 zmesdetect_m1[1370] DBG2 utils.py:378 [Secret token found in config: !ML_USER]
12/29/20 18:04:02 zmesdetect_m1[1370] DBG2 utils.py:378 [Secret token found in config: !ML_PASSWORD]
12/29/20 18:04:02 zmesdetect_m1[1370] DBG2 utils.py:378 [Secret token found in config: !PLATEREC_ALPR_KEY]
12/29/20 18:04:02 zmesdetect_m1[1370] DBG1 utils.py:440 [allowing self-signed certs to work...]
12/29/20 18:04:02 zmesdetect_m1[1370] DBG4 utils.py:450 [Now checking for monitor overrides]
12/29/20 18:04:02 zmesdetect_m1[1370] DBG4 utils.py:513 [Finally, doing parameter substitution]
12/29/20 18:04:02 zmesdetect_m1[1370] INF zm_detect.py:234 [Importing local classes for Object/Face]
12/29/20 18:04:02 zmesdetect_m1[1370] DBG1 utils.py:280 [Trying to download http://localhost/zm/index.php?view=image&eid=1205&fid=alarm&username=admin&password=*****]
12/29/20 18:04:02 zmesdetect_m1[1370] DBG1 utils.py:299 [Trying to download http://localhost/zm/index.php?view=image&eid=1205&fid=snapshot&username=admin&password=*****]
12/29/20 18:04:02 zmesdetect_m1[1370] DBG1 zm_detect.py:295 [No polygon area specfied, so adding a full image polygon:[{'name': 'full_image', 'value': [(0, 0), (1280, 0), (1280, 720), (0, 7
20)], 'pattern': None}]]
12/29/20 18:04:02 zmesdetect_m1[1370] DBG1 zm_detect.py:298 [resizing to 800 before analysis...]
12/29/20 18:04:02 zmesdetect_m1[1370] DBG2 utils.py:138 [resized polygons x=0.625/y=0.625: [{'name': 'full_image', 'value': [(0, 0), (800, 0), (800, 450), (0, 450)], 'pattern': None}]]
12/29/20 18:04:02 zmesdetect_m1[1370] DBG1 zm_detect.py:319 [User ALPR if vehicle found: False]
12/29/20 18:04:02 zmesdetect_m1[1370] DBG4 yolo.py:26 [Yolo init params: {'pyzm_overrides': {'log_level_debug': 5}, 'secrets': '/etc/zm/secrets.ini', 'version': '1.2', 'cpu_max_processes': 
3, 'gpu_max_processes': 1, 'tpu_max_processes': 1, 'cpu_max_lock_wait': 100, 'gpu_max_lock_wait': 600, 'tpu_max_lock_wait': 100, 'base_data_path': '/var/lib/zmeventnotification', 'portal': 
'http://localhost/zm', 'api_portal': 'http://localhost/zm/api', 'user': 'admin', 'password': 'plexnchi11', 'basic_user': '', 'basic_password': '', 'image_path': '/var/lib/zmeventnotificatio
n/images', 'match_past_detections': 'no', 'past_det_max_diff_area': '5%', 'max_detection_size': '90%', 'frame_id': 'bestmatch', 'bestmatch_order': 'a,s', 'wait': '0', 'resize': '800', 'dele
te_after_analyze': 'yes', 'show_percent': 'yes', 'allow_self_signed': 'yes', 'write_image_to_zm': 'yes', 'write_debug_image': 'no', 'detection_sequence': ['object'], 'detection_mode': 'all'
, 'import_zm_zones': 'no', 'only_triggered_zm_zones': 'no', 'poly_color': (255, 255, 255), 'poly_thickness': 2, 'create_animation': 'no', 'animation_types': "'mp4,gif'", 'animation_width': 
640, 'animation_retry_sleep': 15, 'animation_max_tries': 4, 'fast_gif': 'no', 'ml_gateway': None, 'ml_fallback_local': 'no', 'ml_user': '"your_mlapi_user"', 'ml_password': '"your_mlapi_pass
word"', 'use_sequence': 'yes', 'ml_sequence': '{\n\'general\': {\n\'model_sequence\': \'object\',\n\n},\n\'object\': {\n\'general\':{\n\'pattern\':\'.*\',\n\'same_model_sequence_strategy\':
 \'first\' # also \'most\', \'most_unique\'s\n},\n\'sequence\': [{\n\'object_config\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg\',\n\'object_weights\':\'/var/lib/zmev
entnotification/models/tinyyolov4/yolov4-tiny.weights\',\n\'object_labels\': \'/var/lib/zmeventnotification/models/tinyyolov4/coco.names\',\n\'object_min_confidence\': 0.3,\n\'object_framew
ork\':\'opencv\',\n\'object_processor\': \'gpu\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 600,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100\n}]\n},\n\'face\': {\n\'gene
ral\':{\n\'pattern\': \'.*\',\n\'same_model_sequence_strategy\': \'first\'\n},\n\'sequence\': [{\n\'save_unknown_faces\':\'yes\',\n\'save_unknown_faces_leeway_pixels\':100,\n\'face_detectio
n_framework\': \'dlib\',\n\'known_images_path\': \'/var/lib/zmeventnotification/known_faces\',\n\'unknown_images_path\': \'/var/lib/zmeventnotification/unknown_faces\',\n\'face_model\': \'c
nn\',\n\'face_train_model\': \'cnn\',\n\'face_recog_dist_threshold\': \'0.6\',\n\'face_num_jitters\': \'1\',\n\'face_upsample_times\':\'1\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\
': 600,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100,\n\'max_size\':800\n}]\n},\n\n\'alpr\': {\n\'general\':{\n\'same_model_sequence_strategy\': \'first\',\n\'pre_existing_labels\
':[\'car\', \'motorbike\', \'bus\', \'truck\', \'boat\'],\n\'pattern\': \'.*\'\n\n},\n\'sequence\': [{\n\'alpr_api_type\': \'cloud\',\n\'alpr_service\': \'plate_recognizer\',\n\'alpr_key\':
 \'"your_plate_recognizer_api_key"\',\n\'platrec_stats\': \'yes\',\n\'platerec_min_dscore\': 0.1,\n\'platerec_min_score\': 0.2,\n\'max_size\':1600\n}]\n}\n}', 'stream_sequence': "{\n'frame_
strategy': 'most_models',\n'frame_set': 'snapshot,alarm',\n'resize':800\n\n}", 'object_detection_pattern': '.*', 'object_framework': 'opencv', 'object_processor': 'gpu', 'object_config': '/
var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights', 'object_labels': '/var/lib/zmeventnot
ification/models/tinyyolov4/coco.names', 'object_min_confidence': 0.3, 'face_detection_pattern': '.*', 'face_detection_framework': 'dlib', 'face_recognition_framework': 'dlib', 'face_proces
sor': 'cpu', 'face_num_jitters': 1, 'face_upsample_times': 1, 'face_model': 'cnn', 'face_train_model': 'cnn', 'face_recog_dist_threshold': 0.6, 'face_recog_knn_algo': 'ball_tree', 'known_im
ages_path': '/var/lib/zmeventnotification/known_faces', 'unknown_images_path': '/var/lib/zmeventnotification/unknown_faces', 'unknown_face_name': 'unknown face', 'save_unknown_faces': 'yes'
, 'save_unknown_faces_leeway_pixels': 100, 'alpr_service': 'plate_recognizer', 'alpr_detection_pattern': '.*', 'alpr_url': None, 'alpr_key': '"your_plate_recognizer_api_key"', 'alpr_use_aft
er_detection_only': 'yes', 'alpr_api_type': 'cloud', 'platerec_stats': 'yes', 'platerec_regions': None, 'platerec_min_dscore': 0.1, 'platerec_min_score': 0.2, 'openalpr_recognize_vehicle': 
'0', 'openalpr_country': 'us', 'openalpr_state': None, 'openalpr_min_confidence': '0.3', 'openalpr_cmdline_binary': 'alpr', 'openalpr_cmdline_params': '-j -d', 'openalpr_cmdline_min_confide
nce': 0.3, 'tpu_object_weights': '/var/lib/zmeventnotification/models/coral_edgetpu/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite', 'tpu_object_labels': '/var/lib/zmeventnotificati
on/models/coral_edgetpu/coco_indexed.names', 'tpu_object_framework': 'coral_edgetpu', 'tpu_object_processor': 'tpu', 'tpu_min_confidence': '0.6', 'yolo4_object_weights': '/var/lib/zmeventno
tification/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_p
rocessor': 'gpu', 'tinyyolo_object_config': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'tinyyolo_object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolo
v4-tiny.weights', 'tinyyolo_object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'tinyyolo_object_framework': 'opencv', 'tinyyolo_object_processor': 'gpu'}]
12/29/20 18:04:02 zmesdetect_m1[1370] DBG2 yolo.py:35 [portalock: max:1, name:pyzm_uid33_gpu_lock, timeout:600]
12/29/20 18:04:02 zmesdetect_m1[1370] DBG2 zm_detect.py:370 [using g.config['object_detection_pattern']=.*]
12/29/20 18:04:02 zmesdetect_m1[1370] DBG1 zm_detect.py:403 [Using model: object with /var/lib/zmeventnotification/images/1205-alarm.jpg]
12/29/20 18:04:02 zmesdetect_m1[1370] DBG2 yolo.py:45 [Waiting for pyzm_uid33_gpu_lock portalock...]
12/29/20 18:04:02 zmesdetect_m1[1370] DBG2 yolo.py:47 [Got pyzm_uid33_gpu_lock portalock]
12/29/20 18:04:02 zmesdetect_m1[1370] DBG1 yolo.py:74 [|--------- Loading Yolo model from disk ---------|]
12/29/20 18:04:03 zmesdetect_m1[1370] DBG1 yolo.py:82 [Yolo initialization (loading model from disk) took: 0:00:00.030703]
12/29/20 18:04:03 zmesdetect_m1[1370] DBG2 yolo.py:96 [Setting CUDA backend for OpenCV]
12/29/20 18:04:03 zmesdetect_m1[1370] DBG3 yolo.py:97 [If you did not set your CUDA_ARCH_BIN correctly during OpenCV compilation, you will get errors during detection related to invalid dev
ice/make_policy]
12/29/20 18:04:03 zmesdetect_m1[1370] DBG1 yolo.py:137 [|---------- YOLO (input image: 800w*450h, model resize dimensions: 416w*416h) ----------|]
12/29/20 18:04:06 zmesdetect_m1[1370] DBG2 yolo.py:61 [Released pyzm_uid33_gpu_lock portalock]
12/29/20 18:04:06 zmesdetect_m1[1370] DBG1 yolo.py:162 [YOLO detection took: 0:00:03.558663 milliseconds]
12/29/20 18:04:06 zmesdetect_m1[1370] DBG2 yolo.py:196 [YOLO NMS filtering took: 0:00:00.000926]
12/29/20 18:04:06 zmesdetect_m1[1370] DBG3 object.py:55 [core model detection over, got 8 objects. Now filtering]
12/29/20 18:04:06 zmesdetect_m1[1370] DBG3 object.py:59 [Max object size found to be: 90%]
12/29/20 18:04:06 zmesdetect_m1[1370] DBG2 object.py:67 [Converted 90% to 324000.0]
12/29/20 18:04:06 zmesdetect_m1[1370] DBG2 object.py:88 [Ignoring chair [308, 170, 384, 200] as conf. level 0.23676496744155884 is lower than 0.3]
12/29/20 18:04:06 zmesdetect_m1[1370] DBG2 object.py:88 [Ignoring cup [620, 266, 654, 306] as conf. level 0.22373607754707336 is lower than 0.3]
12/29/20 18:04:06 zmesdetect_m1[1370] DBG2 object.py:90 [Returning filtered list of 6 objects.]
12/29/20 18:04:06 zmesdetect_m1[1370] DBG2 image_manip.py:294 [intersection: polygon in process=[(506, 51), (594, 51), (594, 109), (506, 109)]]
12/29/20 18:04:06 zmesdetect_m1[1370] DBG2 image_manip.py:308 [full_image intersects object:tvmonitor[[(506, 51), (594, 51), (594, 109), (506, 109)]]]
12/29/20 18:04:06 zmesdetect_m1[1370] DBG2 image_manip.py:294 [intersection: polygon in process=[(637, 46), (685, 46), (685, 140), (637, 140)]]
12/29/20 18:04:06 zmesdetect_m1[1370] DBG2 image_manip.py:308 [full_image intersects object:pottedplant[[(637, 46), (685, 46), (685, 140), (637, 140)]]]
12/29/20 18:04:06 zmesdetect_m1[1370] DBG2 image_manip.py:294 [intersection: polygon in process=[(373, 203), (471, 203), (471, 341), (373, 341)]]
12/29/20 18:04:06 zmesdetect_m1[1370] DBG2 image_manip.py:308 [full_image intersects object:chair[[(373, 203), (471, 203), (471, 341), (373, 341)]]]
12/29/20 18:04:06 zmesdetect_m1[1370] DBG2 image_manip.py:294 [intersection: polygon in process=[(610, 386), (692, 386), (692, 438), (610, 438)]]
12/29/20 18:04:06 zmesdetect_m1[1370] DBG2 image_manip.py:308 [full_image intersects object:cell phone[[(610, 386), (692, 386), (692, 438), (610, 438)]]]
12/29/20 18:04:06 zmesdetect_m1[1370] DBG2 image_manip.py:294 [intersection: polygon in process=[(212, 296), (248, 296), (248, 322), (212, 322)]]
12/29/20 18:04:06 zmesdetect_m1[1370] DBG2 image_manip.py:308 [full_image intersects object:bowl[[(212, 296), (248, 296), (248, 322), (212, 322)]]]
12/29/20 18:04:06 zmesdetect_m1[1370] DBG2 image_manip.py:294 [intersection: polygon in process=[(66, 344), (216, 344), (216, 452), (66, 452)]]
12/29/20 18:04:06 zmesdetect_m1[1370] DBG2 image_manip.py:308 [full_image intersects object:chair[[(66, 344), (216, 344), (216, 452), (66, 452)]]]
12/29/20 18:04:06 zmesdetect_m1[1370] DBG2 zm_detect.py:618 [ALPR not in use, no need for look aheads in processing]
12/29/20 18:04:07 zmesdetect_m1[1370] INF zm_detect.py:635 [labels found: ['tvmonitor', 'pottedplant', 'chair', 'cell phone', 'bowl', 'chair']]
12/29/20 18:04:07 zmesdetect_m1[1370] DBG2 zm_detect.py:638 [match found in /var/lib/zmeventnotification/images/1205-alarm.jpg, breaking file loop...]
12/29/20 18:04:07 zmesdetect_m1[1370] DBG2 zm_detect.py:703 [Drawing boxes around objects]
12/29/20 18:04:07 zmesdetect_m1[1370] DBG1 zm_detect.py:728 [Writing detected image to /var/cache/zoneminder/events/1/2020-12-29/1205/objdetect.jpg]
12/29/20 18:04:07 zmesdetect_m1[1370] DBG1 zm_detect.py:732 [Writing JSON output to /var/cache/zoneminder/events/1/2020-12-29/1205/objects.json]
12/29/20 18:04:07 zmesdetect_m1[1370] INF zm_detect.py:784 [Prediction string:[a] detected:tvmonitor:71% pottedplant:65% chair:48% cell phone:40% bowl:35% ]
12/29/20 18:04:07 zmesdetect_m1[1370] DBG1 zm_detect.py:787 [Prediction string JSON:[{"type": "object", "label": "tvmonitor", "box": [506, 51, 594, 109], "confidence": "71.06%"}, {"type": "
object", "label": "pottedplant", "box": [637, 46, 685, 140], "confidence": "65.26%"}, {"type": "object", "label": "chair", "box": [373, 203, 471, 341], "confidence": "48.31%"}, {"type": "ob
ject", "label": "cell phone", "box": [610, 386, 692, 438], "confidence": "39.80%"}, {"type": "object", "label": "bowl", "box": [212, 296, 248, 322], "confidence": "34.88%"}, {"type": "objec
t", "label": "chair", "box": [66, 344, 216, 452], "confidence": "34.05%"}]]
12/29/20 18:05:06 zmesdetect_m1[1479] INF zm_detect.py:208 [---------| pyzm version:0.3.11, hook version:6.0.7,  ES version:6.0.7 , OpenCV version:4.4.0|------------]
12/29/20 18:05:06 zmesdetect_m1[1479] DBG1 utils.py:405 [secret filename: /etc/zm/secrets.ini]
12/29/20 18:05:06 zmesdetect_m1[1479] DBG2 utils.py:378 [Secret token found in config: !ZM_PORTAL]
12/29/20 18:05:06 zmesdetect_m1[1479] DBG2 utils.py:378 [Secret token found in config: !ZM_USER]
12/29/20 18:05:06 zmesdetect_m1[1479] DBG2 utils.py:378 [Secret token found in config: !ZM_PASSWORD]
12/29/20 18:05:06 zmesdetect_m1[1479] DBG2 utils.py:378 [Secret token found in config: !ZM_API_PORTAL]
12/29/20 18:05:06 zmesdetect_m1[1479] DBG2 utils.py:378 [Secret token found in config: !ML_USER]
12/29/20 18:05:06 zmesdetect_m1[1479] DBG2 utils.py:378 [Secret token found in config: !ML_PASSWORD]
12/29/20 18:05:06 zmesdetect_m1[1479] DBG2 utils.py:378 [Secret token found in config: !PLATEREC_ALPR_KEY]
12/29/20 18:05:06 zmesdetect_m1[1479] DBG1 utils.py:440 [allowing self-signed certs to work...]
12/29/20 18:05:06 zmesdetect_m1[1479] DBG4 utils.py:450 [Now checking for monitor overrides]
12/29/20 18:05:06 zmesdetect_m1[1479] DBG4 utils.py:513 [Finally, doing parameter substitution]
12/29/20 18:05:06 zmesdetect_m1[1479] INF zm_detect.py:234 [Importing local classes for Object/Face]
12/29/20 18:05:06 zmesdetect_m1[1479] DBG1 utils.py:280 [Trying to download http://localhost/zm/index.php?view=image&eid=1207&fid=alarm&username=admin&password=*****]
12/29/20 18:05:06 zmesdetect_m1[1479] DBG1 utils.py:299 [Trying to download http://localhost/zm/index.php?view=image&eid=1207&fid=snapshot&username=admin&password=*****]
12/29/20 18:05:06 zmesdetect_m1[1479] DBG1 zm_detect.py:295 [No polygon area specfied, so adding a full image polygon:[{'name': 'full_image', 'value': [(0, 0), (1280, 0), (1280, 720), (0, 7
20)], 'pattern': None}]]
12/29/20 18:05:06 zmesdetect_m1[1479] DBG1 zm_detect.py:298 [resizing to 800 before analysis...]
12/29/20 18:05:06 zmesdetect_m1[1479] DBG2 utils.py:138 [resized polygons x=0.625/y=0.625: [{'name': 'full_image', 'value': [(0, 0), (800, 0), (800, 450), (0, 450)], 'pattern': None}]]
12/29/20 18:05:06 zmesdetect_m1[1479] DBG1 zm_detect.py:319 [User ALPR if vehicle found: False]
12/29/20 18:05:06 zmesdetect_m1[1479] DBG4 yolo.py:26 [Yolo init params: {'pyzm_overrides': {'log_level_debug': 5}, 'secrets': '/etc/zm/secrets.ini', 'version': '1.2', 'cpu_max_processes': 
3, 'gpu_max_processes': 1, 'tpu_max_processes': 1, 'cpu_max_lock_wait': 100, 'gpu_max_lock_wait': 600, 'tpu_max_lock_wait': 100, 'base_data_path': '/var/lib/zmeventnotification', 'portal': 
'http://localhost/zm', 'api_portal': 'http://localhost/zm/api', 'user': 'admin', 'password': 'plexnchi11', 'basic_user': '', 'basic_password': '', 'image_path': '/var/lib/zmeventnotificatio
n/images', 'match_past_detections': 'no', 'past_det_max_diff_area': '5%', 'max_detection_size': '90%', 'frame_id': 'bestmatch', 'bestmatch_order': 'a,s', 'wait': '0', 'resize': '800', 'dele
te_after_analyze': 'yes', 'show_percent': 'yes', 'allow_self_signed': 'yes', 'write_image_to_zm': 'yes', 'write_debug_image': 'no', 'detection_sequence': ['object'], 'detection_mode': 'all'
, 'import_zm_zones': 'no', 'only_triggered_zm_zones': 'no', 'poly_color': (255, 255, 255), 'poly_thickness': 2, 'create_animation': 'no', 'animation_types': "'mp4,gif'", 'animation_width': 
640, 'animation_retry_sleep': 15, 'animation_max_tries': 4, 'fast_gif': 'no', 'ml_gateway': None, 'ml_fallback_local': 'no', 'ml_user': '"your_mlapi_user"', 'ml_password': '"your_mlapi_pass
word"', 'use_sequence': 'yes', 'ml_sequence': '{\n\'general\': {\n\'model_sequence\': \'object\',\n\n},\n\'object\': {\n\'general\':{\n\'pattern\':\'.*\',\n\'same_model_sequence_strategy\':
 \'first\' # also \'most\', \'most_unique\'s\n},\n\'sequence\': [{\n\'object_config\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg\',\n\'object_weights\':\'/var/lib/zmev
entnotification/models/tinyyolov4/yolov4-tiny.weights\',\n\'object_labels\': \'/var/lib/zmeventnotification/models/tinyyolov4/coco.names\',\n\'object_min_confidence\': 0.3,\n\'object_framew
ork\':\'opencv\',\n\'object_processor\': \'gpu\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 600,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100\n}]\n},\n\'face\': {\n\'gene
ral\':{\n\'pattern\': \'.*\',\n\'same_model_sequence_strategy\': \'first\'\n},\n\'sequence\': [{\n\'save_unknown_faces\':\'yes\',\n\'save_unknown_faces_leeway_pixels\':100,\n\'face_detectio
n_framework\': \'dlib\',\n\'known_images_path\': \'/var/lib/zmeventnotification/known_faces\',\n\'unknown_images_path\': \'/var/lib/zmeventnotification/unknown_faces\',\n\'face_model\': \'c
nn\',\n\'face_train_model\': \'cnn\',\n\'face_recog_dist_threshold\': \'0.6\',\n\'face_num_jitters\': \'1\',\n\'face_upsample_times\':\'1\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\
': 600,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100,\n\'max_size\':800\n}]\n},\n\n\'alpr\': {\n\'general\':{\n\'same_model_sequence_strategy\': \'first\',\n\'pre_existing_labels\
':[\'car\', \'motorbike\', \'bus\', \'truck\', \'boat\'],\n\'pattern\': \'.*\'\n\n},\n\'sequence\': [{\n\'alpr_api_type\': \'cloud\',\n\'alpr_service\': \'plate_recognizer\',\n\'alpr_key\':
 \'"your_plate_recognizer_api_key"\',\n\'platrec_stats\': \'yes\',\n\'platerec_min_dscore\': 0.1,\n\'platerec_min_score\': 0.2,\n\'max_size\':1600\n}]\n}\n}', 'stream_sequence': "{\n'frame_
strategy': 'most_models',\n'frame_set': 'snapshot,alarm',\n'resize':800\n\n}", 'object_detection_pattern': '.*', 'object_framework': 'opencv', 'object_processor': 'gpu', 'object_config': '/
var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights', 'object_labels': '/var/lib/zmeventnot
ification/models/tinyyolov4/coco.names', 'object_min_confidence': 0.3, 'face_detection_pattern': '.*', 'face_detection_framework': 'dlib', 'face_recognition_framework': 'dlib', 'face_proces
sor': 'cpu', 'face_num_jitters': 1, 'face_upsample_times': 1, 'face_model': 'cnn', 'face_train_model': 'cnn', 'face_recog_dist_threshold': 0.6, 'face_recog_knn_algo': 'ball_tree', 'known_im
ages_path': '/var/lib/zmeventnotification/known_faces', 'unknown_images_path': '/var/lib/zmeventnotification/unknown_faces', 'unknown_face_name': 'unknown face', 'save_unknown_faces': 'yes'
, 'save_unknown_faces_leeway_pixels': 100, 'alpr_service': 'plate_recognizer', 'alpr_detection_pattern': '.*', 'alpr_url': None, 'alpr_key': '"your_plate_recognizer_api_key"', 'alpr_use_aft
er_detection_only': 'yes', 'alpr_api_type': 'cloud', 'platerec_stats': 'yes', 'platerec_regions': None, 'platerec_min_dscore': 0.1, 'platerec_min_score': 0.2, 'openalpr_recognize_vehicle': 
'0', 'openalpr_country': 'us', 'openalpr_state': None, 'openalpr_min_confidence': '0.3', 'openalpr_cmdline_binary': 'alpr', 'openalpr_cmdline_params': '-j -d', 'openalpr_cmdline_min_confide
nce': 0.3, 'tpu_object_weights': '/var/lib/zmeventnotification/models/coral_edgetpu/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite', 'tpu_object_labels': '/var/lib/zmeventnotificati
on/models/coral_edgetpu/coco_indexed.names', 'tpu_object_framework': 'coral_edgetpu', 'tpu_object_processor': 'tpu', 'tpu_min_confidence': '0.6', 'yolo4_object_weights': '/var/lib/zmeventno
tification/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_p
rocessor': 'gpu', 'tinyyolo_object_config': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'tinyyolo_object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolo
v4-tiny.weights', 'tinyyolo_object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'tinyyolo_object_framework': 'opencv', 'tinyyolo_object_processor': 'gpu'}]
12/29/20 18:05:06 zmesdetect_m1[1479] DBG2 yolo.py:35 [portalock: max:1, name:pyzm_uid33_gpu_lock, timeout:600]
12/29/20 18:05:06 zmesdetect_m1[1479] DBG2 zm_detect.py:370 [using g.config['object_detection_pattern']=.*]
12/29/20 18:05:06 zmesdetect_m1[1479] DBG1 zm_detect.py:403 [Using model: object with /var/lib/zmeventnotification/images/1207-alarm.jpg]
12/29/20 18:05:06 zmesdetect_m1[1479] DBG2 yolo.py:45 [Waiting for pyzm_uid33_gpu_lock portalock...]
12/29/20 18:05:06 zmesdetect_m1[1479] DBG2 yolo.py:47 [Got pyzm_uid33_gpu_lock portalock]
12/29/20 18:05:06 zmesdetect_m1[1479] DBG1 yolo.py:74 [|--------- Loading Yolo model from disk ---------|]
12/29/20 18:05:07 zmesdetect_m1[1479] DBG1 yolo.py:82 [Yolo initialization (loading model from disk) took: 0:00:00.039670]
12/29/20 18:05:07 zmesdetect_m1[1479] DBG2 yolo.py:96 [Setting CUDA backend for OpenCV]
12/29/20 18:05:07 zmesdetect_m1[1479] DBG3 yolo.py:97 [If you did not set your CUDA_ARCH_BIN correctly during OpenCV compilation, you will get errors during detection related to invalid dev
ice/make_policy]
12/29/20 18:05:07 zmesdetect_m1[1479] DBG1 yolo.py:137 [|---------- YOLO (input image: 800w*450h, model resize dimensions: 416w*416h) ----------|]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG2 yolo.py:61 [Released pyzm_uid33_gpu_lock portalock]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG1 yolo.py:162 [YOLO detection took: 0:00:03.376621 milliseconds]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG2 yolo.py:196 [YOLO NMS filtering took: 0:00:00.001201]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG3 object.py:55 [core model detection over, got 11 objects. Now filtering]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG3 object.py:59 [Max object size found to be: 90%]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG2 object.py:67 [Converted 90% to 324000.0]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG2 object.py:88 [Ignoring cup [620, 267, 654, 307] as conf. level 0.2999431788921356 is lower than 0.3]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG2 object.py:88 [Ignoring bowl [444, 200, 550, 252] as conf. level 0.24637028574943542 is lower than 0.3]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG2 object.py:88 [Ignoring diningtable [96, 246, 328, 402] as conf. level 0.24072998762130737 is lower than 0.3]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG2 object.py:90 [Returning filtered list of 8 objects.]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG2 image_manip.py:294 [intersection: polygon in process=[(505, 52), (595, 52), (595, 110), (505, 110)]]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG2 image_manip.py:308 [full_image intersects object:tvmonitor[[(505, 52), (595, 52), (595, 110), (505, 110)]]]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG2 image_manip.py:294 [intersection: polygon in process=[(638, 46), (686, 46), (686, 138), (638, 138)]]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG2 image_manip.py:308 [full_image intersects object:pottedplant[[(638, 46), (686, 46), (686, 138), (638, 138)]]]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG2 image_manip.py:294 [intersection: polygon in process=[(72, 345), (210, 345), (210, 451), (72, 451)]]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG2 image_manip.py:308 [full_image intersects object:chair[[(72, 345), (210, 345), (210, 451), (72, 451)]]]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG2 image_manip.py:294 [intersection: polygon in process=[(378, 223), (470, 223), (470, 341), (378, 341)]]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG2 image_manip.py:308 [full_image intersects object:chair[[(378, 223), (470, 223), (470, 341), (378, 341)]]]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG2 image_manip.py:294 [intersection: polygon in process=[(612, 388), (690, 388), (690, 438), (612, 438)]]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG2 image_manip.py:308 [full_image intersects object:cell phone[[(612, 388), (690, 388), (690, 438), (612, 438)]]]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG2 image_manip.py:294 [intersection: polygon in process=[(667, 107), (783, 107), (783, 329), (667, 329)]]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG2 image_manip.py:308 [full_image intersects object:person[[(667, 107), (783, 107), (783, 329), (667, 329)]]]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG2 image_manip.py:294 [intersection: polygon in process=[(208, 294), (248, 294), (248, 322), (208, 322)]]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG2 image_manip.py:308 [full_image intersects object:bowl[[(208, 294), (248, 294), (248, 322), (208, 322)]]]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG2 image_manip.py:294 [intersection: polygon in process=[(176, 232), (210, 232), (210, 306), (176, 306)]]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG2 image_manip.py:308 [full_image intersects object:vase[[(176, 232), (210, 232), (210, 306), (176, 306)]]]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG2 zm_detect.py:618 [ALPR not in use, no need for look aheads in processing]
12/29/20 18:05:10 zmesdetect_m1[1479] INF zm_detect.py:635 [labels found: ['tvmonitor', 'pottedplant', 'chair', 'chair', 'cell phone', 'person', 'bowl', 'vase']]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG2 zm_detect.py:638 [match found in /var/lib/zmeventnotification/images/1207-alarm.jpg, breaking file loop...]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG2 zm_detect.py:703 [Drawing boxes around objects]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG1 zm_detect.py:728 [Writing detected image to /var/cache/zoneminder/events/1/2020-12-29/1207/objdetect.jpg]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG1 zm_detect.py:732 [Writing JSON output to /var/cache/zoneminder/events/1/2020-12-29/1207/objects.json]
12/29/20 18:05:10 zmesdetect_m1[1479] INF zm_detect.py:784 [Prediction string:[a] detected:tvmonitor:91% pottedplant:78% chair:49% cell phone:45% person:38% bowl:35% vase:32% ]
12/29/20 18:05:10 zmesdetect_m1[1479] DBG1 zm_detect.py:787 [Prediction string JSON:[{"type": "object", "label": "tvmonitor", "box": [505, 52, 595, 110], "confidence": "91.29%"}, {"type": "
object", "label": "pottedplant", "box": [638, 46, 686, 138], "confidence": "78.08%"}, {"type": "object", "label": "chair", "box": [72, 345, 210, 451], "confidence": "49.05%"}, {"type": "obj
ect", "label": "chair", "box": [378, 223, 470, 341], "confidence": "45.57%"}, {"type": "object", "label": "cell phone", "box": [612, 388, 690, 438], "confidence": "45.14%"}, {"type": "objec
t", "label": "person", "box": [667, 107, 783, 329], "confidence": "38.19%"}, {"type": "object", "label": "bowl", "box": [208, 294, 248, 322], "confidence": "34.98%"}, {"type": "object", "la
bel": "vase", "box": [176, 232, 210, 306], "confidence": "32.12%"}]]
12/29/20 18:14:45 zmesdetect_m1[2232] INF zm_detect.py:208 [---------| pyzm version:0.3.11, hook version:6.0.7,  ES version:6.0.7 , OpenCV version:4.4.0|------------]
12/29/20 18:14:45 zmesdetect_m1[2232] DBG1 utils.py:405 [secret filename: /etc/zm/secrets.ini]
12/29/20 18:14:45 zmesdetect_m1[2232] DBG2 utils.py:378 [Secret token found in config: !ZM_PORTAL]
12/29/20 18:14:45 zmesdetect_m1[2232] DBG2 utils.py:378 [Secret token found in config: !ZM_USER]
12/29/20 18:14:45 zmesdetect_m1[2232] DBG2 utils.py:378 [Secret token found in config: !ZM_PASSWORD]
12/29/20 18:14:45 zmesdetect_m1[2232] DBG2 utils.py:378 [Secret token found in config: !ZM_API_PORTAL]
12/29/20 18:14:45 zmesdetect_m1[2232] DBG2 utils.py:378 [Secret token found in config: !ML_USER]
12/29/20 18:14:45 zmesdetect_m1[2232] DBG2 utils.py:378 [Secret token found in config: !ML_PASSWORD]
12/29/20 18:14:45 zmesdetect_m1[2232] DBG2 utils.py:378 [Secret token found in config: !PLATEREC_ALPR_KEY]
12/29/20 18:14:45 zmesdetect_m1[2232] DBG1 utils.py:440 [allowing self-signed certs to work...]
12/29/20 18:14:45 zmesdetect_m1[2232] DBG4 utils.py:450 [Now checking for monitor overrides]
12/29/20 18:14:45 zmesdetect_m1[2232] DBG4 utils.py:513 [Finally, doing parameter substitution]
12/29/20 18:14:45 zmesdetect_m1[2232] INF zm_detect.py:234 [Importing local classes for Object/Face]
12/29/20 18:14:46 zmesdetect_m1[2232] DBG1 utils.py:280 [Trying to download http://localhost/zm/index.php?view=image&eid=1225&fid=alarm&username=admin&password=*****]
12/29/20 18:14:46 zmesdetect_m1[2232] DBG1 utils.py:299 [Trying to download http://localhost/zm/index.php?view=image&eid=1225&fid=snapshot&username=admin&password=*****]
12/29/20 18:14:46 zmesdetect_m1[2232] DBG1 zm_detect.py:295 [No polygon area specfied, so adding a full image polygon:[{'name': 'full_image', 'value': [(0, 0), (1280, 0), (1280, 720), (0, 7
20)], 'pattern': None}]]
12/29/20 18:14:46 zmesdetect_m1[2232] DBG1 zm_detect.py:298 [resizing to 800 before analysis...]
12/29/20 18:14:46 zmesdetect_m1[2232] DBG2 utils.py:138 [resized polygons x=0.625/y=0.625: [{'name': 'full_image', 'value': [(0, 0), (800, 0), (800, 450), (0, 450)], 'pattern': None}]]
12/29/20 18:14:46 zmesdetect_m1[2232] DBG1 zm_detect.py:319 [User ALPR if vehicle found: False]
12/29/20 18:14:46 zmesdetect_m1[2232] DBG4 yolo.py:26 [Yolo init params: {'pyzm_overrides': {'log_level_debug': 5}, 'secrets': '/etc/zm/secrets.ini', 'version': '1.2', 'cpu_max_processes': 
3, 'gpu_max_processes': 1, 'tpu_max_processes': 1, 'cpu_max_lock_wait': 100, 'gpu_max_lock_wait': 600, 'tpu_max_lock_wait': 100, 'base_data_path': '/var/lib/zmeventnotification', 'portal': 
'http://localhost/zm', 'api_portal': 'http://localhost/zm/api', 'user': 'admin', 'password': 'plexnchi11', 'basic_user': '', 'basic_password': '', 'image_path': '/var/lib/zmeventnotificatio
n/images', 'match_past_detections': 'no', 'past_det_max_diff_area': '5%', 'max_detection_size': '90%', 'frame_id': 'bestmatch', 'bestmatch_order': 'a,s', 'wait': '0', 'resize': '800', 'dele
te_after_analyze': 'yes', 'show_percent': 'yes', 'allow_self_signed': 'yes', 'write_image_to_zm': 'yes', 'write_debug_image': 'no', 'detection_sequence': ['object'], 'detection_mode': 'all'
, 'import_zm_zones': 'no', 'only_triggered_zm_zones': 'no', 'poly_color': (255, 255, 255), 'poly_thickness': 2, 'create_animation': 'no', 'animation_types': "'mp4,gif'", 'animation_width': 
640, 'animation_retry_sleep': 15, 'animation_max_tries': 4, 'fast_gif': 'no', 'ml_gateway': None, 'ml_fallback_local': 'no', 'ml_user': '"your_mlapi_user"', 'ml_password': '"your_mlapi_pass
word"', 'use_sequence': 'yes', 'ml_sequence': '{\n\'general\': {\n\'model_sequence\': \'object\',\n\n},\n\'object\': {\n\'general\':{\n\'pattern\':\'.*\',\n\'same_model_sequence_strategy\':
 \'first\' # also \'most\', \'most_unique\'s\n},\n\'sequence\': [{\n\'object_config\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg\',\n\'object_weights\':\'/var/lib/zmev
entnotification/models/tinyyolov4/yolov4-tiny.weights\',\n\'object_labels\': \'/var/lib/zmeventnotification/models/tinyyolov4/coco.names\',\n\'object_min_confidence\': 0.3,\n\'object_framew
ork\':\'opencv\',\n\'object_processor\': \'gpu\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 600,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100\n}]\n},\n\'face\': {\n\'gene
ral\':{\n\'pattern\': \'.*\',\n\'same_model_sequence_strategy\': \'first\'\n},\n\'sequence\': [{\n\'save_unknown_faces\':\'yes\',\n\'save_unknown_faces_leeway_pixels\':100,\n\'face_detectio
n_framework\': \'dlib\',\n\'known_images_path\': \'/var/lib/zmeventnotification/known_faces\',\n\'unknown_images_path\': \'/var/lib/zmeventnotification/unknown_faces\',\n\'face_model\': \'c
nn\',\n\'face_train_model\': \'cnn\',\n\'face_recog_dist_threshold\': \'0.6\',\n\'face_num_jitters\': \'1\',\n\'face_upsample_times\':\'1\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\
': 600,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100,\n\'max_size\':800\n}]\n},\n\n\'alpr\': {\n\'general\':{\n\'same_model_sequence_strategy\': \'first\',\n\'pre_existing_labels\
':[\'car\', \'motorbike\', \'bus\', \'truck\', \'boat\'],\n\'pattern\': \'.*\'\n\n},\n\'sequence\': [{\n\'alpr_api_type\': \'cloud\',\n\'alpr_service\': \'plate_recognizer\',\n\'alpr_key\':
 \'"your_plate_recognizer_api_key"\',\n\'platrec_stats\': \'yes\',\n\'platerec_min_dscore\': 0.1,\n\'platerec_min_score\': 0.2,\n\'max_size\':1600\n}]\n}\n}', 'stream_sequence': "{\n'frame_
strategy': 'most_models',\n'frame_set': 'snapshot,alarm',\n'resize':800\n\n}", 'object_detection_pattern': '.*', 'object_framework': 'opencv', 'object_processor': 'gpu', 'object_config': '/
var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights', 'object_labels': '/var/lib/zmeventnot
ification/models/tinyyolov4/coco.names', 'object_min_confidence': 0.3, 'face_detection_pattern': '.*', 'face_detection_framework': 'dlib', 'face_recognition_framework': 'dlib', 'face_proces
sor': 'cpu', 'face_num_jitters': 1, 'face_upsample_times': 1, 'face_model': 'cnn', 'face_train_model': 'cnn', 'face_recog_dist_threshold': 0.6, 'face_recog_knn_algo': 'ball_tree', 'known_im
ages_path': '/var/lib/zmeventnotification/known_faces', 'unknown_images_path': '/var/lib/zmeventnotification/unknown_faces', 'unknown_face_name': 'unknown face', 'save_unknown_faces': 'yes'
, 'save_unknown_faces_leeway_pixels': 100, 'alpr_service': 'plate_recognizer', 'alpr_detection_pattern': '.*', 'alpr_url': None, 'alpr_key': '"your_plate_recognizer_api_key"', 'alpr_use_aft
er_detection_only': 'yes', 'alpr_api_type': 'cloud', 'platerec_stats': 'yes', 'platerec_regions': None, 'platerec_min_dscore': 0.1, 'platerec_min_score': 0.2, 'openalpr_recognize_vehicle': 
'0', 'openalpr_country': 'us', 'openalpr_state': None, 'openalpr_min_confidence': '0.3', 'openalpr_cmdline_binary': 'alpr', 'openalpr_cmdline_params': '-j -d', 'openalpr_cmdline_min_confide
nce': 0.3, 'tpu_object_weights': '/var/lib/zmeventnotification/models/coral_edgetpu/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite', 'tpu_object_labels': '/var/lib/zmeventnotificati
on/models/coral_edgetpu/coco_indexed.names', 'tpu_object_framework': 'coral_edgetpu', 'tpu_object_processor': 'tpu', 'tpu_min_confidence': '0.6', 'yolo4_object_weights': '/var/lib/zmeventno
tification/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_p
rocessor': 'gpu', 'tinyyolo_object_config': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'tinyyolo_object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolo
v4-tiny.weights', 'tinyyolo_object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'tinyyolo_object_framework': 'opencv', 'tinyyolo_object_processor': 'gpu'}]
12/29/20 18:14:46 zmesdetect_m1[2232] DBG2 yolo.py:35 [portalock: max:1, name:pyzm_uid33_gpu_lock, timeout:600]
12/29/20 18:14:46 zmesdetect_m1[2232] DBG2 zm_detect.py:370 [using g.config['object_detection_pattern']=.*]
12/29/20 18:14:46 zmesdetect_m1[2232] DBG1 zm_detect.py:403 [Using model: object with /var/lib/zmeventnotification/images/1225-alarm.jpg]
12/29/20 18:14:46 zmesdetect_m1[2232] DBG2 yolo.py:45 [Waiting for pyzm_uid33_gpu_lock portalock...]
12/29/20 18:15:50 zmesdetect_m1[2288] INF zm_detect.py:208 [---------| pyzm version:0.3.11, hook version:6.0.7,  ES version:6.0.7 , OpenCV version:4.4.0|------------]
12/29/20 18:15:51 zmesdetect_m1[2288] DBG1 utils.py:405 [secret filename: /etc/zm/secrets.ini]
12/29/20 18:15:51 zmesdetect_m1[2288] DBG2 utils.py:378 [Secret token found in config: !ZM_PORTAL]
12/29/20 18:15:51 zmesdetect_m1[2288] DBG2 utils.py:378 [Secret token found in config: !ZM_USER]
12/29/20 18:15:51 zmesdetect_m1[2288] DBG2 utils.py:378 [Secret token found in config: !ZM_PASSWORD]
12/29/20 18:15:51 zmesdetect_m1[2288] DBG2 utils.py:378 [Secret token found in config: !ZM_API_PORTAL]
12/29/20 18:15:51 zmesdetect_m1[2288] DBG2 utils.py:378 [Secret token found in config: !ML_USER]
12/29/20 18:15:51 zmesdetect_m1[2288] DBG2 utils.py:378 [Secret token found in config: !ML_PASSWORD]
12/29/20 18:15:51 zmesdetect_m1[2288] DBG2 utils.py:378 [Secret token found in config: !PLATEREC_ALPR_KEY]
12/29/20 18:15:51 zmesdetect_m1[2288] DBG1 utils.py:440 [allowing self-signed certs to work...]
12/29/20 18:15:51 zmesdetect_m1[2288] DBG4 utils.py:450 [Now checking for monitor overrides]
12/29/20 18:15:51 zmesdetect_m1[2288] DBG4 utils.py:513 [Finally, doing parameter substitution]
12/29/20 18:15:51 zmesdetect_m1[2288] INF zm_detect.py:234 [Importing local classes for Object/Face]
12/29/20 18:15:51 zmesdetect_m1[2288] DBG1 utils.py:280 [Trying to download http://localhost/zm/index.php?view=image&eid=1226&fid=alarm&username=admin&password=*****]
12/29/20 18:15:51 zmesdetect_m1[2288] DBG1 utils.py:299 [Trying to download http://localhost/zm/index.php?view=image&eid=1226&fid=snapshot&username=admin&password=*****]
12/29/20 18:15:51 zmesdetect_m1[2288] DBG1 zm_detect.py:295 [No polygon area specfied, so adding a full image polygon:[{'name': 'full_image', 'value': [(0, 0), (1280, 0), (1280, 720), (0, 7
20)], 'pattern': None}]]
12/29/20 18:15:51 zmesdetect_m1[2288] DBG1 zm_detect.py:298 [resizing to 800 before analysis...]
12/29/20 18:15:51 zmesdetect_m1[2288] DBG2 utils.py:138 [resized polygons x=0.625/y=0.625: [{'name': 'full_image', 'value': [(0, 0), (800, 0), (800, 450), (0, 450)], 'pattern': None}]]
12/29/20 18:15:51 zmesdetect_m1[2288] DBG1 zm_detect.py:319 [User ALPR if vehicle found: False]
12/29/20 18:15:51 zmesdetect_m1[2288] DBG4 yolo.py:26 [Yolo init params: {'pyzm_overrides': {'log_level_debug': 5}, 'secrets': '/etc/zm/secrets.ini', 'version': '1.2', 'cpu_max_processes': 
3, 'gpu_max_processes': 1, 'tpu_max_processes': 1, 'cpu_max_lock_wait': 100, 'gpu_max_lock_wait': 600, 'tpu_max_lock_wait': 100, 'base_data_path': '/var/lib/zmeventnotification', 'portal': 
'http://localhost/zm', 'api_portal': 'http://localhost/zm/api', 'user': 'admin', 'password': 'plexnchi11', 'basic_user': '', 'basic_password': '', 'image_path': '/var/lib/zmeventnotificatio
n/images', 'match_past_detections': 'no', 'past_det_max_diff_area': '5%', 'max_detection_size': '90%', 'frame_id': 'bestmatch', 'bestmatch_order': 'a,s', 'wait': '0', 'resize': '800', 'dele
te_after_analyze': 'yes', 'show_percent': 'yes', 'allow_self_signed': 'yes', 'write_image_to_zm': 'yes', 'write_debug_image': 'no', 'detection_sequence': ['object'], 'detection_mode': 'all'
, 'import_zm_zones': 'no', 'only_triggered_zm_zones': 'no', 'poly_color': (255, 255, 255), 'poly_thickness': 2, 'create_animation': 'no', 'animation_types': "'mp4,gif'", 'animation_width': 
640, 'animation_retry_sleep': 15, 'animation_max_tries': 4, 'fast_gif': 'no', 'ml_gateway': None, 'ml_fallback_local': 'no', 'ml_user': '"your_mlapi_user"', 'ml_password': '"your_mlapi_pass
word"', 'use_sequence': 'yes', 'ml_sequence': '{\n\'general\': {\n\'model_sequence\': \'object\',\n\n},\n\'object\': {\n\'general\':{\n\'pattern\':\'.*\',\n\'same_model_sequence_strategy\':
 \'first\' # also \'most\', \'most_unique\'s\n},\n\'sequence\': [{\n\'object_config\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg\',\n\'object_weights\':\'/var/lib/zmev
entnotification/models/tinyyolov4/yolov4-tiny.weights\',\n\'object_labels\': \'/var/lib/zmeventnotification/models/tinyyolov4/coco.names\',\n\'object_min_confidence\': 0.3,\n\'object_framew
ork\':\'opencv\',\n\'object_processor\': \'gpu\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 600,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100\n}]\n},\n\'face\': {\n\'gene
ral\':{\n\'pattern\': \'.*\',\n\'same_model_sequence_strategy\': \'first\'\n},\n\'sequence\': [{\n\'save_unknown_faces\':\'yes\',\n\'save_unknown_faces_leeway_pixels\':100,\n\'face_detectio
n_framework\': \'dlib\',\n\'known_images_path\': \'/var/lib/zmeventnotification/known_faces\',\n\'unknown_images_path\': \'/var/lib/zmeventnotification/unknown_faces\',\n\'face_model\': \'c
nn\',\n\'face_train_model\': \'cnn\',\n\'face_recog_dist_threshold\': \'0.6\',\n\'face_num_jitters\': \'1\',\n\'face_upsample_times\':\'1\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\
': 600,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100,\n\'max_size\':800\n}]\n},\n\n\'alpr\': {\n\'general\':{\n\'same_model_sequence_strategy\': \'first\',\n\'pre_existing_labels\
':[\'car\', \'motorbike\', \'bus\', \'truck\', \'boat\'],\n\'pattern\': \'.*\'\n\n},\n\'sequence\': [{\n\'alpr_api_type\': \'cloud\',\n\'alpr_service\': \'plate_recognizer\',\n\'alpr_key\':
 \'"your_plate_recognizer_api_key"\',\n\'platrec_stats\': \'yes\',\n\'platerec_min_dscore\': 0.1,\n\'platerec_min_score\': 0.2,\n\'max_size\':1600\n}]\n}\n}', 'stream_sequence': "{\n'frame_
strategy': 'most_models',\n'frame_set': 'snapshot,alarm',\n'resize':800\n\n}", 'object_detection_pattern': '.*', 'object_framework': 'opencv', 'object_processor': 'gpu', 'object_config': '/
var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights', 'object_labels': '/var/lib/zmeventnot
ification/models/tinyyolov4/coco.names', 'object_min_confidence': 0.3, 'face_detection_pattern': '.*', 'face_detection_framework': 'dlib', 'face_recognition_framework': 'dlib', 'face_proces
sor': 'cpu', 'face_num_jitters': 1, 'face_upsample_times': 1, 'face_model': 'cnn', 'face_train_model': 'cnn', 'face_recog_dist_threshold': 0.6, 'face_recog_knn_algo': 'ball_tree', 'known_im
ages_path': '/var/lib/zmeventnotification/known_faces', 'unknown_images_path': '/var/lib/zmeventnotification/unknown_faces', 'unknown_face_name': 'unknown face', 'save_unknown_faces': 'yes'
, 'save_unknown_faces_leeway_pixels': 100, 'alpr_service': 'plate_recognizer', 'alpr_detection_pattern': '.*', 'alpr_url': None, 'alpr_key': '"your_plate_recognizer_api_key"', 'alpr_use_aft
er_detection_only': 'yes', 'alpr_api_type': 'cloud', 'platerec_stats': 'yes', 'platerec_regions': None, 'platerec_min_dscore': 0.1, 'platerec_min_score': 0.2, 'openalpr_recognize_vehicle': 
'0', 'openalpr_country': 'us', 'openalpr_state': None, 'openalpr_min_confidence': '0.3', 'openalpr_cmdline_binary': 'alpr', 'openalpr_cmdline_params': '-j -d', 'openalpr_cmdline_min_confide
nce': 0.3, 'tpu_object_weights': '/var/lib/zmeventnotification/models/coral_edgetpu/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite', 'tpu_object_labels': '/var/lib/zmeventnotificati
on/models/coral_edgetpu/coco_indexed.names', 'tpu_object_framework': 'coral_edgetpu', 'tpu_object_processor': 'tpu', 'tpu_min_confidence': '0.6', 'yolo4_object_weights': '/var/lib/zmeventno
tification/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_p
rocessor': 'gpu', 'tinyyolo_object_config': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'tinyyolo_object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolo
v4-tiny.weights', 'tinyyolo_object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'tinyyolo_object_framework': 'opencv', 'tinyyolo_object_processor': 'gpu'}]
12/29/20 18:15:51 zmesdetect_m1[2288] DBG2 yolo.py:35 [portalock: max:1, name:pyzm_uid33_gpu_lock, timeout:600]
12/29/20 18:15:51 zmesdetect_m1[2288] DBG2 zm_detect.py:370 [using g.config['object_detection_pattern']=.*]
12/29/20 18:15:51 zmesdetect_m1[2288] DBG1 zm_detect.py:403 [Using model: object with /var/lib/zmeventnotification/images/1226-alarm.jpg]
12/29/20 18:15:51 zmesdetect_m1[2288] DBG2 yolo.py:45 [Waiting for pyzm_uid33_gpu_lock portalock...]
12/29/20 18:16:02 zmesdetect_m1[1587] ERR yolo.py:51 [Timeout waiting for pyzm_uid33_gpu_lock portalock for 600 seconds]
12/29/20 18:16:02 zmesdetect_m1[1587] FAT zm_detect.py:860 [Unrecoverable error:Timeout waiting for pyzm_uid33_gpu_lock portallock for 600 seconds Traceback:Traceback (most recent call last
):
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/yolo.py", line 46, in acquire_lock
    self.lock.acquire()
  File "/usr/local/lib/python3.6/dist-packages/portalocker/utils.py", line 343, in acquire
    raise exceptions.AlreadyLocked()
portalocker.exceptions.AlreadyLocked

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 857, in <module>
    main_handler()
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 432, in main_handler
    b, l, c = m.detect(original_image)
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/object.py", line 54, in detect
    b,l,c = self.model.detect(image)
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/yolo.py", line 129, in detect
    self.acquire_lock()
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/yolo.py", line 52, in acquire_lock
    raise ValueError ('Timeout waiting for {} portallock for {} seconds'.format(self.lock_name, self.lock_timeout))
ValueError: Timeout waiting for pyzm_uid33_gpu_lock portallock for 600 seconds
]
pliablepixels commented 3 years ago

Based on your logs above, it seems to be releasing the locks every time before the crash [Released pyzm_uid33_gpu_lock portalock]

Workaround: I've just updated ES and pyzm There is a new attribute in objectconfig.ini inside the [ml] section (ref)

disable_locks=yes # or no

If you set it to no, pyzm won't try and grab locks

See if this works better for you.

However, not sure what the real issue is - this just completely avoids locking.

klutchell commented 3 years ago

Thanks for the workaround, that definitely works as expected and all of my recent events have been processed. I still saw 6 CUBLAS fatal errors over a 2h period but none in the last 8h and compared to the number of successful events processed it's a drop in the bucket. I'll investigate that issue separately when I get a chance.

Is there anything else I can provide to help diagnose the locks not being removed on processing errors? You've done excellent work on all of these components and I'd like to help to improve them where I can. At least we have this issue for reference if anyone else encounters it, though I know my setup is pretty unique.

pliablepixels commented 3 years ago

It would be interesting to know why the locking issue really happens. Note that I haven't authored the locking system - I use portalocker.

There seem to be multiple issues worth isolating:

klutchell commented 3 years ago

Thanks for the suggestions, I hadn't considered memory being an issue but it would explain the occasional CUBLAS_STATUS_NOT_INITIALIZED messages.

Jetson Nano only has 4GB of shared memory between the CPU and the GPU, so it would make sense that on application start I see a few CUBLAS errors before things stabilize. It's difficult to monitor since the Jetson platform doesn't support nvidia-smi but some simple memory monitoring does show it's nearly maxed out on application start, and likely also if under heavy processing load but I can attempt to verify with more tests.

As for the locking, I tried enabling locks and switched to cpu processing, however it's still creating and getting stuck on gpu locks? I manually cleared an existing gpu lock file and it reappeared confirming that even if the processing is using cpu, it is creating locks with gpu in the name. Here are some recent debug logs.

12/31/20 09:20:09 zmesdetect_m1[426] INF zm_detect.py:208 [---------| pyzm version:0.3.13, hook version:6.0.7,  ES version:6.0.7 , OpenCV version:4.4.0|------------]
12/31/20 09:20:09 zmesdetect_m1[426] DBG1 utils.py:406 [secret filename: /etc/zm/secrets.ini]
12/31/20 09:20:09 zmesdetect_m1[426] DBG2 utils.py:379 [Secret token found in config: !ZM_PORTAL]
12/31/20 09:20:09 zmesdetect_m1[426] DBG2 utils.py:379 [Secret token found in config: !ZM_USER]
12/31/20 09:20:09 zmesdetect_m1[426] DBG2 utils.py:379 [Secret token found in config: !ZM_PASSWORD]
12/31/20 09:20:09 zmesdetect_m1[426] DBG2 utils.py:379 [Secret token found in config: !ZM_API_PORTAL]
12/31/20 09:20:09 zmesdetect_m1[426] DBG2 utils.py:379 [Secret token found in config: !ML_USER]
12/31/20 09:20:09 zmesdetect_m1[426] DBG2 utils.py:379 [Secret token found in config: !ML_PASSWORD]
12/31/20 09:20:09 zmesdetect_m1[426] DBG2 utils.py:379 [Secret token found in config: !PLATEREC_ALPR_KEY]
12/31/20 09:20:09 zmesdetect_m1[426] DBG1 utils.py:441 [allowing self-signed certs to work...]
12/31/20 09:20:09 zmesdetect_m1[426] DBG4 utils.py:451 [Now checking for monitor overrides]
12/31/20 09:20:09 zmesdetect_m1[426] DBG4 utils.py:514 [Finally, doing parameter substitution]
12/31/20 09:20:09 zmesdetect_m1[426] INF zm_detect.py:234 [Importing local classes for Object/Face]
12/31/20 09:20:09 zmesdetect_m1[426] DBG1 utils.py:281 [Trying to download http://localhost/zm/index.php?view=image&eid=1516&fid=alarm&username=admin&password=*****]
12/31/20 09:20:09 zmesdetect_m1[426] DBG1 utils.py:300 [Trying to download http://localhost/zm/index.php?view=image&eid=1516&fid=snapshot&username=admin&password=*****]
12/31/20 09:20:09 zmesdetect_m1[426] DBG1 zm_detect.py:295 [No polygon area specfied, so adding a full image polygon:[{'name': 'full_image', 'value': [(0, 0), (1280, 0), (1280, 720), (0, 720
)], 'pattern': None}]]
12/31/20 09:20:09 zmesdetect_m1[426] DBG1 zm_detect.py:298 [resizing to 800 before analysis...]
12/31/20 09:20:09 zmesdetect_m1[426] DBG2 utils.py:139 [resized polygons x=0.625/y=0.625: [{'name': 'full_image', 'value': [(0, 0), (800, 0), (800, 450), (0, 450)], 'pattern': None}]]
12/31/20 09:20:09 zmesdetect_m1[426] DBG1 zm_detect.py:319 [User ALPR if vehicle found: False]
12/31/20 09:20:09 zmesdetect_m1[426] DBG4 yolo.py:26 [Yolo init params: {'pyzm_overrides': {'log_level_debug': 5}, 'secrets': '/etc/zm/secrets.ini', 'version': '1.2', 'cpu_max_processes': 3,
 'gpu_max_processes': 1, 'tpu_max_processes': 1, 'cpu_max_lock_wait': 100, 'gpu_max_lock_wait': 100, 'tpu_max_lock_wait': 100, 'base_data_path': '/var/lib/zmeventnotification', 'portal': 'ht
tp://localhost/zm', 'api_portal': 'http://localhost/zm/api', 'user': 'admin', 'password': 'plexnchi11', 'basic_user': '', 'basic_password': '', 'image_path': '/var/lib/zmeventnotification/im
ages', 'match_past_detections': 'no', 'past_det_max_diff_area': '5%', 'max_detection_size': '90%', 'frame_id': 'bestmatch', 'bestmatch_order': 'a,s', 'wait': '0', 'resize': '800', 'delete_af
ter_analyze': 'yes', 'show_percent': 'yes', 'allow_self_signed': 'yes', 'write_image_to_zm': 'yes', 'write_debug_image': 'no', 'detection_sequence': ['object'], 'detection_mode': 'all', 'imp
ort_zm_zones': 'no', 'only_triggered_zm_zones': 'no', 'poly_color': (255, 255, 255), 'poly_thickness': 2, 'create_animation': 'no', 'animation_types': "'mp4,gif'", 'animation_width': 640, 'a
nimation_retry_sleep': 15, 'animation_max_tries': 4, 'fast_gif': 'no', 'ml_gateway': None, 'ml_fallback_local': 'no', 'ml_user': '"your_mlapi_user"', 'ml_password': '"your_mlapi_password"', 
'disable_locks': 'no', 'use_sequence': 'yes', 'ml_sequence': '{\n\'general\': {\n\'model_sequence\': \'object\',\n\'disable_locks\': \'no\',\n},\n\'object\': {\n\'general\':{\n\'pattern\':\'
.*\',\n\'same_model_sequence_strategy\': \'first\' # also \'most\', \'most_unique\'s\n},\n\'sequence\': [{\n\'object_config\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg
\',\n\'object_weights\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights\',\n\'object_labels\': \'/var/lib/zmeventnotification/models/tinyyolov4/coco.names\',\n\'object_m
in_confidence\': 0.3,\n\'object_framework\':\'opencv\',\n\'object_processor\': \'cpu\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wai
t\': 100\n}]\n},\n\'face\': {\n\'general\':{\n\'pattern\': \'.*\',\n\'same_model_sequence_strategy\': \'first\'\n},\n\'sequence\': [{\n\'save_unknown_faces\':\'yes\',\n\'save_unknown_faces_l
eeway_pixels\':100,\n\'face_detection_framework\': \'dlib\',\n\'known_images_path\': \'/var/lib/zmeventnotification/known_faces\',\n\'unknown_images_path\': \'/var/lib/zmeventnotification/un
known_faces\',\n\'face_model\': \'cnn\',\n\'face_train_model\': \'cnn\',\n\'face_recog_dist_threshold\': \'0.6\',\n\'face_num_jitters\': \'1\',\n\'face_upsample_times\':\'1\',\n\'gpu_max_pro
cesses\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100,\n\'max_size\':800\n}]\n},\n\n\'alpr\': {\n\'general\':{\n\'same_model_sequence_strategy\': \
'first\',\n\'pre_existing_labels\':[\'car\', \'motorbike\', \'bus\', \'truck\', \'boat\'],\n\'pattern\': \'.*\'\n\n},\n\'sequence\': [{\n\'alpr_api_type\': \'cloud\',\n\'alpr_service\': \'pl
ate_recognizer\',\n\'alpr_key\': \'"your_plate_recognizer_api_key"\',\n\'platrec_stats\': \'yes\',\n\'platerec_min_dscore\': 0.1,\n\'platerec_min_score\': 0.2,\n\'max_size\':1600\n}]\n}\n}',
 'stream_sequence': "{\n'frame_strategy': 'most_models',\n'frame_set': 'snapshot,alarm',\n'resize':800\n\n}", 'object_detection_pattern': '.*', 'object_framework': 'opencv', 'object_processo
r': 'gpu', 'object_config': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights', 'object_
labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'object_min_confidence': 0.3, 'face_detection_pattern': '.*', 'face_detection_framework': 'dlib', 'face_recognition_fram
ework': 'dlib', 'face_processor': 'cpu', 'face_num_jitters': 1, 'face_upsample_times': 1, 'face_model': 'cnn', 'face_train_model': 'cnn', 'face_recog_dist_threshold': 0.6, 'face_recog_knn_al
go': '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': 'yes', 'save_unknown_faces_leeway_pixels': 100, 'alpr_service': 'plate_recognizer', 'alpr_detection_pattern': '.*', 'alpr_url': None, 'alpr_key': '"your_plate_recognizer
_api_key"', 'alpr_use_after_detection_only': 'yes', 'alpr_api_type': 'cloud', 'platerec_stats': 'yes', 'platerec_regions': None, 'platerec_min_dscore': 0.1, 'platerec_min_score': 0.2, 'opena
lpr_recognize_vehicle': '0', 'openalpr_country': 'us', 'openalpr_state': None, 'openalpr_min_confidence': '0.3', 'openalpr_cmdline_binary': 'alpr', 'openalpr_cmdline_params': '-j -d', 'opena
lpr_cmdline_min_confidence': 0.3, 'tpu_object_weights': '/var/lib/zmeventnotification/models/coral_edgetpu/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite', 'tpu_object_labels': '/var
/lib/zmeventnotification/models/coral_edgetpu/coco_indexed.names', 'tpu_object_framework': 'coral_edgetpu', 'tpu_object_processor': 'tpu', 'tpu_min_confidence': '0.6', '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/zmeventnotific
ation/models/yolov4/yolov4.cfg', 'yolo4_object_framework': 'opencv', 'yolo4_object_processor': 'gpu', 'yolo3_object_weights': '/var/lib/zmeventnotification/models/yolov3/yolov3.weights', 'yo
lo3_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/model
s/tinyyolov4/yolov4-tiny.weights', 'tinyyolo_object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'tinyyolo_object_framework': 'opencv', 'tinyyolo_object_processor': 
'cpu'}]
12/31/20 09:20:09 zmesdetect_m1[426] DBG2 yolo.py:35 [portalock: max:1, name:pyzm_uid33_gpu_lock, timeout:100]
12/31/20 09:20:09 zmesdetect_m1[426] DBG2 zm_detect.py:370 [using g.config['object_detection_pattern']=.*]
12/31/20 09:20:09 zmesdetect_m1[426] DBG1 zm_detect.py:403 [Using model: object with /var/lib/zmeventnotification/images/1516-alarm.jpg]
12/31/20 09:20:09 zmesdetect_m1[426] DBG2 yolo.py:48 [Waiting for pyzm_uid33_gpu_lock portalock...]
12/31/20 09:20:09 zmesdetect_m1[426] DBG2 yolo.py:50 [Got pyzm_uid33_gpu_lock portalock]
12/31/20 09:20:09 zmesdetect_m1[426] DBG1 yolo.py:79 [|--------- Loading Yolo model from disk ---------|]
12/31/20 09:20:09 zmesdetect_m1[426] DBG1 yolo.py:87 [Yolo initialization (loading model from disk) took: 0:00:00.030855]
12/31/20 09:20:09 zmesdetect_m1[426] DBG2 yolo.py:101 [Setting CUDA backend for OpenCV]
12/31/20 09:20:09 zmesdetect_m1[426] DBG3 yolo.py:102 [If you did not set your CUDA_ARCH_BIN correctly during OpenCV compilation, you will get errors during detection related to invalid devi
ce/make_policy]
12/31/20 09:20:09 zmesdetect_m1[426] DBG1 yolo.py:142 [|---------- YOLO (input image: 800w*450h, model resize dimensions: 416w*416h) ----------|]
12/31/20 09:20:13 zmesdetect_m1[426] DBG2 yolo.py:66 [Released pyzm_uid33_gpu_lock portalock]
12/31/20 09:20:13 zmesdetect_m1[426] DBG1 yolo.py:167 [YOLO detection took: 0:00:03.443351 milliseconds]
12/31/20 09:20:13 zmesdetect_m1[426] DBG2 yolo.py:201 [YOLO NMS filtering took: 0:00:00.000825]
12/31/20 09:20:13 zmesdetect_m1[426] DBG3 object.py:55 [core model detection over, got 6 objects. Now filtering]
12/31/20 09:20:13 zmesdetect_m1[426] DBG3 object.py:59 [Max object size found to be: 90%]
12/31/20 09:20:13 zmesdetect_m1[426] DBG2 object.py:67 [Converted 90% to 324000.0]
12/31/20 09:20:13 zmesdetect_m1[426] DBG2 object.py:88 [Ignoring chair [89, 332, 213, 450] as conf. level 0.29546886682510376 is lower than 0.3]
12/31/20 09:20:13 zmesdetect_m1[426] DBG2 object.py:88 [Ignoring diningtable [26, 271, 414, 451] as conf. level 0.2155763953924179 is lower than 0.3]
12/31/20 09:20:13 zmesdetect_m1[426] DBG2 object.py:90 [Returning filtered list of 4 objects.]
12/31/20 09:20:13 zmesdetect_m1[426] DBG2 image_manip.py:294 [intersection: polygon in process=[(576, 178), (704, 178), (704, 406), (576, 406)]]
12/31/20 09:20:13 zmesdetect_m1[426] DBG2 image_manip.py:308 [full_image intersects object:person[[(576, 178), (704, 178), (704, 406), (576, 406)]]]
12/31/20 09:20:13 zmesdetect_m1[426] DBG2 image_manip.py:294 [intersection: polygon in process=[(391, 112), (565, 112), (565, 422), (391, 422)]]
12/31/20 09:20:13 zmesdetect_m1[426] DBG2 image_manip.py:308 [full_image intersects object:person[[(391, 112), (565, 112), (565, 422), (391, 422)]]]
12/31/20 09:20:13 zmesdetect_m1[426] DBG2 image_manip.py:294 [intersection: polygon in process=[(575, 136), (681, 136), (681, 242), (575, 242)]]
12/31/20 09:20:13 zmesdetect_m1[426] DBG2 image_manip.py:308 [full_image intersects object:chair[[(575, 136), (681, 136), (681, 242), (575, 242)]]]
12/31/20 09:20:13 zmesdetect_m1[426] DBG2 image_manip.py:294 [intersection: polygon in process=[(391, 2), (459, 2), (459, 82), (391, 82)]]
12/31/20 09:20:13 zmesdetect_m1[426] DBG2 image_manip.py:308 [full_image intersects object:tvmonitor[[(391, 2), (459, 2), (459, 82), (391, 82)]]]
12/31/20 09:20:13 zmesdetect_m1[426] DBG2 zm_detect.py:618 [ALPR not in use, no need for look aheads in processing]
12/31/20 09:20:13 zmesdetect_m1[426] INF zm_detect.py:635 [labels found: ['person', 'person', 'chair', 'tvmonitor']]
12/31/20 09:20:13 zmesdetect_m1[426] DBG2 zm_detect.py:638 [match found in /var/lib/zmeventnotification/images/1516-alarm.jpg, breaking file loop...]
12/31/20 09:20:13 zmesdetect_m1[426] DBG2 zm_detect.py:703 [Drawing boxes around objects]
12/31/20 09:20:13 zmesdetect_m1[426] DBG1 zm_detect.py:728 [Writing detected image to /var/cache/zoneminder/events/1/2020-12-31/1516/objdetect.jpg]
12/31/20 09:20:13 zmesdetect_m1[426] DBG1 zm_detect.py:732 [Writing JSON output to /var/cache/zoneminder/events/1/2020-12-31/1516/objects.json]
12/31/20 09:20:13 zmesdetect_m1[426] INF zm_detect.py:784 [Prediction string:[a] detected:person:95% chair:80% tvmonitor:41% ]
12/31/20 09:20:13 zmesdetect_m1[426] DBG1 zm_detect.py:787 [Prediction string JSON:[{"type": "object", "label": "person", "box": [576, 178, 704, 406], "confidence": "95.32%"}, {"type": "obje
ct", "label": "person", "box": [391, 112, 565, 422], "confidence": "86.64%"}, {"type": "object", "label": "chair", "box": [575, 136, 681, 242], "confidence": "80.27%"}, {"type": "object", "l
abel": "tvmonitor", "box": [391, 2, 459, 82], "confidence": "40.65%"}]]
12/31/20 09:20:18 zmesdetect_m1[464] INF zm_detect.py:208 [---------| pyzm version:0.3.13, hook version:6.0.7,  ES version:6.0.7 , OpenCV version:4.4.0|------------]
12/31/20 09:20:18 zmesdetect_m1[464] DBG1 utils.py:406 [secret filename: /etc/zm/secrets.ini]
12/31/20 09:20:18 zmesdetect_m1[464] DBG2 utils.py:379 [Secret token found in config: !ZM_PORTAL]
12/31/20 09:20:18 zmesdetect_m1[464] DBG2 utils.py:379 [Secret token found in config: !ZM_USER]
12/31/20 09:20:18 zmesdetect_m1[464] DBG2 utils.py:379 [Secret token found in config: !ZM_PASSWORD]
12/31/20 09:20:18 zmesdetect_m1[464] DBG2 utils.py:379 [Secret token found in config: !ZM_API_PORTAL]
12/31/20 09:20:18 zmesdetect_m1[464] DBG2 utils.py:379 [Secret token found in config: !ML_USER]
12/31/20 09:20:18 zmesdetect_m1[464] DBG2 utils.py:379 [Secret token found in config: !ML_PASSWORD]
12/31/20 09:20:18 zmesdetect_m1[464] DBG2 utils.py:379 [Secret token found in config: !PLATEREC_ALPR_KEY]
12/31/20 09:20:18 zmesdetect_m1[464] DBG1 utils.py:441 [allowing self-signed certs to work...]
12/31/20 09:20:18 zmesdetect_m1[464] DBG4 utils.py:451 [Now checking for monitor overrides]
12/31/20 09:20:18 zmesdetect_m1[464] DBG4 utils.py:514 [Finally, doing parameter substitution]
12/31/20 09:20:18 zmesdetect_m1[464] INF zm_detect.py:234 [Importing local classes for Object/Face]
12/31/20 09:20:18 zmesdetect_m1[464] DBG1 utils.py:281 [Trying to download http://localhost/zm/index.php?view=image&eid=1517&fid=alarm&username=admin&password=*****]
12/31/20 09:20:19 zmesdetect_m1[464] DBG1 utils.py:300 [Trying to download http://localhost/zm/index.php?view=image&eid=1517&fid=snapshot&username=admin&password=*****]
12/31/20 09:20:19 zmesdetect_m1[464] DBG1 zm_detect.py:295 [No polygon area specfied, so adding a full image polygon:[{'name': 'full_image', 'value': [(0, 0), (1280, 0), (1280, 720), (0, 720
)], 'pattern': None}]]
12/31/20 09:20:19 zmesdetect_m1[464] DBG1 zm_detect.py:298 [resizing to 800 before analysis...]
12/31/20 09:20:19 zmesdetect_m1[464] DBG2 utils.py:139 [resized polygons x=0.625/y=0.625: [{'name': 'full_image', 'value': [(0, 0), (800, 0), (800, 450), (0, 450)], 'pattern': None}]]
12/31/20 09:20:19 zmesdetect_m1[464] DBG1 zm_detect.py:319 [User ALPR if vehicle found: False]
12/31/20 09:20:19 zmesdetect_m1[464] DBG4 yolo.py:26 [Yolo init params: {'pyzm_overrides': {'log_level_debug': 5}, 'secrets': '/etc/zm/secrets.ini', 'version': '1.2', 'cpu_max_processes': 3,
 'gpu_max_processes': 1, 'tpu_max_processes': 1, 'cpu_max_lock_wait': 100, 'gpu_max_lock_wait': 100, 'tpu_max_lock_wait': 100, 'base_data_path': '/var/lib/zmeventnotification', 'portal': 'ht
tp://localhost/zm', 'api_portal': 'http://localhost/zm/api', 'user': 'admin', 'password': 'plexnchi11', 'basic_user': '', 'basic_password': '', 'image_path': '/var/lib/zmeventnotification/im
ages', 'match_past_detections': 'no', 'past_det_max_diff_area': '5%', 'max_detection_size': '90%', 'frame_id': 'bestmatch', 'bestmatch_order': 'a,s', 'wait': '0', 'resize': '800', 'delete_af
ter_analyze': 'yes', 'show_percent': 'yes', 'allow_self_signed': 'yes', 'write_image_to_zm': 'yes', 'write_debug_image': 'no', 'detection_sequence': ['object'], 'detection_mode': 'all', 'imp
ort_zm_zones': 'no', 'only_triggered_zm_zones': 'no', 'poly_color': (255, 255, 255), 'poly_thickness': 2, 'create_animation': 'no', 'animation_types': "'mp4,gif'", 'animation_width': 640, 'a
nimation_retry_sleep': 15, 'animation_max_tries': 4, 'fast_gif': 'no', 'ml_gateway': None, 'ml_fallback_local': 'no', 'ml_user': '"your_mlapi_user"', 'ml_password': '"your_mlapi_password"', 
'disable_locks': 'no', 'use_sequence': 'yes', 'ml_sequence': '{\n\'general\': {\n\'model_sequence\': \'object\',\n\'disable_locks\': \'no\',\n},\n\'object\': {\n\'general\':{\n\'pattern\':\'
.*\',\n\'same_model_sequence_strategy\': \'first\' # also \'most\', \'most_unique\'s\n},\n\'sequence\': [{\n\'object_config\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg
\',\n\'object_weights\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights\',\n\'object_labels\': \'/var/lib/zmeventnotification/models/tinyyolov4/coco.names\',\n\'object_m
in_confidence\': 0.3,\n\'object_framework\':\'opencv\',\n\'object_processor\': \'cpu\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wai
t\': 100\n}]\n},\n\'face\': {\n\'general\':{\n\'pattern\': \'.*\',\n\'same_model_sequence_strategy\': \'first\'\n},\n\'sequence\': [{\n\'save_unknown_faces\':\'yes\',\n\'save_unknown_faces_l
eeway_pixels\':100,\n\'face_detection_framework\': \'dlib\',\n\'known_images_path\': \'/var/lib/zmeventnotification/known_faces\',\n\'unknown_images_path\': \'/var/lib/zmeventnotification/un
known_faces\',\n\'face_model\': \'cnn\',\n\'face_train_model\': \'cnn\',\n\'face_recog_dist_threshold\': \'0.6\',\n\'face_num_jitters\': \'1\',\n\'face_upsample_times\':\'1\',\n\'gpu_max_pro
cesses\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100,\n\'max_size\':800\n}]\n},\n\n\'alpr\': {\n\'general\':{\n\'same_model_sequence_strategy\': \
'first\',\n\'pre_existing_labels\':[\'car\', \'motorbike\', \'bus\', \'truck\', \'boat\'],\n\'pattern\': \'.*\'\n\n},\n\'sequence\': [{\n\'alpr_api_type\': \'cloud\',\n\'alpr_service\': \'pl
ate_recognizer\',\n\'alpr_key\': \'"your_plate_recognizer_api_key"\',\n\'platrec_stats\': \'yes\',\n\'platerec_min_dscore\': 0.1,\n\'platerec_min_score\': 0.2,\n\'max_size\':1600\n}]\n}\n}',
 'stream_sequence': "{\n'frame_strategy': 'most_models',\n'frame_set': 'snapshot,alarm',\n'resize':800\n\n}", 'object_detection_pattern': '.*', 'object_framework': 'opencv', 'object_processo
r': 'gpu', 'object_config': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights', 'object_
labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'object_min_confidence': 0.3, 'face_detection_pattern': '.*', 'face_detection_framework': 'dlib', 'face_recognition_fram
ework': 'dlib', 'face_processor': 'cpu', 'face_num_jitters': 1, 'face_upsample_times': 1, 'face_model': 'cnn', 'face_train_model': 'cnn', 'face_recog_dist_threshold': 0.6, 'face_recog_knn_al
go': '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': 'yes', 'save_unknown_faces_leeway_pixels': 100, 'alpr_service': 'plate_recognizer', 'alpr_detection_pattern': '.*', 'alpr_url': None, 'alpr_key': '"your_plate_recognizer
_api_key"', 'alpr_use_after_detection_only': 'yes', 'alpr_api_type': 'cloud', 'platerec_stats': 'yes', 'platerec_regions': None, 'platerec_min_dscore': 0.1, 'platerec_min_score': 0.2, 'opena
lpr_recognize_vehicle': '0', 'openalpr_country': 'us', 'openalpr_state': None, 'openalpr_min_confidence': '0.3', 'openalpr_cmdline_binary': 'alpr', 'openalpr_cmdline_params': '-j -d', 'opena
lpr_cmdline_min_confidence': 0.3, 'tpu_object_weights': '/var/lib/zmeventnotification/models/coral_edgetpu/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite', 'tpu_object_labels': '/var
/lib/zmeventnotification/models/coral_edgetpu/coco_indexed.names', 'tpu_object_framework': 'coral_edgetpu', 'tpu_object_processor': 'tpu', 'tpu_min_confidence': '0.6', '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/zmeventnotific
ation/models/yolov4/yolov4.cfg', 'yolo4_object_framework': 'opencv', 'yolo4_object_processor': 'gpu', 'yolo3_object_weights': '/var/lib/zmeventnotification/models/yolov3/yolov3.weights', 'yo
lo3_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/model
s/tinyyolov4/yolov4-tiny.weights', 'tinyyolo_object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'tinyyolo_object_framework': 'opencv', 'tinyyolo_object_processor': 
'cpu'}]
12/31/20 09:20:19 zmesdetect_m1[464] DBG2 yolo.py:35 [portalock: max:1, name:pyzm_uid33_gpu_lock, timeout:100]
12/31/20 09:20:19 zmesdetect_m1[464] DBG2 zm_detect.py:370 [using g.config['object_detection_pattern']=.*]
12/31/20 09:20:19 zmesdetect_m1[464] DBG1 zm_detect.py:403 [Using model: object with /var/lib/zmeventnotification/images/1517-alarm.jpg]
12/31/20 09:20:19 zmesdetect_m1[464] DBG2 yolo.py:48 [Waiting for pyzm_uid33_gpu_lock portalock...]
12/31/20 09:20:19 zmesdetect_m1[464] DBG2 yolo.py:50 [Got pyzm_uid33_gpu_lock portalock]
12/31/20 09:20:19 zmesdetect_m1[464] DBG1 yolo.py:79 [|--------- Loading Yolo model from disk ---------|]
12/31/20 09:20:19 zmesdetect_m1[464] DBG1 yolo.py:87 [Yolo initialization (loading model from disk) took: 0:00:00.040898]
12/31/20 09:20:19 zmesdetect_m1[464] DBG2 yolo.py:101 [Setting CUDA backend for OpenCV]
12/31/20 09:20:19 zmesdetect_m1[464] DBG3 yolo.py:102 [If you did not set your CUDA_ARCH_BIN correctly during OpenCV compilation, you will get errors during detection related to invalid devi
ce/make_policy]
12/31/20 09:20:19 zmesdetect_m1[464] DBG1 yolo.py:142 [|---------- YOLO (input image: 800w*450h, model resize dimensions: 416w*416h) ----------|]
12/31/20 09:20:23 zmesdetect_m1[464] DBG2 yolo.py:66 [Released pyzm_uid33_gpu_lock portalock]
12/31/20 09:20:23 zmesdetect_m1[464] FAT zm_detect.py:860 [Unrecoverable error:OpenCV(4.4.0) /opencv-build/build/opencv-4.4.0/modules/dnn/src/cuda4dnn/csl/cublas.hpp:78: error: (-217:Gpu API
 call) CUBLAS_STATUS_NOT_INITIALIZED in function 'UniqueHandle'
 Traceback:Traceback (most recent call last):
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 857, in <module>
    main_handler()
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 432, in main_handler
    b, l, c = m.detect(original_image)
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/object.py", line 54, in detect
    b,l,c = self.model.detect(image)
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/yolo.py", line 156, in detect
    outs = self.net.forward(ln)
cv2.error: OpenCV(4.4.0) /opencv-build/build/opencv-4.4.0/modules/dnn/src/cuda4dnn/csl/cublas.hpp:78: error: (-217:Gpu API call) CUBLAS_STATUS_NOT_INITIALIZED in function 'UniqueHandle'

]
12/31/20 09:30:33 zmesdetect_m1[892] INF zm_detect.py:208 [---------| pyzm version:0.3.13, hook version:6.0.7,  ES version:6.0.7 , OpenCV version:4.4.0|------------]
12/31/20 09:30:33 zmesdetect_m1[892] DBG1 utils.py:406 [secret filename: /etc/zm/secrets.ini]
12/31/20 09:30:33 zmesdetect_m1[892] DBG2 utils.py:379 [Secret token found in config: !ZM_PORTAL]
12/31/20 09:30:33 zmesdetect_m1[892] DBG2 utils.py:379 [Secret token found in config: !ZM_USER]
12/31/20 09:30:33 zmesdetect_m1[892] DBG2 utils.py:379 [Secret token found in config: !ZM_PASSWORD]
12/31/20 09:30:33 zmesdetect_m1[892] DBG2 utils.py:379 [Secret token found in config: !ZM_API_PORTAL]
12/31/20 09:30:33 zmesdetect_m1[892] DBG2 utils.py:379 [Secret token found in config: !ML_USER]
12/31/20 09:30:33 zmesdetect_m1[892] DBG2 utils.py:379 [Secret token found in config: !ML_PASSWORD]
12/31/20 09:30:33 zmesdetect_m1[892] DBG2 utils.py:379 [Secret token found in config: !PLATEREC_ALPR_KEY]
12/31/20 09:30:33 zmesdetect_m1[892] DBG1 utils.py:441 [allowing self-signed certs to work...]
12/31/20 09:30:33 zmesdetect_m1[892] DBG4 utils.py:451 [Now checking for monitor overrides]
12/31/20 09:30:33 zmesdetect_m1[892] DBG4 utils.py:514 [Finally, doing parameter substitution]
12/31/20 09:30:33 zmesdetect_m1[892] INF zm_detect.py:234 [Importing local classes for Object/Face]
12/31/20 09:30:33 zmesdetect_m1[892] DBG1 utils.py:281 [Trying to download http://localhost/zm/index.php?view=image&eid=1520&fid=alarm&username=admin&password=*****]
12/31/20 09:30:33 zmesdetect_m1[892] DBG1 utils.py:300 [Trying to download http://localhost/zm/index.php?view=image&eid=1520&fid=snapshot&username=admin&password=*****]
12/31/20 09:30:34 zmesdetect_m1[892] DBG1 zm_detect.py:295 [No polygon area specfied, so adding a full image polygon:[{'name': 'full_image', 'value': [(0, 0), (1280, 0), (1280, 720), (0, 720
)], 'pattern': None}]]
12/31/20 09:30:34 zmesdetect_m1[892] DBG1 zm_detect.py:298 [resizing to 800 before analysis...]
12/31/20 09:30:34 zmesdetect_m1[892] DBG2 utils.py:139 [resized polygons x=0.625/y=0.625: [{'name': 'full_image', 'value': [(0, 0), (800, 0), (800, 450), (0, 450)], 'pattern': None}]]
12/31/20 09:30:34 zmesdetect_m1[892] DBG1 zm_detect.py:319 [User ALPR if vehicle found: False]
12/31/20 09:30:34 zmesdetect_m1[892] DBG4 yolo.py:26 [Yolo init params: {'pyzm_overrides': {'log_level_debug': 5}, 'secrets': '/etc/zm/secrets.ini', 'version': '1.2', 'cpu_max_processes': 3,
 'gpu_max_processes': 1, 'tpu_max_processes': 1, 'cpu_max_lock_wait': 100, 'gpu_max_lock_wait': 100, 'tpu_max_lock_wait': 100, 'base_data_path': '/var/lib/zmeventnotification', 'portal': 'ht
tp://localhost/zm', 'api_portal': 'http://localhost/zm/api', 'user': 'admin', 'password': 'plexnchi11', 'basic_user': '', 'basic_password': '', 'image_path': '/var/lib/zmeventnotification/im
ages', 'match_past_detections': 'no', 'past_det_max_diff_area': '5%', 'max_detection_size': '90%', 'frame_id': 'bestmatch', 'bestmatch_order': 'a,s', 'wait': '0', 'resize': '800', 'delete_af
ter_analyze': 'yes', 'show_percent': 'yes', 'allow_self_signed': 'yes', 'write_image_to_zm': 'yes', 'write_debug_image': 'no', 'detection_sequence': ['object'], 'detection_mode': 'all', 'imp
ort_zm_zones': 'no', 'only_triggered_zm_zones': 'no', 'poly_color': (255, 255, 255), 'poly_thickness': 2, 'create_animation': 'no', 'animation_types': "'mp4,gif'", 'animation_width': 640, 'a
nimation_retry_sleep': 15, 'animation_max_tries': 4, 'fast_gif': 'no', 'ml_gateway': None, 'ml_fallback_local': 'no', 'ml_user': '"your_mlapi_user"', 'ml_password': '"your_mlapi_password"', 
'disable_locks': 'no', 'use_sequence': 'yes', 'ml_sequence': '{\n\'general\': {\n\'model_sequence\': \'object\',\n\'disable_locks\': \'no\',\n},\n\'object\': {\n\'general\':{\n\'pattern\':\'
.*\',\n\'same_model_sequence_strategy\': \'first\' # also \'most\', \'most_unique\'s\n},\n\'sequence\': [{\n\'object_config\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg
\',\n\'object_weights\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights\',\n\'object_labels\': \'/var/lib/zmeventnotification/models/tinyyolov4/coco.names\',\n\'object_m
in_confidence\': 0.3,\n\'object_framework\':\'opencv\',\n\'object_processor\': \'cpu\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wai
t\': 100\n}]\n},\n\'face\': {\n\'general\':{\n\'pattern\': \'.*\',\n\'same_model_sequence_strategy\': \'first\'\n},\n\'sequence\': [{\n\'save_unknown_faces\':\'yes\',\n\'save_unknown_faces_l
eeway_pixels\':100,\n\'face_detection_framework\': \'dlib\',\n\'known_images_path\': \'/var/lib/zmeventnotification/known_faces\',\n\'unknown_images_path\': \'/var/lib/zmeventnotification/un
known_faces\',\n\'face_model\': \'cnn\',\n\'face_train_model\': \'cnn\',\n\'face_recog_dist_threshold\': \'0.6\',\n\'face_num_jitters\': \'1\',\n\'face_upsample_times\':\'1\',\n\'gpu_max_pro
cesses\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100,\n\'max_size\':800\n}]\n},\n\n\'alpr\': {\n\'general\':{\n\'same_model_sequence_strategy\': \
'first\',\n\'pre_existing_labels\':[\'car\', \'motorbike\', \'bus\', \'truck\', \'boat\'],\n\'pattern\': \'.*\'\n\n},\n\'sequence\': [{\n\'alpr_api_type\': \'cloud\',\n\'alpr_service\': \'pl
ate_recognizer\',\n\'alpr_key\': \'"your_plate_recognizer_api_key"\',\n\'platrec_stats\': \'yes\',\n\'platerec_min_dscore\': 0.1,\n\'platerec_min_score\': 0.2,\n\'max_size\':1600\n}]\n}\n}',
 'stream_sequence': "{\n'frame_strategy': 'most_models',\n'frame_set': 'snapshot,alarm',\n'resize':800\n\n}", 'object_detection_pattern': '.*', 'object_framework': 'opencv', 'object_processo
r': 'gpu', 'object_config': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights', 'object_
labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'object_min_confidence': 0.3, 'face_detection_pattern': '.*', 'face_detection_framework': 'dlib', 'face_recognition_fram
ework': 'dlib', 'face_processor': 'cpu', 'face_num_jitters': 1, 'face_upsample_times': 1, 'face_model': 'cnn', 'face_train_model': 'cnn', 'face_recog_dist_threshold': 0.6, 'face_recog_knn_al
go': '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': 'yes', 'save_unknown_faces_leeway_pixels': 100, 'alpr_service': 'plate_recognizer', 'alpr_detection_pattern': '.*', 'alpr_url': None, 'alpr_key': '"your_plate_recognizer
_api_key"', 'alpr_use_after_detection_only': 'yes', 'alpr_api_type': 'cloud', 'platerec_stats': 'yes', 'platerec_regions': None, 'platerec_min_dscore': 0.1, 'platerec_min_score': 0.2, 'opena
lpr_recognize_vehicle': '0', 'openalpr_country': 'us', 'openalpr_state': None, 'openalpr_min_confidence': '0.3', 'openalpr_cmdline_binary': 'alpr', 'openalpr_cmdline_params': '-j -d', 'opena
lpr_cmdline_min_confidence': 0.3, 'tpu_object_weights': '/var/lib/zmeventnotification/models/coral_edgetpu/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite', 'tpu_object_labels': '/var
/lib/zmeventnotification/models/coral_edgetpu/coco_indexed.names', 'tpu_object_framework': 'coral_edgetpu', 'tpu_object_processor': 'tpu', 'tpu_min_confidence': '0.6', '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/zmeventnotific
ation/models/yolov4/yolov4.cfg', 'yolo4_object_framework': 'opencv', 'yolo4_object_processor': 'gpu', 'yolo3_object_weights': '/var/lib/zmeventnotification/models/yolov3/yolov3.weights', 'yo
lo3_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/model
s/tinyyolov4/yolov4-tiny.weights', 'tinyyolo_object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'tinyyolo_object_framework': 'opencv', 'tinyyolo_object_processor': 
'cpu'}]
12/31/20 09:30:34 zmesdetect_m1[892] DBG2 yolo.py:35 [portalock: max:1, name:pyzm_uid33_gpu_lock, timeout:100]
12/31/20 09:30:34 zmesdetect_m1[892] DBG2 zm_detect.py:370 [using g.config['object_detection_pattern']=.*]
12/31/20 09:30:34 zmesdetect_m1[892] DBG1 zm_detect.py:403 [Using model: object with /var/lib/zmeventnotification/images/1520-alarm.jpg]
12/31/20 09:30:34 zmesdetect_m1[892] DBG2 yolo.py:48 [Waiting for pyzm_uid33_gpu_lock portalock...]
12/31/20 09:30:48 zmesdetect_m1[929] INF zm_detect.py:208 [---------| pyzm version:0.3.13, hook version:6.0.7,  ES version:6.0.7 , OpenCV version:4.4.0|------------]
12/31/20 09:30:48 zmesdetect_m1[929] DBG1 utils.py:406 [secret filename: /etc/zm/secrets.ini]
12/31/20 09:30:48 zmesdetect_m1[929] DBG2 utils.py:379 [Secret token found in config: !ZM_PORTAL]
12/31/20 09:30:48 zmesdetect_m1[929] DBG2 utils.py:379 [Secret token found in config: !ZM_USER]
12/31/20 09:30:48 zmesdetect_m1[929] DBG2 utils.py:379 [Secret token found in config: !ZM_PASSWORD]
12/31/20 09:30:48 zmesdetect_m1[929] DBG2 utils.py:379 [Secret token found in config: !ZM_API_PORTAL]
12/31/20 09:30:48 zmesdetect_m1[929] DBG2 utils.py:379 [Secret token found in config: !ML_USER]
12/31/20 09:30:48 zmesdetect_m1[929] DBG2 utils.py:379 [Secret token found in config: !ML_PASSWORD]
12/31/20 09:30:48 zmesdetect_m1[929] DBG2 utils.py:379 [Secret token found in config: !PLATEREC_ALPR_KEY]
12/31/20 09:30:48 zmesdetect_m1[929] DBG1 utils.py:441 [allowing self-signed certs to work...]
12/31/20 09:30:48 zmesdetect_m1[929] DBG4 utils.py:451 [Now checking for monitor overrides]
12/31/20 09:30:48 zmesdetect_m1[929] DBG4 utils.py:514 [Finally, doing parameter substitution]
12/31/20 09:30:48 zmesdetect_m1[929] INF zm_detect.py:234 [Importing local classes for Object/Face]
12/31/20 09:30:48 zmesdetect_m1[929] DBG1 utils.py:281 [Trying to download http://localhost/zm/index.php?view=image&eid=1521&fid=alarm&username=admin&password=*****]
12/31/20 09:30:49 zmesdetect_m1[929] DBG1 utils.py:300 [Trying to download http://localhost/zm/index.php?view=image&eid=1521&fid=snapshot&username=admin&password=*****]
12/31/20 09:30:49 zmesdetect_m1[929] DBG1 zm_detect.py:295 [No polygon area specfied, so adding a full image polygon:[{'name': 'full_image', 'value': [(0, 0), (1280, 0), (1280, 720), (0, 720
)], 'pattern': None}]]
12/31/20 09:30:49 zmesdetect_m1[929] DBG1 zm_detect.py:298 [resizing to 800 before analysis...]
12/31/20 09:30:49 zmesdetect_m1[929] DBG2 utils.py:139 [resized polygons x=0.625/y=0.625: [{'name': 'full_image', 'value': [(0, 0), (800, 0), (800, 450), (0, 450)], 'pattern': None}]]
12/31/20 09:30:49 zmesdetect_m1[929] DBG1 zm_detect.py:319 [User ALPR if vehicle found: False]
12/31/20 09:30:49 zmesdetect_m1[929] DBG4 yolo.py:26 [Yolo init params: {'pyzm_overrides': {'log_level_debug': 5}, 'secrets': '/etc/zm/secrets.ini', 'version': '1.2', 'cpu_max_processes': 3,
 'gpu_max_processes': 1, 'tpu_max_processes': 1, 'cpu_max_lock_wait': 100, 'gpu_max_lock_wait': 100, 'tpu_max_lock_wait': 100, 'base_data_path': '/var/lib/zmeventnotification', 'portal': 'ht
tp://localhost/zm', 'api_portal': 'http://localhost/zm/api', 'user': 'admin', 'password': 'plexnchi11', 'basic_user': '', 'basic_password': '', 'image_path': '/var/lib/zmeventnotification/im
ages', 'match_past_detections': 'no', 'past_det_max_diff_area': '5%', 'max_detection_size': '90%', 'frame_id': 'bestmatch', 'bestmatch_order': 'a,s', 'wait': '0', 'resize': '800', 'delete_af
ter_analyze': 'yes', 'show_percent': 'yes', 'allow_self_signed': 'yes', 'write_image_to_zm': 'yes', 'write_debug_image': 'no', 'detection_sequence': ['object'], 'detection_mode': 'all', 'imp
ort_zm_zones': 'no', 'only_triggered_zm_zones': 'no', 'poly_color': (255, 255, 255), 'poly_thickness': 2, 'create_animation': 'no', 'animation_types': "'mp4,gif'", 'animation_width': 640, 'a
nimation_retry_sleep': 15, 'animation_max_tries': 4, 'fast_gif': 'no', 'ml_gateway': None, 'ml_fallback_local': 'no', 'ml_user': '"your_mlapi_user"', 'ml_password': '"your_mlapi_password"', 
'disable_locks': 'no', 'use_sequence': 'yes', 'ml_sequence': '{\n\'general\': {\n\'model_sequence\': \'object\',\n\'disable_locks\': \'no\',\n},\n\'object\': {\n\'general\':{\n\'pattern\':\'
.*\',\n\'same_model_sequence_strategy\': \'first\' # also \'most\', \'most_unique\'s\n},\n\'sequence\': [{\n\'object_config\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg
\',\n\'object_weights\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights\',\n\'object_labels\': \'/var/lib/zmeventnotification/models/tinyyolov4/coco.names\',\n\'object_m
in_confidence\': 0.3,\n\'object_framework\':\'opencv\',\n\'object_processor\': \'cpu\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wai
t\': 100\n}]\n},\n\'face\': {\n\'general\':{\n\'pattern\': \'.*\',\n\'same_model_sequence_strategy\': \'first\'\n},\n\'sequence\': [{\n\'save_unknown_faces\':\'yes\',\n\'save_unknown_faces_l
eeway_pixels\':100,\n\'face_detection_framework\': \'dlib\',\n\'known_images_path\': \'/var/lib/zmeventnotification/known_faces\',\n\'unknown_images_path\': \'/var/lib/zmeventnotification/un
known_faces\',\n\'face_model\': \'cnn\',\n\'face_train_model\': \'cnn\',\n\'face_recog_dist_threshold\': \'0.6\',\n\'face_num_jitters\': \'1\',\n\'face_upsample_times\':\'1\',\n\'gpu_max_pro
cesses\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100,\n\'max_size\':800\n}]\n},\n\n\'alpr\': {\n\'general\':{\n\'same_model_sequence_strategy\': \
'first\',\n\'pre_existing_labels\':[\'car\', \'motorbike\', \'bus\', \'truck\', \'boat\'],\n\'pattern\': \'.*\'\n\n},\n\'sequence\': [{\n\'alpr_api_type\': \'cloud\',\n\'alpr_service\': \'pl
ate_recognizer\',\n\'alpr_key\': \'"your_plate_recognizer_api_key"\',\n\'platrec_stats\': \'yes\',\n\'platerec_min_dscore\': 0.1,\n\'platerec_min_score\': 0.2,\n\'max_size\':1600\n}]\n}\n}',
 'stream_sequence': "{\n'frame_strategy': 'most_models',\n'frame_set': 'snapshot,alarm',\n'resize':800\n\n}", 'object_detection_pattern': '.*', 'object_framework': 'opencv', 'object_processo
r': 'gpu', 'object_config': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights', 'object_
labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'object_min_confidence': 0.3, 'face_detection_pattern': '.*', 'face_detection_framework': 'dlib', 'face_recognition_fram
ework': 'dlib', 'face_processor': 'cpu', 'face_num_jitters': 1, 'face_upsample_times': 1, 'face_model': 'cnn', 'face_train_model': 'cnn', 'face_recog_dist_threshold': 0.6, 'face_recog_knn_al
go': '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': 'yes', 'save_unknown_faces_leeway_pixels': 100, 'alpr_service': 'plate_recognizer', 'alpr_detection_pattern': '.*', 'alpr_url': None, 'alpr_key': '"your_plate_recognizer
_api_key"', 'alpr_use_after_detection_only': 'yes', 'alpr_api_type': 'cloud', 'platerec_stats': 'yes', 'platerec_regions': None, 'platerec_min_dscore': 0.1, 'platerec_min_score': 0.2, 'opena
lpr_recognize_vehicle': '0', 'openalpr_country': 'us', 'openalpr_state': None, 'openalpr_min_confidence': '0.3', 'openalpr_cmdline_binary': 'alpr', 'openalpr_cmdline_params': '-j -d', 'opena
lpr_cmdline_min_confidence': 0.3, 'tpu_object_weights': '/var/lib/zmeventnotification/models/coral_edgetpu/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite', 'tpu_object_labels': '/var
/lib/zmeventnotification/models/coral_edgetpu/coco_indexed.names', 'tpu_object_framework': 'coral_edgetpu', 'tpu_object_processor': 'tpu', 'tpu_min_confidence': '0.6', '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/zmeventnotific
ation/models/yolov4/yolov4.cfg', 'yolo4_object_framework': 'opencv', 'yolo4_object_processor': 'gpu', 'yolo3_object_weights': '/var/lib/zmeventnotification/models/yolov3/yolov3.weights', 'yo
lo3_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/model
s/tinyyolov4/yolov4-tiny.weights', 'tinyyolo_object_labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'tinyyolo_object_framework': 'opencv', 'tinyyolo_object_processor': 
'cpu'}]
12/31/20 09:30:49 zmesdetect_m1[929] DBG2 yolo.py:35 [portalock: max:1, name:pyzm_uid33_gpu_lock, timeout:100]
12/31/20 09:30:49 zmesdetect_m1[929] DBG2 zm_detect.py:370 [using g.config['object_detection_pattern']=.*]
12/31/20 09:30:49 zmesdetect_m1[929] DBG1 zm_detect.py:403 [Using model: object with /var/lib/zmeventnotification/images/1521-alarm.jpg]
12/31/20 09:30:49 zmesdetect_m1[929] DBG2 yolo.py:48 [Waiting for pyzm_uid33_gpu_lock portalock...]
12/31/20 09:32:14 zmesdetect_m1[892] ERR yolo.py:54 [Timeout waiting for pyzm_uid33_gpu_lock portalock for 100 seconds]
12/31/20 09:32:14 zmesdetect_m1[892] FAT zm_detect.py:860 [Unrecoverable error:Timeout waiting for pyzm_uid33_gpu_lock portalock for 100 seconds Traceback:Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/yolo.py", line 49, in acquire_lock
    self.lock.acquire()
  File "/usr/local/lib/python3.6/dist-packages/portalocker/utils.py", line 343, in acquire
    raise exceptions.AlreadyLocked()
portalocker.exceptions.AlreadyLocked

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 857, in <module>
    main_handler()
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 432, in main_handler
    b, l, c = m.detect(original_image)
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/object.py", line 54, in detect
    b,l,c = self.model.detect(image)
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/yolo.py", line 134, in detect
    self.acquire_lock()
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/yolo.py", line 55, in acquire_lock
    raise ValueError ('Timeout waiting for {} portalock for {} seconds'.format(self.lock_name, self.lock_timeout))
ValueError: Timeout waiting for pyzm_uid33_gpu_lock portalock for 100 seconds
]
pliablepixels commented 3 years ago

Your yolov4_object_processor seems to be gpu.

klutchell commented 3 years ago

Yeah, but I'm using tinyyolov4variables in my ml_sequence and my object_processor in there points to tinyyolo_object_processor which is cpu.

I can comment out the unused variables to clean up the logs.

pliablepixels commented 3 years ago

Note that you should also switch to zm_detect2.py - it will replace zm_detect.py soon (And will be the 'new' zm_detect.py) - logs are easier to follow there.

klutchell commented 3 years ago

Huh, it looks like it wasn't respecting the object_processor in my ml_sequence but was using the top-level object_processor that was set to gpu. When I changed them both to cpu it started processing on the cpu and I haven't been able to reproduce the locks or cublas errors.

Is ml_sequence in objectconfig.ini actually used as documented? If I thought it was using tinyyolov4/gpu but it was actually defaulting to yolov4/gpu or something else that would certainly explain running out of memory on this device.

In order to switch to zm_detect2 should I just swap the filenames in my install or is it defined in the config somewhere?

12/31/20 11:19:21 zmesdetect_m1[278] INF zm_detect.py:208 [---------| pyzm version:0.3.13, hook version:6.0.7,  ES version:6.0.7 , OpenCV version:4.4.0|------------]
12/31/20 11:19:21 zmesdetect_m1[278] DBG1 utils.py:406 [secret filename: /etc/zm/secrets.ini]
12/31/20 11:19:21 zmesdetect_m1[278] DBG2 utils.py:379 [Secret token found in config: !ZM_PORTAL]
12/31/20 11:19:21 zmesdetect_m1[278] DBG2 utils.py:379 [Secret token found in config: !ZM_USER]
12/31/20 11:19:21 zmesdetect_m1[278] DBG2 utils.py:379 [Secret token found in config: !ZM_PASSWORD]
12/31/20 11:19:21 zmesdetect_m1[278] DBG2 utils.py:379 [Secret token found in config: !ZM_API_PORTAL]
12/31/20 11:19:21 zmesdetect_m1[278] DBG2 utils.py:379 [Secret token found in config: !ML_USER]
12/31/20 11:19:21 zmesdetect_m1[278] DBG2 utils.py:379 [Secret token found in config: !ML_PASSWORD]
12/31/20 11:19:21 zmesdetect_m1[278] DBG2 utils.py:379 [Secret token found in config: !PLATEREC_ALPR_KEY]
12/31/20 11:19:21 zmesdetect_m1[278] DBG1 utils.py:441 [allowing self-signed certs to work...]
12/31/20 11:19:21 zmesdetect_m1[278] DBG4 utils.py:451 [Now checking for monitor overrides]
12/31/20 11:19:21 zmesdetect_m1[278] DBG4 utils.py:514 [Finally, doing parameter substitution]
12/31/20 11:19:21 zmesdetect_m1[278] INF zm_detect.py:234 [Importing local classes for Object/Face]
12/31/20 11:19:21 zmesdetect_m1[278] DBG1 utils.py:281 [Trying to download http://localhost/zm/index.php?view=image&eid=1567&fid=alarm&username=admin&password=*****]
12/31/20 11:19:21 zmesdetect_m1[278] DBG1 utils.py:300 [Trying to download http://localhost/zm/index.php?view=image&eid=1567&fid=snapshot&username=admin&password=*****]
12/31/20 11:19:22 zmesdetect_m1[278] DBG1 zm_detect.py:295 [No polygon area specfied, so adding a full image polygon:[{'name': 'full_image', 'value': [(0, 0), (1280, 0), (1280, 720), (0, 720
)], 'pattern': None}]]
12/31/20 11:19:22 zmesdetect_m1[278] DBG1 zm_detect.py:298 [resizing to 800 before analysis...]
12/31/20 11:19:22 zmesdetect_m1[278] DBG2 utils.py:139 [resized polygons x=0.625/y=0.625: [{'name': 'full_image', 'value': [(0, 0), (800, 0), (800, 450), (0, 450)], 'pattern': None}]]
12/31/20 11:19:22 zmesdetect_m1[278] DBG1 zm_detect.py:319 [User ALPR if vehicle found: False]
12/31/20 11:19:22 zmesdetect_m1[278] DBG4 yolo.py:26 [Yolo init params: {'pyzm_overrides': {'log_level_debug': 5}, 'secrets': '/etc/zm/secrets.ini', 'version': '1.2', 'cpu_max_processes': 3,
 'gpu_max_processes': 1, 'tpu_max_processes': 1, 'cpu_max_lock_wait': 100, 'gpu_max_lock_wait': 100, 'tpu_max_lock_wait': 100, 'base_data_path': '/var/lib/zmeventnotification', 'portal': 'ht
tp://localhost/zm', 'api_portal': 'http://localhost/zm/api', 'user': 'admin', 'password': 'plexnchi11', 'basic_user': '', 'basic_password': '', 'image_path': '/var/lib/zmeventnotification/im
ages', 'match_past_detections': 'no', 'past_det_max_diff_area': '5%', 'max_detection_size': '90%', 'frame_id': 'bestmatch', 'bestmatch_order': 'a,s', 'wait': '0', 'resize': '800', 'delete_af
ter_analyze': 'yes', 'show_percent': 'yes', 'allow_self_signed': 'yes', 'write_image_to_zm': 'yes', 'write_debug_image': 'no', 'detection_sequence': ['object'], 'detection_mode': 'all', 'imp
ort_zm_zones': 'no', 'only_triggered_zm_zones': 'no', 'poly_color': (255, 255, 255), 'poly_thickness': 2, 'create_animation': 'no', 'animation_types': "'mp4,gif'", 'animation_width': 640, 'a
nimation_retry_sleep': 15, 'animation_max_tries': 4, 'fast_gif': 'no', 'ml_gateway': None, 'ml_fallback_local': 'no', 'ml_user': '"your_mlapi_user"', 'ml_password': '"your_mlapi_password"', 
'disable_locks': 'no', 'use_sequence': 'yes', 'ml_sequence': '{\n\'general\': {\n\'model_sequence\': \'object\',\n\'disable_locks\': \'no\',\n},\n\'object\': {\n\'general\':{\n\'pattern\':\'
.*\',\n\'same_model_sequence_strategy\': \'first\' # also \'most\', \'most_unique\'s\n},\n\'sequence\': [{\n\'object_config\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg
\',\n\'object_weights\':\'/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights\',\n\'object_labels\': \'/var/lib/zmeventnotification/models/tinyyolov4/coco.names\',\n\'object_m
in_confidence\': 0.3,\n\'object_framework\':\'opencv\',\n\'object_processor\': \'cpu\',\n\'gpu_max_processes\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wai
t\': 100\n}]\n},\n\'face\': {\n\'general\':{\n\'pattern\': \'.*\',\n\'same_model_sequence_strategy\': \'first\'\n},\n\'sequence\': [{\n\'save_unknown_faces\':\'yes\',\n\'save_unknown_faces_l
eeway_pixels\':100,\n\'face_detection_framework\': \'dlib\',\n\'known_images_path\': \'/var/lib/zmeventnotification/known_faces\',\n\'unknown_images_path\': \'/var/lib/zmeventnotification/un
known_faces\',\n\'face_model\': \'cnn\',\n\'face_train_model\': \'cnn\',\n\'face_recog_dist_threshold\': \'0.6\',\n\'face_num_jitters\': \'1\',\n\'face_upsample_times\':\'1\',\n\'gpu_max_pro
cesses\': 1,\n\'gpu_max_lock_wait\': 100,\n\'cpu_max_processes\': 3,\n\'cpu_max_lock_wait\': 100,\n\'max_size\':800\n}]\n},\n\n\'alpr\': {\n\'general\':{\n\'same_model_sequence_strategy\': \
'first\',\n\'pre_existing_labels\':[\'car\', \'motorbike\', \'bus\', \'truck\', \'boat\'],\n\'pattern\': \'.*\'\n\n},\n\'sequence\': [{\n\'alpr_api_type\': \'cloud\',\n\'alpr_service\': \'pl
ate_recognizer\',\n\'alpr_key\': \'"your_plate_recognizer_api_key"\',\n\'platrec_stats\': \'yes\',\n\'platerec_min_dscore\': 0.1,\n\'platerec_min_score\': 0.2,\n\'max_size\':1600\n}]\n}\n}',
 'stream_sequence': "{\n'frame_strategy': 'most_models',\n'frame_set': 'snapshot,alarm',\n'resize':800\n\n}", 'object_detection_pattern': '.*', 'object_framework': 'opencv', 'object_processo
r': 'cpu', 'object_config': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.cfg', 'object_weights': '/var/lib/zmeventnotification/models/tinyyolov4/yolov4-tiny.weights', 'object_
labels': '/var/lib/zmeventnotification/models/tinyyolov4/coco.names', 'object_min_confidence': 0.3, 'face_detection_pattern': '.*', 'face_detection_framework': 'dlib', 'face_recognition_fram
ework': 'dlib', 'face_processor': 'cpu', 'face_num_jitters': 1, 'face_upsample_times': 1, 'face_model': 'cnn', 'face_train_model': 'cnn', 'face_recog_dist_threshold': 0.6, 'face_recog_knn_al
go': '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': 'yes', 'save_unknown_faces_leeway_pixels': 100, 'alpr_service': 'plate_recognizer', 'alpr_detection_pattern': '.*', 'alpr_url': None, 'alpr_key': '"your_plate_recognizer
_api_key"', 'alpr_use_after_detection_only': 'yes', 'alpr_api_type': 'cloud', 'platerec_stats': 'yes', 'platerec_regions': None, 'platerec_min_dscore': 0.1, 'platerec_min_score': 0.2, 'opena
lpr_recognize_vehicle': '0', 'openalpr_country': 'us', 'openalpr_state': None, 'openalpr_min_confidence': '0.3', 'openalpr_cmdline_binary': 'alpr', 'openalpr_cmdline_params': '-j -d', 'opena
lpr_cmdline_min_confidence': 0.3, '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': 'c
pu'}]
12/31/20 11:19:22 zmesdetect_m1[278] DBG2 yolo.py:35 [portalock: max:3, name:pyzm_uid33_cpu_lock, timeout:100]
12/31/20 11:19:22 zmesdetect_m1[278] DBG2 zm_detect.py:370 [using g.config['object_detection_pattern']=.*]
12/31/20 11:19:22 zmesdetect_m1[278] DBG1 zm_detect.py:403 [Using model: object with /var/lib/zmeventnotification/images/1567-alarm.jpg]
12/31/20 11:19:22 zmesdetect_m1[278] DBG2 yolo.py:48 [Waiting for pyzm_uid33_cpu_lock portalock...]
12/31/20 11:19:22 zmesdetect_m1[278] DBG2 yolo.py:50 [Got pyzm_uid33_cpu_lock portalock]
12/31/20 11:19:22 zmesdetect_m1[278] DBG1 yolo.py:79 [|--------- Loading Yolo model from disk ---------|]
12/31/20 11:19:22 zmesdetect_m1[278] DBG1 yolo.py:87 [Yolo initialization (loading model from disk) took: 0:00:00.030994]
12/31/20 11:19:22 zmesdetect_m1[278] DBG1 yolo.py:98 [Using CPU for detection]
12/31/20 11:19:22 zmesdetect_m1[278] DBG1 yolo.py:142 [|---------- YOLO (input image: 800w*450h, model resize dimensions: 416w*416h) ----------|]
12/31/20 11:19:23 zmesdetect_m1[278] DBG2 yolo.py:66 [Released pyzm_uid33_cpu_lock portalock]
12/31/20 11:19:23 zmesdetect_m1[278] DBG1 yolo.py:167 [YOLO detection took: 0:00:00.723899 milliseconds]
12/31/20 11:19:23 zmesdetect_m1[278] DBG2 yolo.py:201 [YOLO NMS filtering took: 0:00:00.001119]
12/31/20 11:19:23 zmesdetect_m1[278] DBG3 object.py:55 [core model detection over, got 8 objects. Now filtering]
12/31/20 11:19:23 zmesdetect_m1[278] DBG3 object.py:59 [Max object size found to be: 90%]
12/31/20 11:19:23 zmesdetect_m1[278] DBG2 object.py:67 [Converted 90% to 324000.0]
12/31/20 11:19:23 zmesdetect_m1[278] DBG2 object.py:88 [Ignoring diningtable [47, 265, 511, 455] as conf. level 0.27337560057640076 is lower than 0.3]
12/31/20 11:19:23 zmesdetect_m1[278] DBG2 object.py:88 [Ignoring chair [88, 335, 218, 449] as conf. level 0.2466994822025299 is lower than 0.3]
12/31/20 11:19:23 zmesdetect_m1[278] DBG2 object.py:88 [Ignoring chair [250, 177, 382, 331] as conf. level 0.2032891809940338 is lower than 0.3]
12/31/20 11:19:23 zmesdetect_m1[278] DBG2 object.py:90 [Returning filtered list of 5 objects.]
12/31/20 11:19:23 zmesdetect_m1[278] DBG2 image_manip.py:294 [intersection: polygon in process=[(372, 202), (470, 202), (470, 342), (372, 342)]]
12/31/20 11:19:23 zmesdetect_m1[278] DBG2 image_manip.py:308 [full_image intersects object:chair[[(372, 202), (470, 202), (470, 342), (372, 342)]]]
12/31/20 11:19:23 zmesdetect_m1[278] DBG2 image_manip.py:294 [intersection: polygon in process=[(585, 69), (727, 69), (727, 377), (585, 377)]]
12/31/20 11:19:23 zmesdetect_m1[278] DBG2 image_manip.py:308 [full_image intersects object:person[[(585, 69), (727, 69), (727, 377), (585, 377)]]]
12/31/20 11:19:23 zmesdetect_m1[278] DBG2 image_manip.py:294 [intersection: polygon in process=[(513, 54), (583, 54), (583, 106), (513, 106)]]
12/31/20 11:19:23 zmesdetect_m1[278] DBG2 image_manip.py:308 [full_image intersects object:tvmonitor[[(513, 54), (583, 54), (583, 106), (513, 106)]]]
12/31/20 11:19:23 zmesdetect_m1[278] DBG2 image_manip.py:294 [intersection: polygon in process=[(632, 382), (710, 382), (710, 440), (632, 440)]]
12/31/20 11:19:23 zmesdetect_m1[278] DBG2 image_manip.py:308 [full_image intersects object:laptop[[(632, 382), (710, 382), (710, 440), (632, 440)]]]
12/31/20 11:19:23 zmesdetect_m1[278] DBG2 image_manip.py:294 [intersection: polygon in process=[(390, 2), (458, 2), (458, 80), (390, 80)]]
12/31/20 11:19:23 zmesdetect_m1[278] DBG2 image_manip.py:308 [full_image intersects object:tvmonitor[[(390, 2), (458, 2), (458, 80), (390, 80)]]]
12/31/20 11:19:23 zmesdetect_m1[278] DBG2 zm_detect.py:618 [ALPR not in use, no need for look aheads in processing]
12/31/20 11:19:23 zmesdetect_m1[278] INF zm_detect.py:635 [labels found: ['chair', 'person', 'tvmonitor', 'laptop', 'tvmonitor']]
12/31/20 11:19:23 zmesdetect_m1[278] DBG2 zm_detect.py:638 [match found in /var/lib/zmeventnotification/images/1567-alarm.jpg, breaking file loop...]
12/31/20 11:19:23 zmesdetect_m1[278] DBG2 zm_detect.py:703 [Drawing boxes around objects]
12/31/20 11:19:23 zmesdetect_m1[278] DBG1 zm_detect.py:728 [Writing detected image to /var/cache/zoneminder/events/1/2020-12-31/1567/objdetect.jpg]
12/31/20 11:19:23 zmesdetect_m1[278] DBG1 zm_detect.py:732 [Writing JSON output to /var/cache/zoneminder/events/1/2020-12-31/1567/objects.json]
12/31/20 11:19:23 zmesdetect_m1[278] INF zm_detect.py:784 [Prediction string:[a] detected:chair:86% person:72% tvmonitor:68% laptop:46% ]
12/31/20 11:19:23 zmesdetect_m1[278] DBG1 zm_detect.py:787 [Prediction string JSON:[{"type": "object", "label": "chair", "box": [372, 202, 470, 342], "confidence": "85.63%"}, {"type": "objec
t", "label": "person", "box": [585, 69, 727, 377], "confidence": "71.82%"}, {"type": "object", "label": "tvmonitor", "box": [513, 54, 583, 106], "confidence": "67.55%"}, {"type": "object", "
label": "laptop", "box": [632, 382, 710, 440], "confidence": "46.27%"}, {"type": "object", "label": "tvmonitor", "box": [390, 2, 458, 80], "confidence": "45.02%"}]]
pliablepixels commented 3 years ago

Huh, it looks like it wasn't respecting the object_processor in my ml_sequence but was using the top-level object_processor that was set to gpu. When I changed them both to cpu it started processing on the cpu and I haven't been able to reproduce the locks or cublas errors.

Well, I wasn't expecting that (no errors). I'll let you test and run for a longer time

Is ml_sequence in objectconfig.ini actually used as documented? If I thought it was using tinyyolov4/gpu but it was actually defaulting to yolov4/gpu or something else that would certainly explain running out of memory on this device.

I forgot to mention (a big 'I forgot'). All this ml_sequence stuff only applies if you are using zm_detect2 not zm_detect

In order to switch to zm_detect2 should I just swap the filenames in my install or is it defined in the config somewhere?

Well, /var/lib/zmeventnotification/bin/zm_event_start.sh calls zm_detect. Change to zm_detect2. When invoking from CLI use zm_detect2 instead of zm_detect. Note that this is temporary. As more people tell me switching to detect2 doesn't destroy anything, I'll make it the new zm_detect

More details here https://forums.zoneminder.com/viewtopic.php?f=33&t=30332

klutchell commented 3 years ago

Well at least we know why my config changes we're being picked up!

I've switched to the latest commit and substituted zm_detect2.py. Now I'm running into an issue where I don't have the face modules installed and it's looking for them even though face and alpr are not in my model_sequence list. I tried removing those two blocks completely from the ml_sequence and now zm_event_start.sh just returns 1 (no logs).

Here's my current ml_sequence without the variables substituted. If I restore the example face and alpr blocks it will return an error that the face_detection module is not installed (intentionally).

ml_sequence = {
    'general': {
        'model_sequence': 'object',
        'disable_locks': '{{disable_locks}}',
    },
    'object': {
        'general':{
            'pattern':'{{object_detection_pattern}}',
            'same_model_sequence_strategy': 'first' # also 'most', 'most_unique's
        },
        'sequence': [{
            'object_config':'{{tinyyolo_object_config}}',
            'object_weights':'{{tinyyolo_object_weights}}',
            'object_labels': '{{tinyyolo_object_labels}}',
            'object_min_confidence': {{object_min_confidence}},
            'object_framework':'{{tinyyolo_object_framework}}',
            'object_processor': '{{tinyyolo_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}}
        }]
    }
}

12/31/20 15:07:10.308943 zmeventnotification[222].DBG [main:977] [PARENT: Forked process:222 to handle alarm eid:1666]
12/31/20 15:07:10.310213 zmeventnotification[222].DBG [ZoneMinder::Object:115] [Loading ZoneMinder::Event from Events WHERE Id = 1666]
12/31/20 15:07:10.316000 zmeventnotification[222].DBG [main:977] [|----> FORK:Back Room (1), eid:1666 Adding event path:/var/cache/zoneminder/events/1/2020-12-31/1666 to hook for image stora
ge]
12/31/20 15:07:10.316219 zmeventnotification[222].DBG [main:977] [|----> FORK:Back Room (1), eid:1666 Invoking hook on event start:'/var/lib/zmeventnotification/bin/zm_event_start.sh' 1666 1
 "Back Room" "Motion All" "/var/cache/zoneminder/events/1/2020-12-31/1666"]
12/31/20 15:07:12.622864 zmeventnotification[222].DBG [main:977] [|----> FORK:Back Room (1), eid:1666 parse of hook: and []]
12/31/20 15:07:12.622979 zmeventnotification[222].DBG [main:977] [|----> FORK:Back Room (1), eid:1666 hook start returned with text: json:[] exit:1]
12/31/20 15:07:12.623159 zmeventnotification[222].DBG [ZoneMinder::Memory::Mapped:84] [zmMemAttach already attached at 548476436480 for 1]
12/31/20 15:07:12.623480 zmeventnotification[222].DBG [ZoneMinder::Memory:300] [Shared data appears valid for monitor 1: 1]
12/31/20 15:07:14.625187 zmeventnotification[222].DBG [main:977] [|----> FORK:Back Room (1), eid:1666 rules: Checking rules for alarm caused by eid:1666, monitor:1, at: Thu Dec 31 15:07:14 2
020 with cause:Motion All]
12/31/20 15:07:14.625433 zmeventnotification[222].DBG [main:977] [|----> FORK:Back Room (1), eid:1666 rules: No rules found for Monitor, allowing:1]
12/31/20 15:07:14.625748 zmeventnotification[222].DBG [main:977] [|----> FORK:Back Room (1), eid:1666 Matching alarm to connection rules...]
12/31/20 15:07:14.626120 zmeventnotification[222].DBG [main:977] [|----> FORK:Back Room (1), eid:1666 Checking alarm conditions for MQTT 192.168.8.6]
12/31/20 15:07:14.626399 zmeventnotification[222].DBG [main:977] [|----> FORK:Back Room (1), eid:1666 REMOVE: looking for 1 inside ]
12/31/20 15:07:14.626645 zmeventnotification[222].DBG [main:977] [|----> FORK:Back Room (1), eid:1666 Monitor 1 event: last time not found, so should send]
12/31/20 15:07:14.626780 zmeventnotification[222].DBG [main:977] [|----> FORK:Back Room (1), eid:1666 shouldSendEventToConn returned true, so calling sendEvent]
12/31/20 15:07:14.629560 zmeventnotification[222].DBG [main:977] [|----> FORK:Back Room (1), eid:1666 isAllowedChannel: got type:event_start resCode:1]
12/31/20 15:07:14.631129 zmeventnotification[222].INF [main:989] [|----> FORK:Back Room (1), eid:1666 Not sending over MQTT as notify filters are on_success:all and on_fail:none]
12/31/20 15:07:14.637504 zmeventnotification[222].DBG [main:977] [|----> FORK:Back Room (1), eid:1666 child finished writing to parent]
12/31/20 15:07:14.637784 zmeventnotification[222].DBG [ZoneMinder::Memory::Mapped:84] [zmMemAttach already attached at 548476436480 for 1]
12/31/20 15:07:14.638389 zmeventnotification[222].DBG [ZoneMinder::Memory:300] [Shared data appears valid for monitor 1: 1]
12/31/20 15:07:14.638864 zmeventnotification[222].DBG [main:977] [|----> FORK:Back Room (1), eid:1666 For 1 (Back Room), SHM says: state=0, eid=1666]
12/31/20 15:07:14.639601 zmeventnotification[222].INF [main:989] [|----> FORK:Back Room (1), eid:1666 Event 1666 for Monitor 1 has finished]
12/31/20 15:07:14.646242 zmeventnotification[222].DBG [main:977] [|----> FORK:Back Room (1), eid:1666 Event end object is: state=>pending with cause=>Motion: All]
12/31/20 15:07:15.281037 zmeventnotification[114].DBG [main:977] [PARENT: ---------->Tick START<--------------]
12/31/20 15:07:15.281249 zmeventnotification[114].DBG [main:977] [PARENT: After tick: TOTAL: 1,  ES_CONTROL: 1, FCM+WEB: 0, FCM: 0, WEB: 0, MQTT:1, invalid WEB: 0, PENDING: 0]
12/31/20 15:07:15.282139 zmeventnotification[114].DBG [main:977] [PARENT: RAW TEXT-->timestamp--TYPE----SPLIT--1--SPLIT--1609445234.62694]
12/31/20 15:07:15.282324 zmeventnotification[114].DBG [main:977] [PARENT: Job: Update last sent timestamp of monitor:1 to 1609445234.62694 for id:]
12/31/20 15:07:15.282449 zmeventnotification[114].DBG [main:977] [PARENT: There are 1 active child forks...]
12/31/20 15:07:15.282580 zmeventnotification[114].DBG [ZoneMinder::Memory::Mapped:84] [zmMemAttach already attached at 548476432384 for 2]
12/31/20 15:07:15.282809 zmeventnotification[114].DBG [ZoneMinder::Memory:300] [Shared data appears valid for monitor 2: 1]
12/31/20 15:07:15.283065 zmeventnotification[114].DBG [ZoneMinder::Memory::Mapped:84] [zmMemAttach already attached at 548476428288 for 3]
12/31/20 15:07:15.283196 zmeventnotification[114].DBG [ZoneMinder::Memory:300] [Shared data appears valid for monitor 3: 1]
12/31/20 15:07:15.283365 zmeventnotification[114].DBG [ZoneMinder::Memory::Mapped:84] [zmMemAttach already attached at 548476436480 for 1]```
12/31/20 15:07:15.283497 zmeventnotification[114].DBG [ZoneMinder::Memory:300] [Shared data appears valid for monitor 1: 1]
12/31/20 15:07:15.283726 zmeventnotification[114].DBG [main:977] [PARENT: checkEvents() new events found=0]
12/31/20 15:07:15.283792 zmeventnotification[114].DBG [main:977] [PARENT: There are 0 new Events to process]
12/31/20 15:07:15.283852 zmeventnotification[114].DBG [main:977] [PARENT: ---------->Tick END<--------------]
pliablepixels commented 3 years ago

I'll need to see detect debug logs (zmesdetect_mX.log where X=monitorID)

Also, do this manually:

sudo -u www-data '/var/lib/zmeventnotification/bin/zm_event_start.sh' 1666 1
 "Back Room" "Motion All" "/var/cache/zoneminder/events/1/2020-12-31/1666"
klutchell commented 3 years ago

There are no zmesdetect logs getting created at all anymore. Running that and similar commands manually just returns 1.

I think my ml_sequence must be invalid because if I add those two blocks back I get errors about missing modules in the zmesdetect logs. What is the proper way to disable face and alpr with ml_sequence? I've already removed them from model_sequence.

pliablepixels commented 3 years ago

Hmm yes, that is an error. Looking into it.

pliablepixels commented 3 years ago

Should be fixed in pyzm 0.3.15. Please check. If you continue to face issues, please consider joining the ZM slack channel (link on www.zoneminder.com at the bottom) - easier to debug/fix with quick messages.

klutchell commented 3 years ago

I think zm_event_start wasn't running at all due to a whitespace issue in my objectconfig. Once I fixed that and picked up the latest pyzm it started processing again.

I'm still seeing the CUBLAS and gpu lock errors when in gpu mode but that was pretty expected. At least now I'm using the new ml format and zm_detect2 going forward.

It still seems the CUBLAS errors are related to free memory, and I have a good workaround to disable the locks so I'm not blocked by anything.

You've done more than enough here, thanks for all your help and have a Happy New Year!