Giter Site home page Giter Site logo

Comments (13)

wallacebw avatar wallacebw commented on June 3, 2024 1

I'm an idiot, I did a pip install pysm, not a pip install git+https://github.com/pliablepixels/pyzm earlier. working as expected now with 0.3.45.

from pyzm.

pliablepixels avatar pliablepixels commented on June 3, 2024

Are we talking about just face detection or recognition?
The former is natively supported by TPU, not the latter.

The link you shared in the ZM forum actually uses dlib to recognize faces, not TPU

from pyzm.

wallacebw avatar wallacebw commented on June 3, 2024

I was thinking recognition to avoid alerting on 'trusted' people, but having the TPU option for detection would be nice as well.

Thanks.

from pyzm.

pliablepixels avatar pliablepixels commented on June 3, 2024

I've just released a new version of ES + mlapi + pyzm that supports TPU based face detection.
enabled via config https://github.com/pliablepixels/zmeventnotification/blob/0b25246249f2f23c85e0a973d2295343de336dc3/hook/objectconfig.ini#L469-L473

from pyzm.

wallacebw avatar wallacebw commented on June 3, 2024

Great! I'll test it out in the next day or so.

One thing that I'm not clear on based on the docs (looking for a recommendation):
I'm using mocord with 5 minute section lengths resulting is ~ 12 'events' per hour / per camera. I am also using ffmpeg h264 pass-through and am NOT saving jpegs.
I'm also using MLAPI to avoid TPU reloads every event.

I'd like to have ZMEventNotification scan events upon completion of the 'section / 5 min period', but I have 12 cameras currently and it appears that adding a wait=310 to the monitor reserves the TPU during the waiting period.

Any recommendation on how I should set-up ZM / ZMES / MLAPI to acomplish this? I altered zm_event_start.sh and inserted a 'sleep 310' line near the top, is there a better way?

Let me know if you want me to take this to the forums vs github.

thanks again.

from pyzm.

wallacebw avatar wallacebw commented on June 3, 2024

settiing up now... looks like there is a missing ',' in on line 300 in mlapi/mlapiconfig.ini

				'match_past_detections': 'yes',
				'past_det_max_diff_area': '5%' <-- missing trailing comma
				'show_models':'{{show_models}}'

from pyzm.

pliablepixels avatar pliablepixels commented on June 3, 2024

Please update to master versions of pyzm, mlapi and ES (haven't made formal releases yet). This was fixed last night. Made other changes 5 mins ago.

from pyzm.

pliablepixels avatar pliablepixels commented on June 3, 2024

I'd like to have ZMEventNotification scan events upon completion of the 'section / 5 min period', but I have 12 cameras currently and it appears that adding a wait=310 to the monitor reserves the TPU during the waiting period.

Any recommendation on how I should set-up ZM / ZMES / MLAPI to acomplish this? I altered zm_event_start.sh and inserted a 'sleep 310' line near the top, is there a better way?

Wait periods should not be reserving TPU locks. If they are, I'd like to see logs.
However, if you want to scan events upon completion, use event_end_hook in zmeventnotification.ini not event_start_hook and make event_end_notify_if_start_success=no

from pyzm.

wallacebw avatar wallacebw commented on June 3, 2024

Everything is looking great with the coral face detection, thanks again.

I should have been more clear re: the tpu lock. The wait was happening within mlapi.py but it does not lock the TPU. The effect is similar, as processing for mlapi.py is effectively frozen waiting on the timeout.

Regarding the suggestion above, it 'appears' that ZM is sending an event start / stop signal on motion detection begin / end, which doesn't align with the 'segment' start / stop. Am I missing something (wouldn't be the first time)?

One last question: Is there a way to do TPU face detection and then run DLIB based detection / matching only if TPU detected a face?

I tried the following, but I'm guessing that the 'pre_existing_labels' doesn't work within a sequence.


## I added {{tpu_object_weights_face}} earlier in the file ##
...
                'face': {
                        'general':{
                                'pattern': '{{face_detection_pattern}}',
                                'same_model_sequence_strategy': 'union' # combine results below
                        },
                        'sequence': [
                                {
                                        'name': 'Face Detection (TPU)',
                                        'enabled': 'yes',
                                        'face_detection_framework': 'tpu',
                                        'face_weights':'{{tpu_object_weights_face}}',
                                        'face_min_confidence': 0.3
                                },
                                {
                                        'name':'Face Recognition (Dlib)', # optional
                                        'enabled': 'yes', # optional,
                                        'pre_existing_labels':['face'],
                                        'save_unknown_faces':'{{save_unknown_faces}}',
                                        'save_unknown_faces_leeway_pixels':{{save_unknown_faces_leeway_pixels}},
                                        'face_detection_framework': '{{face_detection_framework}}',
                                        'known_images_path': '{{known_images_path}}',
                                        'unknown_images_path': '{{unknown_images_path}}',
                                        'face_model': '{{face_model}}',
                                        'face_train_model': '{{face_train_model}}',
                                        'face_recog_dist_threshold': {{face_recog_dist_threshold}},
                                        'face_num_jitters': {{face_num_jitters}},
                                        'face_upsample_times':{{face_upsample_times}},
                                        'gpu_max_processes': {{gpu_max_processes}},
                                        'gpu_max_lock_wait': {{gpu_max_lock_wait}},
                                        'cpu_max_processes': {{cpu_max_processes}},
                                        'cpu_max_lock_wait': {{cpu_max_lock_wait}},
                                        'max_size':800
                                }]
                },
...

from pyzm.

pliablepixels avatar pliablepixels commented on June 3, 2024

It should work. If it does not please post debug logs.

from pyzm.

wallacebw avatar wallacebw commented on June 3, 2024

Are you referring to the dual face sequence or the event_end_notify?

for the former, using the face sequence above, here's what happens:

Example without identified face:
Client:

