fix doc of image size (#764)

* fix doc of image size, test=document_fix

* fix doc

* fix doc
pull/860/head^2
littletomatodonkey 2021-06-01 17:38:55 +08:00 committed by GitHub
parent 6c6a87f78e
commit a8f21e0167
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -246,7 +246,7 @@ Among them, the `--model` parameter is used to specify the model name, `--pretra
**Note**:
1. If `--output_path=./inference`, then three files will be generated in the folder `inference`, they are `inference.pdiparams`, `inference.pdmodel` and `inference.pdiparams.info`.
2. You can specify the `shape` of the model input image by setting the parameter `--img_size`, the default is `224`, which means the shape of input image is `224*224`.
2. You can specify the `shape` of the model input image by setting the parameter `--img_size`, the default is `224`, which means the shape of input image is `224*224`. If you want to use `Transformer series models`, such as `DeiT_***_384`, `ViT_***_384`, you need to set `--img_size=384`.
The above command will generate the model structure file (`inference.pdmodel`) and the model weight file (`inference.pdiparams`), and then the inference engine can be used for inference:

View File

@ -257,7 +257,8 @@ python tools/export_model.py \
**注意**
1. `--output_path`表示输出的inference模型文件夹路径若`--output_path=./inference`,则会在`inference`文件夹下生成`inference.pdiparams`、`inference.pdmodel`和`inference.pdiparams.info`文件。
2. 可以通过设置参数`--img_size`指定模型输入图像的`shape`,默认为`224`,表示图像尺寸为`224*224`,请根据实际情况修改。
2. 可以通过设置参数`--img_size`指定模型输入图像的`shape`,默认为`224`,表示图像尺寸为`224*224`,请根据实际情况修改;如果使用`Transformer`系列模型,如`DeiT_***_384`, `ViT_***_384`等,请注意模型的输入数据尺寸,需要设置参数`img_size=384`。
上述命令将生成模型结构文件(`inference.pdmodel`)和模型权重文件(`inference.pdiparams`),然后可以使用预测引擎进行推理:
@ -281,7 +282,6 @@ python tools/infer/predict.py \
+ `enable_calc_topk`: 是否计算预测结果的Topk精度指标默认为`False`
+ `gt_label_path`: 图像文件名以及真值标签文件,当`enable_calc_topk`为True时生效用于读取待预测的图像列表及其标签。
**注意**: 如果使用`Transformer`系列模型,如`DeiT_***_384`, `ViT_***_384`等,请注意模型的输入数据尺寸,需要设置参数`resize_short=384`, `resize=384`
* 如果你希望评测模型速度,建议使用该脚本(`tools/infer/predict.py`)同时开启TensorRT加速预测。