cd1abedd9fb3750e25d04042cc1335e0a43aba10
[platform/upstream/dldt.git] / inference-engine / samples / classification_sample / classification_sample.h
1 // Copyright (C) 2018 Intel Corporation
2 //
3 // SPDX-License-Identifier: Apache-2.0
4 //
5
6 #pragma once
7
8 #include <string>
9 #include <vector>
10 #include <gflags/gflags.h>
11 #include <iostream>
12
13 #ifdef _WIN32
14 #include <os/windows/w_dirent.h>
15 #else
16 #include <dirent.h>
17 #endif
18
19 /// @brief message for help argument
20 static const char help_message[] = "Print a usage message.";
21
22 /// @brief message for images argument
23 static const char image_message[] = "Required. Path to a folder with images or path to an image files: a .ubyte file for LeNet"\
24                                     "and a .bmp file for the other networks.";
25
26 /// @brief message for plugin_path argument
27 static const char plugin_path_message[] = "Path to a plugin folder.";
28
29 /// @brief message for model argument
30 static const char model_message[] = "Required. Path to an .xml file with a trained model.";
31
32 /// @brief message for assigning cnn calculation to device
33 static const char target_device_message[] = "Specify the target device to infer on; CPU, GPU, FPGA or MYRIAD is acceptable. " \
34                                             "Sample will look for a suitable plugin for device specified (CPU by default)";
35
36 /// @brief message for performance counters
37 static const char performance_counter_message[] = "Enables per-layer performance report";
38
39 /// @brief message for top results number
40 static const char ntop_message[] = "Number of top results (default 10)";
41
42 /// @brief message for iterations count
43 static const char iterations_count_message[] = "Number of iterations (default 1)";
44
45 /// @brief message for clDNN custom kernels desc
46 static const char custom_cldnn_message[] = "Required for clDNN (GPU)-targeted custom kernels."\
47                                             "Absolute path to the xml file with the kernels desc.";
48
49 /// @brief message for user library argument
50 static const char custom_cpu_library_message[] = "Required for MKLDNN (CPU)-targeted custom layers." \
51                                                  "Absolute path to a shared library with the kernels impl.";
52
53 /// @brief message for plugin messages
54 static const char plugin_message[] = "Enables messages from a plugin";
55
56 /// @brief Define flag for showing help message <br>
57 DEFINE_bool(h, false, help_message);
58
59 /// @brief Define parameter for set image file <br>
60 /// It is a required parameter
61 DEFINE_string(i, "", image_message);
62
63 /// @brief Define parameter for set model file <br>
64 /// It is a required parameter
65 DEFINE_string(m, "", model_message);
66
67 /// @brief Define parameter for set path to plugins <br>
68 DEFINE_string(pp, "", plugin_path_message);
69
70 /// @brief device the target device to infer on <br>
71 DEFINE_string(d, "CPU", target_device_message);
72
73 /// @brief Top results number (default 10) <br>
74 DEFINE_int32(nt, 10, ntop_message);
75
76 /// @brief Enable per-layer performance report
77 DEFINE_bool(pc, false, performance_counter_message);
78
79 /// @brief Define parameter for clDNN custom kernels path <br>
80 /// Default is ./lib
81 DEFINE_string(c, "", custom_cldnn_message);
82
83 /// @brief Absolute path to CPU library with user layers <br>
84 /// It is a optional parameter
85 DEFINE_string(l, "", custom_cpu_library_message);
86
87 /// @brief Iterations count (default 1)
88 DEFINE_int32(ni, 1, iterations_count_message);
89
90 /// @brief Enable plugin messages
91 DEFINE_bool(p_msg, false, plugin_message);
92
93 /**
94 * @brief This function show a help message
95 */
96 static void showUsage() {
97     std::cout << std::endl;
98     std::cout << "classification_sample [OPTION]" << std::endl;
99     std::cout << "Options:" << std::endl;
100     std::cout << std::endl;
101     std::cout << "    -h                      " << help_message << std::endl;
102     std::cout << "    -i \"<path>\"             " << image_message << std::endl;
103     std::cout << "    -m \"<path>\"             " << model_message << std::endl;
104     std::cout << "      -l \"<absolute_path>\"    " << custom_cpu_library_message << std::endl;
105     std::cout << "          Or" << std::endl;
106     std::cout << "      -c \"<absolute_path>\"    " << custom_cldnn_message << std::endl;
107     std::cout << "    -pp \"<path>\"            " << plugin_path_message << std::endl;
108     std::cout << "    -d \"<device>\"           " << target_device_message << std::endl;
109     std::cout << "    -nt \"<integer>\"         " << ntop_message << std::endl;
110     std::cout << "    -ni \"<integer>\"         " << iterations_count_message << std::endl;
111     std::cout << "    -pc                     " << performance_counter_message << std::endl;
112     std::cout << "    -p_msg                  " << plugin_message << std::endl;
113 }