xref: /aosp_15_r20/external/armnn/tests/ImageTensorGenerator/README.md (revision 89c4ff92f2867872bb9e2354d150bf0c8c502810)
1*89c4ff92SAndroid Build Coastguard Worker# The ImageTensorGenerator
2*89c4ff92SAndroid Build Coastguard Worker
3*89c4ff92SAndroid Build Coastguard WorkerThe `ImageTensorGenerator` is a program for pre-processing a .jpg image before generating a .raw tensor file from it.
4*89c4ff92SAndroid Build Coastguard Worker
5*89c4ff92SAndroid Build Coastguard WorkerBuild option:
6*89c4ff92SAndroid Build Coastguard WorkerTo build ModelAccuracyTool, pass the following options to Cmake:
7*89c4ff92SAndroid Build Coastguard Worker* -DBUILD_ACCURACY_TOOL=1
8*89c4ff92SAndroid Build Coastguard Worker
9*89c4ff92SAndroid Build Coastguard Worker|Cmd:|||
10*89c4ff92SAndroid Build Coastguard Worker| ---|---|---|
11*89c4ff92SAndroid Build Coastguard Worker| -h | --help         | Display help messages |
12*89c4ff92SAndroid Build Coastguard Worker| -f | --model-format | Format of the intended model file that uses the images.Different formats have different image normalization styles.Accepted values (tflite) |
13*89c4ff92SAndroid Build Coastguard Worker| -i | --infile       | Input image file to generate tensor from |
14*89c4ff92SAndroid Build Coastguard Worker| -o | --outfile      | Output raw tensor file path |
15*89c4ff92SAndroid Build Coastguard Worker| -z | --output-type  | The data type of the output tensors.If unset, defaults to "float" for all defined inputs. Accepted values (float, int or qasymm8)
16*89c4ff92SAndroid Build Coastguard Worker|    | --new-width    |Resize image to new width. Keep original width if unspecified |
17*89c4ff92SAndroid Build Coastguard Worker|    | --new-height   |             Resize image to new height. Keep original height if unspecified |
18*89c4ff92SAndroid Build Coastguard Worker| -l | --layout       | Output data layout, "NHWC" or "NCHW". Default value: NHWC |
19*89c4ff92SAndroid Build Coastguard Worker
20*89c4ff92SAndroid Build Coastguard WorkerExample usage: <br>
21*89c4ff92SAndroid Build Coastguard Worker<code>./ImageTensorGenerator -i /path/to/image/dog.jpg -o /output/path/dog.raw --new-width 224 --new-height 224</code>