private async void Page_Loaded(object sender, RoutedEventArgs e) { StorageFile modelFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri($"ms-appx:///Assets/bear.onnx")); //model = await bearModel.CreateFromStreamAsync(modelFile); string labelsString = await File.ReadAllTextAsync("Assets/labels.txt"); var labels = labelsString.Split("\r\n"); model = new ObjectDetection(labels); await model.Init(modelFile); }
private async void Page_Loaded(object sender, RoutedEventArgs e) { StorageFile modelFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri($"ms-appx:///Assets/bear.onnx")); classificationModel = await bearModel.CreateFromStreamAsync(modelFile); StorageFile detectionFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri($"ms-appx:///Assets/bear-detection.onnx")); detectionModel = new ObjectDetection(new List <string> { "black bear", "brown bear", "polar bear" }); await detectionModel.Init(detectionFile); }