Opencv detection yolov4 target detection video stream error

I encountered a bug today. I didn’t have a problem before, but I have a problem today

There is no problem with yolov4 target detection image. There is a problem with this test video or calling camera detection

Report the following error:

TypeError: Expected cv::UMat for argument ‘src’

src data type = 17 is not supported

Repeated installation of OpenCV and numpy versions keeps reporting this error

Later, I thought it might be because the dataset pictures were in Chinese, so I renamed the pictures and re labeled them. The labels were also in English, and then I trained. After training, I found that there were still problems.

Finally, it is found that the result of Yolo prediction code is not directly returned to the picture,

images = yolo.detect_ image(image)
r_ image = images.get(‘image’)

The picture is in the dictionary

When the video is called

frame = np.array(yolo.detect_image(frame))

It needs to be changed to

frame = yolo.detect_ image(frame)
frame = np.array(frame.get(‘image’))

Moreover, Chinese pictures and Chinese labels have no effect.

Read More: