未验证 提交 f55dcfab 编写于 作者: T Tingquan Gao 提交者: GitHub

Update to be more friendly (#674)

* Update, test=document_fix

* Add the usage hint about Transformers series models, test=document_fix
上级 97f4f557
......@@ -210,9 +210,13 @@ Among them:
+ `pretrained_model`: Weight file path, such as `./pretrained/MobileNetV3_large_x1_0_pretrained/`;
+ `use_gpu`: Whether to use the GPU, default by `True`;
+ `load_static_weights`: Whether to load the pre-trained model obtained from static image training, default by `False`;
+ `resize_short`: The length of the shortest side of the image that be scaled proportionally, default by `256`;
+ `resize`: The side length of the image that be center cropped from resize_shorted image, default by `224`;
+ `pre_label_image`: Whether to pre-label the image data, default value: `False`;
+ `pre_label_out_idr`: The output path of pre-labeled image data. When `pre_label_image=True`, a lot of subfolders will be generated under the path, each subfolder represent a category, which stores all the images predicted by the model to belong to the category.
**Note**: If you want to use `Transformer series models`, such as `DeiT_***_384`, `ViT_***_384`, etc., please pay attention to the input size of model, and need to set `resize_short=384`, `reize=384`.
About more detailed infomation, you can refer to [infer.py](../../../tools/infer/infer.py).
<a name="model_inference"></a>
......@@ -253,6 +257,9 @@ Among them:
+ `use_tensorrt`: Whether to use the TesorRT, default by `True`;
+ `use_gpu`: Whether to use the GPU, default by `True`
+ `enable_mkldnn`: Wheter to use `MKL-DNN`, default by `False`. When both `use_gpu` and `enable_mkldnn` are set to `True`, GPU is used to run and `enable_mkldnn` will be ignored.
+ `resize_short`: The length of the shortest side of the image that be scaled proportionally, default by `256`;
+ `resize`: The side length of the image that be center cropped from resize_shorted image, default by `224`;
**Note**: If you want to use `Transformer series models`, such as `DeiT_***_384`, `ViT_***_384`, etc., please pay attention to the input size of model, and need to set `resize_short=384`, `reize=384`.
If you want to evaluate the speed of the model, it is recommended to use [predict.py](../../../tools/infer/predict.py), and enable TensorRT to accelerate.
......@@ -73,6 +73,8 @@ paddleclas --model_name=ResNet50 --top_k=5 --image_file='docs/images/whl/demo.jp
* pre_label_image(bool): whether prelabel or not, default=False.
* pre_label_out_idr(str): If prelabeling, the path of output.
**Note**: If you want to use `Transformer series models`, such as `DeiT_***_384`, `ViT_***_384`, etc., please pay attention to the input size of model, and need to set `resize_short=384`, `reize=384`.
### 3. Different Usages of Codes
**We provide two ways to use: 1. Python interative programming 2. Bash command line programming**
......
......@@ -224,9 +224,13 @@ python tools/infer/infer.py \
+ `pretrained_model`:模型权重文件路径,如 `./output/MobileNetV3_large_x1_0/best_model/ppcls`
+ `use_gpu` : 是否开启GPU训练,默认值:`True`
+ `load_static_weights` : 模型权重文件是否为静态图训练得到的,默认值:`False`
+ `resize_short`: 对输入图像进行等比例缩放,表示最短边的尺寸,默认值:`256`
+ `resize`: 对`resize_short`操作后的进行居中裁剪,表示裁剪的尺寸,默认值:`224`
+ `pre_label_image` : 是否对图像数据进行预标注,默认值:`False`
+ `pre_label_out_idr` : 预标注图像数据的输出文件夹,当`pre_label_image=True`时,会在该文件夹下面生成很多个子文件夹,每个文件夹名称为类别id,其中存储模型预测属于该类别的所有图像。
**注意**: 如果使用`Transformer`系列模型,如`DeiT_***_384`, `ViT_***_384`等,请注意模型的输入数据尺寸,需要设置参数`resize_short=384`, `reize=384`
<a name="model_inference"></a>
## 4. 使用inference模型进行模型推理
......@@ -265,5 +269,9 @@ python tools/infer/predict.py \
+ `use_tensorrt`:是否使用 TesorRT 预测引擎,默认值:`True`
+ `use_gpu`:是否使用 GPU 预测,默认值:`True`
+ `enable_mkldnn`:是否启用`MKL-DNN`加速,默认为`False`。注意`enable_mkldnn``use_gpu`同时为`True`时,将忽略`enable_mkldnn`,而使用GPU运行。
+ `resize_short`: 对输入图像进行等比例缩放,表示最短边的尺寸,默认值:`256`
+ `resize`: 对`resize_short`操作后的进行居中裁剪,表示裁剪的尺寸,默认值:`224`
**注意**: 如果使用`Transformer`系列模型,如`DeiT_***_384`, `ViT_***_384`等,请注意模型的输入数据尺寸,需要设置参数`resize_short=384`, `reize=384`
* 如果你希望评测模型速度,建议使用该脚本(`tools/infer/predict.py`),同时开启TensorRT加速预测。
......@@ -72,6 +72,8 @@ paddleclas --model_name=ResNet50 --top_k=5 --image_file='docs/images/whl/demo.jp
* pre_label_image(bool): 是否需要进行预标注。
* pre_label_out_idr(str): 进行预标注后,输出结果的文件路径,默认为None。
**注意**: 如果使用`Transformer`系列模型,如`DeiT_***_384`, `ViT_***_384`等,请注意模型的输入数据尺寸,需要设置参数`resize_short=384`, `reize=384`
### 3. 代码使用方法
**提供两种使用方式:1、python交互式编程。2、bash命令行式编程**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册