2021-03-25 02:40:09 +03:00
|
|
|
// Copyright (C) 2018-2021 Intel Corporation
|
2018-11-23 16:19:43 +03:00
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
2018-10-16 13:45:03 +03:00
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <gflags/gflags.h>
|
2021-04-22 14:02:54 +03:00
|
|
|
|
2018-10-16 13:45:03 +03:00
|
|
|
#include <iostream>
|
2021-04-22 14:02:54 +03:00
|
|
|
#include <string>
|
|
|
|
|
#include <vector>
|
2018-10-16 13:45:03 +03:00
|
|
|
|
|
|
|
|
/// @brief message for help argument
|
|
|
|
|
static const char help_message[] = "Print a usage message.";
|
|
|
|
|
|
2020-11-16 01:26:04 -08:00
|
|
|
/// @brief message for model argument
|
|
|
|
|
static const char model_message[] = "Required. Path to an .xml file with a trained model.";
|
|
|
|
|
|
2018-10-16 13:45:03 +03:00
|
|
|
/// @brief message for images argument
|
2021-08-11 14:47:29 +03:00
|
|
|
static const char image_message[] =
|
|
|
|
|
"Required. Path to a folder with images or path to an image files: a .ubyte file for LeNet"
|
|
|
|
|
" and a .bmp file for the other networks.";
|
2018-10-16 13:45:03 +03:00
|
|
|
|
|
|
|
|
/// @brief message for assigning cnn calculation to device
|
2021-08-11 14:47:29 +03:00
|
|
|
static const char target_device_message[] =
|
|
|
|
|
"Optional. Specify the target device to infer on (the list of available devices is shown below). "
|
|
|
|
|
"Default value is CPU. Use \"-d HETERO:<comma_separated_devices_list>\" format to specify HETERO plugin. "
|
|
|
|
|
"Sample will look for a suitable plugin for device specified.";
|
2018-10-16 13:45:03 +03:00
|
|
|
|
|
|
|
|
/// @brief message for top results number
|
2019-04-12 18:25:53 +03:00
|
|
|
static const char ntop_message[] = "Optional. Number of top results. Default value is 10.";
|
2018-10-16 13:45:03 +03:00
|
|
|
|
2021-04-15 13:42:46 +03:00
|
|
|
/// @brief message for plugin custom kernels desc
|
2021-04-22 14:02:54 +03:00
|
|
|
static const char custom_plugin_cfg_message[] = "Required for GPU, MYRIAD, HDDL custom kernels. "
|
|
|
|
|
"Absolute path to the .xml config file with the kernels descriptions.";
|
2018-10-16 13:45:03 +03:00
|
|
|
|
|
|
|
|
/// @brief message for user library argument
|
2021-04-22 14:02:54 +03:00
|
|
|
static const char custom_ex_library_message[] = "Required for CPU plugin custom layers. "
|
|
|
|
|
"Absolute path to a shared library with the kernels implementations.";
|
2018-10-16 13:45:03 +03:00
|
|
|
|
|
|
|
|
/// @brief Define flag for showing help message <br>
|
|
|
|
|
DEFINE_bool(h, false, help_message);
|
|
|
|
|
|
|
|
|
|
/// @brief Define parameter for set image file <br>
|
|
|
|
|
/// It is a required parameter
|
|
|
|
|
DEFINE_string(i, "", image_message);
|
|
|
|
|
|
|
|
|
|
/// @brief Define parameter for set model file <br>
|
|
|
|
|
/// It is a required parameter
|
|
|
|
|
DEFINE_string(m, "", model_message);
|
|
|
|
|
|
|
|
|
|
/// @brief device the target device to infer on <br>
|
2021-04-15 13:42:46 +03:00
|
|
|
/// It is an optional parameter
|
2018-10-16 13:45:03 +03:00
|
|
|
DEFINE_string(d, "CPU", target_device_message);
|
|
|
|
|
|
|
|
|
|
/// @brief Top results number (default 10) <br>
|
2021-04-15 13:42:46 +03:00
|
|
|
/// It is an optional parameter
|
2019-04-12 18:25:53 +03:00
|
|
|
DEFINE_uint32(nt, 10, ntop_message);
|
2018-10-16 13:45:03 +03:00
|
|
|
|
2021-04-15 13:42:46 +03:00
|
|
|
/// @brief Define parameter for plugin custom kernels path <br>
|
|
|
|
|
/// It is an optional parameter
|
|
|
|
|
DEFINE_string(c, "", custom_plugin_cfg_message);
|
2018-10-16 13:45:03 +03:00
|
|
|
|
|
|
|
|
/// @brief Absolute path to CPU library with user layers <br>
|
2021-04-15 13:42:46 +03:00
|
|
|
/// It is an optional parameter
|
|
|
|
|
DEFINE_string(l, "", custom_ex_library_message);
|
2018-10-16 13:45:03 +03:00
|
|
|
|
|
|
|
|
/**
|
2021-04-22 14:02:54 +03:00
|
|
|
* @brief This function show a help message
|
|
|
|
|
*/
|
2018-10-16 13:45:03 +03:00
|
|
|
static void showUsage() {
|
|
|
|
|
std::cout << std::endl;
|
|
|
|
|
std::cout << "classification_sample_async [OPTION]" << std::endl;
|
|
|
|
|
std::cout << "Options:" << std::endl;
|
|
|
|
|
std::cout << std::endl;
|
|
|
|
|
std::cout << " -h " << help_message << std::endl;
|
|
|
|
|
std::cout << " -m \"<path>\" " << model_message << std::endl;
|
2020-11-16 01:26:04 -08:00
|
|
|
std::cout << " -i \"<path>\" " << image_message << std::endl;
|
2021-04-15 13:42:46 +03:00
|
|
|
std::cout << " -l \"<absolute_path>\" " << custom_ex_library_message << std::endl;
|
2018-10-16 13:45:03 +03:00
|
|
|
std::cout << " Or" << std::endl;
|
2021-04-15 13:42:46 +03:00
|
|
|
std::cout << " -c \"<absolute_path>\" " << custom_plugin_cfg_message << std::endl;
|
2018-10-16 13:45:03 +03:00
|
|
|
std::cout << " -d \"<device>\" " << target_device_message << std::endl;
|
|
|
|
|
std::cout << " -nt \"<integer>\" " << ntop_message << std::endl;
|
|
|
|
|
}
|