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

不画Bounding Box (出现负数) #5

Open
danielzhangau opened this issue May 14, 2022 · 8 comments
Open

不画Bounding Box (出现负数) #5

danielzhangau opened this issue May 14, 2022 · 8 comments

Comments

@danielzhangau
Copy link

danielzhangau commented May 14, 2022

今天在测试代码的时候发现,结果没有框。通过print log发现bbox的坐标很大。e.g. [45355, 43453, -43453, -34343]

应该是一个bug出现在postprocess之前,参与anchor那里。我后来把anchor那一部分全部comment掉,运行没有问题。

但我想请教一下anchor,grid在这里起到什么作用?

@project-zzy
Copy link

请问您具体注释了哪些代码?我也出现了box坐标为负数的情况,期待您的回复

@hpc203
Copy link
Owner

hpc203 commented Sep 15, 2022

用 官方的方式导出python export.py --weights yolov5s.pt --include torchscript onnx
里面包含了yolo层的,而我的仓库里的代码是默认onnx文件里不包含yolo层的,把代码里的yolo层decode去掉就可以的

@JJY0710
Copy link

JJY0710 commented Sep 28, 2022

用 官方的方式导出python export.py --weights yolov5s.pt --include torchscript onnx 里面包含了yolo层的,而我的仓库里的代码是默认onnx文件里不包含yolo层的,把代码里的yolo层decode去掉就可以的

请问deocde在哪呢,yolo.py里面没找到decode

@smith-jianbo
Copy link

用 官方的方式导出python export.py --weights yolov5s.pt --include torchscript onnx 里面包含了yolo层的,而我的仓库里的代码是默认onnx文件里不包含yolo层的,把代码里的yolo层decode去掉就可以的

请教一下,opencv c++版本的具体怎么修改呢

@y-jt
Copy link

y-jt commented Apr 25, 2023

#5 (comment)
你只用把,大概170多行
{
//float cx = (pdata[0] * 2.f - 0.5f + j) * stride; ///cx
//float cy = (pdata[1] * 2.f - 0.5f + i) * stride; ///cy
//float w = powf(pdata[2] * 2.f, 2.f) * anchor_w; ///w
//float h = powf(pdata[3] * 2.f, 2.f) * anchor_h; ///h
}
这段代码替换成
{
float cx = pdata[0];
float cy = pdata[1];
float w = pdata[2];
float h = pdata[3];
}

@hpc203
Copy link
Owner

hpc203 commented Apr 25, 2023 via email

@chengdashia
Copy link

用 官方的方式导出python export.py --weights yolov5s.pt --include torchscript onnx 里面包含了yolo层的,而我的仓库里的代码是默认onnx文件里不包含yolo层的,把代码里的yolo层decode去掉就可以的

请问deocde在哪呢,yolo.py里面没找到decode

请问最后解决了吗?

@chengdashia
Copy link

请问您具体注释了哪些代码?我也出现了box坐标为负数的情况,期待您的回复

请问您最后解决了吗?我也出现了box坐标为负数的情况,期待您的回复

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

7 participants