In this repo, you will find sample apps that demonstrate how to use Windows ML to build machine learning applications, and tools that help verify models and troubleshoot issues during development on Windows 10.
For additional information on Windows ML, including step-by-step tutorials and how-to guides, please visit the Windows ML documentation.
- Visual Studio 2017 Version 15.7.4 or Newer
- Windows 10 - Build 17738 or higher
- Windows SDK - Build 17738 or higher
- FNSCandyStyleTransfer\UWP\cs: a UWP C# app that uses the FNS-Candy style transfer model to make a cool image.
- SqueezeNetObjectDetection\UWP\cs: a UWP C# app that uses the SqueezeNet model to detect the predominant object in an image.
- SqueezeNetObjectDetection\Desktop\cpp: a classic desktop C++/WinRT app that uses the SqueezeNet model to detect the predominant object in an image.
- MNIST\UWP\cs: a UWP C# app that uses the MNIST model to detect numberic characters.
- MNIST\UWP\cppcx: a UWP C++/CX app that uses the MNIST model to detect numberic characters.
- CustomTensorization: a Windows Console Application (C++/WinRT) that shows how to do custom tensorization.
- Emoji8: a UWP C# app that uses the FER Emotion model to evaluate how well the user's facial expressions match randomly selected emojis.
- PlaneIdentifier: a UWP app and a WPF app packaged with the Desktop Bridge, sharing the same model trained using Azure Custom Vision service. For step-by-step instructions for this sample, please see the blog post Upgrade your WinML application to the latest bits.
- WinMLRunner: a command-line tool that can run .onnx or .pb models where the input and output variables are tensors or images. It is a very handy tool to quickly validate an ONNX model. It will attempt to load, bind, and evaluate a model and print out helpful messages. It also captures performance measurements.
Using the samples
The easiest way to use these samples without using Git is to download the zip file containing the current version (using the following link or by clicking the "Download ZIP" button on the repo page). You can then unzip the entire archive and use the samples in Visual Studio 2017.
Notes: Before you unzip the archive, right-click it, select Properties, and then select Unblock. Be sure to unzip the entire archive, and not just individual samples. The samples all depend on the SharedContent folder in the archive. In Visual Studio 2017, the platform target defaults to ARM, so be sure to change that to x64 or x86 if you want to test on a non-ARM device.
Reminder: If you unzip individual samples, they will not build due to references to other portions of the ZIP file that were not unzipped. You must unzip the entire archive if you intend to build the samples.
- For issues, file a bug on GitHub Issues.
- Ask questions on Stack Overflow.
- Vote for popular feature requests on Windows Developer Feedback or include your own request.
- Requires ONNX v1.2 or higher.
- Supports F16 datatypes with GPU-based model inferences for better performance and reduced model footprint. You can use WinMLTools to convert your models from FP32 to FP16.
- Allows desktop apps to consume Windows.AI.MachineLearning APIs with WinRT/C++.
We're always looking for your help to fix bugs and improve the samples. Create a pull request, and we'll be happy to take a look.