From 875ecbe08f89788d467d0c7afd61709de8e00e70 Mon Sep 17 00:00:00 2001 From: inisis Date: Mon, 21 Oct 2024 11:56:11 +0800 Subject: [PATCH] update paddle2onnx doc --- docs/ppocr/infer_deploy/paddle2onnx.en.md | 6 ++++++ docs/ppocr/infer_deploy/paddle2onnx.md | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/docs/ppocr/infer_deploy/paddle2onnx.en.md b/docs/ppocr/infer_deploy/paddle2onnx.en.md index 91d3dae509..45db4eae10 100644 --- a/docs/ppocr/infer_deploy/paddle2onnx.en.md +++ b/docs/ppocr/infer_deploy/paddle2onnx.en.md @@ -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: diff --git a/docs/ppocr/infer_deploy/paddle2onnx.md b/docs/ppocr/infer_deploy/paddle2onnx.md index b9c3c628d6..bd837b2ccc 100644 --- a/docs/ppocr/infer_deploy/paddle2onnx.md +++ b/docs/ppocr/infer_deploy/paddle2onnx.md @@ -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 预测可执行如下命令: