Windows-Machine-Learning/Samples/SqueezeNetObjectDetection/Desktop/cpp
Paul McDaniel f850d36092 Added the official Microsoft.AI.MachineLearning nuget. 2020-05-19 08:33:47 -07:00
..
Labels.txt refactor the folder structure 2018-07-26 16:44:45 -07:00
README.md User/orilevari/copy labels (#165) 2019-02-15 17:49:01 -08:00
SqueezeNetObjectDetectionCPP.vcxproj Added the official Microsoft.AI.MachineLearning nuget. 2020-05-19 08:33:47 -07:00
SqueezeNetObjectDetectionCPP.vcxproj.filters Added the official Microsoft.AI.MachineLearning nuget. 2020-05-19 08:33:47 -07:00
main.cpp Added the official Microsoft.AI.MachineLearning nuget. 2020-05-19 08:33:47 -07:00
packages.config Added the official Microsoft.AI.MachineLearning nuget. 2020-05-19 08:33:47 -07:00
pch.cpp refactor the folder structure 2018-07-26 16:44:45 -07:00
pch.h Added the official Microsoft.AI.MachineLearning nuget. 2020-05-19 08:33:47 -07:00

README.md

SqueezeNet Object Detection sample

This is a desktop application 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.

Prerequisites

Build the sample

  1. If you download the samples ZIP, be sure to unzip the entire archive, not just the folder with the sample you want to build.
  2. Start Microsoft Visual Studio 2017 and select File > Open > Project/Solution.
  3. Starting in the folder where you unzipped the samples, go to the Samples subfolder, then the subfolder for this specific sample (SqueezeNetObjectDetection\Desktop\cpp). Double-click the Visual Studio solution file (.sln).
  4. Confirm that the project is pointed to the correct SDK that you installed (e.g. 17763). You can do this by right-clicking the project in the Solution Explorer, selecting Properties, and modifying the Windows SDK Version.
  5. Confirm that you are set for the right configuration and platform (for example: Debug, x64).
  6. Build the solution (Ctrl+Shift+B).

Run the sample

  1. Open a Command Prompt (in the Windows 10 search bar, type cmd and press Enter).
  2. Change the current folder to the folder containing the built EXE (cd <path-to-exe>).
  3. Run the executable as shown below. Make sure to replace the install location with what matches yours:
SqueezeNetObjectDetection.exe C:\Repos\Windows-Machine-Learning\SharedContent\media\kitten_224.png
  1. You should get output similar to the following:
Loading modelfile 'C:\Repos\Windows-Machine-Learning\SharedContent\models\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

License

MIT. See LICENSE file.