Example #1
0
        public async Task <CNTKGraphModelOutput> EvaluateAsync(CNTKGraphModelInput input)
        {
            CNTKGraphModelOutput        output  = new CNTKGraphModelOutput();
            LearningModelBindingPreview binding = new LearningModelBindingPreview(learningModel);

            binding.Bind("Input338", input.Input338);
            binding.Bind("Plus692_Output_0", output.Plus692_Output_0);
            LearningModelEvaluationResultPreview evalResult = await learningModel.EvaluateAsync(binding, string.Empty);

            return(output);
        }
        private async void CameraHelper_FrameArrived(object sender, Microsoft.Toolkit.Uwp.Helpers.FrameEventArgs e)
        {
            try
            {
                var input = new CNTKGraphModelInput()
                {
                    Input338 = e.VideoFrame
                };
                var output = await _model.EvaluateAsync(input);

                var max   = output.Plus692_Output_0.Max();
                var index = output.Plus692_Output_0.IndexOf(max);
                var text  = $"{_emotions[index]}";
                Update(text);
            }
            catch (Exception exception)
            {
                //kill the exception
            }
        }