yolov3 to onnx is the same as the original torch prediction

1. What I want to do: Convert the pth model of yolov3 to onnx, and call it with opencv
. 2. Reason: I hope not to introduce a deep learning framework, and whoever compiles tensorflow understands! And the package file will be small


Method : 1. Refer to the idea of ​​the great god: rewrite the output of the three feature maps of yolov3, the output format is xyxy, and the
upsample is rewritten with transposed convolution 2. When yolov3 is trained, use the new network to train normally, and when testing np.concatenate the output of the three feature maps to predict, the two results have been verified to be the same
3. What I want to do: convert the pth model output by the network to onnx, and predict the onnx model
4. Question: onnx prediction results and 3 is different, the results are the same where the frames are sparse, and there are more frames where the frames are denser, and the conf from onnx will be larger than the conf from 3.
Update on March 25, 2021:
encounter 4 this problem from nms When considering it, this is a typical nms problem!
I have this problem because the iou on the nms side of the yolov3 network is giou, and the original iou written in numpy on the onnx side is the same after changing it to giou!

Guess you like

Origin blog.csdn.net/weixin_43868576/article/details/115217278