예제 #1
0
        public static async Task <FriesOrNotFriesModel> CreateFromStreamAsync(IRandomAccessStreamReference stream)
        {
            FriesOrNotFriesModel learningModel = new FriesOrNotFriesModel();

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

            learningModel.session = new LearningModelSession(learningModel.model);
            learningModel.binding = new LearningModelBinding(learningModel.session);
            return(learningModel);
        }
예제 #2
0
        private async Task InitializeModelAsync()
        {
            if (_model != null)
            {
                return;
            }

            var onnx = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/FriesOrNotFries.onnx"));

            _model = await FriesOrNotFriesModel.CreateFromStreamAsync(onnx);
        }