Ejemplo n.º 1
0
        private async void InitializeModel()
        {
            string      modelPath = @"ms-appx:///Assets/FER_Emotion_Recognition.onnx";
            StorageFile modelFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri(modelPath));

            model = await FER_Emotion_RecognitionModel.CreateFromStreamAsync(modelFile);
        }
        public static async Task <FER_Emotion_RecognitionModel> CreateFromStreamAsync(IRandomAccessStreamReference stream)
        {
            FER_Emotion_RecognitionModel learningModel = new FER_Emotion_RecognitionModel();

            learningModel.model = await LearningModel.LoadFromStreamAsync(stream);

            learningModel.session = new LearningModelSession(learningModel.model);
            learningModel.binding = new LearningModelBinding(learningModel.session);
            return(learningModel);
        }