#OpenSource – Microsoft anuncia que ofrece la calculadora de Windows en modo Open Sources, y el source code es lo menos importante del anuncio

Buenas !

Hace un par de días, Microsoft anunció que ofrecería el código fuente de la calculadora de Windows en modo Open Source.

Official Blog Post, Announcing the Open Sourcing of Windows Calculator

Como era de esperar, hubo muchas opiniones diferentes. Hay que incluir a los [haters tiempo completo] que empezaron a soltar argumentos como: “esto es una vergüenza, no es suficiente“,  o “esto es una broma, liberar el código fuente de una app tan simple como la calculadora“.

calculator W10

Dejando de lado, esas opiniones haters sin fundamento, hay que leer entre lineas para darse cuenta que hay varios puntos muy importantes detrás de este anuncio.

Comencemos por el código fuente, disponible en Github bajo la licencia MIT, esto de por si es genial. Sin embargo, si has estudiado o aprendido a programar, es muy probable que en algún momento de tu carrera, hayas creado una calculadora. Es casi el 2do paso obligatorio después del Hello World, en mi caso la programé en Pascal, hace muchos pero muchos años.

Lo que seguramente no has hecho, cuando programaste tu calculadora, fue agregar telemetría de uso a la misma. Y, aunque no lo parezca, detrás de la calculadora de Windows, hay mucha información de telemetría. Este es un excelente ejemplo para comenzar a comprender como agregar telemetría a una aplicación. Inclusive si tomamos como referencia a una aplicación simple como la calculadora de Windows (sin ofender). Si además te aburres, puedes invertir un par de minutos en leer Microsoft Privacy Statement, un documento muy divertido para comprender como Microsoft maneja tu información personal.

Otro punto a importante a tener en cuenta en este anuncio, es la posibilidad de comenzar a comprender como se maneja un producto. Una vez más, inclusive uno tan “simple” como la calculadora de Windows. Tener acceso a los pasos necesarios para gestionar las Features por cada Release (Feature Process steps), o inclusive ver como el tablero Kanban de features es publico para los colaboradores del grupo, es un excelente recurso de aprendizaje.

calculator github feature tracking

Y sin olvidar, que la Calculadora es una Universal Windows Platform App, así que también esta la oportunidad de aprender un poco de desarrollo de Apps para Windows 10, Xaml, y conceptos de Fluent App Design !

Happy coding!

Saludos @ Burlington

El Bruno

References

#OpenSource – Microsoft open sources the Calculator, and the app is the less important part of this

Hi !

A couple of days ago Microsoft announced that they open sourced the Windows Calculator.

Official Blog Post, Announcing the Open Sourcing of Windows Calculator

And there were a lot of mixed opinions (as usual) about this. Of course, we have the [full time haters] with some arguments like, this is not enough or this is a joke, a so simple app.

calculator W10

However if you read between the lines, there are a couple of very important topics here, which are not related to the calculator at all.

Let’s start with the source code. It’s all available in Github under the MIT licence, and that’s great. If you ever studying CS, you probably already code a calculator, so there is nothing new here. Mine was in Pascal, a long time ago.

But, and this is a bit [But], I don’t think you never added Telemetry to your calculator. And this is the Windows Calculator, there is a lot of telemetry here. You can start to understand how to add Telemetry in a “simple App” (no offense here, please). So, as a bonus, you get access to this information. And if you are very bored, you may want to read the Microsoft Privacy Statement. A nice document around how Microsoft manage personal data.

The 2nd topic which you may learn from the Calculator, is how to manage a product. Again, the source code here is the less important part. But have access to the Feature Process steps, or even to the Feature Tracking Kanban, will give you a sense on how to work with product features, understand releases, and more.

calculator github feature tracking

And finally, this is a Universal Windows Platform App, so there is a huge opportunity here to learn Xaml, and it seems that there is some Fluent App Design concept around here. I’m assuming the conversation behind the app, should be amazing!

Happy coding!

Greetings @ Burlington

El Bruno

References

#Event – Materiales utilizados en la sesión [Getting Started with Machine Learning.Net & Windows Machine Learning] con el grupo de usuarios GLUG

Buenas!

