-
Notifications
You must be signed in to change notification settings - Fork 0
/
defaults.yaml
200 lines (156 loc) · 6.69 KB
/
defaults.yaml
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# Name of the model. Will be the stem of the input model if undefined.
name: ~
# List of stages for multistage models. Doesn't have to be provided
# for single-stage models.
stages:
# Name of the stage. Required.
stage_name:
# Path to an ONNX or IR model. IR is supported only for RVC2 and RVC3 conversions.
# It can be either a local file or an S3 url. Required.
input_model: ~
# Specify the current input and desired output encoding for image data inputs.
encoding:
from: RGB
to: BGR
# Configuration for the calibration dataset.
# Required for Hailo and RVC4, optional for RVC3, ignored for RVC2.
# If specified, then the `calibration.path` must be provided.
calibration:
# Path to the calibration dataset. It can be either a local directory,
# an S3 url, or an LDF identificator in a form <dataset_name>:<split>.
# Example:
# path: models/coco128
# path: test_name:val
path: ~
# Include only the specified number of images from the calibration dataset.
# Optional.
max_images: -1
# What method to use for resizing. Options are:
# - CROP: center crop the image to the specified size.
# - PAD: resize and pad the image to the specified size.
# - RESIZE: resize the image to the specified size, ignoring aspect ratio.
resize_method: RESIZE
# For multi-stage models, the calibration can be an output of a previous stage.
# The `link` section specifies how to use the outputs from the previous stage.
# link:
# Name of the stage to link to. Required.
# stage: ~
# Name of the output to use. Either `output` or `script` must be provided.
# output: ~
# A custom python script to use for post-processing the linked output.
# It can be either a path or url to a python file, or a string with the script.
# The script must contain a function
# `run_script(outputs: dict[str, np.ndarray]) -> np.ndarray` which takes the
# dictionary of linked outputs and produces a single array.
# Either `output` or `script` must be provided.
# script: ~
# Scale values to be used for the input image per channel.
# Can be either:
# - a single value to be used for all channels.
# - a list of values to be used for each channel.
# - a "imagenet" string to use the ImageNet values.
# Equivalent to [ 58.395, 57.12, 57.375 ]
scale_values: ~
# Mean values to be used for the input image per channel.
# Same options as for scale_values. "imagenet" equivalent to [ 123.675, 116.28, 103.53 ].
mean_values: ~
# The input shape of the network. If not provided,
# it will be inferred from the model if possible.
shape: ~
# Lettercode representation of the input layout. e.g. NCHW
layout: ~
# Remote path where to upload the compiled model. Optional.
output_remote_url: ~
# Keep the intermediate files created during the compilation.
keep_intermediate_outputs: true
# Do not run ONNX simplifier on the provided model.
disable_onnx_simplification: false
# List of input names with shapes,
# data types, values for freezing and input modifiers.
# Overrides the top-level input modifiers.
# Example:
# inputs:
# - name: input.0 # a node name for hailo, a tensor name of other platforms
# shape: [ 1, 3, 256, 256 ]
# data_type: float32 (default)
# scale_values: [ 255., 255., 255. ]
# encoding:
# from: RGB
# to: BGR
# - name: is_training
# freeze_value: false
# - name: sequence_len
# freeze_value: 250
#
# Examples of valid data types: 'float32', 'float32', 'uint8'
inputs: []
# List of the output names.
# Example:
# outputs:
# - name: output.0
# - name: output.1
outputs: []
# --- Hailo-Specific Arguments ---
hailo:
# Specifies the optimization level. A number between 0 and 3.
optimization_level: 2
# Specifies the compression level. A number between 0 and 4.
compression_level: 2
# Batch size for the calibration.
# batch_size: 8
batch_size: 8
# Stop after quantization. Used in tests.
disable_compilation: false
# List of additional arguments to pass to the model optimizer.
alls: []
# Disables calibration.
disable_calibration: false
# Hardware architecture to be used.
hw_arch: hailo8
# --- RVC2-Specific Arguments ---
rvc2:
# Specifies number of shaves.
number_of_shaves: 8
# Specifies number of CMX slices.
number_of_cmx_slices: 8
# List of additional arguments to pass to the model optimizer.
# The additional arguments are passed as-is and always take precedence
# over the default arguments.
mo_args: []
# List of additional arguments to pass to the compile_tool.
compile_tool_args: []
# Produces .superblob file instead of regular .blob.
superblob: true
# If the original model has FP32 weights or biases, they are compressed to FP16. All intermediate data is kept in original precision.
compress_to_fp16: true
# --- RVC3-Specific Argument ---
rvc3:
# Target device for POT. Can be one of { VPU, ANY }
pot_target_device: VPU
# List of additional arguments to pass to the model optimizer.
# The additional arguments are passed as-is and always take precedence
# over the default arguments.
mo_args: []
# List of additional arguments to pass to the compile_tool.
compile_tool_args: []
# If the original model has FP32 weights or biases, they are compressed to FP16. All intermediate data is kept in original precision.
compress_to_fp16: true
# --- RVC4-Specific Arguments ---
rvc4:
# List of additional arguments to pass to SNPE onnx-to-dlc.
# The additional arguments are passed as-is and always take precedence
# over the default arguments.
snpe_onnx_to_dlc_args: []
# List of additional arguments to pass to SNPE snpe-dlc-quant.
snpe_dlc_quant_args: []
# List of additional arguments to pass to SNPE snpe-dlc-graph-prepare.
snpe_dlc_graph_prepare_args: []
# Whether to include the raw images in the intermediate outputs.
# Warning: the raw images can get very large.
keep_raw_images: False
# Selects per-axis-element quantization for the weights
# and biases of certain layer types.
# Only Convolution, Deconvolution, and FullyConnected are supported.
use_per_channel_quantization: True
# Enables row wise quantization of Matmul and FullyConnected ops.
use_per_row_quantization: False