public static async Task <JacketModel> CreateModel(StorageFile file) { LearningModelPreview learningModel = await LearningModelPreview.LoadModelFromStorageFileAsync(file); JacketModel model = new JacketModel(); model.learningModel = learningModel; return(model); }
protected async override void OnNavigatedTo(NavigationEventArgs e) { var appInstalledFolder = Windows.ApplicationModel.Package.Current.InstalledLocation; var modelFolder = await appInstalledFolder.GetFolderAsync("Models"); var modelFile = await modelFolder.GetFileAsync("jacket_model.onnx"); model = await JacketModel.CreateModel(modelFile); base.OnNavigatedTo(e); }