sudo -u http /var/lib/zmeventnotification/bin/zm_detect.py --config /etc/zm/objectconfig.ini  --debug --eventid 39206 --monitorid 13ll
INF [zmesdetect_m13ll] [Setting up signal handler for logs]
INF [zmesdetect_m13ll] [Switching global logger to ZMLog]
INF [zmesdetect_m13ll] [---------| app:6.1.19, pyzm:0.3.43, ES:6.1.19 , OpenCV:4.5.1|------------]
DBG1 [zmesdetect_m13ll] [secret filename: /etc/zm/secrets.ini]
DBG2 [zmesdetect_m13ll] [Secret token found in config: !ZM_PORTAL]
DBG2 [zmesdetect_m13ll] [Secret token found in config: !ZM_USER]
DBG2 [zmesdetect_m13ll] [Secret token found in config: !ZM_PASSWORD]
DBG2 [zmesdetect_m13ll] [Secret token found in config: !ZM_API_PORTAL]
DBG2 [zmesdetect_m13ll] [Secret token found in config: !ML_USER]
DBG2 [zmesdetect_m13ll] [Secret token found in config: !ML_PASSWORD]
DBG2 [zmesdetect_m13ll] [Secret token found in config: !PLATEREC_ALPR_KEY]
DBG1 [zmesdetect_m13ll] [allowing self-signed certs to work...]
DBG4 [zmesdetect_m13ll] [Now checking for monitor overrides]
DBG4 [zmesdetect_m13ll] [Finally, doing parameter substitution]
INF [zmesdetect_m13ll] [Importing remote shim classes for Object/Face]
INF [zmesdetect_m13ll] [Connecting with ZM APIs]
DBG2 [zmesdetect_m13ll] [API SSL certificate check has been disbled]
DBG1 [zmesdetect_m13ll] [using username/password for login]
DBG2 [zmesdetect_m13ll] [Using new token API]
DBG1 [zmesdetect_m13ll] [Access token expires on:2021-04-04 20:04:46.592028 [43200s]]
DBG1 [zmesdetect_m13ll] [Refresh token expires on:2021-04-05 08:04:46.592331 [86400s]]
DBG2 [zmesdetect_m13ll] [using ml_sequence]
DBG2 [zmesdetect_m13ll] [using stream_sequence]
INF [zmesdetect_m13ll] [Detecting using remote API Gateway http://127.0.0.1:5000/api/v1]
DBG2 [zmesdetect_m13ll] [Found token file, checking if token has not expired]
DBG1 [zmesdetect_m13ll] [Access token is valid for 686 more seconds]
DBG2 [zmesdetect_m13ll] [Invoking mlapi with url:http://127.0.0.1:5000/api/v1/detect/object?type=object and json: mid=13ll reason=None stream=39206, stream_options={'frame_strategy': 'most_models', 'frame_set': 'snapshot,alarm', 'contig_frames_before_error': 5, 'max_attempts': 3, 'sleep_between_attempts': 4, 'resize': 1920, 'api': None, 'polygons': []} ml_overrides={'model_sequence': 'object,face,alpr', 'object': {'pattern': '(person|car|dog|cat|bird|bicycle|backpack|umbrella|handbag|suitcase|frisbee|sports ball|baseball bat|skateboard|bottle|cup|knife|cell phone|book|motorbike|bus|truck|boat)'}, 'face': {'pattern': '.*'}, 'alpr': {'pattern': '.*'}} headers={'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MTc1MzcxOTksIm5iZiI6MTYxNzUzNzE5OSwianRpIjoiNGU5YmY1NTMtYmVmNy00YzFlLTkwM2ItZWE1MjQxNTM1OTY0IiwiZXhwIjoxNjE3NTQwNzk5LCJpZGVudGl0eSI6InptZXMiLCJmcmVzaCI6ZmFsc2UsInR5cGUiOiJhY2Nlc3MifQ.BcoUeTA5b-ARLefzp0avGjTk9_DQSQZxvm67-hSpOa8'} params={'delete': True, 'response_format': 'zm_detect'} ]
DBG1 [zmesdetect_m13ll] [remote detection inferencing took: 0:00:29.422874]
DBG1 [zmesdetect_m13ll] [Total remote detection detection took: 0:00:29.424286]
DBG1 [zmesdetect_m13ll] [Closing logs]

Server:

sudo -u http python3 mlapi.py -d -c /etc/zoneminder/mlapiconfig.ini
INF [zm_mlapi] [Setting up signal handler for logs]
INF [zm_mlapi] [Switching global logger to ZMLog]
INF [zm_mlapi] [Switched to ZM logs]
DBG1 [zm_mlapi] [secret filename: /etc/zm/secrets.ini]
DBG1 [zm_mlapi] [Secret token found in config: !MLAPI_SECRET_KEY]
DBG1 [zm_mlapi] [Secret token found in config: !PLATEREC_ALPR_KEY]
DBG4 [zm_mlapi] [Doing parameter substitution for globals]
DBG4 [zm_mlapi] [Doing parameter substitution for monitor specific entities]
DBG1 [zm_mlapi] [Opening DB at ./db/db.json]
DBG1 [zm_mlapi] [DB engine ready]
DBG2 [zm_mlapi] [API SSL certificate check has been disbled]
DBG1 [zm_mlapi] [using username/password for login]
DBG2 [zm_mlapi] [Using new token API]
DBG1 [zm_mlapi] [Access token expires on:2021-04-04 20:01:03.568562 [43200s]]
DBG1 [zm_mlapi] [Refresh token expires on:2021-04-05 08:01:03.568831 [86400s]]
DBG3 [zm_mlapi] [No need to relogin as access token still has 719.9999909833333 minutes remaining]
DBG4 [zm_mlapi] [make_request called with url=https://surveillance.wallacehouse.com/api/zones.json payload={} type=get query={'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjE3NTM3NjYzLCJleHAiOjE2MTc1ODA4NjMsInVzZXIiOiJ6b25lbWluZGVyX2VuIiwidHlwZSI6ImFjY2VzcyJ9.jV_uptfxmyX7zAZ5TsA0m37mosRo9HmGARtK9L4Teqc'}]
DBG4 [zm_mlapi] [Not importing zone:New for monitor:1 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:New for monitor:2 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:New for monitor:3 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:New for monitor:4 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:Grass for monitor:5 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:New for monitor:6 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:New for monitor:7 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:New for monitor:8 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:New for monitor:9 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:New for monitor:10 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:New for monitor:11 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:New for monitor:12 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:New for monitor:10 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:Bed for monitor:10 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:Bushes for monitor:5 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:All for monitor:16 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:New for monitor:13 as the global setting says no and there is no local override]
DBG2 [zm_mlapi] [using ml_sequence]
DBG1 [zm_mlapi] [Resetting models, will be loaded on next run]
INF [zm_mlapi] [--------| mlapi version:2.2.13, pyzm version:0.3.43 |--------]
INF [zm_mlapi] [Using bjoern as WSGI server]
DBG1 [zm_mlapi] [Monitor ID not specified, or not found in mlapi config, using zm_detect overrides]
DBG2 [zm_mlapi] [using ml_sequence]
DBG4 [zm_mlapi] [Found stream_sequence in mlapi config, ignoring objectconfig.ini]
DBG1 [zm_mlapi] [Object Recognition requested]
DBG1 [zm_mlapi] [Calling detect streams]
DBG3 [zm_mlapi] [Using automatic locking as we are switching between models]
DBG2 [zm_mlapi] [Media get SSL certificate check has been disbled]
DBG2 [zm_mlapi] [Using URL 39206 for stream]
DBG2 [zm_mlapi] [We will only process frames: ['snapshot', 'alarm']]
DBG2 [zm_mlapi] [No need to start streams, we are picking images from https://surveillance.wallacehouse.com/index.php?view=image&eid=39206]
DBG4 [zm_mlapi] [Trying to convert snapshot to a real frame id]
DBG3 [zm_mlapi] [No need to relogin as access token still has 719.8066667833333 minutes remaining]
DBG4 [zm_mlapi] [make_request called with url=https://surveillance.wallacehouse.com/api/events/39206.json payload={} type=get query={'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjE3NTM3NjYzLCJleHAiOjE2MTc1ODA4NjMsInVzZXIiOiJ6b25lbWluZGVyX2VuIiwidHlwZSI6ImFjY2VzcyJ9.jV_uptfxmyX7zAZ5TsA0m37mosRo9HmGARtK9L4Teqc'}]
DBG4 [zm_mlapi] [At the point of analysis, Event:39206 snapshot frame id was:1,so using it]
DBG3 [zm_mlapi] [Reading https://surveillance.wallacehouse.com/index.php?view=image&eid=39206&fid=1]
DBG3 [zm_mlapi] [No need to relogin as access token still has 719.8059308666667 minutes remaining]
DBG4 [zm_mlapi] [make_request called with url=https://surveillance.wallacehouse.com/index.php?view=image&eid=39206&fid=1 payload={} type=get query={'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjE3NTM3NjYzLCJleHAiOjE2MTc1ODA4NjMsInVzZXIiOiJ6b25lbWluZGVyX2VuIiwidHlwZSI6ImFjY2VzcyJ9.jV_uptfxmyX7zAZ5TsA0m37mosRo9HmGARtK9L4Teqc'}]
DBG1 [zm_mlapi] [perf: Starting for frame:1]
DBG1 [zm_mlapi] [============ Frame: 1 Running object model in sequence ==================]
DBG4 [zm_mlapi] [Loading sequence: TPU object detection]
DBG2 [zm_mlapi] [Initializing model  type:object with options:{'name': 'TPU object detection', 'enabled': 'yes', 'object_weights': '/var/lib/zmeventnotification/models/coral_edgetpu/ssdlite_mobiledet_coco_qat_postprocess_edgetpu.tflite', 'object_labels': '/var/lib/zmeventnotification/models/coral_edgetpu/coco_indexed.names', 'object_min_confidence': 0.5, 'object_framework': 'coral_edgetpu', 'tpu_max_processes': 1, 'tpu_max_lock_wait': 120, 'max_detection_size': '90%', 'show_models': 'yes', 'match_past_detections': 'yes', 'past_det_max_diff_area': '5%', 'disable_locks': 'no'}]
DBG2 [zm_mlapi] [portalock: max:1, name:pyzm_uid33_tpu_lock, timeout:120]
DBG4 [zm_mlapi] [Skipping CPU/GPU Yolov4 Object Detection as it is disabled]
DBG3 [zm_mlapi] [object has a same_model_sequence strategy of most_unique]
DBG3 [zm_mlapi] [--------- Frame:1 Running variation: #1 -------------]
DBG2 [zm_mlapi] [Waiting for pyzm_uid33_tpu_lock portalock...]
DBG2 [zm_mlapi] [Got pyzm_uid33_tpu_lock portalock]
DBG1 [zm_mlapi] [|--------- Loading "TPU object detection" model from disk -------------|]
DBG1 [zm_mlapi] [perf: processor:tpu TPU initialization (loading /var/lib/zmeventnotification/models/coral_edgetpu/ssdlite_mobiledet_coco_qat_postprocess_edgetpu.tflite from disk) took: 2676.15 ms]
DBG1 [zm_mlapi] [|---------- TPU (input image: 1920w*1085h) ----------|]
DBG2 [zm_mlapi] [Released portalock pyzm_uid33_tpu_lock]
DBG1 [zm_mlapi] [perf: processor:tpu Coral TPU detection took: 38.32 ms]
DBG3 [zm_mlapi] [Coral object returning: [[54, 2, 1925, 1124]],['(coral) airplane'],[0.5234375]]
DBG3 [zm_mlapi] [core model detection over, got 1 objects. Now filtering]
DBG3 [zm_mlapi] [Max object size found to be: 90%]
DBG2 [zm_mlapi] [Converted 90% to 1874880.0]
DBG2 [zm_mlapi] [Ignoring object:(coral) airplane, as it's area: 2099262px exceeds max_object_area of 1874880.0px]
DBG2 [zm_mlapi] [Returning filtered list of 0 objects.]
DBG4 [zm_mlapi] [This model iteration inside object found: labels: [],conf:[]]
DBG3 [zm_mlapi] [Max object size found to be: 90%]
DBG2 [zm_mlapi] [Converted 90% to 1874880.0]
DBG2 [zm_mlapi] [No polygons, adding full image polygon: {'name': 'full_image', 'value': [(0, 0), (2688, 0), (2688, 1520), (0, 1520)], 'pattern': None}]
DBG3 [zm_mlapi] [resized polygons x=0.7142857142857143/y=0.7138157894736842: [{'name': 'full_image', 'value': [(0, 0), (1920, 0), (1920, 1085), (0, 1085)], 'pattern': None}]]
DBG2 [zm_mlapi] [We did not find any object matches in frame: 1]
DBG1 [zm_mlapi] [============ Frame: 1 Running face model in sequence ==================]
DBG1 [zm_mlapi] [Initializing face detection]
DBG2 [zm_mlapi] [portalock: max:1, name:pyzm_uid33_tpu_lock, timeout:120]
DBG1 [zm_mlapi] [perf: processor:cpu Face Recognition library load time took: 0.00 ms ]
DBG1 [zm_mlapi] [Initializing face recognition with model:hog upsample:1, jitters:0]
DBG2 [zm_mlapi] [portalock: max:3, name:pyzm_uid33_cpu_lock, timeout:120]
DBG1 [zm_mlapi] [pre-trained faces found, using that. If you want to add new images, remove: /var/lib/zmeventnotification/known_faces/faces.dat]
DBG3 [zm_mlapi] [face has a same_model_sequence strategy of union]
DBG3 [zm_mlapi] [--------- Frame:1 Running variation: #1 -------------]
DBG2 [zm_mlapi] [Waiting for pyzm_uid33_tpu_lock portalock...]
DBG2 [zm_mlapi] [Got pyzm_uid33_tpu_lock lock...]
DBG1 [zm_mlapi] [|--------- Loading "Face Detection (TPU)" model from disk -------------|]
DBG1 [zm_mlapi] [perf: processor:tpu TPU initialization (loading /var/lib/zmeventnotification/models/coral_edgetpu/ssd_mobilenet_v2_face_quant_postprocess_edgetpu.tflite from disk) took: 2.13 ms]
DBG1 [zm_mlapi] [|---------- TPU (input image: 1920w*1085h) ----------|]
DBG1 [zm_mlapi] [Released pyzm_uid33_tpu_lock portalock]
DBG1 [zm_mlapi] [perf: processor:tpu Coral TPU detection took: 40.87 ms]
DBG4 [zm_mlapi] [Coral face is detection only. Skipping recognition phase]
DBG3 [zm_mlapi] [Coral face returning: [],[],[]]
DBG4 [zm_mlapi] [This model iteration inside face found: labels: [],conf:[]]
DBG3 [zm_mlapi] [Max object size found to be: 90%]
DBG2 [zm_mlapi] [Converted 90% to 1874880.0]
DBG3 [zm_mlapi] [--------- Frame:1 Running variation: #2 -------------]
DBG1 [zm_mlapi] [|---------- Dlib Face recognition (input image: 1920w*1085h) ----------|]
DBG5 [zm_mlapi] [Face options={'name': 'Face Recognition (Dlib)', 'enabled': 'yes', 'pre_existing_labels': ['face'], 'save_unknown_faces': 'yes', 'save_unknown_faces_leeway_pixels': 50, 'face_detection_framework': 'dlib', 'known_images_path': '/var/lib/zmeventnotification/known_faces', 'unknown_images_path': '/var/lib/zmeventnotification/unknown_faces', 'face_model': 'cnn', 'face_train_model': 'cnn', 'face_recog_dist_threshold': 0.6, 'face_num_jitters': 0, 'face_upsample_times': 1, 'gpu_max_processes': 1, 'gpu_max_lock_wait': 120, 'cpu_max_processes': 3, 'cpu_max_lock_wait': 120, 'max_size': 800, 'disable_locks': 'no'}]
DBG2 [zm_mlapi] [Scaling image down to max size: 800]
DBG2 [zm_mlapi] [Waiting for pyzm_uid33_cpu_lock portalock...]
DBG2 [zm_mlapi] [Got pyzm_uid33_cpu_lock lock...]
DBG1 [zm_mlapi] [perf: processor:cpu Finding faces took 20282.14 ms]
DBG1 [zm_mlapi] [Released pyzm_uid33_cpu_lock portalock]
DBG1 [zm_mlapi] [perf: processor:cpu Computing face recognition distances took 0.88 ms]
DBG4 [zm_mlapi] [This model iteration inside face found: labels: [],conf:[]]
DBG3 [zm_mlapi] [Max object size found to be: 90%]
DBG2 [zm_mlapi] [Converted 90% to 1874880.0]
DBG2 [zm_mlapi] [We did not find any face matches in frame: 1]
DBG1 [zm_mlapi] [============ Frame: 1 Running alpr model in sequence ==================]
DBG2 [zm_mlapi] [Making sure we have matched one of ['car', 'motorbike', 'bus', 'truck', 'boat'] in [] before we proceed]
DBG1 [zm_mlapi] [Did not find pre existing labels, not running model]
DBG3 [zm_mlapi] [Reading https://surveillance.wallacehouse.com/index.php?view=image&eid=39206&fid=alarm]
DBG3 [zm_mlapi] [No need to relogin as access token still has 719.3990308166667 minutes remaining]
DBG4 [zm_mlapi] [make_request called with url=https://surveillance.wallacehouse.com/index.php?view=image&eid=39206&fid=alarm payload={} type=get query={'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjE3NTM3NjYzLCJleHAiOjE2MTc1ODA4NjMsInVzZXIiOiJ6b25lbWluZGVyX2VuIiwidHlwZSI6ImFjY2VzcyJ9.jV_uptfxmyX7zAZ5TsA0m37mosRo9HmGARtK9L4Teqc'}]
DBG1 [zm_mlapi] [HTTP error: 404 Client Error: Not Found for url: https://surveillance.wallacehouse.com/index.php?view=image&eid=39206&fid=alarm&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjE3NTM3NjYzLCJleHAiOjE2MTc1ODA4NjMsInVzZXIiOiJ6b25lbWluZGVyX2VuIiwidHlwZSI6ImFjY2VzcyJ9.jV_uptfxmyX7zAZ5TsA0m37mosRo9HmGARtK9L4Teqc]
DBG4 [zm_mlapi] [Raising BAD_IMAGE ValueError for a 404]
DBG2 [zm_mlapi] [Failed attempt:1 of 3]
DBG2 [zm_mlapi] [Sleeping for 4 seconds before retry]
DBG3 [zm_mlapi] [No need to relogin as access token still has 719.3308028166666 minutes remaining]
DBG4 [zm_mlapi] [make_request called with url=https://surveillance.wallacehouse.com/index.php?view=image&eid=39206&fid=alarm payload={} type=get query={'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjE3NTM3NjYzLCJleHAiOjE2MTc1ODA4NjMsInVzZXIiOiJ6b25lbWluZGVyX2VuIiwidHlwZSI6ImFjY2VzcyJ9.jV_uptfxmyX7zAZ5TsA0m37mosRo9HmGARtK9L4Teqc'}]
DBG1 [zm_mlapi] [HTTP error: 404 Client Error: Not Found for url: https://surveillance.wallacehouse.com/index.php?view=image&eid=39206&fid=alarm&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjE3NTM3NjYzLCJleHAiOjE2MTc1ODA4NjMsInVzZXIiOiJ6b25lbWluZGVyX2VuIiwidHlwZSI6ImFjY2VzcyJ9.jV_uptfxmyX7zAZ5TsA0m37mosRo9HmGARtK9L4Teqc]
DBG4 [zm_mlapi] [Raising BAD_IMAGE ValueError for a 404]
DBG2 [zm_mlapi] [Failed attempt:2 of 3]
DBG2 [zm_mlapi] [Sleeping for 4 seconds before retry]
DBG3 [zm_mlapi] [No need to relogin as access token still has 719.2625762833334 minutes remaining]
DBG4 [zm_mlapi] [make_request called with url=https://surveillance.wallacehouse.com/index.php?view=image&eid=39206&fid=alarm payload={} type=get query={'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjE3NTM3NjYzLCJleHAiOjE2MTc1ODA4NjMsInVzZXIiOiJ6b25lbWluZGVyX2VuIiwidHlwZSI6ImFjY2VzcyJ9.jV_uptfxmyX7zAZ5TsA0m37mosRo9HmGARtK9L4Teqc'}]
DBG1 [zm_mlapi] [HTTP error: 404 Client Error: Not Found for url: https://surveillance.wallacehouse.com/index.php?view=image&eid=39206&fid=alarm&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjE3NTM3NjYzLCJleHAiOjE2MTc1ODA4NjMsInVzZXIiOiJ6b25lbWluZGVyX2VuIiwidHlwZSI6ImFjY2VzcyJ9.jV_uptfxmyX7zAZ5TsA0m37mosRo9HmGARtK9L4Teqc]
DBG4 [zm_mlapi] [Raising BAD_IMAGE ValueError for a 404]
DBG2 [zm_mlapi] [Failed attempt:3 of 3]
DBG1 [zm_mlapi] [Error reading frame: 1 of max 5 contiguous errors]
DBG1 [zm_mlapi] [Reached end of frame_set]
DBG1 [zm_mlapi] [Ran out of frames to read]
DBG1 [zm_mlapi] [perf: TOTAL detection sequence (with image loads) took: 32674.41 ms  to process 39206]
DBG1 [zm_mlapi] [Returning {'matched_data': {'boxes': [], 'error_boxes': [], 'labels': [], 'confidences': [], 'frame_id': None, 'image_dimensions': {'original': (1520, 2688), 'resized': (1085, 1920)}, 'image': None, 'polygons': [{'name': 'full_image', 'value': [(0, 0), (1920, 0), (1920, 1085), (0, 1085)], 'pattern': None}]}, 'all_matches': []}]

Example with a face detected:

Client:

sudo -u http /var/lib/zmeventnotification/bin/zm_detect.py --config /etc/zm/objectconfig.ini  --debug --eventid 36581 --monitorid 13ll
INF [zmesdetect_m13ll] [Setting up signal handler for logs]
INF [zmesdetect_m13ll] [Switching global logger to ZMLog]
INF [zmesdetect_m13ll] [---------| app:6.1.19, pyzm:0.3.43, ES:6.1.19 , OpenCV:4.5.1|------------]
DBG1 [zmesdetect_m13ll] [secret filename: /etc/zm/secrets.ini]
DBG2 [zmesdetect_m13ll] [Secret token found in config: !ZM_PORTAL]
DBG2 [zmesdetect_m13ll] [Secret token found in config: !ZM_USER]
DBG2 [zmesdetect_m13ll] [Secret token found in config: !ZM_PASSWORD]
DBG2 [zmesdetect_m13ll] [Secret token found in config: !ZM_API_PORTAL]
DBG2 [zmesdetect_m13ll] [Secret token found in config: !ML_USER]
DBG2 [zmesdetect_m13ll] [Secret token found in config: !ML_PASSWORD]
DBG2 [zmesdetect_m13ll] [Secret token found in config: !PLATEREC_ALPR_KEY]
DBG1 [zmesdetect_m13ll] [allowing self-signed certs to work...]
DBG4 [zmesdetect_m13ll] [Now checking for monitor overrides]
DBG4 [zmesdetect_m13ll] [Finally, doing parameter substitution]
INF [zmesdetect_m13ll] [Importing remote shim classes for Object/Face]
INF [zmesdetect_m13ll] [Connecting with ZM APIs]
DBG2 [zmesdetect_m13ll] [API SSL certificate check has been disbled]
DBG1 [zmesdetect_m13ll] [using username/password for login]
DBG2 [zmesdetect_m13ll] [Using new token API]
DBG1 [zmesdetect_m13ll] [Access token expires on:2021-04-04 20:12:03.621765 [43200s]]
DBG1 [zmesdetect_m13ll] [Refresh token expires on:2021-04-05 08:12:03.622057 [86400s]]
DBG2 [zmesdetect_m13ll] [using ml_sequence]
DBG2 [zmesdetect_m13ll] [using stream_sequence]
INF [zmesdetect_m13ll] [Detecting using remote API Gateway http://127.0.0.1:5000/api/v1]
DBG2 [zmesdetect_m13ll] [Found token file, checking if token has not expired]
DBG1 [zmesdetect_m13ll] [Access token is valid for 1123 more seconds]
DBG2 [zmesdetect_m13ll] [Invoking mlapi with url:http://127.0.0.1:5000/api/v1/detect/object?type=object and json: mid=13ll reason=None stream=36581, stream_options={'frame_strategy': 'most_models', 'frame_set': 'snapshot,alarm', 'contig_frames_before_error': 5, 'max_attempts': 3, 'sleep_between_attempts': 4, 'resize': 1920, 'api': None, 'polygons': []} ml_overrides={'model_sequence': 'object,face,alpr', 'object': {'pattern': '(person|car|dog|cat|bird|bicycle|backpack|umbrella|handbag|suitcase|frisbee|sports ball|baseball bat|skateboard|bottle|cup|knife|cell phone|book|motorbike|bus|truck|boat)'}, 'face': {'pattern': '.*'}, 'alpr': {'pattern': '.*'}} headers={'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MTc1MzcxOTksIm5iZiI6MTYxNzUzNzE5OSwianRpIjoiNGU5YmY1NTMtYmVmNy00YzFlLTkwM2ItZWE1MjQxNTM1OTY0IiwiZXhwIjoxNjE3NTQwNzk5LCJpZGVudGl0eSI6InptZXMiLCJmcmVzaCI6ZmFsc2UsInR5cGUiOiJhY2Nlc3MifQ.BcoUeTA5b-ARLefzp0avGjTk9_DQSQZxvm67-hSpOa8'} params={'delete': True, 'response_format': 'zm_detect'} ]
DBG1 [zmesdetect_m13ll] [remote detection inferencing took: 0:00:47.486976]
DBG2 [zmesdetect_m13ll] [Grabbing image from https://surveillance.wallacehouse.com/index.php?view=image&eid=36581&fid=4369 as we need to write objdetect.jpg]
DBG3 [zmesdetect_m13ll] [No need to relogin as access token still has 719.2084915833333 minutes remaining]
DBG4 [zmesdetect_m13ll] [make_request called with url=https://surveillance.wallacehouse.com/index.php?view=image&eid=36581&fid=4369 payload={} type=get query={'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjE3NTM4MzIzLCJleHAiOjE2MTc1ODE1MjMsInVzZXIiOiJ6b25lbWluZGVyX2VuIiwidHlwZSI6ImFjY2VzcyJ9.vCkVFxfWGWphhGTMeie7Mt3dbaEGDDSSnF8QFf57hS4'}]
DBG1 [zmesdetect_m13ll] [Total remote detection detection took: 0:00:47.548639]
INF [zmesdetect_m13ll] [Prediction string:[x] detected:(coral) person:80% (coral) book:64% face:96% Brian Wallace:100% ]
DBG1 [zmesdetect_m13ll] [Prediction string JSON:{"labels": ["(coral) person", "(coral) book", "(coral) book", "(coral) book", "(coral) book", "(coral) book", "(coral) book", "(coral) book", "(coral) book", "(coral) book", "face", "Brian Wallace"], "boxes": [[359, 386, 1363, 1081], [1679, 648, 1712, 745], [1605, 675, 1629, 759], [1592, 919, 1628, 985], [1664, 910, 1705, 980], [1614, 788, 1645, 857], [1660, 784, 1696, 853], [1477, 942, 1523, 992], [1695, 613, 1726, 674], [1597, 614, 1620, 679], [693, 366, 999, 723], [703, 456, 938, 691]], "frame_id": "4369", "confidences": [0.8046875, 0.640

Server:

sudo -u http python3 mlapi.py -d -c /etc/zoneminder/mlapiconfig.ini
INF [zm_mlapi] [Setting up signal handler for logs]
INF [zm_mlapi] [Switching global logger to ZMLog]
INF [zm_mlapi] [Switched to ZM logs]
DBG1 [zm_mlapi] [secret filename: /etc/zm/secrets.ini]
DBG1 [zm_mlapi] [Secret token found in config: !MLAPI_SECRET_KEY]
DBG1 [zm_mlapi] [Secret token found in config: !PLATEREC_ALPR_KEY]
DBG4 [zm_mlapi] [Doing parameter substitution for globals]
DBG4 [zm_mlapi] [Doing parameter substitution for monitor specific entities]
DBG1 [zm_mlapi] [Opening DB at ./db/db.json]
DBG1 [zm_mlapi] [DB engine ready]
DBG2 [zm_mlapi] [API SSL certificate check has been disbled]
DBG1 [zm_mlapi] [using username/password for login]
DBG2 [zm_mlapi] [Using new token API]
DBG1 [zm_mlapi] [Access token expires on:2021-04-04 20:11:58.468366 [43200s]]
DBG1 [zm_mlapi] [Refresh token expires on:2021-04-05 08:11:58.468623 [86400s]]
DBG3 [zm_mlapi] [No need to relogin as access token still has 719.9999912999999 minutes remaining]
DBG4 [zm_mlapi] [make_request called with url=https://surveillance.wallacehouse.com/api/zones.json payload={} type=get query={'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjE3NTM4MzE4LCJleHAiOjE2MTc1ODE1MTgsInVzZXIiOiJ6b25lbWluZGVyX2VuIiwidHlwZSI6ImFjY2VzcyJ9.l28c3x-H3Lv_F0ZC5yI-HSggXmAg7GKXhS4jEHmphsY'}]
DBG4 [zm_mlapi] [Not importing zone:New for monitor:1 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:New for monitor:2 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:New for monitor:3 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:New for monitor:4 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:Grass for monitor:5 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:New for monitor:6 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:New for monitor:7 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:New for monitor:8 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:New for monitor:9 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:New for monitor:10 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:New for monitor:11 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:New for monitor:12 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:New for monitor:10 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:Bed for monitor:10 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:Bushes for monitor:5 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:All for monitor:16 as the global setting says no and there is no local override]
DBG4 [zm_mlapi] [Not importing zone:New for monitor:13 as the global setting says no and there is no local override]
DBG2 [zm_mlapi] [using ml_sequence]
DBG1 [zm_mlapi] [Resetting models, will be loaded on next run]
INF [zm_mlapi] [--------| mlapi version:2.2.13, pyzm version:0.3.43 |--------]
INF [zm_mlapi] [Using bjoern as WSGI server]
DBG1 [zm_mlapi] [Monitor ID not specified, or not found in mlapi config, using zm_detect overrides]
DBG2 [zm_mlapi] [using ml_sequence]
DBG4 [zm_mlapi] [Found stream_sequence in mlapi config, ignoring objectconfig.ini]
DBG1 [zm_mlapi] [Object Recognition requested]
DBG1 [zm_mlapi] [Calling detect streams]
DBG3 [zm_mlapi] [Using automatic locking as we are switching between models]
DBG2 [zm_mlapi] [Media get SSL certificate check has been disbled]
DBG2 [zm_mlapi] [Using URL 36581 for stream]
DBG2 [zm_mlapi] [We will only process frames: ['snapshot', 'alarm']]
DBG2 [zm_mlapi] [No need to start streams, we are picking images from https://surveillance.wallacehouse.com/index.php?view=image&eid=36581]
DBG4 [zm_mlapi] [Trying to convert snapshot to a real frame id]
DBG3 [zm_mlapi] [No need to relogin as access token still has 719.9138656666667 minutes remaining]
DBG4 [zm_mlapi] [make_request called with url=https://surveillance.wallacehouse.com/api/events/36581.json payload={} type=get query={'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjE3NTM4MzE4LCJleHAiOjE2MTc1ODE1MTgsInVzZXIiOiJ6b25lbWluZGVyX2VuIiwidHlwZSI6ImFjY2VzcyJ9.l28c3x-H3Lv_F0ZC5yI-HSggXmAg7GKXhS4jEHmphsY'}]
DBG4 [zm_mlapi] [At the point of analysis, Event:36581 snapshot frame id was:4369,so using it]
DBG3 [zm_mlapi] [Reading https://surveillance.wallacehouse.com/index.php?view=image&eid=36581&fid=4369]
DBG3 [zm_mlapi] [No need to relogin as access token still has 719.9110601333334 minutes remaining]
DBG4 [zm_mlapi] [make_request called with url=https://surveillance.wallacehouse.com/index.php?view=image&eid=36581&fid=4369 payload={} type=get query={'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjE3NTM4MzE4LCJleHAiOjE2MTc1ODE1MTgsInVzZXIiOiJ6b25lbWluZGVyX2VuIiwidHlwZSI6ImFjY2VzcyJ9.l28c3x-H3Lv_F0ZC5yI-HSggXmAg7GKXhS4jEHmphsY'}]
DBG1 [zm_mlapi] [perf: Starting for frame:4369]
DBG1 [zm_mlapi] [============ Frame: 4369 Running object model in sequence ==================]
DBG4 [zm_mlapi] [Loading sequence: TPU object detection]
DBG2 [zm_mlapi] [Initializing model  type:object with options:{'name': 'TPU object detection', 'enabled': 'yes', 'object_weights': '/var/lib/zmeventnotification/models/coral_edgetpu/ssdlite_mobiledet_coco_qat_postprocess_edgetpu.tflite', 'object_labels': '/var/lib/zmeventnotification/models/coral_edgetpu/coco_indexed.names', 'object_min_confidence': 0.5, 'object_framework': 'coral_edgetpu', 'tpu_max_processes': 1, 'tpu_max_lock_wait': 120, 'max_detection_size': '90%', 'show_models': 'yes', 'match_past_detections': 'yes', 'past_det_max_diff_area': '5%', 'disable_locks': 'no'}]
DBG2 [zm_mlapi] [portalock: max:1, name:pyzm_uid33_tpu_lock, timeout:120]
DBG4 [zm_mlapi] [Skipping CPU/GPU Yolov4 Object Detection as it is disabled]
DBG3 [zm_mlapi] [object has a same_model_sequence strategy of most_unique]
DBG3 [zm_mlapi] [--------- Frame:4369 Running variation: #1 -------------]
DBG2 [zm_mlapi] [Waiting for pyzm_uid33_tpu_lock portalock...]
DBG2 [zm_mlapi] [Got pyzm_uid33_tpu_lock portalock]
DBG1 [zm_mlapi] [|--------- Loading "TPU object detection" model from disk -------------|]
DBG1 [zm_mlapi] [perf: processor:tpu TPU initialization (loading /var/lib/zmeventnotification/models/coral_edgetpu/ssdlite_mobiledet_coco_qat_postprocess_edgetpu.tflite from disk) took: 2674.25 ms]
DBG1 [zm_mlapi] [|---------- TPU (input image: 1920w*1085h) ----------|]
DBG2 [zm_mlapi] [Released portalock pyzm_uid33_tpu_lock]
DBG1 [zm_mlapi] [perf: processor:tpu Coral TPU detection took: 38.31 ms]
DBG3 [zm_mlapi] [Coral object returning: [[359, 386, 1363, 1081], [1679, 648, 1712, 745], [1605, 675, 1629, 759], [1592, 919, 1628, 985], [1664, 910, 1705, 980], [1614, 788, 1645, 857], [1660, 784, 1696, 853], [1477, 942, 1523, 992], [1695, 613, 1726, 674], [1597, 614, 1620, 679]],['(coral) person', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book'],[0.8046875, 0.640625, 0.6171875, 0.609375, 0.57421875, 0.57421875, 0.55859375, 0.55859375, 0.55859375, 0.5234375]]
DBG3 [zm_mlapi] [core model detection over, got 10 objects. Now filtering]
DBG3 [zm_mlapi] [Max object size found to be: 90%]
DBG2 [zm_mlapi] [Converted 90% to 1874880.0]
DBG2 [zm_mlapi] [Returning filtered list of 10 objects.]
DBG4 [zm_mlapi] [This model iteration inside object found: labels: ['(coral) person', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book'],conf:[0.8046875, 0.640625, 0.6171875, 0.609375, 0.57421875, 0.57421875, 0.55859375, 0.55859375, 0.55859375, 0.5234375]]
DBG3 [zm_mlapi] [Max object size found to be: 90%]
DBG2 [zm_mlapi] [Converted 90% to 1874880.0]
DBG2 [zm_mlapi] [No polygons, adding full image polygon: {'name': 'full_image', 'value': [(0, 0), (2688, 0), (2688, 1520), (0, 1520)], 'pattern': None}]
DBG3 [zm_mlapi] [resized polygons x=0.7142857142857143/y=0.7138157894736842: [{'name': 'full_image', 'value': [(0, 0), (1920, 0), (1920, 1085), (0, 1085)], 'pattern': None}]]
DBG3 [zm_mlapi] [intersection: comparing object:(coral) person,POLYGON ((359 386, 1363 386, 1363 1081, 359 1081, 359 386)) to polygon:full_image,POLYGON ((0 0, 1920 0, 1920 1085, 0 1085, 0 0))]
DBG2 [zm_mlapi] [Match pattern overridden to (person|car|dog|cat|bird|bicycle|backpack|umbrella|handbag|suitcase|frisbee|sports ball|baseball bat|skateboard|bottle|cup|knife|cell phone|book|motorbike|bus|truck|boat) in ml_overrides]
DBG3 [zm_mlapi] [full_image intersects object:(coral) person[[(359, 386), (1363, 386), (1363, 1081), (359, 1081)]]]
DBG3 [zm_mlapi] [intersection: comparing object:(coral) book,POLYGON ((1679 648, 1712 648, 1712 745, 1679 745, 1679 648)) to polygon:full_image,POLYGON ((0 0, 1920 0, 1920 1085, 0 1085, 0 0))]
DBG2 [zm_mlapi] [Match pattern overridden to (person|car|dog|cat|bird|bicycle|backpack|umbrella|handbag|suitcase|frisbee|sports ball|baseball bat|skateboard|bottle|cup|knife|cell phone|book|motorbike|bus|truck|boat) in ml_overrides]
DBG3 [zm_mlapi] [full_image intersects object:(coral) book[[(1679, 648), (1712, 648), (1712, 745), (1679, 745)]]]
DBG3 [zm_mlapi] [intersection: comparing object:(coral) book,POLYGON ((1605 675, 1629 675, 1629 759, 1605 759, 1605 675)) to polygon:full_image,POLYGON ((0 0, 1920 0, 1920 1085, 0 1085, 0 0))]
DBG2 [zm_mlapi] [Match pattern overridden to (person|car|dog|cat|bird|bicycle|backpack|umbrella|handbag|suitcase|frisbee|sports ball|baseball bat|skateboard|bottle|cup|knife|cell phone|book|motorbike|bus|truck|boat) in ml_overrides]
DBG3 [zm_mlapi] [full_image intersects object:(coral) book[[(1605, 675), (1629, 675), (1629, 759), (1605, 759)]]]
DBG3 [zm_mlapi] [intersection: comparing object:(coral) book,POLYGON ((1592 919, 1628 919, 1628 985, 1592 985, 1592 919)) to polygon:full_image,POLYGON ((0 0, 1920 0, 1920 1085, 0 1085, 0 0))]
DBG2 [zm_mlapi] [Match pattern overridden to (person|car|dog|cat|bird|bicycle|backpack|umbrella|handbag|suitcase|frisbee|sports ball|baseball bat|skateboard|bottle|cup|knife|cell phone|book|motorbike|bus|truck|boat) in ml_overrides]
DBG3 [zm_mlapi] [full_image intersects object:(coral) book[[(1592, 919), (1628, 919), (1628, 985), (1592, 985)]]]
DBG3 [zm_mlapi] [intersection: comparing object:(coral) book,POLYGON ((1664 910, 1705 910, 1705 980, 1664 980, 1664 910)) to polygon:full_image,POLYGON ((0 0, 1920 0, 1920 1085, 0 1085, 0 0))]
DBG2 [zm_mlapi] [Match pattern overridden to (person|car|dog|cat|bird|bicycle|backpack|umbrella|handbag|suitcase|frisbee|sports ball|baseball bat|skateboard|bottle|cup|knife|cell phone|book|motorbike|bus|truck|boat) in ml_overrides]
DBG3 [zm_mlapi] [full_image intersects object:(coral) book[[(1664, 910), (1705, 910), (1705, 980), (1664, 980)]]]
DBG3 [zm_mlapi] [intersection: comparing object:(coral) book,POLYGON ((1614 788, 1645 788, 1645 857, 1614 857, 1614 788)) to polygon:full_image,POLYGON ((0 0, 1920 0, 1920 1085, 0 1085, 0 0))]
DBG2 [zm_mlapi] [Match pattern overridden to (person|car|dog|cat|bird|bicycle|backpack|umbrella|handbag|suitcase|frisbee|sports ball|baseball bat|skateboard|bottle|cup|knife|cell phone|book|motorbike|bus|truck|boat) in ml_overrides]
DBG3 [zm_mlapi] [full_image intersects object:(coral) book[[(1614, 788), (1645, 788), (1645, 857), (1614, 857)]]]
DBG3 [zm_mlapi] [intersection: comparing object:(coral) book,POLYGON ((1660 784, 1696 784, 1696 853, 1660 853, 1660 784)) to polygon:full_image,POLYGON ((0 0, 1920 0, 1920 1085, 0 1085, 0 0))]
DBG2 [zm_mlapi] [Match pattern overridden to (person|car|dog|cat|bird|bicycle|backpack|umbrella|handbag|suitcase|frisbee|sports ball|baseball bat|skateboard|bottle|cup|knife|cell phone|book|motorbike|bus|truck|boat) in ml_overrides]
DBG3 [zm_mlapi] [full_image intersects object:(coral) book[[(1660, 784), (1696, 784), (1696, 853), (1660, 853)]]]
DBG3 [zm_mlapi] [intersection: comparing object:(coral) book,POLYGON ((1477 942, 1523 942, 1523 992, 1477 992, 1477 942)) to polygon:full_image,POLYGON ((0 0, 1920 0, 1920 1085, 0 1085, 0 0))]
DBG2 [zm_mlapi] [Match pattern overridden to (person|car|dog|cat|bird|bicycle|backpack|umbrella|handbag|suitcase|frisbee|sports ball|baseball bat|skateboard|bottle|cup|knife|cell phone|book|motorbike|bus|truck|boat) in ml_overrides]
DBG3 [zm_mlapi] [full_image intersects object:(coral) book[[(1477, 942), (1523, 942), (1523, 992), (1477, 992)]]]
DBG3 [zm_mlapi] [intersection: comparing object:(coral) book,POLYGON ((1695 613, 1726 613, 1726 674, 1695 674, 1695 613)) to polygon:full_image,POLYGON ((0 0, 1920 0, 1920 1085, 0 1085, 0 0))]
DBG2 [zm_mlapi] [Match pattern overridden to (person|car|dog|cat|bird|bicycle|backpack|umbrella|handbag|suitcase|frisbee|sports ball|baseball bat|skateboard|bottle|cup|knife|cell phone|book|motorbike|bus|truck|boat) in ml_overrides]
DBG3 [zm_mlapi] [full_image intersects object:(coral) book[[(1695, 613), (1726, 613), (1726, 674), (1695, 674)]]]
DBG3 [zm_mlapi] [intersection: comparing object:(coral) book,POLYGON ((1597 614, 1620 614, 1620 679, 1597 679, 1597 614)) to polygon:full_image,POLYGON ((0 0, 1920 0, 1920 1085, 0 1085, 0 0))]
DBG2 [zm_mlapi] [Match pattern overridden to (person|car|dog|cat|bird|bicycle|backpack|umbrella|handbag|suitcase|frisbee|sports ball|baseball bat|skateboard|bottle|cup|knife|cell phone|book|motorbike|bus|truck|boat) in ml_overrides]
DBG3 [zm_mlapi] [full_image intersects object:(coral) book[[(1597, 614), (1620, 614), (1620, 679), (1597, 679)]]]
DBG1 [zm_mlapi] [============ Frame: 4369 Running face model in sequence ==================]
DBG1 [zm_mlapi] [Initializing face detection]
DBG2 [zm_mlapi] [portalock: max:1, name:pyzm_uid33_tpu_lock, timeout:120]
DBG1 [zm_mlapi] [perf: processor:cpu Face Recognition library load time took: 0.00 ms ]
DBG1 [zm_mlapi] [Initializing face recognition with model:hog upsample:1, jitters:0]
DBG2 [zm_mlapi] [portalock: max:3, name:pyzm_uid33_cpu_lock, timeout:120]
DBG1 [zm_mlapi] [pre-trained faces found, using that. If you want to add new images, remove: /var/lib/zmeventnotification/known_faces/faces.dat]
DBG3 [zm_mlapi] [face has a same_model_sequence strategy of union]
DBG3 [zm_mlapi] [--------- Frame:4369 Running variation: #1 -------------]
DBG2 [zm_mlapi] [Waiting for pyzm_uid33_tpu_lock portalock...]
DBG2 [zm_mlapi] [Got pyzm_uid33_tpu_lock lock...]
DBG1 [zm_mlapi] [|--------- Loading "Face Detection (TPU)" model from disk -------------|]
DBG1 [zm_mlapi] [perf: processor:tpu TPU initialization (loading /var/lib/zmeventnotification/models/coral_edgetpu/ssd_mobilenet_v2_face_quant_postprocess_edgetpu.tflite from disk) took: 2.20 ms]
DBG1 [zm_mlapi] [|---------- TPU (input image: 1920w*1085h) ----------|]
DBG1 [zm_mlapi] [Released pyzm_uid33_tpu_lock portalock]
DBG1 [zm_mlapi] [perf: processor:tpu Coral TPU detection took: 40.48 ms]
DBG4 [zm_mlapi] [Coral face is detection only. Skipping recognition phase]
DBG3 [zm_mlapi] [Coral face returning: [[693, 366, 999, 723]],['face'],[0.9609375]]
DBG4 [zm_mlapi] [This model iteration inside face found: labels: ['face'],conf:[0.9609375]]
DBG3 [zm_mlapi] [Max object size found to be: 90%]
DBG2 [zm_mlapi] [Converted 90% to 1874880.0]
DBG3 [zm_mlapi] [intersection: comparing object:face,POLYGON ((693 366, 999 366, 999 723, 693 723, 693 366)) to polygon:full_image,POLYGON ((0 0, 1920 0, 1920 1085, 0 1085, 0 0))]
DBG2 [zm_mlapi] [Match pattern overridden to .* in ml_overrides]
DBG3 [zm_mlapi] [full_image intersects object:face[[(693, 366), (999, 366), (999, 723), (693, 723)]]]
DBG3 [zm_mlapi] [--------- Frame:4369 Running variation: #2 -------------]
DBG1 [zm_mlapi] [|---------- Dlib Face recognition (input image: 1920w*1085h) ----------|]
DBG5 [zm_mlapi] [Face options={'name': 'Face Recognition (Dlib)', 'enabled': 'yes', 'pre_existing_labels': ['face'], 'save_unknown_faces': 'yes', 'save_unknown_faces_leeway_pixels': 50, 'face_detection_framework': 'dlib', 'known_images_path': '/var/lib/zmeventnotification/known_faces', 'unknown_images_path': '/var/lib/zmeventnotification/unknown_faces', 'face_model': 'cnn', 'face_train_model': 'cnn', 'face_recog_dist_threshold': 0.6, 'face_num_jitters': 0, 'face_upsample_times': 1, 'gpu_max_processes': 1, 'gpu_max_lock_wait': 120, 'cpu_max_processes': 3, 'cpu_max_lock_wait': 120, 'max_size': 800, 'disable_locks': 'no'}]
DBG2 [zm_mlapi] [Scaling image down to max size: 800]
DBG2 [zm_mlapi] [Waiting for pyzm_uid33_cpu_lock portalock...]
DBG2 [zm_mlapi] [Got pyzm_uid33_cpu_lock lock...]
DBG1 [zm_mlapi] [perf: processor:cpu Finding faces took 21088.42 ms]
DBG1 [zm_mlapi] [Released pyzm_uid33_cpu_lock portalock]
DBG1 [zm_mlapi] [perf: processor:cpu Computing face recognition distances took 260.19 ms]
DBG3 [zm_mlapi] [Comparing to known faces...]
DBG5 [zm_mlapi] [Closest knn match indexes (lesser is better): (array([[0.45659342]]), array([[11]]))]
DBG1 [zm_mlapi] [perf: processor:cpu Matching recognized faces to known faces took 4.55 ms]
DBG2 [zm_mlapi] [Scaling image back up to 1920]
DBG3 [zm_mlapi] [Face Dlib:Returning: [[703, 456, 938, 691]], ['Brian Wallace'], [1]]
DBG4 [zm_mlapi] [This model iteration inside face found: labels: ['Brian Wallace'],conf:[1]]
DBG3 [zm_mlapi] [Max object size found to be: 90%]
DBG2 [zm_mlapi] [Converted 90% to 1874880.0]
DBG3 [zm_mlapi] [intersection: comparing object:Brian,POLYGON ((703 456, 938 456, 938 691, 703 691, 703 456)) to polygon:full_image,POLYGON ((0 0, 1920 0, 1920 1085, 0 1085, 0 0))]
DBG2 [zm_mlapi] [Match pattern overridden to .* in ml_overrides]
DBG3 [zm_mlapi] [full_image intersects object:Brian[[(703, 456), (938, 456), (938, 691), (703, 691)]]]
DBG1 [zm_mlapi] [============ Frame: 4369 Running alpr model in sequence ==================]
DBG2 [zm_mlapi] [Making sure we have matched one of ['car', 'motorbike', 'bus', 'truck', 'boat'] in ['(coral) person', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', 'face', 'Brian'] before we proceed]
DBG1 [zm_mlapi] [Did not find pre existing labels, not running model]
DBG3 [zm_mlapi] [Reading https://surveillance.wallacehouse.com/index.php?view=image&eid=36581&fid=alarm]
DBG3 [zm_mlapi] [No need to relogin as access token still has 719.4858274666666 minutes remaining]
DBG4 [zm_mlapi] [make_request called with url=https://surveillance.wallacehouse.com/index.php?view=image&eid=36581&fid=alarm payload={} type=get query={'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjE3NTM4MzE4LCJleHAiOjE2MTc1ODE1MTgsInVzZXIiOiJ6b25lbWluZGVyX2VuIiwidHlwZSI6ImFjY2VzcyJ9.l28c3x-H3Lv_F0ZC5yI-HSggXmAg7GKXhS4jEHmphsY'}]
DBG1 [zm_mlapi] [perf: Starting for frame:alarm]
DBG1 [zm_mlapi] [============ Frame: alarm Running object model in sequence ==================]
DBG3 [zm_mlapi] [object has a same_model_sequence strategy of most_unique]
DBG3 [zm_mlapi] [--------- Frame:alarm Running variation: #1 -------------]
DBG2 [zm_mlapi] [Waiting for pyzm_uid33_tpu_lock portalock...]
DBG2 [zm_mlapi] [Got pyzm_uid33_tpu_lock portalock]
DBG1 [zm_mlapi] [|---------- TPU (input image: 1920w*1085h) ----------|]
DBG2 [zm_mlapi] [Released portalock pyzm_uid33_tpu_lock]
DBG1 [zm_mlapi] [perf: processor:tpu Coral TPU detection took: 39.03 ms]
DBG3 [zm_mlapi] [Coral object returning: [[642, 472, 1113, 1076], [1678, 648, 1713, 748], [1604, 674, 1627, 759], [1091, 956, 1380, 1067], [1595, 924, 1631, 988], [1662, 917, 1702, 982], [1464, 940, 1523, 994], [1609, 786, 1641, 857], [1696, 610, 1728, 672], [1659, 784, 1696, 851]],['(coral) person', '(coral) book', '(coral) book', '(coral) chair', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book'],[0.70703125, 0.65234375, 0.6171875, 0.59765625, 0.59765625, 0.57421875, 0.57421875, 0.55859375, 0.55859375, 0.546875]]
DBG3 [zm_mlapi] [core model detection over, got 10 objects. Now filtering]
DBG3 [zm_mlapi] [Max object size found to be: 90%]
DBG2 [zm_mlapi] [Converted 90% to 1874880.0]
DBG2 [zm_mlapi] [Returning filtered list of 10 objects.]
DBG4 [zm_mlapi] [This model iteration inside object found: labels: ['(coral) person', '(coral) book', '(coral) book', '(coral) chair', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book'],conf:[0.70703125, 0.65234375, 0.6171875, 0.59765625, 0.59765625, 0.57421875, 0.57421875, 0.55859375, 0.55859375, 0.546875]]
DBG3 [zm_mlapi] [Max object size found to be: 90%]
DBG2 [zm_mlapi] [Converted 90% to 1874880.0]
DBG3 [zm_mlapi] [intersection: comparing object:(coral) person,POLYGON ((642 472, 1113 472, 1113 1076, 642 1076, 642 472)) to polygon:full_image,POLYGON ((0 0, 1920 0, 1920 1085, 0 1085, 0 0))]
DBG2 [zm_mlapi] [Match pattern overridden to (person|car|dog|cat|bird|bicycle|backpack|umbrella|handbag|suitcase|frisbee|sports ball|baseball bat|skateboard|bottle|cup|knife|cell phone|book|motorbike|bus|truck|boat) in ml_overrides]
DBG3 [zm_mlapi] [full_image intersects object:(coral) person[[(642, 472), (1113, 472), (1113, 1076), (642, 1076)]]]
DBG3 [zm_mlapi] [intersection: comparing object:(coral) book,POLYGON ((1678 648, 1713 648, 1713 748, 1678 748, 1678 648)) to polygon:full_image,POLYGON ((0 0, 1920 0, 1920 1085, 0 1085, 0 0))]
DBG2 [zm_mlapi] [Match pattern overridden to (person|car|dog|cat|bird|bicycle|backpack|umbrella|handbag|suitcase|frisbee|sports ball|baseball bat|skateboard|bottle|cup|knife|cell phone|book|motorbike|bus|truck|boat) in ml_overrides]
DBG3 [zm_mlapi] [full_image intersects object:(coral) book[[(1678, 648), (1713, 648), (1713, 748), (1678, 748)]]]
DBG3 [zm_mlapi] [intersection: comparing object:(coral) book,POLYGON ((1604 674, 1627 674, 1627 759, 1604 759, 1604 674)) to polygon:full_image,POLYGON ((0 0, 1920 0, 1920 1085, 0 1085, 0 0))]
DBG2 [zm_mlapi] [Match pattern overridden to (person|car|dog|cat|bird|bicycle|backpack|umbrella|handbag|suitcase|frisbee|sports ball|baseball bat|skateboard|bottle|cup|knife|cell phone|book|motorbike|bus|truck|boat) in ml_overrides]
DBG3 [zm_mlapi] [full_image intersects object:(coral) book[[(1604, 674), (1627, 674), (1627, 759), (1604, 759)]]]
DBG3 [zm_mlapi] [intersection: comparing object:(coral) chair,POLYGON ((1091 956, 1380 956, 1380 1067, 1091 1067, 1091 956)) to polygon:full_image,POLYGON ((0 0, 1920 0, 1920 1085, 0 1085, 0 0))]
DBG2 [zm_mlapi] [Match pattern overridden to (person|car|dog|cat|bird|bicycle|backpack|umbrella|handbag|suitcase|frisbee|sports ball|baseball bat|skateboard|bottle|cup|knife|cell phone|book|motorbike|bus|truck|boat) in ml_overrides]
DBG3 [zm_mlapi] [full_image intersects object:(coral) chair[[(1091, 956), (1380, 956), (1380, 1067), (1091, 1067)]] but does NOT match your detect pattern filter]
DBG3 [zm_mlapi] [intersection: comparing object:(coral) book,POLYGON ((1595 924, 1631 924, 1631 988, 1595 988, 1595 924)) to polygon:full_image,POLYGON ((0 0, 1920 0, 1920 1085, 0 1085, 0 0))]
DBG2 [zm_mlapi] [Match pattern overridden to (person|car|dog|cat|bird|bicycle|backpack|umbrella|handbag|suitcase|frisbee|sports ball|baseball bat|skateboard|bottle|cup|knife|cell phone|book|motorbike|bus|truck|boat) in ml_overrides]
DBG3 [zm_mlapi] [full_image intersects object:(coral) book[[(1595, 924), (1631, 924), (1631, 988), (1595, 988)]]]
DBG3 [zm_mlapi] [intersection: comparing object:(coral) book,POLYGON ((1662 917, 1702 917, 1702 982, 1662 982, 1662 917)) to polygon:full_image,POLYGON ((0 0, 1920 0, 1920 1085, 0 1085, 0 0))]
DBG2 [zm_mlapi] [Match pattern overridden to (person|car|dog|cat|bird|bicycle|backpack|umbrella|handbag|suitcase|frisbee|sports ball|baseball bat|skateboard|bottle|cup|knife|cell phone|book|motorbike|bus|truck|boat) in ml_overrides]
DBG3 [zm_mlapi] [full_image intersects object:(coral) book[[(1662, 917), (1702, 917), (1702, 982), (1662, 982)]]]
DBG3 [zm_mlapi] [intersection: comparing object:(coral) book,POLYGON ((1464 940, 1523 940, 1523 994, 1464 994, 1464 940)) to polygon:full_image,POLYGON ((0 0, 1920 0, 1920 1085, 0 1085, 0 0))]
DBG2 [zm_mlapi] [Match pattern overridden to (person|car|dog|cat|bird|bicycle|backpack|umbrella|handbag|suitcase|frisbee|sports ball|baseball bat|skateboard|bottle|cup|knife|cell phone|book|motorbike|bus|truck|boat) in ml_overrides]
DBG3 [zm_mlapi] [full_image intersects object:(coral) book[[(1464, 940), (1523, 940), (1523, 994), (1464, 994)]]]
DBG3 [zm_mlapi] [intersection: comparing object:(coral) book,POLYGON ((1609 786, 1641 786, 1641 857, 1609 857, 1609 786)) to polygon:full_image,POLYGON ((0 0, 1920 0, 1920 1085, 0 1085, 0 0))]
DBG2 [zm_mlapi] [Match pattern overridden to (person|car|dog|cat|bird|bicycle|backpack|umbrella|handbag|suitcase|frisbee|sports ball|baseball bat|skateboard|bottle|cup|knife|cell phone|book|motorbike|bus|truck|boat) in ml_overrides]
DBG3 [zm_mlapi] [full_image intersects object:(coral) book[[(1609, 786), (1641, 786), (1641, 857), (1609, 857)]]]
DBG3 [zm_mlapi] [intersection: comparing object:(coral) book,POLYGON ((1696 610, 1728 610, 1728 672, 1696 672, 1696 610)) to polygon:full_image,POLYGON ((0 0, 1920 0, 1920 1085, 0 1085, 0 0))]
DBG2 [zm_mlapi] [Match pattern overridden to (person|car|dog|cat|bird|bicycle|backpack|umbrella|handbag|suitcase|frisbee|sports ball|baseball bat|skateboard|bottle|cup|knife|cell phone|book|motorbike|bus|truck|boat) in ml_overrides]
DBG3 [zm_mlapi] [full_image intersects object:(coral) book[[(1696, 610), (1728, 610), (1728, 672), (1696, 672)]]]
DBG3 [zm_mlapi] [intersection: comparing object:(coral) book,POLYGON ((1659 784, 1696 784, 1696 851, 1659 851, 1659 784)) to polygon:full_image,POLYGON ((0 0, 1920 0, 1920 1085, 0 1085, 0 0))]
DBG2 [zm_mlapi] [Match pattern overridden to (person|car|dog|cat|bird|bicycle|backpack|umbrella|handbag|suitcase|frisbee|sports ball|baseball bat|skateboard|bottle|cup|knife|cell phone|book|motorbike|bus|truck|boat) in ml_overrides]
DBG3 [zm_mlapi] [full_image intersects object:(coral) book[[(1659, 784), (1696, 784), (1696, 851), (1659, 851)]]]
DBG1 [zm_mlapi] [============ Frame: alarm Running face model in sequence ==================]
DBG3 [zm_mlapi] [face has a same_model_sequence strategy of union]
DBG3 [zm_mlapi] [--------- Frame:alarm Running variation: #1 -------------]
DBG2 [zm_mlapi] [Waiting for pyzm_uid33_tpu_lock portalock...]
DBG2 [zm_mlapi] [Got pyzm_uid33_tpu_lock lock...]
DBG1 [zm_mlapi] [|---------- TPU (input image: 1920w*1085h) ----------|]
DBG1 [zm_mlapi] [Released pyzm_uid33_tpu_lock portalock]
DBG1 [zm_mlapi] [perf: processor:tpu Coral TPU detection took: 40.78 ms]
DBG4 [zm_mlapi] [Coral face is detection only. Skipping recognition phase]
DBG3 [zm_mlapi] [Coral face returning: [[629, 475, 882, 769]],['face'],[0.30859375]]
DBG4 [zm_mlapi] [This model iteration inside face found: labels: ['face'],conf:[0.30859375]]
DBG3 [zm_mlapi] [Max object size found to be: 90%]
DBG2 [zm_mlapi] [Converted 90% to 1874880.0]
DBG3 [zm_mlapi] [intersection: comparing object:face,POLYGON ((629 475, 882 475, 882 769, 629 769, 629 475)) to polygon:full_image,POLYGON ((0 0, 1920 0, 1920 1085, 0 1085, 0 0))]
DBG2 [zm_mlapi] [Match pattern overridden to .* in ml_overrides]
DBG3 [zm_mlapi] [full_image intersects object:face[[(629, 475), (882, 475), (882, 769), (629, 769)]]]
DBG3 [zm_mlapi] [--------- Frame:alarm Running variation: #2 -------------]
DBG1 [zm_mlapi] [|---------- Dlib Face recognition (input image: 1920w*1085h) ----------|]
DBG5 [zm_mlapi] [Face options={'name': 'Face Recognition (Dlib)', 'enabled': 'yes', 'pre_existing_labels': ['face'], 'save_unknown_faces': 'yes', 'save_unknown_faces_leeway_pixels': 50, 'face_detection_framework': 'dlib', 'known_images_path': '/var/lib/zmeventnotification/known_faces', 'unknown_images_path': '/var/lib/zmeventnotification/unknown_faces', 'face_model': 'cnn', 'face_train_model': 'cnn', 'face_recog_dist_threshold': 0.6, 'face_num_jitters': 0, 'face_upsample_times': 1, 'gpu_max_processes': 1, 'gpu_max_lock_wait': 120, 'cpu_max_processes': 3, 'cpu_max_lock_wait': 120, 'max_size': 800, 'disable_locks': 'no'}]
DBG2 [zm_mlapi] [Scaling image down to max size: 800]
DBG2 [zm_mlapi] [Waiting for pyzm_uid33_cpu_lock portalock...]
DBG2 [zm_mlapi] [Got pyzm_uid33_cpu_lock lock...]
DBG1 [zm_mlapi] [perf: processor:cpu Finding faces took 21310.49 ms]
DBG1 [zm_mlapi] [Released pyzm_uid33_cpu_lock portalock]
DBG1 [zm_mlapi] [perf: processor:cpu Computing face recognition distances took 261.30 ms]
DBG3 [zm_mlapi] [Comparing to known faces...]
DBG5 [zm_mlapi] [Closest knn match indexes (lesser is better): (array([[0.45387916]]), array([[17]]))]
DBG1 [zm_mlapi] [perf: processor:cpu Matching recognized faces to known faces took 2.63 ms]
DBG2 [zm_mlapi] [Scaling image back up to 1920]
DBG3 [zm_mlapi] [Face Dlib:Returning: [[653, 562, 816, 725]], ['Brian Wallace'], [1]]
DBG4 [zm_mlapi] [This model iteration inside face found: labels: ['Brian Wallace'],conf:[1]]
DBG3 [zm_mlapi] [Max object size found to be: 90%]
DBG2 [zm_mlapi] [Converted 90% to 1874880.0]
DBG3 [zm_mlapi] [intersection: comparing object:Brian,POLYGON ((653 562, 816 562, 816 725, 653 725, 653 562)) to polygon:full_image,POLYGON ((0 0, 1920 0, 1920 1085, 0 1085, 0 0))]
DBG2 [zm_mlapi] [Match pattern overridden to .* in ml_overrides]
DBG3 [zm_mlapi] [full_image intersects object:Brian[[(653, 562), (816, 562), (816, 725), (653, 725)]]]
DBG1 [zm_mlapi] [============ Frame: alarm Running alpr model in sequence ==================]
DBG2 [zm_mlapi] [Making sure we have matched one of ['car', 'motorbike', 'bus', 'truck', 'boat'] in ['(coral) person', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', 'face', 'Brian'] before we proceed]
DBG1 [zm_mlapi] [Did not find pre existing labels, not running model]
DBG1 [zm_mlapi] [perf: TOTAL detection sequence (with image loads) took: 47475.12 ms  to process 36581]
DBG1 [zm_mlapi] [Returning {'matched_data': {'boxes': [[359, 386, 1363, 1081], [1679, 648, 1712, 745], [1605, 675, 1629, 759], [1592, 919, 1628, 985], [1664, 910, 1705, 980], [1614, 788, 1645, 857], [1660, 784, 1696, 853], [1477, 942, 1523, 992], [1695, 613, 1726, 674], [1597, 614, 1620, 679], [693, 366, 999, 723], [703, 456, 938, 691]], 'error_boxes': [], 'labels': ['(coral) person', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', 'face', 'Brian Wallace'], 'confidences': [0.8046875, 0.640625, 0.6171875, 0.609375, 0.57421875, 0.57421875, 0.55859375, 0.55859375, 0.55859375, 0.5234375, 0.9609375, 1], 'frame_id': '4369', 'image_dimensions': {'original': (1520, 2688), 'resized': (1085, 1920)}, 'image': None, 'polygons': [{'name': 'full_image', 'value': [(0, 0), (1920, 0), (1920, 1085), (0, 1085)], 'pattern': None}]}, 'all_matches': [{'frame_id': '4369', 'boxes': [[359, 386, 1363, 1081], [1679, 648, 1712, 745], [1605, 675, 1629, 759], [1592, 919, 1628, 985], [1664, 910, 1705, 980], [1614, 788, 1645, 857], [1660, 784, 1696, 853], [1477, 942, 1523, 992], [1695, 613, 1726, 674], [1597, 614, 1620, 679], [693, 366, 999, 723], [703, 456, 938, 691]], 'error_boxes': [], 'labels': ['(coral) person', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', 'face', 'Brian Wallace'], 'confidences': [0.8046875, 0.640625, 0.6171875, 0.609375, 0.57421875, 0.57421875, 0.55859375, 0.55859375, 0.55859375, 0.5234375, 0.9609375, 1], 'models': ['object', 'face']}, {'frame_id': 'alarm', 'boxes': [[642, 472, 1113, 1076], [1678, 648, 1713, 748], [1604, 674, 1627, 759], [1595, 924, 1631, 988], [1662, 917, 1702, 982], [1464, 940, 1523, 994], [1609, 786, 1641, 857], [1696, 610, 1728, 672], [1659, 784, 1696, 851], [629, 475, 882, 769], [653, 562, 816, 725]], 'error_boxes': [[1091, 956, 1380, 1067]], 'labels': ['(coral) person', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', '(coral) book', 'face', 'Brian Wallace'], 'confidences': [0.70703125, 0.65234375, 0.6171875, 0.59765625, 0.57421875, 0.57421875, 0.55859375, 0.55859375, 0.546875, 0.30859375, 1], 'models': ['object', 'face']}]}]

from pyzm.

pliablepixels avatar pliablepixels commented on June 3, 2024
INF [zm_mlapi] [--------| mlapi version:2.2.13, pyzm version:0.3.43 |--------]

You are not running master of pyzm. It should be 0.3.45. Please see my comment above. Before you try anything else, please make sure you have manually updated pyzm to the master branch. Please make sure to update today, as I just made some changes.

Once done, this is an example of what I mean:

'face': {
			'general':{
				'pattern': '.*',
				'same_model_sequence_strategy': 'union' # important, so it will combine output from detection and recognition
			},
			'sequence': [
				{
				'name': 'Face Detection (TPU)',
				'enabled': 'yes',
				'face_detection_framework': 'tpu',
				'face_weights':'/var/lib/zmeventnotification/models/coral_edgetpu/ssd_mobilenet_v2_face_quant_postprocess_edgetpu.tflite',
				'face_min_confidence': 0.3
          
        		},
				{
				'name': 'Dlib Face Retection',
				'enabled': 'yes',
				'pre_existing_labels': ['face'],
				'save_unknown_faces':'no',
				'save_unknown_faces_leeway_pixels':50,
				'face_detection_framework': 'dlib',
				'known_images_path': '/var/lib/zmeventnotification/known_faces',
				'unknown_images_path': '/var/lib/zmeventnotification/unknown_faces',
				'face_model': 'cnn',
				'face_train_model': 'cnn',
				'face_recog_dist_threshold': 0.6,
				'face_num_jitters': 0,
				'face_upsample_times':1,
				'gpu_max_processes': 1,
				'gpu_max_lock_wait': 120,
				'cpu_max_processes': 2,
				'cpu_max_lock_wait': 120,
				'max_size':800
			}
			]
		},
  • We are first running TPU face detection. If it works, it will find 'face'
  • We then run DLib face recognition. If will only run if we have 'face' in some previous sequence of face models.
  • Very important: same_model_sequence_strategy is union. It will combine values. If we did not write that, one of the matches would be picked up.

from pyzm.

pliablepixels avatar pliablepixels commented on June 3, 2024

closing as original issue resolved. Please create a new issue if required for other items, or reopen if you see issues with this topic.

from pyzm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.