Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / samples / perfcheck / README.md
1 # Perfcheck Sample
2
3 This topic demonstrates how to build and run the Perfcheck sample application, which estimates performance by calculating minimum, average, and maximum FPS.
4
5 ## How It Works
6
7 Upon the start-up, the sample application reads command line parameters and loads a network and its inputs from given directory to the Inference Engine plugin.
8 Then application starts infer requests in asynchronous mode till specified number of iterations is finished.
9 After inference stage, Perfcheck sample computes total time of execution, divides execution time in 10 intervals and evaluates minimum, average and maximum FPS among these intervals.
10
11 ## Running
12
13 Running the application with the `-h` option yields the following usage message:
14
15 ```sh
16 ./perfcheck -h
17 [ INFO ] Inference Engine:
18         API version ............ <version>
19         Build .................. <number>
20
21 perfcheck [OPTIONS]
22 [OPTIONS]:
23         -m                       <value>        Required. Path to an .xml file with a trained model.
24         -h                                      Optional. Print a usage message.
25         -d                       <value>        Optional. Specify the target device to infer on. Sample will look for a suitable plugin for device specified. Default value: CPU.
26         -pp                      <value>        Optional. Path to a plugin folder.
27         -l                       <value>        Optional. Required for CPU custom layers. Absolute path to a shared library with the kernels implementation.
28         -c                       <value>        Optional. Required for GPU custom kernels. Absolute path to an .xml file with the kernels description.
29         -inputs_dir              <value>        Optional. Path to a folder with images and binaries for inputs. Default value: ".".
30         -config                  <value>        Optional. Path to a configuration file.
31         -num_iterations          <value>        Optional. Specify number of iterations. Default value: 1000. Must be greater than or equal to 1000.
32         -batch                   <value>        Optional. Specify batch. Default value: 1.
33         -num_networks            <value>        Optional. Specify number of networks. Default value: 1. Must be less than or equal to 16.
34         -num_requests            <value>        Optional. Specify number of infer requests. Default value depends on specified device.
35         -num_fpga_devices        <value>        Optional. Specify number of FPGA devices. Default value: 1.
36 ```
37
38 Running the application with the empty list of options yields an error message.
39
40 To run the sample, you can use public or pre-trained models. To download the pre-trained models, use the OpenVINO [Model Downloader](https://github.com/opencv/open_model_zoo/tree/2018/model_downloader) or go to [https://download.01.org/opencv/](https://download.01.org/opencv/).
41
42 > **NOTE**: Before running the sample with a trained model, make sure the model is converted to the Inference Engine format (\*.xml + \*.bin) using the [Model Optimizer tool](./docs/MO_DG/Deep_Learning_Model_Optimizer_DevGuide.md).
43
44 You can use the following command to do inference on CPU on images from a folder using a trained Faster R-CNN network:
45
46 ```sh
47 ./perfcheck -m <path_to_model>/faster_rcnn.xml -inputs_dir <path_to_inputs> -d CPU
48 ```
49
50 ## Sample Output
51
52 The application outputs a performance statistics that shows: total execution time (in milliseconds), number of iterations, batch size, minimum, average and maximum FPS.
53 Example of sample output:
54
55 ```sh
56 [ INFO ] Inference Engine:
57         API version ............ <version>
58         Build .................. <number>
59 [ INFO ] Loading network files:
60 [ INFO ]        <path_to_model_xml_file>
61 [ INFO ]        <path_to_model_bin_file>
62 [ INFO ] Loading network 0
63 [ INFO ] All networks are loaded
64
65 Total time:     8954.61 ms
66 Num iterations: 1000
67 Batch:          1
68 Min FPS:        110.558
69 Avg FPS:        111.674
70 Max FPS:        112.791
71 ```
72
73 ## See Also
74
75 * [Using Inference Engine Samples](./docs/IE_DG/Samples_Overview.md)
76 * [Model Optimizer](./docs/MO_DG/Deep_Learning_Model_Optimizer_DevGuide.md)
77 * [Model Downloader](https://github.com/opencv/open_model_zoo/tree/2018/model_downloader)