This is a VSTO Outlook addin that uses SqueezeNet, a pre-trained machine learning model, to detect the predominant object in an image selected by the user from a file.
Note: SqueezeNet was trained to work with image sizes of 224x224, so you must provide an image of size 224X224.
To get access to Windows.AI.MachineLearning and various other Windows classes an assembly reference needs to be added for Windows.winmd
For this project the assembly reference is parametrized by the environment variable WINDOWS_WINMD, so you need to set this environment variable before building.
The file path for the Windows.winmd file may be: C:\Program Files (x86)\Windows Kits\10\UnionMetadata\[version]\Windows.winmd
- Visual Studio 2017 Version 15.7.4 or Newer
- Windows 10 - Build 17763 or higher
- Windows SDK - Build 17763 or higher
- If you download the samples ZIP, be sure to unzip the entire archive, not just the folder with the sample you want to build.
- Start Microsoft Visual Studio 2017 and select File > Open > Project/Solution.
- Starting in the folder where you unzipped the samples, go to the Samples subfolder, then the subfolder for this sample (**SqueezeNetObjectDetection). Double-click the Visual Studio solution file (.sln).
- Confirm that you are set for the right configuration and platform (for example: Debug, x64).
- Build the solution by right clicking the project in Solution Explorer and selecting Build (Ctrl+Shift+B).
-
To debug the sample and then run it, press F5 or select Debug > Start Debugging. To run the sample without debugging, press Ctrl+F5 or selectDebug > Start Without Debugging.
-
You should get output similar to the following:
Loading modelfile 'Assets/SqueezeNet.onnx' on the 'default' device model file loaded in 421 ticks Loading the image... Binding... Running the model... model run took 31 ticks "tabby, tabby cat" with confidence of 0.931461 "Egyptian cat" with confidence of 0.065307 "tiger cat" with confidence of 0.002927
MIT. See LICENSE file.