FaceMaskDetection
FaceMaskDetection copied to clipboard
invalid index to scalar variable
i tried running it and got the following error.
╰─$ py opencv_dnn_infer.py --img-path /home/<name>/Pictures/Webcam/2021-11-12-101657.jpg
Traceback (most recent call last):
File "opencv_dnn_infer.py", line 117, in <module>
run_on_video(Net, video_path, conf_thresh=0.5)
File "opencv_dnn_infer.py", line 89, in run_on_video
img_raw = inference(Net, img_raw, target_shape=(260, 260), conf_thresh=conf_thresh)
File "opencv_dnn_infer.py", line 47, in inference
y_bboxes_output, y_cls_output = net.forward(getOutputsNames(net))
File "opencv_dnn_infer.py", line 41, in getOutputsNames
return [layersNames[i[0] - 1] for i in net.getUnconnectedOutLayers()]
File "opencv_dnn_infer.py", line 41, in <listcomp>
return [layersNames[i[0] - 1] for i in net.getUnconnectedOutLayers()]
IndexError: invalid index to scalar variable.
help plz.
nvm somehow i is a scalar now so just remove the [0]
Why I need to remove [0] in windows 10, but in Jetson TX2 some devices need to remove some don't need remove.