ZoneMinder / zmeventnotification

Machine Learning powered Secure Websocket & MQTT based ZoneMinder event notification server
408 stars 128 forks source link

problem adding "own" pre-trained model to ML sequence. #387

Closed ozgurozc closed 3 years ago

ozgurozc commented 3 years ago

Event Server version: 6.1.16

**Hooks version :app:6.1.16, pyzm:0.3.38

Are you using MLAPI? (Y/N) Yes

If you are using MLAPI, please mention the version Zoneminder Version v1.34.23

Details: I am trying to add a mask pre-trained model to my ML sequence. Just cp the weight and cfg file with coco.names to the current yolo4 folder and run it without an issue , below is the log. bad is person without mask, good is person with proper mask.

With replacing current yolo4 weights and cfg root@zoneminder:/var/cache/zoneminder/events/15/2021-03-29/1155# sudo -u www-data /var/lib/zmeventnotification/bin/zm_detect.py --config /etc/zm/objectconfig.ini --debug --eventid 1371 --monitorid 18 --eventpath=/tmp INF [zmesdetect_m18] [Setting up signal handler for logs] INF [zmesdetect_m18] [---------| app:6.1.16, pyzm:0.3.38, ES:6.1.16 , OpenCV:4.5.1-dev|------------] DBG1 [zmesdetect_m18] [secret filename: /etc/zm/secrets.ini] DBG2 [zmesdetect_m18] [Secret token found in config: !ZM_PORTAL] DBG2 [zmesdetect_m18] [Secret token found in config: !ZM_USER] DBG2 [zmesdetect_m18] [Secret token found in config: !ZM_PASSWORD] DBG2 [zmesdetect_m18] [Secret token found in config: !ZM_API_PORTAL] DBG2 [zmesdetect_m18] [Secret token found in config: !ML_USER] DBG2 [zmesdetect_m18] [Secret token found in config: !ML_PASSWORD] DBG1 [zmesdetect_m18] [allowing self-signed certs to work...] DBG4 [zmesdetect_m18] [Now checking for monitor overrides] DBG2 [zmesdetect_m18] [import_zm_zones: match_reason=False and reason=None] DBG2 [zmesdetect_m18] [Getting ZM zones using https://127.0.0.1/zm/api/zones/forMonitor/18.json?username=xxx&password=yyy&user=xxx&pass=yyy] DBG2 [zmesdetect_m18] [importing zoneminder polygon: trdb-mezitli [422,288 435,138 544,138 518,308 445,296]] DBG2 [zmesdetect_m18] [importing zoneminder polygon: wc [81,194 153,199 173,376 92,378]] DBG4 [zmesdetect_m18] [Finally, doing parameter substitution] INF [zmesdetect_m18] [Importing local classes for Object/Face] INF [zmesdetect_m18] [Connecting with ZM APIs] DBG2 [zmesdetect_m18] [API SSL certificate check has been disbled] DBG1 [zmesdetect_m18] [using username/password for login] DBG2 [zmesdetect_m18] [Using new token API] DBG1 [zmesdetect_m18] [Access token expires on:2021-04-11 02:04:16.153876 [7200s]] DBG1 [zmesdetect_m18] [Refresh token expires on:2021-04-12 00:04:16.154798 [86400s]] DBG3 [zmesdetect_m18] [No need to relogin as access token still has 119.99996975 minutes remaining] DBG4 [zmesdetect_m18] [make_request called with url=https://127.0.0.1/zm/api/host/gettimezone.json payload={} type=get query={'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjE4MDg4NjU2LCJleHAiOjE2MTgwOTU4NTYsInVzZXIiOiJhZG1pbiIsInR5cGUiOiJhY2Nlc3MifQ.EYm-GPDsxOaVhLIwCv4E3I4ZMl2g9hb9ye14p0KP9ag'}] DBG2 [zmesdetect_m18] [using ml_sequence] DBG2 [zmesdetect_m18] [using stream_sequence] DBG1 [zmesdetect_m18] [Resetting models, will be loaded on next run] DBG3 [zmesdetect_m18] [Using automatic locking as we are switching between models] DBG2 [zmesdetect_m18] [Media get SSL certificate check has been disbled] DBG2 [zmesdetect_m18] [Using URL 1371 for stream] DBG2 [zmesdetect_m18] [We will only process frames: ['snapshot', 'alarm']] DBG2 [zmesdetect_m18] [No need to start streams, we are picking images from https://127.0.0.1/zm/index.php?view=image&eid=1371] DBG3 [zmesdetect_m18] [Reading https://127.0.0.1/zm/index.php?view=image&eid=1371&fid=snapshot] DBG3 [zmesdetect_m18] [No need to relogin as access token still has 119.99961738333333 minutes remaining] DBG4 [zmesdetect_m18] [make_request called with url=https://127.0.0.1/zm/index.php?view=image&eid=1371&fid=snapshot payload={} type=get query={'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjE4MDg4NjU2LCJleHAiOjE2MTgwOTU4NTYsInVzZXIiOiJhZG1pbiIsInR5cGUiOiJhY2Nlc3MifQ.EYm-GPDsxOaVhLIwCv4E3I4ZMl2g9hb9ye14p0KP9ag'}] DBG1 [zmesdetect_m18] [perf: Starting for frame:snapshot] DBG1 [zmesdetect_m18] [============ Frame: snapshot Running object model in sequence ==================] DBG3 [zmesdetect_m18] [load_models (just init, actual load happens at first detect): ['object']] DBG2 [zmesdetect_m18] [Initializing model type:object with options:{'object_config': '/var/lib/zmeventnotification/models/yolov4/yolov4.cfg', 'object_weights': '/var/lib/zmeventnotification/models/yolov4/yolov4.weights', 'object_labels': '/var/lib/zmeventnotification/models/yolov4/coco.names', 'object_min_confidence': 0.3, 'object_framework': 'opencv', 'object_processor': 'cpu', 'gpu_max_processes': 1, 'gpu_max_lock_wait': 100, 'cpu_max_processes': 16, 'cpu_max_lock_wait': 100, 'max_detection_size': '80%', 'disable_locks': 'no'}] DBG2 [zmesdetect_m18] [portalock: max:16, name:pyzm_uid33_cpu_lock, timeout:100] DBG3 [zmesdetect_m18] [object has a same_model_sequence strategy of first] DBG3 [zmesdetect_m18] [--------- Frame:snapshot Running variation: #1 -------------] DBG2 [zmesdetect_m18] [Waiting for pyzm_uid33_cpu_lock portalock...] filenames [PosixPath('/tmp/pyzm_uid33_cpu_lock.00.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.01.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.02.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.03.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.04.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.05.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.06.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.07.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.08.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.09.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.10.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.11.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.12.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.13.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.14.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.15.lock')] trying lock [PosixPath('/tmp/pyzm_uid33_cpu_lock.00.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.01.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.02.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.03.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.04.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.05.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.06.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.07.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.08.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.09.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.10.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.11.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.12.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.13.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.14.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.15.lock')] trying lock for /tmp/pyzm_uid33_cpu_lock.00.lock locked /tmp/pyzm_uid33_cpu_lock.00.lock DBG2 [zmesdetect_m18] [Got pyzm_uid33_cpu_lock portalock] DBG1 [zmesdetect_m18] [|--------- Loading Yolo model from disk ---------|] DBG1 [zmesdetect_m18] [perf: processor:cpu Yolo initialization (loading /var/lib/zmeventnotification/models/yolov4/yolov4.weights model from disk) took: 134.64 ms] DBG1 [zmesdetect_m18] [Using CPU for detection] DBG1 [zmesdetect_m18] [|---------- YOLO (input image: 640w*480h, model resize dimensions: 416w*416h) ----------|] DBG2 [zmesdetect_m18] [Released pyzm_uid33_cpu_lock portalock] DBG1 [zmesdetect_m18] [perf: processor:cpu Yolo detection took: 1314.70 ms] DBG2 [zmesdetect_m18] [perf: processor:cpu Yolo NMS filtering took: 1.27 ms] DBG3 [zmesdetect_m18] [core model detection over, got 2 objects. Now filtering] DBG3 [zmesdetect_m18] [Max object size found to be: 80%] DBG2 [zmesdetect_m18] [Converted 80% to 245760.0] DBG2 [zmesdetect_m18] [Returning filtered list of 2 objects.] DBG4 [zmesdetect_m18] [This model iteration inside object found: labels: ['bad', 'good'],conf:[0.9128651022911072, 0.8282113671302795]] DBG3 [zmesdetect_m18] [intersection: comparing object:bad,POLYGON ((476 230, 486 230, 486 244, 476 244, 476 230)) to polygon:trdb-mezitli,POLYGON ((422 288, 435 138, 544 138, 518 308, 445 296, 422 288))] DBG2 [zmesdetect_m18] [Using global match pattern: .*] DBG3 [zmesdetect_m18] [trdb-mezitli intersects object:bad[[(476, 230), (486, 230), (486, 244), (476, 244)]]] DBG3 [zmesdetect_m18] [intersection: comparing object:good,POLYGON ((250 222, 370 222, 370 352, 250 352, 250 222)) to polygon:trdb-mezitli,POLYGON ((422 288, 435 138, 544 138, 518 308, 445 296, 422 288))] DBG3 [zmesdetect_m18] [intersection: comparing object:good,POLYGON ((250 222, 370 222, 370 352, 250 352, 250 222)) to polygon:wc,POLYGON ((81 194, 153 199, 173 376, 92 378, 81 194))] DBG3 [zmesdetect_m18] [breaking out of same model loop, as matches found and strategy is "first"] DBG1 [zmesdetect_m18] [============ Frame: snapshot Running alpr model in sequence ==================] DBG2 [zmesdetect_m18] [Making sure we have matched one of ['car', 'motorbike', 'bus', 'truck', 'boat'] in ['bad'] before we proceed] DBG1 [zmesdetect_m18] [Did not find pre existing labels, not running model] DBG3 [zmesdetect_m18] [Reading https://127.0.0.1/zm/index.php?view=image&eid=1371&fid=alarm] DBG3 [zmesdetect_m18] [No need to relogin as access token still has 119.97086506666666 minutes remaining] DBG4 [zmesdetect_m18] [make_request called with url=https://127.0.0.1/zm/index.php?view=image&eid=1371&fid=alarm payload={} type=get query={'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjE4MDg4NjU2LCJleHAiOjE2MTgwOTU4NTYsInVzZXIiOiJhZG1pbiIsInR5cGUiOiJhY2Nlc3MifQ.EYm-GPDsxOaVhLIwCv4E3I4ZMl2g9hb9ye14p0KP9ag'}] DBG1 [zmesdetect_m18] [perf: Starting for frame:alarm] DBG1 [zmesdetect_m18] [============ Frame: alarm Running object model in sequence ==================] DBG3 [zmesdetect_m18] [object has a same_model_sequence strategy of first] DBG3 [zmesdetect_m18] [--------- Frame:alarm Running variation: #1 -------------] DBG2 [zmesdetect_m18] [Waiting for pyzm_uid33_cpu_lock portalock...] filenames [PosixPath('/tmp/pyzm_uid33_cpu_lock.00.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.01.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.02.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.03.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.04.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.05.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.06.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.07.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.08.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.09.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.10.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.11.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.12.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.13.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.14.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.15.lock')] trying lock [PosixPath('/tmp/pyzm_uid33_cpu_lock.00.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.01.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.02.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.03.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.04.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.05.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.06.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.07.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.08.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.09.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.10.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.11.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.12.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.13.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.14.lock'), PosixPath('/tmp/pyzm_uid33_cpu_lock.15.lock')] trying lock for /tmp/pyzm_uid33_cpu_lock.00.lock locked /tmp/pyzm_uid33_cpu_lock.00.lock DBG2 [zmesdetect_m18] [Got pyzm_uid33_cpu_lock portalock] DBG1 [zmesdetect_m18] [|---------- YOLO (input image: 640w*480h, model resize dimensions: 416w*416h) ----------|] DBG2 [zmesdetect_m18] [Released pyzm_uid33_cpu_lock portalock] DBG1 [zmesdetect_m18] [perf: processor:cpu Yolo detection took: 1032.62 ms] DBG2 [zmesdetect_m18] [perf: processor:cpu Yolo NMS filtering took: 1.15 ms] DBG3 [zmesdetect_m18] [core model detection over, got 2 objects. Now filtering] DBG3 [zmesdetect_m18] [Max object size found to be: 80%] DBG2 [zmesdetect_m18] [Converted 80% to 245760.0] DBG2 [zmesdetect_m18] [Returning filtered list of 2 objects.] DBG4 [zmesdetect_m18] [This model iteration inside object found: labels: ['good', 'good'],conf:[0.8169835805892944, 0.6945945024490356]] DBG3 [zmesdetect_m18] [intersection: comparing object:good,POLYGON ((250 218, 370 218, 370 358, 250 358, 250 218)) to polygon:trdb-mezitli,POLYGON ((422 288, 435 138, 544 138, 518 308, 445 296, 422 288))] DBG3 [zmesdetect_m18] [intersection: comparing object:good,POLYGON ((250 218, 370 218, 370 358, 250 358, 250 218)) to polygon:wc,POLYGON ((81 194, 153 199, 173 376, 92 378, 81 194))] INF [zmesdetect_m18] [object:good at POLYGON ((250 218, 370 218, 370 358, 250 358, 250 218)) does not fall into any polygons, removing...] DBG3 [zmesdetect_m18] [intersection: comparing object:good,POLYGON ((522 217, 528 217, 528 235, 522 235, 522 217)) to polygon:trdb-mezitli,POLYGON ((422 288, 435 138, 544 138, 518 308, 445 296, 422 288))] DBG2 [zmesdetect_m18] [Using global match pattern: .*] DBG3 [zmesdetect_m18] [trdb-mezitli intersects object:good[[(522, 217), (528, 217), (528, 235), (522, 235)]]] DBG3 [zmesdetect_m18] [breaking out of same model loop, as matches found and strategy is "first"] DBG1 [zmesdetect_m18] [============ Frame: alarm Running alpr model in sequence ==================] DBG2 [zmesdetect_m18] [Making sure we have matched one of ['car', 'motorbike', 'bus', 'truck', 'boat'] in ['good'] before we proceed] DBG1 [zmesdetect_m18] [Did not find pre existing labels, not running model] DBG1 [zmesdetect_m18] [perf: TOTAL detection sequence (with image loads) took: 3011.30 ms to process 1371] INF [zmesdetect_m18] [Prediction string:[s] detected:bad:91% ] DBG1 [zmesdetect_m18] [Prediction string JSON:{"labels": ["bad"], "boxes": [[476, 230, 486, 244]], "frame_id": "snapshot", "confidences": [0.9128651022911072], "image_dimensions": {"original": [480, 640], "resized": [480, 640]}}] [s] detected:bad:91% --SPLIT--{"labels": ["bad"], "boxes": [[476, 230, 486, 244]], "frame_id": "snapshot", "confidences": [0.9128651022911072], "image_dimensions": {"original": [480, 640], "resized": [480, 640]}} DBG1 [zmesdetect_m18] [Writing detected image to /tmp/objdetect.jpg] DBG1 [zmesdetect_m18] [Writing JSON output to /tmp/objects.json] DBG1 [zmesdetect_m18] [Closing logs]

