Skr20200701

Results 6 comments of Skr20200701

I had the same problem。。RTX A6000

I encountered the same problem after modifying the common.py file, and the prediction boxes were all wrong.

我把app/src/main/cpp/Yolov5.cpp中预测框中心点(cx,cy)坐标乘了4倍,(w,h)分别乘以6倍和3.5倍,预测结果貌似凑对了,不知道能不能这样修改。。请指教 ![image](https://user-images.githubusercontent.com/67671719/88358682-87811080-cda2-11ea-8fe7-fe368ed20fb3.png)

> > 我把APP/src/Main/cpp/yolov5.cpp中预测框中心点(Cx,Cy)坐标乘了4倍,(w,h)分别乘以6倍和3.5倍,预测结果貌似凑对了,不知道能不能这样修改.请指教 > > ![image](https://user-images.githubusercontent.com/67671719/88358682-87811080-cda2-11ea-8fe7-fe368ed20fb3.png) > > 你是只是测试了几张图片吗?我做了类似的操作,有的图像可以,但是有的图像就会有较大的偏差 对,我就测试几张,我这个方法是不行,还是的找其他正规方法的

Hello, did you use convolution operation instead of slicing operation to solve this problem? Does this require retraining? @kadebudongtan

你好,我解决了自己训练的模型,部署时预测框都在左上角不对的问题了。 【1】在导出onnx模型时,common.py删除切片操作还是采用的return self.conv(torch.cat([x,x,x,x], 1))替代。然后export.py导出模型时,输入大小改为训练模型时的一半,如输入大小640时为[320, 320] ![image](https://user-images.githubusercontent.com/67671719/89187394-d1060280-d5cf-11ea-94b0-5058bd7ff863.png) ![image](https://user-images.githubusercontent.com/67671719/89188048-b1bba500-d5d0-11ea-8957-cd5323dd4c18.png) 【2】预测框不对是因为YoloV5.h文件中,预测层没有根据自己模型指定对,原来的是“394,“375,“output”这3层输出,可以根据Netron查看自己模型的3个预测层修改,我的是“output”,“423”,“442”,然后预测框正确。 ![image](https://user-images.githubusercontent.com/67671719/89188519-5c33c800-d5d1-11ea-9d69-9be395769f23.png) ![image](https://user-images.githubusercontent.com/67671719/89186746-cf880a80-d5ce-11ea-91e9-47f18a203e43.png) 感谢之前各位大佬的回答和分享!