itsnine / yolov5-onnxruntime

YOLOv5 ONNX Runtime C++ inference code.
247 stars 58 forks source link

I encountered a bug in detect #3

Closed p110120p1 closed 3 years ago

p110120p1 commented 3 years ago

Hello, when I used the same onnx model to detect the original yolov5 project and this project, I encountered the problem of different results. The original yolov5 project category result is correct, but only part of the category of this project is correct, the recognition box The same, but the confidence level is also different. How to solve this problem?

itsnine commented 3 years ago

@p110120p1 hi, I'll check it a bit later, when I have time for that

p110120p1 commented 3 years ago

@itsnine OK, thank you.

itsnine commented 3 years ago

@p110120p1 sorry for the late answer, I reproduced the problem. I haven't solved this problem yet, because I don't really know the cause of it, probably it could be operations with floating point values in c++, for example, the letterbox function returns visually the same resized image as in python, but the models output for that image is a bit different, even boxes coordinates. Note that PyTorch and ONNXRuntime results are not the same even in Python.

p110120p1 commented 3 years ago

@itsnine Well, it seems possible that this problem is due to differences in the underlying programming language, and thank you for taking the time to try to fix it

itsnine commented 2 years ago

@p110120p1 hi, there was a bug with color conversion, I accidentally used BGR format to detect and I fixed that so in C++ and Python the ONNXRuntime result should be the same now.

p110120p1 commented 2 years ago

@itsnine Okay, that's great. Thanks for taking the bug out of your busy schedule