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); }
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); }