Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
UwpYoloLoadModel.cs
using System;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
namespace UwpAppYolo01
{
public sealed partial class MainPage : Page
{
private TinyYoloV2Model _model;
public MainPage()
{
InitializeComponent();
}
protected override async void OnNavigatedTo(NavigationEventArgs e)
{
LoadYoloOnnxModel();
await CameraPreview.StartAsync();
CameraPreview.CameraHelper.FrameArrived += CameraHelper_FrameArrived;
}
private async void LoadYoloOnnxModel()
{
var file = await Windows.Storage.StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Tiny-YOLOv2.onnx"));
_model = await TinyYoloV2Model.CreateTinyYoloV2Model(file); //,
}
private void CameraHelper_FrameArrived(object sender, Microsoft.Toolkit.Uwp.Helpers.FrameEventArgs e)
{
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment