python 如何用opencv部署?
xiaodingding opened this issue · comments
1.修改,因为提示参数不多,返回的只有三个参数
#bs, _, ny, nx = outs[i].shape # x(bs,255,20,20) to x(bs,3,20,20,85)
bs, ny, nx = outs[i].shape # x(bs,255,20,20) to x(bs,3,20,20,85)
修改参数之后,包这个错误:
ValueError: cannot reshape array of size 151200 into shape (1,3,6,25200,6)
[INFO]blob shape: (1, 3, 640, 640)
0 (1, 25200, 6)
Traceback (most recent call last):
File "main_yolov5.py", line 124, in
dets = yolonet.detect(srcimg)
File "main_yolov5.py", line 99, in detect
outs[i] = outs[i].reshape(bs, self.na, self.no, ny, nx).transpose(0, 1, 3, 4, 2)
ValueError: cannot reshape array of size 151200 into shape (1,3,6,25200,6)
这个仓库的代码有些旧了,最近我发布了使用opencv部署yolov5-v6.1的程序,源码地址是:
https://github.com/hpc203/yolov5-v6.1-opencv-onnxrun
可以用这个新的,里面讲解了如何转换生成onnx文件