Click here to Skip to main content
15,031,495 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hello,
i have a question about yolov3
when i use ML.NET 1.4 for image object detection

What I have tried:

i study ML.NET sample:https://github.com/dotnet/machinelearning-samples/tree/master/samples/csharp/getting-started/DeepLearning_ObjectDetection_Onnx

and modify pipline for yolov3 input and ouput
C#
var pipeline = mlContext.Transforms.LoadImages("input_1", "", nameof(ImageNetData.ImagePath))
                .Append(mlContext.Transforms.ResizeImages("input_1", ImageNetSettings.imageWidth, ImageNetSettings.imageHeight, "input_1"))
                .Append(mlContext.Transforms.ExtractPixels("input_1"))
                .Append(mlContext.Transforms.ApplyOnnxModel(modelFile: modelLocation, outputColumnNames: new[]
                {
                    "yolonms_layer_1/ExpandDims_1:0",
                    "yolonms_layer_1/ExpandDims_3:0",
                    "yolonms_layer_1/concat_2:0"
                }, inputColumnNames: new[] {"input_1"}));


when i predict data, i dont know how to modify three output ids,
because this method only accept one input arg
C#
var scoredData = model.Transform(testData);

            IEnumerable<float[]> probabilities =
                scoredData.GetColumn<float[]>("yolonms_layer_1/concat_2:0").ToList();


yolov3 onnx model download from https://github.com/onnx/models
and use Netron to get output layers

please give me some guidance, thank you all very much!
Posted
Updated 24-Oct-20 1:09am
v6

Hello, I faced the same issue as you...
Did you find a solution for it?
   
Comments
mx117eva007 15-Dec-19 2:21am
   
i didn't find the solution ...
.Append(mlContext.Transforms.ApplyOnnxModel(modelFile: modelLocation, outputColumnNames: new[] { "yolonms_layer_1/ExpandDims_1:0",
"yolonms_layer_1/ExpandDims_3:0",
"yolonms_layer_1/concat_2:0" }, inputColumnNames: new[] { "input_1" }))
.Append(mlContext.Transforms.Concatenate("outputs", new[] { "yolonms_layer_1/ExpandDims_1:0",
"yolonms_layer_1/ExpandDims_3:0",
"yolonms_layer_1/concat_2:0" }));

IEnumerable<float[]> probabilities =
scoredData.GetColumn<float[]>("outputs").ToList();
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900