1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
9 #include <gflags/gflags.h>
13 #include <os/windows/w_dirent.h>
18 /// @brief message for help argument
19 static const char help_message[] = "Print a usage message.";
21 /// @brief message for images argument
22 static const char image_message[] = "Required. Path to a folder with images or path to an image files: a .ubyte file for LeNet"\
23 "and a .bmp file for the other networks.";
25 /// @brief message for plugin_path argument
26 static const char plugin_path_message[] = "Path to a plugin folder.";
28 /// @brief message for model argument
29 static const char model_message[] = "Required. Path to an .xml file with a trained model.";
31 /// @brief message for assigning cnn calculation to device
32 static const char target_device_message[] = "Specify the target device to infer on; CPU, GPU, FPGA, HDDL or MYRIAD is acceptable. " \
33 "Sample will look for a suitable plugin for device specified (CPU by default)";
35 /// @brief message for performance counters
36 static const char performance_counter_message[] = "Enables per-layer performance report";
38 /// @brief message for top results number
39 static const char ntop_message[] = "Number of top results. Default value is 10";
41 /// @brief message for iterations count
42 static const char iterations_count_message[] = "Number of iterations. Default value is 1";
44 /// @brief message for clDNN custom kernels desc
45 static const char custom_cldnn_message[] = "Required for GPU custom kernels. "\
46 "Absolute path to the .xml file with the kernels descriptions.";
48 /// @brief message for user library argument
49 static const char custom_cpu_library_message[] = "Required for CPU custom layers. " \
50 "Absolute path to a shared library with the kernels implementations.";
52 /// @brief message for plugin messages
53 static const char plugin_message[] = "Enables messages from a plugin";
55 /// @brief Define flag for showing help message <br>
56 DEFINE_bool(h, false, help_message);
58 /// @brief Define parameter for set image file <br>
59 /// It is a required parameter
60 DEFINE_string(i, "", image_message);
62 /// @brief Define parameter for set model file <br>
63 /// It is a required parameter
64 DEFINE_string(m, "", model_message);
66 /// @brief Define parameter for set path to plugins <br>
67 DEFINE_string(pp, "", plugin_path_message);
69 /// @brief device the target device to infer on <br>
70 DEFINE_string(d, "CPU", target_device_message);
72 /// @brief Top results number (default 10) <br>
73 DEFINE_uint32(nt, 10, ntop_message);
75 /// @brief Enable per-layer performance report
76 DEFINE_bool(pc, false, performance_counter_message);
78 /// @brief Define parameter for clDNN custom kernels path <br>
80 DEFINE_string(c, "", custom_cldnn_message);
82 /// @brief Absolute path to CPU library with user layers <br>
83 /// It is a optional parameter
84 DEFINE_string(l, "", custom_cpu_library_message);
86 /// @brief Iterations count (default 1)
87 DEFINE_uint32(ni, 1, iterations_count_message);
89 /// @brief Enable plugin messages
90 DEFINE_bool(p_msg, false, plugin_message);
93 * @brief This function show a help message
95 static void showUsage() {
96 std::cout << std::endl;
97 std::cout << "classification_sample [OPTION]" << std::endl;
98 std::cout << "Options:" << std::endl;
99 std::cout << std::endl;
100 std::cout << " -h " << help_message << std::endl;
101 std::cout << " -i \"<path>\" " << image_message << std::endl;
102 std::cout << " -m \"<path>\" " << model_message << std::endl;
103 std::cout << " -l \"<absolute_path>\" " << custom_cpu_library_message << std::endl;
104 std::cout << " Or" << std::endl;
105 std::cout << " -c \"<absolute_path>\" " << custom_cldnn_message << std::endl;
106 std::cout << " -pp \"<path>\" " << plugin_path_message << std::endl;
107 std::cout << " -d \"<device>\" " << target_device_message << std::endl;
108 std::cout << " -nt \"<integer>\" " << ntop_message << std::endl;
109 std::cout << " -ni \"<integer>\" " << iterations_count_message << std::endl;
110 std::cout << " -pc " << performance_counter_message << std::endl;
111 std::cout << " -p_msg " << plugin_message << std::endl;