RaspberryPI & OpenCV + Yolo: AttributeError: module 'cv2' has no attribute 'dnn'

asked 2020-11-21 15:29:46 -0600

Ghetto82 gravatar image

updated 2020-11-21 15:35:02 -0600

Hi,

i want to use object detection with my raspberry pi 3 and zero with rasp_pi cam. i've followed the following: - OPENCV installed: https://www.youtube.com/watch?v=xlmJs... - DARKNET installed: https://github.com/AlexeyAB/darknet

Everything is working if i pass an image (jpg).

i want the real time video streaming, so i use this code (part1 is working, it's not working part2/3): - CODE (part2): https://hills.ccsf.edu/~cluk1/cs231/p...

i got this errors: pi@raspberrypi:~/darknet $ python3 test.py [INFO] loading YOLO from disk... Traceback (most recent call last): File "test.py", line 25, in <module> net = cv2.dnn.readNetFromDarknet(configPath, weightsPath) AttributeError: module 'cv2' has no attribute 'dnn'

pi@raspberrypi:~/darknet $ python test.py [INFO] loading YOLO from disk... Traceback (most recent call last): File "test.py", line 25, in <module> net = cv2.dnn.readNetFromDarknet(configPath, weightsPath) AttributeError: 'module' object has no attribute 'dnn'

it seems a mission impossible because it's one week i'm working on that without a solution. Can you please help me?

edit retag flag offensive close merge delete

Comments

When did u installed opencv? OpenCV version and python version and OS platform?

supra56 gravatar imagesupra56 ( 2020-11-21 20:08:34 -0600 )edit

check out cv2.getBuildInformation() it has information about the builtin modules

berak gravatar imageberak ( 2020-11-22 04:19:56 -0600 )edit