Error: OpenCV(4.8.0) /io/opencv/modules/dnn/src/darknet/darknet_io.cpp:660: error: (-215:Assertion failed) separator_index < line.size() in function 'ReadDarknetFromCfgStream'

def saveSeq(C,counter,th):
  op = r'/content/drive/MyDrive/CV/Output'
  if len(C)<th:
    pass
  else:
    k=1
    for frame in C:
      imName = str(counter)+'_'+str(k)+'.jpg'
      final = os.path.join(op,imName)
      box,labels,con = cv.detect_common_objects(frame)
      frame = draw_bbox(frame,box,labels)
      cv2.imwrite(final,frame)
      k+=1

what is this error?? why is this error?

error usually means, that the .cfg file for your darknet model is broken

unfortunately, your code snippet is useless here (as it’s incomplete, not reproducable, noone here knows what ‘cv’ is)

please:

  • check the .cfg file used, show us.
  • link us to where you copypasted that code & got that model

im sorry, cv is i imported cvlib as cv

https://raw.githubusercontent.com/AlexeyAB/darknet/master/cfg/yolov4.cfg

please make sure, your downloaded cfg is the same as on the website (dl errrors do happen !)

hey berak, im actually new to this i know the theory behind the models etc.
this was supposed to be my first project detecting the change and classifying the objects for a cctv.
im using google colab, i really did not follow your last response, i dint comprehend.
can you please help me out wdym?

again, post your cfg file here, something is broken in your local copy.

it’s a simple ‘ini’ format, must be either of:

[header]
#comment
key=value

This topic was automatically closed after 8 days. New replies are no longer allowed.