The hb_eval_preprocess tool is used for preprocessing image data on x86 system.
Preprocessing refers to certain image data operations before being fed into the model, e.g., image resizing, image cropping, image padding, etc.
The basic flow of the hb_eval_preprocess tool to preprocess an image and generate a binary file is shown below:
The board-side model is only supported by the AIbenchmark PTQ sample model, whose model is included:
mobilenetv1, mobilenetv2, resnet50, googlenet, efficientnet_lite0, efficientnet_lite1, efficientnet_lite2, efficientnet_lite3, efficientnet_lite4, vargconvnet, efficientnasnet_m, efficientnasnet_s, resnet18, yolov2_darknet19, yolov3_darknet53, yolov5x、ssd_mobilenetv1, centernet_resnet101, yolov3_vargdarknet, deeplabv3plus_efficientnetb0, fastscnn_efficientnetb0, deeplabv3plus_efficientnetm1, deeplabv3plus_efficientnetm2.
| Parameter Name | Parameter Description |
-h, --help | Display help information and exit. |
--version | Display version information and exit. |
-m, --model_name | Specify the model name. You can use the hb_eval_preprocess --help command to see supported models. |
-i, --image_dir | Specify the path of input images. |
-o, --output_dir | Specify the output path. |
-v, --val_txt | Specify the name of the image file required by the evaluation. The preprocessing will use these names to generate images. |
Taking the resnet50 model as an example, you can use the following command to preprocess the image:
The hb_eval_preprocess tool will generate binary image files in the directory specified by the --output_dir parameter.
More application samples of the hb_eval_preprocess tool in the accuracy evaluations of on-board models can be found in Data Pre-process.