1 # Image Classification Sample
3 This topic demonstrates how to build and run the Image Classification sample application, which does
4 inference using image classification networks like AlexNet and GoogLeNet.
8 Running the application with the <code>-h</code> option yields the following usage message:
10 ./classification_sample -h
12 API version ............ <version>
13 Build .................. <number>
15 classification_sample [OPTION]
19 Print a usage message.
20 -i "<path1>" "<path2>"
21 Required. Path to a folder with images or path to an image files: a .ubyte file for LeNet
22 and a .bmp file for the other networks.
24 Required. Path to an .xml file with a trained model.
26 Optional. Absolute path to library with MKL-DNN (CPU) custom layers (*.so).
29 Optional. Absolute path to clDNN (GPU) custom layers config (*.xml).
31 Path to a plugin folder.
33 Specify the target device to infer on; CPU, GPU, FPGA or MYRIAD is acceptable. Sample will look for a suitable plugin for device specified
35 Number of top results (default 10)
37 Number of iterations (default 1)
39 Enables per-layer performance report
41 Enables messages from a plugin
45 Running the application with the empty list of options yields the usage message given above and an error message.
47 You can do inference on an image using a trained AlexNet network on Intel® Processors using the following command:
49 ./classification_sample -i <path_to_image>/cat.bmp -m <path_to_model>/alexnet_fp32.xml
54 By default the application outputs top-10 inference results.
55 Add the <code>-nt</code> option to the previous command to modify the number of top output results.
56 <br>For example, to get the top-5 results on Intel® HD Graphics, use the following commands:
58 ./classification_sample -i <path_to_image>/cat.bmp -m <path_to_model>/alexnet_fp32.xml -nt 5 -d GPU
63 Upon the start-up the sample application reads command line parameters and loads a network and an image to the Inference
64 Engine plugin. When inference is done, the application creates an
65 output image and outputs data to the standard output stream.
68 * [Using Inference Engine Samples](./docs/Inference_Engine_Developer_Guide/Samples_Overview.md)