private async Task LoadFaceLandmarkModelAsync() { //Load a machine learning model StorageFile modelFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri($"ms-appx:///Assets/Models/landmark_detection_56_se_external.onnx")); landmarkModelGen = await LandmarkModel.CreateFromStreamAsync(modelFile as IRandomAccessStreamReference); }
public static async Task <LandmarkModel> CreateFromStreamAsync(IRandomAccessStreamReference stream) { LandmarkModel learningModel = new LandmarkModel(); learningModel.model = await LearningModel.LoadFromStreamAsync(stream); learningModel.session = new LearningModelSession(learningModel.model); learningModel.binding = new LearningModelBinding(learningModel.session); return(learningModel); }