| 176 | } |
| 177 | |
| 178 | void PrintConfig() { |
| 179 | printf( |
| 180 | "usage:\n./quantization_cmd [-h] [-p] <proto file> [-m] <model file> [-i] <input folder> [-b] <val> [-w] <val> " |
| 181 | "[-n] <val> [-s] <val> [-t] <val> [-o] <output_name>\n" |
| 182 | "\t-h, --help \t show this message\n" |
| 183 | "\t-p, --proto \t(require) tnn proto file name\n" |
| 184 | "\t-m, --model \t(require) tnn model file name\n" |
| 185 | "\t-i, --input_path \t(require) the folder of input files\n" |
| 186 | "\t-b, --blob_method \t(optional) the method to quantize blob\n" |
| 187 | "\t\t0: MIN_MAX (default)\n" |
| 188 | "\t\t2: KL_DIVERGENCE\n" |
| 189 | "\t-w, --weight_method\t(optional) the method to quantize weights\n" |
| 190 | "\t\t0: MIN_MAX (default)\n" |
| 191 | "\t\t1: ADMM\n" |
| 192 | "\t-r, --reverse_channel\t(optional) reverse B and R channel when preprocess image\n" |
| 193 | "\t\t0: the network uses rgb order (default)\n" |
| 194 | "\t\t1: the network uses bgr order\n" |
| 195 | "\t-n, --bias \t(optional) bias val when preprocess image " |
| 196 | "input, ie, " |
| 197 | "0.0,0.0,0.0 \n" |
| 198 | "\t-s, --scale \t(optional) scale val when preprocess image " |
| 199 | "input, ie, " |
| 200 | "1.0,1.0,1.0 \n" |
| 201 | "\t\tformula: y = (x - bias) * scale\n" |
| 202 | "\t-t, --merge_type\t(optional) merge blob/weights channel when quantize blob/weights\n" |
| 203 | "\t\t0: per-channel mode (default)\n" |
| 204 | "\t\t1: mix mode weight: per-channel blob: per-tensor\n" |
| 205 | "\t\t2: per-tersor mode\n" |
| 206 | "\t-o, --output \t(optional) specify the name of output\n"); |
| 207 | } |
| 208 | |
| 209 | int main(int argc, char* argv[]) { |
| 210 | // Init parameters |