-
Hello, I have trained a YOLOv5 model using custom dataset and exported to ONNX. It took a little while to discover the idiosyncrasies of the YOLOv5 model output but I have it working now in Python and performance is very good, however I need to have it working in C#. Even though I am using the same ORT version, the same model and the same image input I am not getting quality results in C#. The problem must be something simple with image input or with result interpretation, but I have not been able to discover what that is. My C# code is here, I have been trying multiple things:
Thank you for any help |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I have discovered the problem. There was 2 problems, The first problem was that the image pixels need to be normalised to values between 0 and 1 by /255f. The other problem was that the confidences don't need to be scaled with sigmoid. As soon as I took that out of the C# program started working the same as the Python program. the final C# code was:
|
Beta Was this translation helpful? Give feedback.
I have discovered the problem. There was 2 problems, The first problem was that the image pixels need to be normalised to values between 0 and 1 by /255f.
The other problem was that the confidences don't need to be scaled with sigmoid. As soon as I took that out of the C# program started working the same as the Python program.
the final C# code was: