Setting a path in a web program that uses Python and OpenCV #69166
Replies: 3 comments
-
Make sure that your
|
Beta Was this translation helpful? Give feedback.
-
In reply to what rantirules mentioned, make sure you are using the right path for your data files. It appears that your code produces an error at the function readNetFromDarknet. Here's a fix that could work for you better
Hope this helps! Have a great day |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
question
Body
I'm going to use YOLOv4 to create a program that takes pictures of the desired object when it comes into the camera angle.
Below is the content of the code app.py for that.
I modified it to a relative route to distribute this program.
But there was an error
OpenCV(4.8.1) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\darknet\darknet_importer.cpp:210: error: (-212:Parsing error) Failed to open NetParameter file: yolov4.cfg in function 'cv::dnn::dnn4_v20230620::readNetFromDarknet'
File "C:\Users\shini\new-webcam-app\webcam_server\app.py", line 17, in
net = cv2.dnn.readNet(YOLO_WEIGHTS, YOLO_CFG)
However, if v3 is used instead of YOLOv4, no error has occurred even when using the relative path.
I wonder how YOLOv4 is used and set as a relative path does not cause an error. I ask for your help me.
Guidelines
Beta Was this translation helpful? Give feedback.
All reactions