Example #1
0
        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);
        }
Example #2
0
        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];
        }