this tutorial doesn't work anymore with the new version of ONNX model 1.3,
please update documentation with the new "LearningModelSession" approach:
// create a binding object from the session
LearningModelBinding binding = new LearningModelBinding(_session);
//Bind model input with contents from InkCanvas
VideoFrame vf = await _helper.GetHandWrittenImage(inkGrid);
ImageFeatureValue imageTensor = ImageFeatureValue.CreateFromVideoFrame(vf);
binding.Bind("Input3", imageTensor);
//Evaluate the model
int ticks = Environment.TickCount;
// Process the frame with the model
var results = await _session.EvaluateAsync(binding, $"Run { ++_runCount } ");
ticks = Environment.TickCount - ticks;
string message = $"Run took { ticks } ticks";
// retrieve results from evaluation
var resultTensor = results.Outputs["Plus214_Output_0"] as TensorFloat;
var resultVector = resultTensor.GetAsVectorView();
IList<float> imageList = resultVector.ToList();
////Query to check for highest probability digit
var maxIndex = imageList.IndexOf(imageList.Max());
////Display the results
numberLabel.Text = maxIndex.ToString();
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
ID: 4db9595e-6600-0a29-1ec5-a105bc0f1cc7
Version Independent ID: bdbf508e-f549-44c4-7e74-91b52cce7250
This repo has changed significantly since this issue was first raised, and further changes are upcoming. As such, I'm going through and closing many of these stale issues which sat unassigned for a long while.
this tutorial doesn't work anymore with the new version of ONNX model 1.3, please update documentation with the new "LearningModelSession" approach:
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.