|
|
@@ -75,17 +75,17 @@ Linux:
|
|
|
|
|
|
Windows:
|
|
|
```
|
|
|
-./paddlex-encryption/tool/paddlex_encrypt_tool.exe -model_dir /path/to/paddlex_inference_model -save_dir /path/to/paddlex_encrypted_model
|
|
|
+./paddlex-encryption/tool/paddlex_encrypt_tool.exe -model_dir path\to\paddlex_inference_model -save_dir path/to/paddlex_encrypted_model
|
|
|
```
|
|
|
|
|
|
-`-model_dir`用于指定inference模型路径(参考[导出inference模型](deploy_python.html#inference)将模型导出为inference格式模型),可使用[导出小度熊识别模型](deploy_python.html#inference)中导出的`inference_model`(**注意**:由于PaddleX代码的持续更新,版本低于1.0.0的模型暂时无法直接用于预测部署,参考[模型版本升级](../upgrade_version.md)对模型版本进行升级。)。加密完成后,加密过的模型会保存至指定的`-save_dir`下,包含`__model__.encrypted`、`__params__.encrypted`和`model.yml`三个文件,同时生成密钥信息,命令输出如下图所示,密钥为`kLAl1qOs5uRbFt0/RrIDTZW2+tOf5bzvUIaHGF8lJ1c=`
|
|
|
+`-model_dir`用于指定inference模型路径(参考[导出inference模型](deploy_python.html#inference)将模型导出为inference格式模型),可使用[导出小度熊识别模型](deploy_python.html#inference)中导出的`inference_model`。加密完成后,加密过的模型会保存至指定的`-save_dir`下,包含`__model__.encrypted`、`__params__.encrypted`和`model.yml`三个文件,同时生成密钥信息,命令输出如下图所示,密钥为`kLAl1qOs5uRbFt0/RrIDTZW2+tOf5bzvUIaHGF8lJ1c=`
|
|
|
|
|
|

|
|
|
|
|
|
## 2. PaddleX C++加密部署
|
|
|
|
|
|
### 2.1 Linux平台使用
|
|
|
-参考[Linux平台编译指南](deploy_cpp/deploy_cpp_linux.md)编译C++部署代码。编译成功后,预测demo的可执行程序分别为`build/demo/detector`,`build/demo/classifer`,`build/demo/segmenter`,用户可根据自己的模型类型选择,其主要命令参数说明如下:
|
|
|
+参考[Linux平台编译指南](deploy_cpp/deploy_cpp_linux.md)编译C++部署代码。编译成功后,预测demo的可执行程序分别为`build/demo/detector`,`build/demo/classifier`,`build/demo/segmenter`,用户可根据自己的模型类型选择,其主要命令参数说明如下:
|
|
|
|
|
|
| 参数 | 说明 |
|
|
|
| ---- | ---- |
|
|
|
@@ -93,7 +93,7 @@ Windows:
|
|
|
| image | 要预测的图片文件路径 |
|
|
|
| image_list | 按行存储图片路径的.txt文件 |
|
|
|
| use_gpu | 是否使用 GPU 预测, 支持值为0或1(默认值为0) |
|
|
|
-| use_trt | 是否使用 TensorTr 预测, 支持值为0或1(默认值为0) |
|
|
|
+| use_trt | 是否使用 TensorRT 预测, 支持值为0或1(默认值为0) |
|
|
|
| gpu_id | GPU 设备ID, 默认值为0 |
|
|
|
| save_dir | 保存可视化结果的路径, 默认值为"output",classifier无该参数 |
|
|
|
| key | 加密过程中产生的密钥信息,默认值为""表示加载的是未加密的模型 |
|
|
|
@@ -136,24 +136,24 @@ Windows:
|
|
|
|
|
|
`样例一`:
|
|
|
|
|
|
-不使用`GPU`测试图片 `/path/to/xiaoduxiong.jpeg`
|
|
|
+不使用`GPU`测试图片 `\path\to\xiaoduxiong.jpeg`
|
|
|
|
|
|
```shell
|
|
|
-.\\paddlex_inference\\detector.exe --model_dir=\\path\\to\\inference_model --image=\\path\\to\\xiaoduxiong.jpeg --save_dir=output --key=kLAl1qOs5uRbFt0/RrIDTZW2+tOf5bzvUIaHGF8lJ1c=
|
|
|
+.\paddlex_inference\detector.exe --model_dir=\path\to\inference_model --image=\path\to\xiaoduxiong.jpeg --save_dir=output --key=kLAl1qOs5uRbFt0/RrIDTZW2+tOf5bzvUIaHGF8lJ1c=
|
|
|
```
|
|
|
`--key`传入加密工具输出的密钥,例如`kLAl1qOs5uRbFt0/RrIDTZW2+tOf5bzvUIaHGF8lJ1c=`, 图片文件`可视化预测结果`会保存在`save_dir`参数设置的目录下。
|
|
|
|
|
|
|
|
|
`样例二`:
|
|
|
|
|
|
-使用`GPU`预测多个图片`\\path\\to\\image_list.txt`,image_list.txt内容的格式如下:
|
|
|
+使用`GPU`预测多个图片`\path\to\image_list.txt`,image_list.txt内容的格式如下:
|
|
|
```
|
|
|
-\\path\\to\\images\\xiaoduxiong1.jpeg
|
|
|
-\\path\\to\\images\\xiaoduxiong2.jpeg
|
|
|
+\path\to\images\xiaoduxiong1.jpeg
|
|
|
+\path\to\images\xiaoduxiong2.jpeg
|
|
|
...
|
|
|
-\\path\\to\\images\\xiaoduxiongn.jpeg
|
|
|
+\path\to\images\xiaoduxiongn.jpeg
|
|
|
```
|
|
|
```shell
|
|
|
-.\\paddlex_inference\\detector.exe --model_dir=\\path\\to\\models\\inference_model --image_list=\\path\\to\\images_list.txt --use_gpu=1 --save_dir=output --key=kLAl1qOs5uRbFt0/RrIDTZW2+tOf5bzvUIaHGF8lJ1c=
|
|
|
+.\paddlex_inference\detector.exe --model_dir=\path\to\models\inference_model --image_list=\path\to\images_list.txt --use_gpu=1 --save_dir=output --key=kLAl1qOs5uRbFt0/RrIDTZW2+tOf5bzvUIaHGF8lJ1c=
|
|
|
```
|
|
|
`--key`传入加密工具输出的密钥,例如`kLAl1qOs5uRbFt0/RrIDTZW2+tOf5bzvUIaHGF8lJ1c=`, 图片文件`可视化预测结果`会保存在`save_dir`参数设置的目录下。
|