Exemplo n.º 1
0
        public static async Task <MyCustomVisionModel> CreateMyCustomVisionModel(StorageFile file)
        {
            LearningModelPreview learningModel = await LearningModelPreview.LoadModelFromStorageFileAsync(file);

            MyCustomVisionModel model = new MyCustomVisionModel();

            model.learningModel = learningModel;
            return(model);
        }
Exemplo n.º 2
0
        private async Task LoadModelAsync()
        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => StatusText.Text = $"Loading {_modelFileName}");

            var modelFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri($"ms-appx:///Assets/{_modelFileName}"));

            _model = await MyCustomVisionModel.CreateMyCustomVisionModel(modelFile);

            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => StatusText.Text = $"Loaded {_modelFileName}");
        }