83f00ded888216bc182c1cbcd1c6205bcf610068
[platform/upstream/dldt.git] / inference-engine / samples / classification_sample / README.md
1 # Image Classification Sample
2
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.
5
6 ## Running
7
8 Running the application with the <code>-h</code> option yields the following usage message:
9 ```sh
10 ./classification_sample -h
11 InferenceEngine: 
12     API version ............ <version>
13     Build .................. <number>
14
15 classification_sample [OPTION]
16 Options:
17
18     -h                      
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.
23     -m "<path>"             
24                             Required. Path to an .xml file with a trained model.
25         -l "<absolute_path>"
26                             Optional. Absolute path to library with MKL-DNN (CPU) custom layers (*.so).
27         Or
28         -c "<absolute_path>"
29                             Optional. Absolute path to clDNN (GPU) custom layers config (*.xml).
30     -pp "<path>"            
31                             Path to a plugin folder.
32     -d "<device>"           
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
34     -nt "<integer>"         
35                             Number of top results (default 10)
36     -ni "<integer>"         
37                             Number of iterations (default 1)
38     -pc                     
39                             Enables per-layer performance report
40     -p_msg                  
41                             Enables messages from a plugin
42
43 ```
44
45 Running the application with the empty list of options yields the usage message given above and an error message.
46
47 You can do inference on an image using a trained AlexNet network on Intel&reg; Processors using the following command:
48 ```sh
49 ./classification_sample -i <path_to_image>/cat.bmp -m <path_to_model>/alexnet_fp32.xml
50 ```
51
52 ### Outputs
53
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&reg; HD Graphics, use the following commands:
57 ```sh
58 ./classification_sample -i <path_to_image>/cat.bmp -m <path_to_model>/alexnet_fp32.xml -nt 5 -d GPU
59 ```
60
61 ### How it works
62
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.
66
67 ## See Also 
68 * [Using Inference Engine Samples](./docs/Inference_Engine_Developer_Guide/Samples_Overview.md)