<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Emanuel Vecchio on Medium]]></title>
        <description><![CDATA[Stories by Emanuel Vecchio on Medium]]></description>
        <link>https://medium.com/@emanuel.vecchio?source=rss-15d201c14fc3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*LR0M4JwJckPT_4sf0gh8Jw.jpeg</url>
            <title>Stories by Emanuel Vecchio on Medium</title>
            <link>https://medium.com/@emanuel.vecchio?source=rss-15d201c14fc3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 23:12:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@emanuel.vecchio/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[AI made easy with Windows Machine Learning (Preview)]]></title>
            <link>https://medium.com/southworks/ai-made-easy-with-windows-machine-learning-preview-5a7547575b58?source=rss-15d201c14fc3------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a7547575b58</guid>
            <category><![CDATA[uwp]]></category>
            <category><![CDATA[onnx]]></category>
            <category><![CDATA[windows-10]]></category>
            <category><![CDATA[windows-machine-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Emanuel Vecchio]]></dc:creator>
            <pubDate>Wed, 14 Mar 2018 12:33:07 GMT</pubDate>
            <atom:updated>2018-03-23T11:46:56.630Z</atom:updated>
            <content:encoded><![CDATA[<h4>Testing Windows Machine Learning Preview through Emotion Recognition.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jeM1DZQQtAEsXoTUxOnPYQ.png" /></figure><p>The latest Windows 10 SDK Insider Preview -build 17110- comes with a new API known as <a href="https://docs.microsoft.com/en-gb/windows/uwp/machine-learning/"><em>Windows Machine Learning</em></a> that enable developers to load pretrained ONNX models, bind to its input/output tensors and perform predictions effortlessly on any DirectX 12 compatible GPU. Deploying AI systems on Windows has never been easier.</p><blockquote><strong>Open Neural Network Exchange Format</strong> -ONNX- enables models to be trained in one framework and transferred to another for inference. It is just a file format on top of <strong>protobuf </strong>which carries the computational graph, as well as all the parameters required for making predictions.</blockquote><p>Let’s see an example.</p><h3>Adding AI capabilities to an application</h3><p>This post demonstrates the use of generic <em>Windows.AI.MachineLearning</em> (Preview) API to load an <em>ONNX </em>model, bind it to an input image and an output tensor, and perform the evaluation. To keep the focus on the new features, we left out all additional <em>UWP </em>stuff.</p><p>The full sample can be obtained from <a href="https://github.com/southworkscom/WindowsML-Samples/tree/master/EmotionRecognition">GitHub</a> 👈. It uses the device’s camera to take a picture and feed the model.</p><h4>Prerequisites</h4><p>To run this sample you’ll need the following:</p><ul><li><a href="https://blogs.windows.com/windowsexperience/2018/02/27/announcing-windows-10-insider-preview-build-17110-fast">Windows 10 Insider Preview (Fast Ring) (build &gt;= 17110)</a></li><li><a href="https://www.microsoft.com/en-us/software-download/windowsinsiderpreviewSDK">Windows 10 SDK Insider Preview (build 17110)</a></li><li><a href="https://www.visualstudio.com/es/vs/preview/">Visual Studio 2017 Preview (15.6.1 Preview 1.0)</a></li></ul><blockquote>Notice that all tools are still on Preview, it’s not recommended to install them on productive systems.</blockquote><h4><strong>1. Create or Edit an existing UWP project</strong></h4><p>Open or create a new <em>UWP </em>project using <strong>Visual Studio 2017 Preview</strong> and make sure to select the target and minimum platform versions to: <em>Windows 10 Insider Preview (10.0; Build 17110)</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*86IU42lyUmGyTQ205TbDTQ.png" /></figure><h4><strong>2. Load the ONNX pretrained model into the Visual Studio project</strong></h4><p>Now, we need a pretrained model for the specific task we’ll be adding in our UWP project.</p><p>There is a <a href="https://github.com/onnx/models/tree/master/emotion_ferplus">pretrained</a> model for emotion recognition on the<em> onnx models repository</em>. Unfortunately, this model expects normalized input data. This will not work well with the <em>Windows Machine Learning SDK</em> since the API does not currently provide tools to do such kind of data pre-processing.</p><p>So, I trained a <a href="https://github.com/rnrneverdies/FERPlus/commit/a3d514595be2124fe2e9409545c41ef6c46ad053">slightly modified</a> version of the original <em>Microsoft\FERPlus</em> network that includes the normalization step into the model itself, thus creating a new model that directly accepts 64x64 gray scale images (i.e. without previous normalization).</p><p>Download the pretrained model from <a href="https://github.com/southworkscom/WindowsML-Samples/raw/master/EmotionRecognition/src/Assets/FERPlus.onnx"><strong>here</strong></a><strong>, </strong>then copy it into the <em>Assets</em> folder and rename it as <em>FERPlus.onnx</em> if needed.</p><h4>3. Add a class for loading the model and perform the inference</h4><p>Add a new class and name it <em>EmotionRecognizer. </em>Also, declare an auxiliary internal class named <em>Results</em> like the sample below, we will use it later for returning the predictions. Aditionally, declare the class variables: the model, the input image and the output tensor descriptors.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5a2e3ddf74c6f5536e0e80c854f0ca85/href">https://medium.com/media/5a2e3ddf74c6f5536e0e80c854f0ca85/href</a></iframe><p>2. Add the method responsible for loading the<em> FERPlus.onnx</em> model. This method also looks up the input and output variables that we’ll need latter for feeding the data into the model when performing the prediction.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9e12879dd6ec7068c8d13e683330436b/href">https://medium.com/media/9e12879dd6ec7068c8d13e683330436b/href</a></iframe><p>3. Finally, add the method that performs the inference/prediction. This example will return a <em>Result </em>object containing the likelihood of each emotion to be present on the picture’s face (the model assumes is receiving the image of a face).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ae2e9921b556c53a1798ad8e46b1c7cf/href">https://medium.com/media/ae2e9921b556c53a1798ad8e46b1c7cf/href</a></iframe><h4>4. Test the recognizer</h4><p>So far, we created our emotion recognizer. Now, to test it we first need to instantiate our class and invoke <strong><em>LoadModelAsync() </em></strong>once, then we need to invoke <strong><em>EvaluateAsync(..)</em></strong> with a <em>VideoFrame </em>as parameter every time we want to make a prediction. The <em>VideoFrame</em> is just a container for the image we want to evaluate.</p><p>Note that the model input receives a gray scale image of 64x64 pixels. You might want to create an image and feed it into the model. For best results, make sure the face dominates the image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*5Zmg0yOjGcJmqKeEuxkpKg.png" /></figure><p>You can also use the example on GitHub that uses the device’s camera to take pictures to then feed the model. The sample also contains a few useful methods to Crop, Scale down and Convert to gray scale the images taken through the camera.</p><p>Nevertheless, just in case you want to test the <em>EmotionRecognizer</em> directly loading an image from a file… here’s an example by using the <em>FileOpenPicker</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/09d68f984fedd37f28b7c11dab5c5c65/href">https://medium.com/media/09d68f984fedd37f28b7c11dab5c5c65/href</a></iframe><h3>Conclusions</h3><p>Although this technology is still under active development and needs to grow and mature, it is a big step forward in order to have a better ecosystem for easly deploying Machine Learning models into windows applications. Also, it would be great to have this feature available for other kind of .NET applications like ASP.NET or NET Core.</p><p>At the moment, we are looking forward to the next Windows 10 major update 🤞.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a7547575b58" width="1" height="1" alt=""><hr><p><a href="https://medium.com/southworks/ai-made-easy-with-windows-machine-learning-preview-5a7547575b58">AI made easy with Windows Machine Learning (Preview)</a> was originally published in <a href="https://medium.com/southworks">SOUTHWORKS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>