abd-shoumik / Social-distance-detection

Social distance detection , a deep learning computer vision project with yolo object detection
https://abd-shoumik.github.io/Social-distance-detection/
113 stars 70 forks source link

getting an error #3

Open faroogfatma opened 3 years ago

faroogfatma commented 3 years ago

error Traceback (most recent call last)

in () 32 # load our YOLO object detector trained on COCO dataset (80 classes) 33 print("[INFO] loading YOLO from disk...") ---> 34 net = cv2.dnn.readNetFromDarknet(configPath, weightsPath) 35 36 # determine only the *output* layer names that we need from YOLO error: OpenCV(4.1.2) /io/opencv/modules/dnn/src/darknet/darknet_importer.cpp:214: error: (-212:Parsing error) Failed to parse NetParameter file: /content/drive/My Drive/social-distance-detector/yolo-coco/yolov3.weights in function 'readNetFromDarknet'
ghost commented 2 years ago

The dnn module of OpenCv can't get the path to your YOLO weights. You may keep in it in root folder of your program, or create folder within this root folder and copy the path to the weights. Also remember that weights comes before cfg. cv2.dnn.readNetFromDarknet('weghtsPath', 'configPath')