Es momento de otro post para compartir los materiales utilizados durante la sesión con el grupo de usuarios GLUGnet User Group for .NET, Web, Mobile, Database. Especial agradecimiento para Joe Kunk (@JoeKunk) y a los asistentes al webcast vía Google Hangouts. Por cierto, la sesión fue con los materiales actualizados a la version 0.10 de ML.NetÑ Windows ML and Machine Learning.Net.

Como siempre, aquí están las slides.

Source Code GitHub https://github.com/elbruno/events/tree/master/2019%2002%2021%20GLUG%20NetUG%20MLNet

Y algunos links que comenté durante la sesión:

Resources

Happy Coding!

Saludos @ Toronto

El Bruno

#Event – Resources for the session [Getting Started with Machine Learning.Net & Windows Machine Learning] on the GLUG .Net User Group

Hi!

Another post-event post, this time with a big thanks to Joe Kunk (@JoeKunk) and to all the members of the GLUGnet User Group for .NET, Web, Mobile, Database. We had an amazing time, via Google Hangouts in the session about Windows ML and Machine Learning.Net.

As usual, now it’s time to share slides, code and more.

Source Code GitHub https://github.com/elbruno/events/tree/master/2019%2002%2021%20GLUG%20NetUG%20MLNet

And some Machine Learning.Net resources:

Resources

Greetings @ Toronto

El Bruno

#Event – Resources used on my session at the largest Canada makeathon: @MakeUofT [How a PoC at home can scale to Enterprise Level using #CustomVision APIs]

2019 02 16 MakeUofT Custom Vision Bruno

Hi !

