cv2.error: OpenCV(4.9.0) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\darknet\darknet_io.cpp:705: error: (-215:Assertion failed) separator_index < line.size() in function ‘cv::dnn::darknet::ReadDarknetFromCfgStream’
here is the code :
import cv2
import cvlib as cv
from cvlib.object_detection import draw_bbox
from gtts import gTTS
from playsound import playsound
video = cv2.VideoCapture(0)
while True:
ret, frame=video.read()
bbox,label,conf=cv.detect_common_objects(frame,enable_gpu=True)
cv2.imshow("Object Detection", output_image)
if cv2.waitkey(1) & 0xFF == ord(" "):
break
i am getting error in this “bbox,label,conf=cv.detect_common_objects(frame,enable_gpu=True)”
KITRETSU:
import cvlib as cv
cvlib is not opencv so check cvlib doc. try to reproduce your error with opencv only
but the video where i got the code used same code and it worked for them ,the difference is they were on a mac while i am on a windows device . also can you tell me the fix
file a bug with cvlib. it’s their problem. they used OpenCV wrong. the model files appear corrupted.
berak
March 13, 2024, 6:50pm
5
please check your cfg file with a text editor.
it’s supposed to be some ini format, key=value
i guess, you have some html / error file instead
mliu31
January 18, 2025, 10:43pm
6
following the same tutorial and having the same issues! ik this is old but did you figure it out?
file a bug with the “cvlib” project. “cvlib” is not OpenCV. it merely uses OpenCV.
This topic was automatically closed after 15 days. New replies are no longer allowed.