Hi asker, meanwhile I was able to recompile openCV again with python3.7 bindings. But I still cannot get object detection working. The output looks as follows now. Do you have an idea what I could do now? Thanks a lot for your support.
Code: Select all
jetson@nano:~$ sudo -u www-data /var/lib/zmeventnotification/bin/zm_detect.py --config /etc/zm/objectconfig.ini --eventid 550 --monitorid 1 --debug
08/27/23 00:10:21 zmesdetect_m1[7527] INF ZMLog.py:292 [Setting up signal handler for logs]
08/27/23 00:10:21 zmesdetect_m1[7527] INF ZMLog.py:301 [Switching global logger to ZMLog]
08/27/23 00:10:22 zmesdetect_m1[7527] INF zm_detect.py:283 [---------| app:6.1.28, pyzm:0.3.62, ES:6.1.28
, OpenCV:4.5.0|------------]
08/27/23 00:10:22 zmesdetect_m1[7527] INF utils.py:404 [Reading config from: /etc/zm/objectconfig.ini]
08/27/23 00:10:22 zmesdetect_m1[7527] INF utils.py:409 [Reading secrets from: /etc/zm/secrets.ini]
08/27/23 00:10:22 zmesdetect_m1[7527] DBG2 utils.py:381 [Secret token found in config: !ZM_PORTAL]
08/27/23 00:10:22 zmesdetect_m1[7527] DBG2 utils.py:381 [Secret token found in config: !ZM_USER]
08/27/23 00:10:22 zmesdetect_m1[7527] DBG2 utils.py:381 [Secret token found in config: !ZM_PASSWORD]
08/27/23 00:10:22 zmesdetect_m1[7527] DBG2 utils.py:381 [Secret token found in config: !ZM_API_PORTAL]
08/27/23 00:10:22 zmesdetect_m1[7527] DBG2 utils.py:381 [Secret token found in config: !ML_USER]
08/27/23 00:10:22 zmesdetect_m1[7527] DBG2 utils.py:381 [Secret token found in config: !ML_PASSWORD]
08/27/23 00:10:22 zmesdetect_m1[7527] DBG2 utils.py:381 [Secret token found in config: !PLATEREC_ALPR_KEY]
08/27/23 00:10:22 zmesdetect_m1[7527] DBG1 utils.py:444 [allowing self-signed certs to work...]
08/27/23 00:10:22 zmesdetect_m1[7527] DBG2 utils.py:454 [Now checking for monitor overrides]
08/27/23 00:10:22 zmesdetect_m1[7527] DBG3 utils.py:521 [Finally, doing parameter substitution]
08/27/23 00:10:22 zmesdetect_m1[7527] INF zm_detect.py:308 [Importing local classes for Object/Face]
08/27/23 00:10:24 zmesdetect_m1[7527] INF zm_detect.py:333 [Connecting with ZM APIs]
08/27/23 00:10:24 zmesdetect_m1[7527] DBG2 api.py:69 [API SSL certificate check has been disbled]
08/27/23 00:10:24 zmesdetect_m1[7527] DBG1 api.py:173 [using username/password for login]
08/27/23 00:10:24 zmesdetect_m1[7527] DBG2 api.py:202 [Using new token API]
08/27/23 00:10:24 zmesdetect_m1[7527] DBG2 zm_detect.py:341 [using ml_sequence]
08/27/23 00:10:24 zmesdetect_m1[7527] DBG2 zm_detect.py:353 [using stream_sequence]
08/27/23 00:10:24 zmesdetect_m1[7527] DBG1 detect_sequence.py:160 [Resetting models, will be loaded on next run]
08/27/23 00:10:24 zmesdetect_m1[7527] DBG3 detect_sequence.py:634 [Using automatic locking as we are switching between models]
08/27/23 00:10:24 zmesdetect_m1[7527] DBG2 Media.py:51 [Media get SSL certificate check has been disbled]
08/27/23 00:10:24 zmesdetect_m1[7527] DBG2 Media.py:99 [Using URL 550 for stream]
08/27/23 00:10:24 zmesdetect_m1[7527] DBG2 Media.py:114 [We will only process frames: ['snapshot', 'alarm']]
08/27/23 00:10:24 zmesdetect_m1[7527] DBG2 Media.py:137 [No need to start streams, we are picking images from http://192.168.178.170/zm/index.php?view=image&eid=550]
08/27/23 00:10:24 zmesdetect_m1[7527] DBG3 Media.py:271 [Reading http://192.168.178.170/zm/index.php?view=image&eid=550&fid=snapshot]
08/27/23 00:10:24 zmesdetect_m1[7527] DBG3 api.py:263 [make_request called with url=http://192.168.178.170/zm/index.php?view=image&eid=550&fid=snapshot payload={} type=get query={'token': None}]
08/27/23 00:10:24 zmesdetect_m1[7527] DBG1 detect_sequence.py:654 [perf: Starting for frame:snapshot]
08/27/23 00:10:24 zmesdetect_m1[7527] DBG1 detect_sequence.py:664 [Sequence of detection types to execute: ['object', 'face', 'alpr']]
08/27/23 00:10:24 zmesdetect_m1[7527] DBG1 detect_sequence.py:669 [============ Frame: snapshot Running object detection type in sequence ==================]
08/27/23 00:10:24 zmesdetect_m1[7527] DBG2 detect_sequence.py:174 [Skipping TPU object detection as it is disabled]
08/27/23 00:10:24 zmesdetect_m1[7527] DBG2 detect_sequence.py:178 [Loading sequence: YoloV4 GPU/CPU]
08/27/23 00:10:24 zmesdetect_m1[7527] DBG2 detect_sequence.py:179 [Initializing model type:object with options:{'name': 'YoloV4 GPU/CPU', 'enabled': 'yes', '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': 'gpu', 'gpu_max_processes': 1, 'gpu_max_lock_wait': 100, 'cpu_max_processes': 3, 'cpu_max_lock_wait': 100, 'max_detection_size': '90%', 'disable_locks': 'no'}]
08/27/23 00:10:24 zmesdetect_m1[7527] DBG2 yolo.py:55 [portalock: max:1, name:pyzm_uid33_gpu_lock, timeout:100]
08/27/23 00:10:24 zmesdetect_m1[7527] DBG3 detect_sequence.py:689 [object has a same_model_sequence strategy of first]
08/27/23 00:10:24 zmesdetect_m1[7527] DBG1 detect_sequence.py:701 [--------- Frame:snapshot Running variation: #1 -------------]
08/27/23 00:10:24 zmesdetect_m1[7527] DBG2 yolo.py:152 [detect extracted image dimensions as: 800wx450h]
08/27/23 00:10:24 zmesdetect_m1[7527] DBG2 yolo.py:68 [Waiting for pyzm_uid33_gpu_lock portalock...]
08/27/23 00:10:24 zmesdetect_m1[7527] DBG2 yolo.py:70 [Got pyzm_uid33_gpu_lock portalock]
08/27/23 00:10:24 zmesdetect_m1[7527] DBG1 yolo.py:102 [|--------- Loading "YoloV4 GPU/CPU" model from disk -------------|]
08/27/23 00:10:25 zmesdetect_m1[7527] DBG1 yolo.py:117 [perf: processor:gpu Yolo initialization (loading /var/lib/zmeventnotification/models/yolov4/yolov4.weights model from disk) took: 852.94 ms]
08/27/23 00:10:25 zmesdetect_m1[7527] DBG2 yolo.py:130 [Setting CUDA backend for OpenCV]
08/27/23 00:10:25 zmesdetect_m1[7527] DBG3 yolo.py:132 [If you did not set your CUDA_ARCH_BIN correctly during OpenCV compilation, you will get errors during detection related to invalid device/make_policy]
08/27/23 00:10:25 zmesdetect_m1[7527] DBG1 yolo.py:177 [|---------- YOLO (input image: 800w*450h, model resize dimensions: 416w*416h) ----------|]
08/27/23 00:10:25 zmesdetect_m1[7527] DBG2 yolo.py:86 [Released pyzm_uid33_gpu_lock portalock]
08/27/23 00:10:25 zmesdetect_m1[7527] ERR detect_sequence.py:713 [Error running model: OpenCV(4.5.0) /home/jetson/nano_build_opencv/workspace/opencv-4.5.0/modules/dnn/src/cuda4dnn/csl/memory.hpp:54: error: (-217:Gpu API call) no CUDA-capable device is detected in function 'ManagedPtr'
]
08/27/23 00:10:25 zmesdetect_m1[7527] DBG2 detect_sequence.py:714 [Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/pyzm/ml/detect_sequence.py", line 710, in detect_stream
_b,_l,_c,_m = m.detect(image=frame)
File "/usr/local/lib/python3.7/dist-packages/pyzm/ml/object.py", line 71, in detect
b,l,c,_model_names = self.model.detect(image)
File "/usr/local/lib/python3.7/dist-packages/pyzm/ml/yolo.py", line 189, in detect
outs = self.net.forward(ln)
cv2.error: OpenCV(4.5.0) /home/jetson/nano_build_opencv/workspace/opencv-4.5.0/modules/dnn/src/cuda4dnn/csl/memory.hpp:54: error: (-217:Gpu API call) no CUDA-capable device is detected in function 'ManagedPtr'
]
08/27/23 00:10:25 zmesdetect_m1[7527] DBG2 detect_sequence.py:770 [We did not find any object matches in frame: snapshot]
08/27/23 00:10:25 zmesdetect_m1[7527] DBG1 detect_sequence.py:669 [============ Frame: snapshot Running face detection type in sequence ==================]
08/27/23 00:10:25 zmesdetect_m1[7527] DBG2 detect_sequence.py:190 [Skipping TPU face detection as it is disabled]
08/27/23 00:10:27 zmesdetect_m1[7527] ERR detect_sequence.py:196 [Error loading same model variation for face:No module named 'face_recognition']
08/27/23 00:10:27 zmesdetect_m1[7527] DBG2 detect_sequence.py:197 [Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/pyzm/ml/detect_sequence.py", line 194, in _load_models
self.models[seq].append(FaceDetect.Face(options=face_seq))
File "/usr/local/lib/python3.7/dist-packages/pyzm/ml/face.py", line 14, in __init__
import pyzm.ml.face_dlib as face_dlib
File "/usr/local/lib/python3.7/dist-packages/pyzm/ml/face_dlib.py", line 3, in <module>
import pyzm.ml.face_train_dlib as train
File "/usr/local/lib/python3.7/dist-packages/pyzm/ml/face_train_dlib.py", line 18, in <module>
import face_recognition
ModuleNotFoundError: No module named 'face_recognition'
]
08/27/23 00:10:27 zmesdetect_m1[7527] DBG3 detect_sequence.py:689 [face has a same_model_sequence strategy of union]
08/27/23 00:10:27 zmesdetect_m1[7527] DBG2 detect_sequence.py:770 [We did not find any face matches in frame: snapshot]
08/27/23 00:10:27 zmesdetect_m1[7527] DBG1 detect_sequence.py:669 [============ Frame: snapshot Running alpr detection type in sequence ==================]
08/27/23 00:10:27 zmesdetect_m1[7527] DBG2 detect_sequence.py:672 [Making sure we have matched one of ['car', 'motorbike', 'bus', 'truck', 'boat'] in [] before we proceed]
08/27/23 00:10:27 zmesdetect_m1[7527] DBG1 detect_sequence.py:674 [Did not find pre existing labels, not running detection type]
08/27/23 00:10:27 zmesdetect_m1[7527] DBG3 Media.py:271 [Reading http://192.168.178.170/zm/index.php?view=image&eid=550&fid=alarm]
08/27/23 00:10:27 zmesdetect_m1[7527] DBG3 api.py:263 [make_request called with url=http://192.168.178.170/zm/index.php?view=image&eid=550&fid=alarm payload={} type=get query={'token': None}]
08/27/23 00:10:27 zmesdetect_m1[7527] DBG1 detect_sequence.py:654 [perf: Starting for frame:alarm]
08/27/23 00:10:27 zmesdetect_m1[7527] DBG1 detect_sequence.py:664 [Sequence of detection types to execute: ['object', 'face', 'alpr']]
08/27/23 00:10:27 zmesdetect_m1[7527] DBG1 detect_sequence.py:669 [============ Frame: alarm Running object detection type in sequence ==================]
08/27/23 00:10:27 zmesdetect_m1[7527] DBG3 detect_sequence.py:689 [object has a same_model_sequence strategy of first]
08/27/23 00:10:27 zmesdetect_m1[7527] DBG1 detect_sequence.py:701 [--------- Frame:alarm Running variation: #1 -------------]
08/27/23 00:10:27 zmesdetect_m1[7527] DBG2 yolo.py:152 [detect extracted image dimensions as: 800wx450h]
08/27/23 00:10:27 zmesdetect_m1[7527] DBG2 yolo.py:68 [Waiting for pyzm_uid33_gpu_lock portalock...]
08/27/23 00:10:27 zmesdetect_m1[7527] DBG2 yolo.py:70 [Got pyzm_uid33_gpu_lock portalock]
08/27/23 00:10:27 zmesdetect_m1[7527] DBG1 yolo.py:177 [|---------- YOLO (input image: 800w*450h, model resize dimensions: 416w*416h) ----------|]
08/27/23 00:10:27 zmesdetect_m1[7527] DBG2 yolo.py:86 [Released pyzm_uid33_gpu_lock portalock]
08/27/23 00:10:27 zmesdetect_m1[7527] ERR detect_sequence.py:713 [Error running model: OpenCV(4.5.0) /home/jetson/nano_build_opencv/workspace/opencv-4.5.0/modules/dnn/src/cuda4dnn/csl/memory.hpp:54: error: (-217:Gpu API call) no CUDA-capable device is detected in function 'ManagedPtr'
]
08/27/23 00:10:27 zmesdetect_m1[7527] DBG2 detect_sequence.py:714 [Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/pyzm/ml/detect_sequence.py", line 710, in detect_stream
_b,_l,_c,_m = m.detect(image=frame)
File "/usr/local/lib/python3.7/dist-packages/pyzm/ml/object.py", line 71, in detect
b,l,c,_model_names = self.model.detect(image)
File "/usr/local/lib/python3.7/dist-packages/pyzm/ml/yolo.py", line 189, in detect
outs = self.net.forward(ln)
cv2.error: OpenCV(4.5.0) /home/jetson/nano_build_opencv/workspace/opencv-4.5.0/modules/dnn/src/cuda4dnn/csl/memory.hpp:54: error: (-217:Gpu API call) no CUDA-capable device is detected in function 'ManagedPtr'
]
08/27/23 00:10:27 zmesdetect_m1[7527] DBG2 detect_sequence.py:770 [We did not find any object matches in frame: alarm]
08/27/23 00:10:27 zmesdetect_m1[7527] DBG1 detect_sequence.py:669 [============ Frame: alarm Running face detection type in sequence ==================]
08/27/23 00:10:27 zmesdetect_m1[7527] DBG2 detect_sequence.py:190 [Skipping TPU face detection as it is disabled]
08/27/23 00:10:27 zmesdetect_m1[7527] ERR detect_sequence.py:196 [Error loading same model variation for face:No module named 'face_recognition']
08/27/23 00:10:27 zmesdetect_m1[7527] DBG2 detect_sequence.py:197 [Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/pyzm/ml/detect_sequence.py", line 194, in _load_models
self.models[seq].append(FaceDetect.Face(options=face_seq))
File "/usr/local/lib/python3.7/dist-packages/pyzm/ml/face.py", line 14, in __init__
import pyzm.ml.face_dlib as face_dlib
File "/usr/local/lib/python3.7/dist-packages/pyzm/ml/face_dlib.py", line 3, in <module>
import pyzm.ml.face_train_dlib as train
File "/usr/local/lib/python3.7/dist-packages/pyzm/ml/face_train_dlib.py", line 18, in <module>
import face_recognition
ModuleNotFoundError: No module named 'face_recognition'
]
08/27/23 00:10:27 zmesdetect_m1[7527] DBG3 detect_sequence.py:689 [face has a same_model_sequence strategy of union]
08/27/23 00:10:27 zmesdetect_m1[7527] DBG2 detect_sequence.py:770 [We did not find any face matches in frame: alarm]
08/27/23 00:10:27 zmesdetect_m1[7527] DBG1 detect_sequence.py:669 [============ Frame: alarm Running alpr detection type in sequence ==================]
08/27/23 00:10:27 zmesdetect_m1[7527] DBG2 detect_sequence.py:672 [Making sure we have matched one of ['car', 'motorbike', 'bus', 'truck', 'boat'] in [] before we proceed]
08/27/23 00:10:27 zmesdetect_m1[7527] DBG1 detect_sequence.py:674 [Did not find pre existing labels, not running detection type]
08/27/23 00:10:27 zmesdetect_m1[7527] DBG1 detect_sequence.py:831 [perf: TOTAL detection sequence (with image loads) took: 2699.40 ms to process 550]
08/27/23 00:10:27 zmesdetect_m1[7527] DBG1 zm_detect.py:556 [Closing logs]
jetson@nano:~$