What an amazing time at the Canadian Largest Makeathon: MakeUofT (https://ieee.utoronto.ca/makeuoft/). The event, people and ideas are great. And now it’s time to share some of the materials used during my session

How a PoC at home can scale to Enterprise Level using Custom Vision APIs

It all started with a DIY project to use Computer Vision for security cameras at home. A custom Machine Learning model is the core component used to analyze pictures to detect people, animals and more in a house environment. The AI processing is performed at the edge, in dedicated hardware and the collected information is stored in the cloud.

The same idea can be applied to several CCTV scenarios, like parking lots, train stations, malls and more. However, moving this into enterprise scale brings a set of challenges, which are going to be described and explained in this session.

These are the slides I’ve used

And the source code is available here

https://github.com/elbruno/events/tree/master/2019%2002%2016%20MakeUofT%20Custom%20Vision

In the source code you can find the console and Windows 10 app samples I’ve coded live and also the exported images of my custom vision demo project in windows, linux and raspberry pi flavors. The 3rd one is where I spent some time updating the original linux one to work on the small device.

And as usual a couple of interesting links

Greetings @ Toronto

El Bruno

#WinML – #CustomVision, reconocimiento de objectos utilizando Onnx en Windows10, calculando FPS

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

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

#WinML – #CustomVision, object recognition using Onnx in Windows10, calculate FPS

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

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

#Onnx – Reconocimiento de objetos con #CustomVision y ONNX desde aplicaciones Windows 10 con Windows ML, Frames de objetos detectados

Buenas !

Custom Vision nos permite crear modelos de reconocimiento de objetos. Una vez entrenados estos modelos, podemos analizar una imagen y el modelo nos ofrecerá como respuesta

  • Una lista de objetos [Tags] detectados en cada imagen
  • Para cada Tag tendremos también la probabilidad [score] asociado al mismo y una serie de valores numéricos con la posición del objeto encontrado dentro de la imagen analizada

En posts anteriores escribí sobre como realizar el análisis de objetos desde el feed de una WebCam en una aplicación Windows 10. El siguiente paso es mostrar el Frame del objeto reconocido.

01 custom vision analysis and draw frame

El siguiente código muestra un ejemplo sobre como mostrar los frames en la Windows 10 App utilizando un Canvas. Las 2 funciones principales son

  • DrawFrames() donde realizado una iteración sobre las predicciones realizadas
  • DrawFrame() esta es la función que se encarga de dibujar el Frame en tiempo real. Hay un poco de matemáticas en la misma para ajustar los valores de ONNX al tamaño real del Canvas y de la WebCam.

Por ejemplo, estos son los valores con los que trabajo en un tag de Iron Fist en la imagen de este post.

  • El tamaño del Canvas es de ActualWidth: 1356, ActualHeight: 700
  • Los valores que retorna ONNX son Top: 20.80284, Left: 73.15757, Height: 54.41817, Width: 24.3813
  • El Frame a mostrar se dibujará con los siguientes valores Y: 140, x: 989, Height: 378, Width: 325

En siguientes posts comentare detalles finales sobre como medir el tiempo de procesamiento y otros tips más.

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

#Onnx – Object recognition with #CustomVision and ONNX in Windows applications using Windows ML, drawing frames

Hi !

Custom Vision Allows us to create models of Object recognition. Once these models are trained, we can analyze an image and the model will offer us as an answer

  • A list of [Tags] objects detected in each image
  • For each TAG we will also have the probability [score] associated with it and a series of numerical values with the position of the object found within the analyzed image

In previous posts I wrote about how to perform object analysis from the feed From a Webcam In a Windows 10 application. The next step is to show the Frame of the recognized object.

01 custom vision analysis and draw frame

The following code shows an example of how to show the frames In the Windows 10 App using a Canvas. The 2 main functions are

  • DrawFrames(Where an iteration of the predictions made
  • DrawFrame() This is the function that takes care of drawing the Frame in real time. There’s a little bit of math in it to adjust the ONNX values to the actual size of the Canvas and the Webcam.

For example, these are the values that I work with in a tag of Iron Fist In the image of this post.

  • The Canvas size is Actual Width: 1356, Actual Height: 700
  • The values returned by ONNX prediction process are Top: 20.80284, Left: 73.15757, Height: 54.41817, Width: 24.3813
  • The Frame To show will be drawn with the following values Y: 140, x: 989, Height: 378, Width: 325

In following posts I’ll comment on final details on how to measure processing time and other tips.

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

#Onnx – Object recognition with #CustomVision and ONNX in Windows applications using Windows ML

Hi!

One of the most interesting options that gives us Custom Vision, is the ability to export a model trained to be used on other platforms, without invoking Custom Vision own web service.

The 4 options available that we have today are

  • CoreML, iOS 11
  • TensorFlow, Android
  • ONNX, Windows ML
  • DockerFile, Azure IoT Edge, Azure Functions, AzureML

cv marvel export to ios tensorflow onnx dockerfile

I’ll share my experiences using the ONNX exported models being used in a Windows 10 Universal App.

The first thing we have to know is the version of Windows 10 with which we will work, because at the time of export we will see that we have 2 options

  • ONNX 1.0 for Windows 10 lower than 17738
  • ONNX 1.2 for Windows 10 higher than 17738

I am currently working with Win10 18317, so my examples will be for the ONNX version 1.2. The exported file is a zip that internally has the following files

  • CSharp\ObjectDetection.cs
  • python\cntk_predict.py
  • python\object_detection.py
  • labels.txt
  • model.onnx

The directories CSharp and Python have sample files to use the model with these languages. The file [labels.txt] contains the labels defined in the model, and finally the ONNX file is the model per se.

custom vision marvel onnx 1.2 exported files

For this example, I will use a blank App UWP with the following features

  • Added package NuGet Microsoft.Toolkit.Uwp.UI. Controls
  • Using the same, to access the webcam at the beginning of the app
  • We process each of the frames That are received from the webcam

Sample Code

At this point, we can now use our exported model to analyze images. We must add the file ONNX to our project, and configure the same to be a content and to be copied to the output build of our application.

An important detail here, is that if you have [Visual Studio Tools for AI] installed in Visual Studio, when you add this file the extension will automatically add a CS class to use with the model.  This class requires a lot of work to work, I recommend deleting it, as we will use as a base that is exported from Custom Vision, [ObjectDetection.cs].

custom vision marvel add onnx file to solution in vs

The file [ObjectDetection.cs] contains everything you need to use our model In a UWP App. At the start of the App we initialize the ONNX model, and in each Frame That is received from the camera will process the same to show the results in the window of Debug.

Now, for our app Work properly, you have to make a series of changes to the file [ObjectDetection.cs]. The changes are mainly related to the way in which WinML Processes the output when analyzing an image:

custom vision marvel uwp app running and analyzing

To be able to work this way, I added a new binding To process the output of the processing. This binding Respects the contract of ONNX with an array Long [1, 4].

This way we have no mistake of those “funny” that make you spend pleasant moments.

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