Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cherry-pick] update paddle2onnx doc #14051

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/ppocr/infer_deploy/paddle2onnx.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ After execution, the ONNX model will be saved in `./inference/det_onnx/`, `./inf

In addition, the following models do not currently support conversion to ONNX models: NRTR, SAR, RARE, SRN.

If you have optimization needs for the exported ONNX model, we recommend using `onnxslim`.
```bash linenums="1"
pip install onnxslim
onnxslim model.onnx slim.onnx
```

## 3. prediction

Take the English OCR model as an example, use **ONNXRuntime** to predict and execute the following commands:
Expand Down
6 changes: 6 additions & 0 deletions docs/ppocr/infer_deploy/paddle2onnx.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ paddle2onnx --model_dir ./inference/ch_ppocr_mobile_v2.0_cls_infer \
--input_shape_dict "{'x': [-1,3,-1,-1]}"
```

如你对导出的 ONNX 模型有优化的需求,推荐使用 `onnxslim` 对模型进行优化:
```bash linenums="1"
pip install onnxslim
onnxslim model.onnx slim.onnx
```

## 3. 推理预测

以中文OCR模型为例,使用 ONNXRuntime 预测可执行如下命令:
Expand Down