Buenas !

Hoy va un post rápido. Y es del tipo de ayuda mental, ya que siempre que tengo que mostrar información relacionada a proceso de frames por segundo, tengo que buscar en mis aplicaciones anteriores.

En este caso agregare esta información al reconocimiento de imágenes con un modelo Onnx exportado desde Custom Vision. En la UWP app que he creado en post anteriores, mostrare un label con la fecha y hora, e información de FPS.

01 custom vision uwp frame analysis using onnx fps

El código es muy simple, especial detalle a la linea 10


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();
});
}

view raw

CVOnnxFps.cs

hosted with ❤ by GitHub

Brain Backup done!

The full app can be seen in https://github.com/elbruno/events/tree/master/2019%2001%2010%20CodeMash%20CustomVision/CSharp/CustomVisionMarvelConsole01

Happy Coding!

Saludos @ Burlington

El Bruno

References

My Posts

Windows 10 and YOLOV2 for Object Detection Series

Leave a comment

Discover more from El Bruno

Subscribe now to keep reading and get access to the full archive.

Continue reading