Hi !

Quick post today. And it’s mostly as a brain reminder on the best way to perform a Frames Per Second calculation when we are analyzing images using a ONNX model. In the final UWP app, I added a top right label displaying the current date and time, and the processed FPS

01 custom vision uwp frame analysis using onnx fps

And the code behind all this is very simple, specially line 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

So, I’ll search for my sample next time I need to display this.

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

Happy Coding!

Greetings @ Burlington

El Bruno

References

My Posts

Windows 10 and YOLOV2 for Object Detection Series

25 responses to “#WinML – #CustomVision, object recognition using Onnx in Windows10, calculate FPS”

  1. […] Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate F… […]

    Like

  2. […] Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate F… […]

    Like

  3. […] Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate F… […]

    Like

  4. […] Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate F… […]

    Like

  5. […] Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate F… […]

    Like

  6. […] Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate F… […]

    Like

  7. […] Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate F… […]

    Like

  8. […] Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate F… […]

    Like

  9. […] Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate F… […]

    Like

  10. […] Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate F… […]

    Like

  11. […] Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate F… […]

    Like

  12. […] Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate F… […]

    Like

  13. […] Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate F… […]

    Like

  14. […] Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate F… […]

    Like

  15. […] Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate F… […]

    Like

  16. […] Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate F… […]

    Like

  17. […] Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate F… […]

    Like

  18. […] Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate F… […]

    Like

  19. […] Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate F… […]

    Like

  20. […] Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate F… […]

    Like

  21. […] Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate F… […]

    Like

  22. […] Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate F… […]

    Like

  23. […] Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate F… […]

    Like

  24. […] Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate F… […]

    Like

  25. […] Object recognition with Custom Vision and ONNX in Windows applications using Windows ML, calculate F… […]

    Like

Leave a reply to #Docker – Average response times using a CustomVision.ai docker container in a #RaspberryPi and a PC – El Bruno Cancel reply

Discover more from El Bruno

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

Continue reading