You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
onnxExporting ONNX models or loading ONNX modelsP2Priority of the issue for triage purpose: Needs to be fixed at some point.questionFurther information is requested
3.) OnnxModelScorer.cs
public struct TinyYoloModelSettings
{
public const string ModelInput = "input_1";
public const string ModelOutput = "yolonms_layer_1/ExpandDims_3:0";
}
.
.
.
var pipeline = mlContext.Transforms.LoadImages(outputColumnName: "image", imageFolder: "", inputColumnName: nameof(ImageNetData.ImagePath))
.Append(mlContext.Transforms.ResizeImages(outputColumnName: "image", imageWidth: ImageNetSettings.imageWidth, imageHeight: ImageNetSettings.imageHeight, inputColumnName: "input_1"))
.Append(mlContext.Transforms.ExtractPixels(outputColumnName: "image"))
.Append(mlContext.Transforms.ApplyOnnxModel(modelFile: modelLocation, outputColumnNames: new[] { TinyYoloModelSettings.ModelOutput }, inputColumnNames: new[] { TinyYoloModelSettings.ModelInput }));
.
.
.
public static void Main()
{
var assetsRelativePath = @"../../../assets";
string assetsPath = GetAbsolutePath(assetsRelativePath);
var modelFilePath = Path.Combine(assetsPath, "Model", "yolov3.onnx");
var imagesFolder = Path.Combine(assetsPath, "images");
var outputFolder = Path.Combine(assetsPath, "images", "output");
Also, how should I carry out the Preprocessing and Postprocessing steps?
The text was updated successfully, but these errors were encountered:
mstfbl
added
P2
Priority of the issue for triage purpose: Needs to be fixed at some point.
question
Further information is requested
labels
Jan 9, 2020
This might be an answer to your question, or introduce an additional question:
The YOLOv3 model you downloaded, has ONNX version 1.5 and operation set (opset) 10.
From this site, I assume that using that model will not work (yet).
I would also be interested in using YOLOv3 object detection in C#, so if someone knows how to get this to work, please react here.
onnxExporting ONNX models or loading ONNX modelsP2Priority of the issue for triage purpose: Needs to be fixed at some point.questionFurther information is requested
Hello
I'm working on the latest version of Visual Studio 2019 on Windows 10
I have tried to work on object detection using yolov3 model. The yolov3.onnx file has been downloaded from https://github.com/onnx/models/tree/master/vision/object_detection_segmentation/yolov3
Below is the snippet of the error shown on the console screen.
This is the image of the output.
The code is similar as used for object detection using tiny-yolov2. Following are the changes made in the code.
1.) ImageNetPrediction.cs file
public class ImageNetPrediction
{
[ColumnName("yolonms_layer_1/ExpandDims_3:0")]
public float[] PredictedLabels;
}
2.) YoloOutputParser.cs
public const int ROW_COUNT = 13;
public const int COL_COUNT = 13;
public const int CHANNEL_COUNT = 125;
public const int BOXES_PER_CELL = 5;
public const int BOX_INFO_FEATURE_COUNT = 5;
public const int CLASS_COUNT = 80;
public const float CELL_WIDTH = 32;
public const float CELL_HEIGHT = 32;
.
.
.
private string[] labels = new string[]
{
"person", "bicycle", "car", "motorbike", "aeroplane", "bus", "train", "truck", "boat", "traffic light", "fire hydrant", "stop sign", "parking meter", "bench", "bird", "cat", "dog",
"horse", "sheep", "cow", "elephant", "bear", "zebra", "giraffe", "backpack", "umbrella", "handbag", "tie", "suitcase", "frisbee", "skis", "snowboard", "sports ball", "kite",
"baseball bat", "baseball glove", "skateboard", "surfboard", "tennis racket", "bottle", "wine glass", "cup", "fork", "knife", "spoon", "bowl", "banana", "apple", "sandwich", "orange",
"broccoli", "carrot", "hot dog", "pizza", "donut", "cake", "chair", "sofa", "pottedplant", "bed", "diningtable", "toilet", "tvmonitor", "laptop", "mouse", "remote", "keyboard",
"cell phone", "microwave", "oven", "toaster", "sink", "refrigerator", "book", "clock", "vase", "scissors", "teddy bear", "hair drier", "toothbrush"
};
3.) OnnxModelScorer.cs
public struct TinyYoloModelSettings
{
public const string ModelInput = "input_1";
public const string ModelOutput = "yolonms_layer_1/ExpandDims_3:0";
}
.
.
.
var pipeline = mlContext.Transforms.LoadImages(outputColumnName: "image", imageFolder: "", inputColumnName: nameof(ImageNetData.ImagePath))
.Append(mlContext.Transforms.ResizeImages(outputColumnName: "image", imageWidth: ImageNetSettings.imageWidth, imageHeight: ImageNetSettings.imageHeight, inputColumnName: "input_1"))
.Append(mlContext.Transforms.ExtractPixels(outputColumnName: "image"))
.Append(mlContext.Transforms.ApplyOnnxModel(modelFile: modelLocation, outputColumnNames: new[] { TinyYoloModelSettings.ModelOutput }, inputColumnNames: new[] { TinyYoloModelSettings.ModelInput }));
.
.
.
public static void Main()
{
var assetsRelativePath = @"../../../assets";
string assetsPath = GetAbsolutePath(assetsRelativePath);
var modelFilePath = Path.Combine(assetsPath, "Model", "yolov3.onnx");
var imagesFolder = Path.Combine(assetsPath, "images");
var outputFolder = Path.Combine(assetsPath, "images", "output");
Also, how should I carry out the Preprocessing and Postprocessing steps?
The text was updated successfully, but these errors were encountered: