1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
// Copyright 2022-2023 Intel Corporation.
//
// This software and the related documents are Intel copyrighted materials,
// and your use of them is governed by the express license under which they
// were provided to you ("License"). Unless the License provides otherwise,
// you may not use, modify, copy, publish, distribute, disclose or transmit
// this software or the related documents without Intel's prior written
// permission.
//
// This software and the related documents are provided as is, with no express
// or implied warranties, other than those that are expressly stated in the
// License.
#pragma once
#include <gflags/gflags.h>
#include <iostream>
#include <string>
#include <vector>
/// @brief message for help argument
static const char help_message[] = "Print a usage message";
/// @brief message for images argument
static const char input_message[] =
"Optional. Path to a folder with images and/or binaries or to specific image or binary file.";
/// @brief message for compiled model argument
static const char compiled_model_message[] = "Optional. Path to a .bin file with a trained compiled model";
// @brief message for the custom plugins.xml file option
static const char plugins_message[] = "Optional. Select a custom plugins to use.";
// @brief message folding_option flag
static const char folding_option_message[] = "Optional. Set the folding options for dla compiler: options 0-3.";
// @brief message fold_preprocessing flag
static const char fold_preprocessing_message[] = "Optional. Enable fold preprocessing option for dla compiler.";
// @brief message bgr flag
static const char bgr_message[] = "Optional. Indicate images are in bgr format.";
// @brief message encryption_key flag
static const char encryption_key_message[] =
"Optional. Encryption key (using hexidecimal characters, 16 bytes- 32 hexidecimal char).";
// @brief message encryption_iv flag
static const char encryption_iv_message[] =
"Optional. Initialization vector for encryption. (8 bytes - 16 hexidecimal char)";
// @brief message binary flag
static const char bin_data_message[] =
"Optional. Specify that the input should be read as binary data (otherwise, if input tensor has depth 1, or 3 it "
"will default to U8 image processing).";
/// @brief message resize flag
static const char input_image_resize_message[] =
"Optional. Input image resizing methods when the input image width and height do not match the desired "
"input width and height of the model. resize: Resizing the input image to the model input size; "
"pad_resize: Pad the input image with black pixels (i.e., 0) into a squared image and "
"resize the padded image to model input size.";
/// @brief message enable early-access features flag
static const char enable_early_access_message[] =
"Optional. Enables early access (EA) features of FPGA AI Suite. These are features that are actively being "
"developed and have not yet met production quality standards. These features may have flaws. "
"Consult the FPGA AI Suite documentation for details.";
/// @brief Define flag for showing help message <br>
DEFINE_bool(h, false, help_message);
/// @brief Declare flag for showing help message <br>
DECLARE_bool(help);
/// @brief Define parameter for set image file <br>
/// i or mif is a required parameter
DEFINE_string(i, "", input_message);
/// @brief Define parameter for compiled model file <br>
/// It is not a required parameter
DEFINE_string(cm, "", compiled_model_message);
/// @brief Path to a plugins_xml file
DEFINE_string(plugins, "", plugins_message);
/// @brief Define flag whether the image is in bgr format
DEFINE_bool(bgr, false, bgr_message);
/// Select folding options; 0,1,2,3
DEFINE_int32(folding_option, 1, folding_option_message);
/// @brief Define flag for enabling folding preprocessing
DEFINE_bool(fold_preprocessing, false, fold_preprocessing_message);
/// @brief encryption key
DEFINE_string(encryption_key, "", encryption_key_message);
/// @brief initialization vector
DEFINE_string(encryption_iv, "", encryption_iv_message);
/// @brief Specify that the inputs should be read as binary.
DEFINE_bool(bin_data, false, bin_data_message);
/// @brief Define flag for using input image resize <br>
DEFINE_string(resize_type, "", input_image_resize_message);
/// @brief Enables early-access (EA) features of CoreDLA <br>
DEFINE_bool(enable_early_access, false, enable_early_access_message);
/**
* @brief This function show a help message
*/
static void showUsage() {
std::cout << std::endl;
std::cout << "aot_splitter [OPTION]" << std::endl;
std::cout << "Options:" << std::endl;
std::cout << std::endl;
std::cout << " -h, --help " << help_message << std::endl;
std::cout << " -i \"<path>\" " << input_message << std::endl;
std::cout << " -cm \"<path>\" " << compiled_model_message << std::endl;
std::cout << " -plugins " << plugins_message << std::endl;
std::cout << " -bgr " << bgr_message << std::endl;
std::cout << " -bin_data " << bin_data_message << std::endl;
std::cout << " -resize_type \"resize/pad_resize\" " << input_image_resize_message << std::endl;
std::cout << " -folding_option " << folding_option_message << std::endl;
std::cout << " -fold_preprocessing " << fold_preprocessing_message << std::endl;
std::cout << " -encryption_key " << encryption_key_message << std::endl;
std::cout << " -encryption_iv " << encryption_iv_message << std::endl;
std::cout << " -enable_early_access " << enable_early_access_message << std::endl;
}
|