yolov5-lite-onnxruntime icon indicating copy to clipboard operation
yolov5-lite-onnxruntime copied to clipboard

c++demo 标定框是负数

Open defzhangaa opened this issue 1 year ago • 4 comments

我的c++标定框是负数,降了onnx版本也不行。

defzhangaa avatar Jun 12 '24 07:06 defzhangaa

已解决:除了issue #8 中提到了降低onnx版本,我参照了.py的代码,发现cpp demo中标定框计算有误,应将代码Line 233-241改为如下: float cx = (preds[0] - padw) * ratiow; ///cx float cy = (preds[1] - padh) * ratioh; ///cy float w = preds[2] * ratiow; ///w float h = preds[3] * ratioh; ///h

float xmin = (cx - 0.5 * w); float ymin = (cy - 0.5 * h); float xmax = (cx + 0.5 * w); float ymax = (cy + 0.5 * h);

defzhangaa avatar Jun 12 '24 08:06 defzhangaa

更新:这个代码也是有问题的,但是不知怎么解决了。。。

defzhangaa avatar Jun 12 '24 08:06 defzhangaa

@defzhangaa 不然你加我联系方式?讨论一下?V:pcycccccc

pcycccccc avatar Jun 12 '24 09:06 pcycccccc

@defzhangaa 不然你加我联系方式?讨论一下?V:pcycccccc

我更新了一下昨天的Code,发现改成上面这个就可以跑通了

defzhangaa avatar Jun 13 '24 06:06 defzhangaa