Skip to content

Instantly share code, notes, and snippets.

@baudneo
Created September 5, 2021 23:22
Show Gist options
  • Save baudneo/406efa03ced5c06e7df88b1090c01369 to your computer and use it in GitHub Desktop.
Save baudneo/406efa03ced5c06e7df88b1090c01369 to your computer and use it in GitHub Desktop.
log output with new high confidence append and smart frame_set with out of bound logic
09/05/21 16:05:21.172364 zm_mlapi[1839] DBG1 Media:471 [media:read:image: self.frames_processed=7 --- self.fids_processed=['s-116', '70', '140', '206', 'a-92', '228'] --- self.frame_set[self.frame_set_index]='
350' --- self.get_last_frame()='228' --- self.max_frames=9]
09/05/21 16:05:21.175061 zm_mlapi[1839] DBG2 Media:488 [api:make_req: 'get'-><hidden>/api/events/29027.json?noframes=true query={'token': 'eyJ0eXAiOiJKV1QiLCJhbGciO...'}]
09/05/21 16:05:21.250609 zm_mlapi[1839] DBG1 Media:501 [media:read:image: fid=350 current frame buffer length '229' last API call frame buffer length was '229']
09/05/21 16:05:21.25084 zm_mlapi[1839] ERR Media:562 [media:read:image: skip_all=False --- self.skip_all_count=3]
09/05/21 16:05:21.255593 zm_mlapi[1839] DBG1 Media:582 [media:read:image: monitor 1 running at 9 FPS - threshold of 8 converts to 72 frames. frames over by -> 121 / fps -> 13.444444444444445 seconds]
09/05/21 16:05:21.257971 zm_mlapi[1839] DBG1 Media:613 [media:read:oob: the current requested frame ID '350' is out of bounds of the current frame buffer length '229' by -> 121 frames, decreasing frame ID to l
ast available frame plus a 2 frame buffer to allow for disk write -> 227]
09/05/21 16:05:21.260449 zm_mlapi[1839] DBG1 Media:689 [self.api.get_auth()='token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjMwODY4MTc4LCJleHAiOjE2MzA4ODk3NzgsInVzZXIiOiJtbGFwa
SIsInR5cGUiOiJhY2Nlc3MifQ.zzWBCjhFcK9DWqGkUrPb3Sbtizu3yBM1nHUTjP42Kfo']
09/05/21 16:05:21.26288 zm_mlapi[1839] DBG2 Media:690 [api:make_req: 'get'-><hidden>/index.php?view=image&eid=29027&fid=227 query={'token': 'eyJ0eXAiOiJKV1QiLCJhbGciO...'}]
09/05/21 16:05:21.72588 zm_mlapi[1839] DBG1 Media:754 [media:read: API returned frame with dimensions -> (1080, 1920), using 'resize' of 800=(450, 800)]
09/05/21 16:05:21.728569 zm_mlapi[1839] DBG2 detect_sequence:1328 [frame: 227 [strategy:most_models] (8 of 9) - model: 'object' [strat:most_models] (1 of 1) - sequence: 'coral:MobileDET' [strat:most_unique] (1
of 2)]
09/05/21 16:05:21.73111 zm_mlapi[1839] DBG2 coral_edgetpu:200 [pycoral: 320*320 image resize requested]
09/05/21 16:05:21.738245 zm_mlapi[1839] DBG2 coral_edgetpu:50 [portalock: got 'pyzm_uid1000_TPU_lock']
09/05/21 16:05:21.740761 zm_mlapi[1839] DBG1 coral_edgetpu:216 [pycoral: 'coral:MobileDET' input image: 320w*320h]
09/05/21 16:05:21.75878 zm_mlapi[1839] DBG2 coral_edgetpu:66 [portalock: released 'pyzm_uid1000_TPU_lock']
09/05/21 16:05:21.761378 zm_mlapi[1839] DBG1 coral_edgetpu:234 [perf:pycoral: 'coral:MobileDET' detection took: 15.14 ms]
09/05/21 16:05:21.76386 zm_mlapi[1839] DBG2 coral_edgetpu:253 [pycoral: the image was resized before processing, scaling bounding boxes in image back up by factors of -> x=2.5 y=1.406]
09/05/21 16:05:21.766359 zm_mlapi[1839] DBG1 coral_edgetpu:273 [pycoral returning ['car', 'car'] -- [[115, 44, 222, 82], [322, 56, 428, 97]] -- [0.67578125, 0.640625]]
09/05/21 16:05:21.768604 zm_mlapi[1839] DBG2 detect_sequence:1478 [ml: model: 'object' seq: 'coral:MobileDET' found 2 detections -> car, car]
09/05/21 16:05:21.770982 zm_mlapi[1839] DBG1 detect_sequence:494 [>>> detected 'car (1/2)' confidence: 0.68]
09/05/21 16:05:21.773459 zm_mlapi[1839] DBG1 detect_sequence:542 ['car (1/2)' minimum confidence found: (object_min_conf:sequence->coral:MobileDET) -> '0.6']
09/05/21 16:05:21.775798 zm_mlapi[1839] DBG4 detect_sequence:560 ['car (1/2)' max area of detected object found (max_detection_size:sequence->coral:MobileDET) -> '90%']
09/05/21 16:05:21.778186 zm_mlapi[1839] DBG2 detect_sequence:573 [max size: converted 90% of 800w*450h->360000 to 324000.0 pixels]
09/05/21 16:05:21.780629 zm_mlapi[1839] DBG2 detect_sequence:597 [checking if 'car (1/2)' @ [(115, 44), (222, 44), (222, 82), (115, 82)] is inside polygon/zone 'front_yard' located at [(0, 177), (452, 108), (4
47, 83), (796, 186), (796, 446), (0, 449)]]
09/05/21 16:05:21.783141 zm_mlapi[1839] DBG2 detect_sequence:775 [intersection: 'car (1/2)' does not intersect zone: front_yard, removing...]
09/05/21 16:05:21.785933 zm_mlapi[1839] DBG2 detect_sequence:488 [detection: 'car (1/2)' has FAILED filtering]
09/05/21 16:05:21.788561 zm_mlapi[1839] DBG1 detect_sequence:494 [>>> detected 'car (2/2)' confidence: 0.64]
09/05/21 16:05:21.791359 zm_mlapi[1839] DBG1 detect_sequence:542 ['car (2/2)' minimum confidence found: (object_min_conf:sequence->coral:MobileDET) -> '0.6']
09/05/21 16:05:21.79397 zm_mlapi[1839] DBG4 detect_sequence:560 ['car (2/2)' max area of detected object found (max_detection_size:sequence->coral:MobileDET) -> '90%']
09/05/21 16:05:21.79651 zm_mlapi[1839] DBG2 detect_sequence:573 [max size: converted 90% of 800w*450h->360000 to 324000.0 pixels]
09/05/21 16:05:21.799258 zm_mlapi[1839] DBG2 detect_sequence:597 [checking if 'car (2/2)' @ [(322, 56), (428, 56), (428, 97), (322, 97)] is inside polygon/zone 'front_yard' located at [(0, 177), (452, 108), (4
47, 83), (796, 186), (796, 446), (0, 449)]]
09/05/21 16:05:21.802153 zm_mlapi[1839] DBG2 detect_sequence:775 [intersection: 'car (2/2)' does not intersect zone: front_yard, removing...]
09/05/21 16:05:21.805335 zm_mlapi[1839] DBG2 detect_sequence:1063 [detection: 'car (2/2)' has FAILED filtering]
09/05/21 16:05:21.808033 zm_mlapi[1839] DBG2 detect_sequence:1328 [frame: 227 [strategy:most_models] (8 of 9) - model: 'object' [strat:most_models] (1 of 1) - sequence: 'DarkNet:v4' [strat:most_unique] (2 of 2
)]
09/05/21 16:05:21.811313 zm_mlapi[1839] DBG2 yolo:48 [portalock: acquired -> 'pyzm_uid1000_GPU_lock']
09/05/21 16:05:21.814029 zm_mlapi[1839] DBG1 yolo:152 [yolo: 'DarkNet:v4' (GPU) [input image w*h 800*450 - resized to model w*h: 416*416]]
09/05/21 16:05:21.980957 zm_mlapi[1839] DBG2 yolo:64 [portalock: released -> 'pyzm_uid1000_GPU_lock']
09/05/21 16:05:22.430783 zm_mlapi[1839] DBG2 yolo:210 [perf:yolo:GPU: 'DarkNet:v4' detection took: 613.95 ms]
09/05/21 16:05:22.433528 zm_mlapi[1839] DBG1 yolo:213 [yolo:DBG!: data for monitoring (GPU reset add-on) -> ['outs=3', 'out=8112', 'out=2028', 'out=507']]
09/05/21 16:05:22.43614 zm_mlapi[1839] DBG1 yolo:251 [yolo returning ['car', 'person', 'car', 'car', 'car'] -- [[121, 47, 219, 85], [238, 74, 278, 172], [320, 58, 422, 94], [373, 37, 431, 65], [643, 143, 699,
179]] -- [0.99609375, 0.986328125, 0.978515625, 0.55615234375, 0.50439453125]]
09/05/21 16:05:22.441122 zm_mlapi[1839] DBG2 detect_sequence:1478 [ml: model: 'object' seq: 'DarkNet:v4' found 5 detections -> car, person, car, car, car]
09/05/21 16:05:22.443586 zm_mlapi[1839] DBG1 detect_sequence:494 [>>> detected 'car (1/5)' confidence: 1.00]
09/05/21 16:05:22.446132 zm_mlapi[1839] DBG1 detect_sequence:542 ['car (1/5)' minimum confidence found: (object_min_conf:sequence->DarkNet:v4) -> '0.56']
09/05/21 16:05:22.448629 zm_mlapi[1839] DBG2 detect_sequence:597 [checking if 'car (1/5)' @ [(121, 47), (219, 47), (219, 85), (121, 85)] is inside polygon/zone 'front_yard' located at [(0, 177), (452, 108), (4
47, 83), (796, 186), (796, 446), (0, 449)]]
09/05/21 16:05:22.45115 zm_mlapi[1839] DBG2 detect_sequence:775 [intersection: 'car (1/5)' does not intersect zone: front_yard, removing...]
09/05/21 16:05:22.453605 zm_mlapi[1839] DBG2 detect_sequence:488 [detection: 'car (1/5)' has FAILED filtering]
09/05/21 16:05:22.456046 zm_mlapi[1839] DBG1 detect_sequence:494 [>>> detected 'person (2/5)' confidence: 0.99]
09/05/21 16:05:22.45855 zm_mlapi[1839] DBG1 detect_sequence:542 ['person (2/5)' minimum confidence found: (object_min_conf:sequence->DarkNet:v4) -> '0.56']
09/05/21 16:05:22.461108 zm_mlapi[1839] DBG2 detect_sequence:597 [checking if 'person (2/5)' @ [(238, 74), (278, 74), (278, 172), (238, 172)] is inside polygon/zone 'front_yard' located at [(0, 177), (452, 108
), (447, 83), (796, 186), (796, 446), (0, 449)]]
09/05/21 16:05:22.463569 zm_mlapi[1839] DBG1 detect_sequence:604 ['person (2/5)' INTERSECTS polygon/zone 'front_yard']
09/05/21 16:05:22.466332 zm_mlapi[1839] DBG2 detect_sequence:610 ['person (2/5)' has 1375.40 pixels (35.09%) inside 'front_yard']
09/05/21 16:05:22.468794 zm_mlapi[1839] DBG4 detect_sequence:615 [minimum area of detected object inside of polygon/zone: found (contained_area:object->general) -> '10px']
09/05/21 16:05:22.471251 zm_mlapi[1839] DBG3 detect_sequence:643 [detection label match pattern: zone 'front_yard' has overrides->'(person|dog|cat)']
09/05/21 16:05:22.473736 zm_mlapi[1839] DBG2 detect_sequence:1060 [detection: 'person (2/5)' has PASSED filtering]
09/05/21 16:05:22.476171 zm_mlapi[1839] DBG1 detect_sequence:494 [>>> detected 'car (3/5)' confidence: 0.98]
09/05/21 16:05:22.478675 zm_mlapi[1839] DBG1 detect_sequence:542 ['car (3/5)' minimum confidence found: (object_min_conf:sequence->DarkNet:v4) -> '0.56']
09/05/21 16:05:22.48124 zm_mlapi[1839] DBG2 detect_sequence:597 [checking if 'car (3/5)' @ [(320, 58), (422, 58), (422, 94), (320, 94)] is inside polygon/zone 'front_yard' located at [(0, 177), (452, 108), (44
7, 83), (796, 186), (796, 446), (0, 449)]]
09/05/21 16:05:22.483736 zm_mlapi[1839] DBG2 detect_sequence:775 [intersection: 'car (3/5)' does not intersect zone: front_yard, removing...]
09/05/21 16:05:22.486211 zm_mlapi[1839] DBG2 detect_sequence:488 [detection: 'car (3/5)' has FAILED filtering]
09/05/21 16:05:22.488644 zm_mlapi[1839] DBG1 detect_sequence:494 [>>> detected 'car (4/5)' confidence: 0.56]
09/05/21 16:05:22.491154 zm_mlapi[1839] DBG1 detect_sequence:542 ['car (4/5)' minimum confidence found: (object_min_conf:sequence->DarkNet:v4) -> '0.56']
09/05/21 16:05:22.493637 zm_mlapi[1839] DBG2 detect_sequence:546 [confidence: 55.62 is lower than minimum of 56.00, removing...]
09/05/21 16:05:22.496041 zm_mlapi[1839] DBG2 detect_sequence:488 [detection: 'car (4/5)' has FAILED filtering]
09/05/21 16:05:22.498456 zm_mlapi[1839] DBG1 detect_sequence:494 [>>> detected 'car (5/5)' confidence: 0.50]
09/05/21 16:05:22.500922 zm_mlapi[1839] DBG1 detect_sequence:542 ['car (5/5)' minimum confidence found: (object_min_conf:sequence->DarkNet:v4) -> '0.56']
09/05/21 16:05:22.503319 zm_mlapi[1839] DBG2 detect_sequence:546 [confidence: 50.44 is lower than minimum of 56.00, removing...]
09/05/21 16:05:22.505734 zm_mlapi[1839] DBG2 detect_sequence:1063 [detection: 'car (5/5)' has FAILED filtering]
09/05/21 16:05:22.508042 zm_mlapi[1839] DBG2 detect_sequence:1509 [ml:strategy: '1' filtered label: ['person'] [0.986328125] ['yolo[GPU]'] [[238, 74, 278, 172]]]
09/05/21 16:05:22.51039 zm_mlapi[1839] DBG1 detect_sequence:1545 [HIGH_CONF=YES: current best detection ['person']->[0.986328125]-->['yolo[GPU]'] --- current comparison ['person']->[0.986328125]-->['yolo[GPU]'
]]
09/05/21 16:05:22.512805 zm_mlapi[1839] DBG1 detect_sequence:1577 [high confidence match: skipping this comparison as the two detections that are about to be compared are the exact same]
09/05/21 16:05:22.515138 zm_mlapi[1839] DBG2 detect_sequence:1780 [perf:frame: 227 took 786.55 ms]
09/05/21 16:05:22.518047 zm_mlapi[1839] DBG1 Media:471 [media:read:image: self.frames_processed=8 --- self.fids_processed=['s-116', '70', '140', '206', 'a-92', '228', '227'] --- self.frame_set[self.frame_set_i
ndex]='430' --- self.get_last_frame()='227' --- self.max_frames=9]
09/05/21 16:05:22.520792 zm_mlapi[1839] DBG2 Media:488 [api:make_req: 'get'-><hidden>/api/events/29027.json?noframes=true query={'token': 'eyJ0eXAiOiJKV1QiLCJhbGciO...'}]
09/05/21 16:05:22.614798 zm_mlapi[1839] DBG1 Media:501 [media:read:image: fid=430 current frame buffer length '229' last API call frame buffer length was '229']
09/05/21 16:05:22.615045 zm_mlapi[1839] ERR Media:562 [media:read:image: skip_all=False --- self.skip_all_count=4]
09/05/21 16:05:22.619925 zm_mlapi[1839] DBG1 Media:582 [media:read:image: monitor 1 running at 9 FPS - threshold of 8 converts to 72 frames. frames over by -> 201 / fps -> 22.333333333333332 seconds]
09/05/21 16:05:22.622364 zm_mlapi[1839] DBG1 Media:613 [media:read:oob: the current requested frame ID '430' is out of bounds of the current frame buffer length '229' by -> 201 frames, decreasing frame ID to l
ast available frame plus a 2 frame buffer to allow for disk write -> 227]
09/05/21 16:05:22.624816 zm_mlapi[1839] DBG1 Media:654 [media:read:image: skipping current frame ID -> '227' as it has already been processed on this run. Frame ID's processed --> ['s-116', '70', '140', '206'
, 'a-92', '228', '227']]
09/05/21 16:05:22.627378 zm_mlapi[1839] DBG1 Media:434 [media:read:image: there are no more frames to read -> frame_set_index=OOB]
09/05/21 16:05:22.629683 zm_mlapi[1839] DBG1 detect_sequence:1165 [ml: ran out of frames to read, breaking out of frame loop]
09/05/21 16:05:22.632058 zm_mlapi[1839] DBG1 detect_sequence:1867 [perf:1->29027: complete detection sequence (with image loads) took: 20089.89 ms]
09/05/21 16:05:22.638151 zm_mlapi[1839] DBG2 mlapi:410 [mlapi:detect: restoring global config/polygons from per monitor overrides...]
09/05/21 16:05:22.640485 zm_mlapi[1839] DBG1 mlapi:439 [mlapi:detect: returning {'matched_data': {'boxes': [[633, 218, 765, 402]], 'error_boxes': [[118, 42, 222, 83], [320, 53, 430, 97], [120, 47, 218, 85], [3
20, 59, 422, 95]], 'labels': ['person'], 'confidences': [0.994140625], 'frame_id': 's-116', 'model_names': ['yolo[GPU]'], 'image_dimensions': {'original': (1080, 1920), 'resized': (450, 800)}, 'type': ['object
'], 'image': None, 'polygons': [{'name': 'front_yard', 'value': [(0, 177), (452, 108), (447, 83), (796, 186), (796, 446), (0, 449)], 'pattern': '(person|dog|cat)'}]}, 'all_matches': [{'frame_id': 's-116', 'box
es': [[633, 218, 765, 402]], 'error_boxes': [[118, 42, 222, 83], [320, 53, 430, 97], [120, 47, 218, 85], [320, 59, 422, 95]], 'labels': ['person'], 'confidences': [0.994140625], 'detection_types': ['object'],
'model_names': ['yolo[GPU]']}, {'frame_id': '70', 'boxes': [[326, 98, 366, 232]], 'error_boxes': [[120, 47, 218, 85], [319, 58, 421, 96], [374, 37, 430, 65]], 'labels': ['person'], 'confidences': [0.9921875],
'detection_types': ['object'], 'model_names': ['yolo[GPU]']}, {'frame_id': '140', 'boxes': [[676, 237, 798, 407]], 'error_boxes': [[120, 47, 218, 85], [319, 58, 421, 94], [642, 142, 700, 180]], 'labels': ['per
son'], 'confidences': [0.98095703125], 'detection_types': ['object'], 'model_names': ['yolo[GPU]']}, {'frame_id': '210', 'boxes': [[304, 92, 354, 214]], 'error_boxes': [[120, 47, 218, 85], [320, 59, 420, 95]],
'labels': ['person'], 'confidences': [0.9951171875], 'detection_types': ['object'], 'model_names': ['yolo[GPU]']}, {'frame_id': 'a-92', 'boxes': [[450, 146, 520, 322]], 'error_boxes': [[118, 42, 222, 83], [31
8, 55, 428, 97], [121, 47, 217, 85], [319, 60, 421, 94], [642, 144, 698, 178], [374, 37, 430, 65]], 'labels': ['person'], 'confidences': [0.9931640625], 'detection_types': ['object'], 'model_names': ['yolo[GPU
]']}, {'frame_id': '280', 'boxes': [[239, 74, 275, 174]], 'error_boxes': [[121, 47, 219, 85], [320, 58, 422, 94]], 'labels': ['person'], 'confidences': [0.984375], 'detection_types': ['object'], 'model_names':
['yolo[GPU]']}, {'frame_id': '227', 'boxes': [[238, 74, 278, 172]], 'error_boxes': [[121, 47, 219, 85], [320, 58, 422, 94]], 'labels': ['person'], 'confidences': [0.986328125], 'detection_types': ['object'],
'model_names': ['yolo[GPU]']}], 'success': True, 'all_filtered': False, 'num_filtered': 4}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment