public static async Task <celebrityModel> CreateFromStreamAsync(IRandomAccessStreamReference stream) { celebrityModel learningModel = new celebrityModel(); learningModel.model = await LearningModel.LoadFromStreamAsync(stream); learningModel.session = new LearningModelSession(learningModel.model); learningModel.binding = new LearningModelBinding(learningModel.session); return(learningModel); }
private async void LoadModel() { StorageFile modelFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri($"ms-appx:///Assets/celebrity.onnx")); modelGen = await celebrityModel.CreateFromStreamAsync(modelFile as IRandomAccessStreamReference); }