**When adding a new model to the objectconfig.ini and new folder with mask weight as below , I am having problem detecting the mask with error below.

`root@zoneminder:/usr/local/lib/python3.6/dist-packages/pyzm/ml# sudo -u www-data /var/lib/zmeventnotification/bin/zm_detect.py --config /etc/zm/objectconfig.ini --debug --eventid 1155 --monitorid 15 INF [zmesdetect_m15] [Setting up signal handler for logs] INF [zmesdetect_m15] [---------| app:6.1.16, pyzm:0.3.38, ES:6.1.16 , OpenCV:4.5.1-dev|------------] DBG1 [zmesdetect_m15] [secret filename: /etc/zm/secrets.ini] DBG2 [zmesdetect_m15] [Secret token found in config: !ZM_PORTAL] DBG2 [zmesdetect_m15] [Secret token found in config: !ZM_USER] DBG2 [zmesdetect_m15] [Secret token found in config: !ZM_PASSWORD] DBG2 [zmesdetect_m15] [Secret token found in config: !ZM_API_PORTAL] DBG2 [zmesdetect_m15] [Secret token found in config: !ML_USER] DBG2 [zmesdetect_m15] [Secret token found in config: !ML_PASSWORD] DBG1 [zmesdetect_m15] [allowing self-signed certs to work...] DBG4 [zmesdetect_m15] [Now checking for monitor overrides] DBG2 [zmesdetect_m15] [import_zm_zones: match_reason=False and reason=None] DBG2 [zmesdetect_m15] [Getting ZM zones using https://127.0.0.1/zm/api/zones/forMonitor/15.json?username=xxx&password=yyy&user=xxx&pass=yyy] DBG2 [zmesdetect_m15] [importing zoneminder polygon: ofis_istiklal [0,0 348,37 342,279 15,271]] DBG4 [zmesdetect_m15] [Finally, doing parameter substitution] INF [zmesdetect_m15] [Importing local classes for Object/Face] INF [zmesdetect_m15] [Connecting with ZM APIs] DBG2 [zmesdetect_m15] [API SSL certificate check has been disbled] DBG1 [zmesdetect_m15] [using username/password for login] DBG2 [zmesdetect_m15] [Using new token API] DBG1 [zmesdetect_m15] [Access token expires on:2021-04-11 01:28:06.564240 [7200s]] DBG1 [zmesdetect_m15] [Refresh token expires on:2021-04-11 23:28:06.565197 [86400s]] DBG3 [zmesdetect_m15] [No need to relogin as access token still has 119.99996883333333 minutes remaining] DBG4 [zmesdetect_m15] [make_request called with url=https://127.0.0.1/zm/api/host/gettimezone.json payload={} type=get query={'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjE4MDg2NDg2LCJleHAiOjE2MTgwOTM2ODYsInVzZXIiOiJhZG1pbiIsInR5cGUiOiJhY2Nlc3MifQ.7UM6LRkpuy8FThSnjBsEp4KL79TfCtVPbj8VNo8Jui8'}] DBG2 [zmesdetect_m15] [using ml_sequence] DBG2 [zmesdetect_m15] [using stream_sequence] DBG1 [zmesdetect_m15] [Resetting models, will be loaded on next run] DBG3 [zmesdetect_m15] [Using manual locking as we are only using one model] DBG2 [zmesdetect_m15] [Media get SSL certificate check has been disbled] DBG2 [zmesdetect_m15] [Using URL 1155 for stream] DBG2 [zmesdetect_m15] [We will only process frames: ['snapshot', 'alarm']] DBG2 [zmesdetect_m15] [No need to start streams, we are picking images from https://127.0.0.1/zm/index.php?view=image&eid=1155] DBG3 [zmesdetect_m15] [Reading https://127.0.0.1/zm/index.php?view=image&eid=1155&fid=snapshot] DBG3 [zmesdetect_m15] [No need to relogin as access token still has 119.99960185 minutes remaining] DBG4 [zmesdetect_m15] [make_request called with url=https://127.0.0.1/zm/index.php?view=image&eid=1155&fid=snapshot payload={} type=get query={'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjE4MDg2NDg2LCJleHAiOjE2MTgwOTM2ODYsInVzZXIiOiJhZG1pbiIsInR5cGUiOiJhY2Nlc3MifQ.7UM6LRkpuy8FThSnjBsEp4KL79TfCtVPbj8VNo8Jui8'}] DBG1 [zmesdetect_m15] [perf: Starting for frame:snapshot] DBG1 [zmesdetect_m15] [============ Frame: snapshot Running mask model in sequence ==================] DBG3 [zmesdetect_m15] [load_models (just init, actual load happens at first detect): ['mask']] 04/10/21 23:28:06 zmesdetect_m15[22317] ERR detect_sequence.py:188 [Invalid model: mask]

04/10/21 23:28:06 zmesdetect_m15[22317] ERR detect_sequence.py:191 [Error loading same model variation for mask:Invalid model: mask]

DBG2 [zmesdetect_m15] [Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/detect_sequence.py", line 189, in _load_models raise ValueError ('Invalid model: {}'.format(seq)) ValueError: Invalid model: mask ] 04/10/21 23:28:06 zmesdetect_m15[22317] ERR detect_sequence.py:439 [Error loading model for mask:'mask']

DBG2 [zmesdetect_m15] [Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/detect_sequence.py", line 436, in detect_stream for m in self.models[seq]: KeyError: 'mask' ] DBG3 [zmesdetect_m15] [Reading https://127.0.0.1/zm/index.php?view=image&eid=1155&fid=alarm] DBG3 [zmesdetect_m15] [No need to relogin as access token still has 119.99909883333333 minutes remaining] DBG4 [zmesdetect_m15] [make_request called with url=https://127.0.0.1/zm/index.php?view=image&eid=1155&fid=alarm payload={} type=get query={'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjE4MDg2NDg2LCJleHAiOjE2MTgwOTM2ODYsInVzZXIiOiJhZG1pbiIsInR5cGUiOiJhY2Nlc3MifQ.7UM6LRkpuy8FThSnjBsEp4KL79TfCtVPbj8VNo8Jui8'}] DBG1 [zmesdetect_m15] [perf: Starting for frame:alarm] DBG1 [zmesdetect_m15] [============ Frame: alarm Running mask model in sequence ==================] DBG3 [zmesdetect_m15] [load_models (just init, actual load happens at first detect): ['mask']] 04/10/21 23:28:06 zmesdetect_m15[22317] ERR detect_sequence.py:188 [Invalid model: mask]

04/10/21 23:28:06 zmesdetect_m15[22317] ERR detect_sequence.py:191 [Error loading same model variation for mask:Invalid model: mask]

DBG2 [zmesdetect_m15] [Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/detect_sequence.py", line 189, in _load_models raise ValueError ('Invalid model: {}'.format(seq)) ValueError: Invalid model: mask ] 04/10/21 23:28:06 zmesdetect_m15[22317] ERR detect_sequence.py:439 [Error loading model for mask:'mask']

DBG2 [zmesdetect_m15] [Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/detect_sequence.py", line 436, in detect_stream for m in self.models[seq]: KeyError: 'mask' ] 04/10/21 23:28:06 zmesdetect_m15[22317] FAT zm_detect.py:570 [Unrecoverable error:'mask' Traceback:Traceback (most recent call last): File "/var/lib/zmeventnotification/bin/zm_detect.py", line 565, in main_handler() File "/var/lib/zmeventnotification/bin/zm_detect.py", line 411, in main_handler matched_data,all_data = m.detect_stream(stream=stream, options=stream_options) File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/detect_sequence.py", line 543, in detect_stream for m in self.models[seq]: KeyError: 'mask' ] `

