BobLd / YOLOv4MLNet

Use the YOLO v4 and v5 (ONNX) models for object detection in C# using ML.Net
MIT License
79 stars 31 forks source link

Running YoloV5 Onnx with multiple outputs #9

Closed afisk closed 3 years ago

afisk commented 3 years ago

I have a YoloV5 Onnx model with 4 outputs, however I can only use a single output at a time. If I try reading in all 3 in my YoloV4Prediction.cs class, I get 'Parameter is not valid' when I run predictionEngine.Predict( .. ); in Program.cs. Any ideas on how I can use all 3 output classes at the same time? { "output", new[] { 1, 25200, 8 } }, { "445", new[] { 1, 3, 80, 80, 8 } }, { "506", new[] { 1, 3, 40, 40, 8 } }, { "567", new[] { 1, 3, 20, 20, 8 } },

BobLd commented 3 years ago

Hi,

Before going any further, can you confirm you had a look at the following:

Also, can you make sure your output layers names match the names in the code?

afisk commented 3 years ago

@BobLd YOU ARE AMAZING!!!!!!!!!!!!

the https://github.com/BobLd/YOLOv4MLNet/tree/yolo-v5-incl link made this super super easy. I changed a couple things and it worked like a charm! Thank you Thank you Thank you. I've been looking at this stuff for a couple of days. THANK YOU SOOOOO MUCH!!!!!

BobLd commented 3 years ago

My pleasure. Thanks to @raulsf6 too