예제 #1
0
        private async void LoadModel()
        {
            Uri         uri = new Uri("ms-appx:///Assets/mnist.onnx");
            StorageFile stf = await StorageFile.GetFileFromApplicationUriAsync(uri);

            modelGen = await mnistModel.CreateFromStreamAsync(stf as IRandomAccessStreamReference);
        }
예제 #2
0
        private async Task LoadModelAsync()
        {
            //Load a machine learning model
            StorageFile modelFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri($"ms-appx:///Assets/mnist.onnx"));

            ModelGen = await mnistModel.CreateFromStreamAsync(modelFile as IRandomAccessStreamReference);
        }
예제 #3
0
        public static async Task <mnistModel> CreateFromStreamAsync(IRandomAccessStreamReference stream)
        {
            mnistModel learningModel = new mnistModel();

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

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