{"id":334,"date":"2021-11-29T18:06:05","date_gmt":"2021-11-30T02:06:05","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/windowsai\/?p=334"},"modified":"2021-11-29T18:11:06","modified_gmt":"2021-11-30T02:11:06","slug":"introducing-the-windows-ml-samples-gallery","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/windowsai\/introducing-the-windows-ml-samples-gallery\/","title":{"rendered":"Introducing the Windows ML Samples Gallery"},"content":{"rendered":"<p>Learn how the Windows ML API can be used to create powerful ML experiences on Windows through the <a href=\"https:\/\/www.microsoft.com\/store\/apps\/9PKBFQKBCLM9\">Windows ML Samples Gallery<\/a>. The Gallery is a Windows 11 packaged desktop app built using the <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/apps\/windows-app-sdk\/\">Windows App SDK<\/a> (parts of the Gallery are backwards compatible to Windows 8.1). The initial release contains 5 interactive samples that showcase Windows ML through managed and native scenarios (more samples coming soon!). Each sample comes with the corresponding code.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Image Classification (<a href=\"https:\/\/github.com\/microsoft\/Windows-Machine-Learning\/tree\/master\/Samples\/WinMLSamplesGallery\/WinMLSamplesGallery\/Samples\/ImageClassifier\">GitHub<\/a>)<\/strong><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/11\/ImageClassification.jpg\"><img decoding=\"async\" class=\"wp-image-347 size-full aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/11\/ImageClassification.jpg\" alt=\"Image Image Classification\" width=\"444\" height=\"341\" srcset=\"https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/11\/ImageClassification.jpg 444w, https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/11\/ImageClassification-300x230.jpg 300w\" sizes=\"(max-width: 444px) 100vw, 444px\" \/><\/a><\/p>\n<p>Pick an image and display the most probable class predictions from 1000 possible categories in the image classification sample. Learn how to<\/p>\n<ul>\n<li>Integrate models from the <a href=\"https:\/\/github.com\/onnx\/models\">ONNX Model Zoo<\/a> with Windows ML<\/li>\n<li>Perform pre\/post processing\n<ul>\n<li>Every model has its own steps for data pre and post processing (e.g. normalization, resizing, NCHW conversion, etc.)<\/li>\n<li>This sample demonstrates how each model can be called in Windows ML by performing the needed pre-post processing in a hardware-platform agnostic way, while taking advantage of VideoFrame optimizations when available.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong>Image Effects (<a href=\"https:\/\/github.com\/microsoft\/Windows-Machine-Learning\/tree\/master\/Samples\/WinMLSamplesGallery\/WinMLSamplesGallery\/Samples\/ImageEffects\">GitHub<\/a>)<\/strong><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/11\/ImageEffects.jpg\"><img decoding=\"async\" class=\"wp-image-351 size-full aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/11\/ImageEffects.jpg\" alt=\"Image Image Effects\" width=\"472\" height=\"259\" srcset=\"https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/11\/ImageEffects.jpg 472w, https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/11\/ImageEffects-300x165.jpg 300w\" sizes=\"(max-width: 472px) 100vw, 472px\" \/><\/a><\/p>\n<p>Pick an image and apply a variety of effects powered by Windows ML like blur, sharpen, and contrast in the image effects sample. Learn how to<\/p>\n<ul>\n<li>Build dynamic models on the fly using the LearningModelBuild Experimental API\n<ul>\n<li>Some models in the model zoo expect data in a specific format, and these samples show you how to use the operators in Windows ML to convert your image data into a compatible format.<\/li>\n<li>These dynamic models are built with known weights and parameters to do common operations that don&#8217;t require the model to be trained like the classification models.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong>Batched Inputs (<a href=\"https:\/\/github.com\/microsoft\/Windows-Machine-Learning\/tree\/master\/Samples\/WinMLSamplesGallery\/WinMLSamplesGallery\/Samples\/Batching\">GitHub<\/a>)<\/strong><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/11\/BatchedInputs.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-350 size-full\" src=\"https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/11\/BatchedInputs.jpg\" alt=\"Image Batched Inputs\" width=\"429\" height=\"225\" srcset=\"https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/11\/BatchedInputs.jpg 429w, https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/11\/BatchedInputs-300x157.jpg 300w\" sizes=\"(max-width: 429px) 100vw, 429px\" \/><\/a><\/p>\n<p>Infer multiple inputs at once to increase runtime performance in the batching sample. Learn how to<\/p>\n<ul>\n<li>Get better performance on GPU with large, batched inputs<\/li>\n<\/ul>\n<p>Many models in the ONNX model zoo don&#8217;t have a free dimension to allow for batched inference, so you can edit models using <a href=\"https:\/\/github.com\/microsoft\/Windows-Machine-Learning\/tree\/master\/Tools\/WinMLDashboard\">WinMLDashboard<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>OpenCV &amp; ImageSharp Interop<\/strong><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/11\/OpenCVImageSharp.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-357 size-full\" src=\"https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/11\/OpenCVImageSharp.jpg\" alt=\"Image OpenCVImageSharp\" width=\"1405\" height=\"494\" srcset=\"https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/11\/OpenCVImageSharp.jpg 1405w, https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/11\/OpenCVImageSharp-300x105.jpg 300w, https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/11\/OpenCVImageSharp-1024x360.jpg 1024w, https:\/\/devblogs.microsoft.com\/windowsai\/wp-content\/uploads\/sites\/71\/2021\/11\/OpenCVImageSharp-768x270.jpg 768w\" sizes=\"(max-width: 1405px) 100vw, 1405px\" \/><\/a><\/p>\n<p>Use Windows ML to classify images that have been edited natively using OpenCV and ImageSharp in the OpenCV and ImageSharp Interop samples. Learn how to<\/p>\n<ul>\n<li>Use Interop with other popular frameworks<\/li>\n<\/ul>\n<p>View the <a href=\"https:\/\/github.com\/microsoft\/Windows-Machine-Learning\/tree\/master\/Samples\/WinMLSamplesGallery\/WinMLSamplesGallery\/Samples\/OpenCVInterop\">OpenCV<\/a> and <a href=\"https:\/\/github.com\/microsoft\/Windows-Machine-Learning\/tree\/master\/Samples\/WinMLSamplesGallery\/WinMLSamplesGallery\/Samples\/ImageSharpInterop\">ImageSharp<\/a> Interop samples on GitHub.<\/p>\n<p>Want to see an example of interop with your favorite framework? File a request on the GitHub <a href=\"https:\/\/github.com\/microsoft\/Windows-Machine-Learning\/issues\/new\">issues page<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Try it out and stay involved<\/strong><\/p>\n<p>The Windows ML Samples Gallery can be downloaded from the <a href=\"https:\/\/www.microsoft.com\/store\/apps\/9PKBFQKBCLM9\">Microsoft Store<\/a> or from <a href=\"https:\/\/github.com\/microsoft\/Windows-Machine-Learning\/tree\/master\/Samples\/WinMLSamplesGallery#build-from-source\">GitHub<\/a>. We encourage you to try it out and give feedback by reporting issues or requesting new samples on the <a href=\"https:\/\/github.com\/microsoft\/Windows-Machine-Learning\/issues\">issues page<\/a>.<\/p>\n<p>Stay tuned to the Windows AI Blog for more updates and news!<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Coming Soon<\/strong><\/p>\n<p>Real-time video inferencing samples and much more!<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how the Windows ML API can be used to create powerful ML experiences on Windows through the Windows ML Samples Gallery.<\/p>\n","protected":false},"author":75187,"featured_media":335,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[4,7],"class_list":["post-334","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-windows-ai","tag-directml","tag-windows-ml"],"acf":[],"blog_post_summary":"<p>Learn how the Windows ML API can be used to create powerful ML experiences on Windows through the Windows ML Samples Gallery.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/windowsai\/wp-json\/wp\/v2\/posts\/334","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/windowsai\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/windowsai\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/windowsai\/wp-json\/wp\/v2\/users\/75187"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/windowsai\/wp-json\/wp\/v2\/comments?post=334"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/windowsai\/wp-json\/wp\/v2\/posts\/334\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/windowsai\/wp-json\/wp\/v2\/media\/335"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/windowsai\/wp-json\/wp\/v2\/media?parent=334"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/windowsai\/wp-json\/wp\/v2\/categories?post=334"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/windowsai\/wp-json\/wp\/v2\/tags?post=334"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}