public async Task <ArtCriticOutput> EvaluateAsync(ArtCriticInput input) { binding.Bind("data", input.data); var result = await session.EvaluateAsync(binding, "0"); var output = new ArtCriticOutput(); output.classLabel = result.Outputs["classLabel"] as TensorString; output.loss = result.Outputs["loss"] as IList <IDictionary <string, float> >; return(output); }
private async void recognizeButton_Click(object sender, RoutedEventArgs e) { //Bind model input with contents from InkCanvas VideoFrame vf = await helper.GetHandWrittenImage(inkGrid); ModelInput.data = ImageFeatureValue.CreateFromVideoFrame(vf); // Evaluate the model ModelOutput = await ModelGen.EvaluateAsync(ModelInput); //Display the results numberLabel.Text = ModelOutput.classLabel.GetAsVectorView()[0]; }