Skip to content

Instantly share code, notes, and snippets.

@elbruno
Created January 28, 2019 02:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elbruno/6ff51a14f71113944dc850a9c9374707 to your computer and use it in GitHub Desktop.
Save elbruno/6ff51a14f71113944dc850a9c9374707 to your computer and use it in GitHub Desktop.
CVOnnxFps.cs
private Stopwatch _stopwatch;
private async Task LoadAndEvaluateModelAsync(VideoFrame videoFrame)
{
_stopwatch = Stopwatch.StartNew();
_predictions = await _objectDetection.PredictImageAsync(videoFrame);
_stopwatch.Stop();
await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
var message = $"{DateTime.Now.ToLongTimeString()} - {1000f / _stopwatch.ElapsedMilliseconds,4:f1} fps";
TextBlockResults.Text = message; DrawFrames();
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment