iArunava / YOLOv3-Object-Detection-with-OpenCV

This project implements a real-time image and video object detection classifier using pretrained yolov3 models.
MIT License
320 stars 173 forks source link

-212 Parsing error at Windows10 #18

Open skykongkong8 opened 3 years ago

skykongkong8 commented 3 years ago

Have NO CLUE why this isnt working cuz it worked with THE SAME method at mac... Plz gimme any advice to solve my ``` problem..

`import cv2
import numpy
net = cv2.dnn.readNet("yolov3.weights", "yolov3.cfg")
classes = []
with open("coco.names", "r") as f:
    classes = [line.strip() for line in f.readlines()]
layer_names = net.getLayerNames()
output_layers = [layer_names[i[0] - 1] for i in net.getUnconnectedOutLayers()]
colors = np.random.uniform(0, 255, size=(len(classes), 3))
 `

and the error message is like: OpenCV(4.5.1) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-kh7iq4w7\opencv\modules\dnn\src\darknet\darknet_importer.cpp:207: error: (-212:Parsing error) Failed to parse NetParameter file: yolov3.cfg in function 'cv::dnn::dnn4_v20201117::readNetFromDarknet'

I had already tried the 'absolute path method' and the 'lowering the cv-py version method' but it seems both of them isnt my problem..

++ I also tried re-downloading the .cfg file since the error message seemed to have some problem with it, but it didnt make any progress. (I downloaded it from ) so guess the file source isnt the real problem

AYUDAME POR FAVOR