Objectconfig.ini as follows

objectconfig_test_mask.txt

Is it possible to use both models on the same event?

ozgurozc commented 3 years ago

Actual error is as follows, I really tried hard to overcome this challenge , could you assist me to find my mistake? or how can I add mask detection model to the sequence after detecting person in the alarm image?

DBG3 [zmesdetect_m15] [load_models (just init, actual load happens at first detect): ['mask']] 04/10/21 23:28:06 zmesdetect_m15[22317] ERR detect_sequence.py:188 [Invalid model: mask]

04/10/21 23:28:06 zmesdetect_m15[22317] ERR detect_sequence.py:191 [Error loading same model variation for mask:Invalid model: mask]

DBG2 [zmesdetect_m15] [Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/detect_sequence.py", line 189, in _load_models raise ValueError ('Invalid model: {}'.format(seq)) ValueError: Invalid model: mask ] 04/10/21 23:28:06 zmesdetect_m15[22317] ERR detect_sequence.py:439 [Error loading model for mask:'mask']

DBG2 [zmesdetect_m15] [Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/detect_sequence.py", line 436, in detect_stream for m in self.models[seq]: KeyError: 'mask' ] 04/10/21 23:28:06 zmesdetect_m15[22317] FAT zm_detect.py:570 [Unrecoverable error:'mask' Traceback:Traceback (most recent call last): File "/var/lib/zmeventnotification/bin/zm_detect.py", line 565, in main_handler() File "/var/lib/zmeventnotification/bin/zm_detect.py", line 411, in main_handler matched_data,all_data = m.detect_stream(stream=stream, options=stream_options) File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/detect_sequence.py", line 543, in detect_stream for m in self.models[seq]: KeyError: 'mask' ]

ozgurozc commented 3 years ago

My mistake problem solved...