Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python 如何用opencv部署? #25

Open
xiaodingding opened this issue Feb 22, 2022 · 1 comment
Open

python 如何用opencv部署? #25

xiaodingding opened this issue Feb 22, 2022 · 1 comment

Comments

@xiaodingding
Copy link

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)
image

@hpc203
Copy link
Owner

hpc203 commented Mar 1, 2022

这个仓库的代码有些旧了,最近我发布了使用opencv部署yolov5-v6.1的程序,源码地址是:
https://github.com/hpc203/yolov5-v6.1-opencv-onnxrun
可以用这个新的,里面讲解了如何转换生成onnx文件

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants