我有:
import cv2
import cvlib as cv
import cvlib.object_detection
from gtts import gTTS
from playsound import playsound
video = cv2.VideoCapture(0)
while (True):
retu, frame0=video.read()
bbox, label, conf = cv.detect_common_objects(frame0)
output_image= cvlib.object_detection.draw_bbox(frame0, bbox, label, conf)
cv2.imshow( Cam , output_image)
if cv2.waitKey(1) & 0xFF==ord( f ):
break
video.release()
cv2.destroyAllWindows()
而我却继续这样做。
Traceback (most recent call last):
File "C:UserswptassemblyPycharmProjectsimageLibrary.venvcam.py", line 36, in <module>
bbox, label, conf = cv.detect_common_objects(frame)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:UserswptassemblyPycharmProjectsimageLibrary.venvLibsite-packagescvlibobject_detection.py", line 125, in detect_common_objects
net = cv2.dnn.readNet(weights_file_abs_path, config_file_abs_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cv2.error: OpenCV(4.9.0) D:aopencv-pythonopencv-pythonopencvmodulesdnnsrcdarknetdarknet_io.cpp:705: error: (-215:Assertion failed) separator_index < line.size() in function cv::dnn::darknet::ReadDarknetFromCfgStream
守则是从我的网络活动中获取图像,探测物体,然后在网上取出一个盒子;然而,我却不断扔下Error。