Skip to content

Commit a8c5dd4

Browse files
authored
fix vl docs (#17612) (#17613)
* fix vl docs (#17612) * fix mkdocs (#17614)
1 parent 3eb3ad9 commit a8c5dd4

File tree

3 files changed

+12
-69
lines changed

3 files changed

+12
-69
lines changed

docs/version3.x/pipeline_usage/PaddleOCR-VL.en.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1446,7 +1446,8 @@ Setting it to <code>None</code> means using the instantiation parameter; otherwi
14461446
- Calling the `save_to_img()` method will save the visualization results to the specified `save_path`. If a directory is specified, visualized images for layout region detection, global OCR, layout reading order, etc., will be saved. If a file is specified, it will be saved directly to that file. (Pipelines typically contain many result images, so it is not recommended to directly specify a specific file path, as multiple images will be overwritten, retaining only the last one.)
14471447
- Calling the `save_to_markdown()` method will save the converted Markdown file to the specified `save_path`. The saved file path will be `save_path/{your_img_basename}.md`. If the input is a PDF file, it is recommended to directly specify a directory; otherwise, multiple markdown files will be overwritten.
14481448

1449-
Additionally, it also supports obtaining visualized images and prediction results with results through attributes, as follows:<table>
1449+
<li>Additionally, it also supports obtaining visualized images and prediction results with results through attributes, as follows:
1450+
<table>
14501451
<thead>
14511452
<tr>
14521453
<th>Attribute</th>
@@ -1480,7 +1481,7 @@ Additionally, it also supports obtaining visualized images and prediction result
14801481
<li>The prediction result returned by the <code>img</code> attribute is data of dict type. The keys are <code>layout_det_res</code>, <code>overall_ocr_res</code>, <code>text_paragraphs_ocr_res</code>, <code>formula_res_region1</code>, <code>table_cell_img</code>, and <code>seal_res_region1</code>, with corresponding values being <code>Image.Image</code> objects: used to display visualized images of layout region detection, OCR, OCR text paragraphs, formulas, tables, and seal results, respectively. If optional modules are not used, the dict only contains <code>layout_det_res</code>.</li>
14811482
<li>The prediction result returned by the <code>markdown</code> attribute is data of dict type. The keys are <code>markdown_texts</code>, <code>markdown_images</code>, and <code>page_continuation_flags</code>, with corresponding values being markdown text, images displayed in Markdown (<code>Image.Image</code> objects), and a bool tuple used to identify whether the first element on the current page is the start of a paragraph and whether the last element is the end of a paragraph, respectively.</li>
14821483
</ul>
1483-
1484+
</li>
14841485
</details>
14851486

14861487
## 3. Enhancing VLM Inference Performance Using Inference Acceleration Frameworks
@@ -1591,7 +1592,7 @@ The parameters supported by this command are as follows:
15911592

15921593
### 3.2 Client Usage Methods
15931594

1594-
After launching the VLM inference service, the client can call the service through PaddleOCR. **Please note that because the client needs to invoke the sequential model for layout detection, it is still recommended to run the client on GPU or other acceleration devices to achieve more stable and efficient performance. Please refer to Section 1 for the client-side environment configuration. The configuration described in Section 3.1 applies only to starting the service and is not applicable to the client.**
1595+
After launching the VLM inference service, the client can call the service through PaddleOCR. **Please note that because the client needs to call the layout detection model, it is still recommended to run the client on GPU or other acceleration devices to achieve more stable and efficient performance. Please refer to Section 1 for the client-side environment configuration. The configuration described in Section 3.1 applies only to starting the service and is not applicable to the client.**
15951596

15961597
#### 3.2.1 CLI Invocation
15971598

docs/version3.x/pipeline_usage/PaddleOCR-VL.md

Lines changed: 6 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,6 +1211,8 @@ output = pipeline.predict(["imgs/file1.png", "imgs/file2.png", "imgs/file3.png"]
12111211
<th>参数说明</th>
12121212
<th>参数类型</th>
12131213
<th>默认值</th>
1214+
</tr>
1215+
</thead>
12141216
<tr>
12151217
<td><code>res_list</code></td>
12161218
<td><b>含义:</b>多页 PDF 推理预测出的结果列表。</td>
@@ -1235,6 +1237,7 @@ output = pipeline.predict(["imgs/file1.png", "imgs/file2.png", "imgs/file3.png"]
12351237
<td><code>Bool</code></td>
12361238
<td><code>False</code></td>
12371239
</tr>
1240+
</table>
12381241
</details>
12391242

12401243
<details><summary>(4)对预测结果进行处理:每个样本的预测结果均为对应的Result对象,且支持打印、保存为图片、保存为<code>json</code>文件的操作:</summary>
@@ -1412,68 +1415,7 @@ output = pipeline.predict(["imgs/file1.png", "imgs/file2.png", "imgs/file3.png"]
14121415
</li>
14131416
<li>调用<code>save_to_img()</code> 方法会将可视化结果保存到指定的<code>save_path</code>中,如果指定为目录,则会将版面区域检测可视化图像、全局OCR可视化图像、版面阅读顺序可视化图像等内容保存,如果指定为文件,则直接保存到该文件中。</li>
14141417
<li>调用<code>save_to_markdown()</code> 方法会将转化后的 Markdown 文件保存到指定的<code>save_path</code>中,保存的文件路径为<code>save_path/{your_img_basename}.md</code>,如果输入是 PDF 文件,建议直接指定目录,否责多个 markdown 文件会被覆盖。</li>
1415-
1416-
- `page_index`: `(Union[int, None])` 如果输入是PDF文件,则表示当前是PDF的第几页,否则为 `None`
1417-
1418-
- `page_count`: `(Union[int, None])` 如果输入是PDF文件,表示当前是PDF的总页数,否则为 `None`
1419-
1420-
- `width`: `(int)` 原始输入图像的宽度。
1421-
1422-
- `height`: `(int)` 原始输入图像的高度。
1423-
1424-
- `model_settings`: `(Dict[str, bool])` 配置 PaddleOCR-VL 所需的模型参数
1425-
1426-
- `use_doc_preprocessor`: `(bool)` 控制是否启用文档预处理子产线
1427-
- `use_layout_detection`: `(bool)` 控制是否启用版面检测模块
1428-
- `use_chart_recognition`: `(bool)` 控制是否开启图表识别功能
1429-
- `format_block_content`: `(bool)` 控制是否在`JSON`中保存格式化后的markdown内容
1430-
- `markdown_ignore_labels`: `(List[str])` 需要在Markdown中忽略的版面标签
1431-
1432-
- `doc_preprocessor_res`: `(Dict[str, Union[List[float], str]])` 文档预处理结果dict,仅当`use_doc_preprocessor=True`时存在
1433-
- `input_path`: `(str)` 文档预处理子接受的图像路径,当输入为`numpy.ndarray`时,保存为`None`,此处为`None`
1434-
- `page_index`: `None`,此处的输入为`numpy.ndarray`,所以值为`None`
1435-
- `model_settings`: `(Dict[str, bool])` 文档预处理子的模型配置参数
1436-
- `use_doc_orientation_classify`: `(bool)` 控制是否启用文档图像方向分类子模块
1437-
- `use_doc_unwarping`: `(bool)` 控制是否启用文本图像扭曲矫正子模块
1438-
- `angle`: `(int)` 文档图像方向分类子模块的预测结果,启用时返回实际角度值
1439-
1440-
- `parsing_res_list`: `(List[Dict])` 解析结果的列表,每个元素为一个字典,列表顺序为解析后的阅读顺序。
1441-
- `block_bbox`: `(np.ndarray)` 版面区域的边界框。
1442-
- `block_label`: `(str)` 版面区域的标签,例如`text`, `table`等。
1443-
- `block_content`: `(str)` 内容为版面区域内的内容。
1444-
- `block_id`: `(int)` 版面区域的索引,用于显示版面排序结果。
1445-
- `block_order` `(int)` 版面区域的顺序,用于显示版面阅读顺序,对于非排序部分,默认值为 `None`。
1446-
1447-
- 调用`save_to_json()` 方法会将上述内容保存到指定的 `save_path` 中,如果指定为目录,则保存的路径为`save_path/{your_img_basename}_res.json`,如果指定为文件,则直接保存到该文件中。由于 json 文件不支持保存numpy数组,因此会将其中的 `numpy.array` 类型转换为列表形式。json中的字段内容如下:
1448-
- `input_path`: `(str)` 待预测图像或者PDF的输入路径
1449-
1450-
- `page_index`: `(Union[int, None])` 如果输入是PDF文件,则表示当前是PDF的第几页,否则为 `None`
1451-
1452-
- `model_settings`: `(Dict[str, bool])` 配置 PaddleOCR-VL 所需的模型参数
1453-
1454-
- `use_doc_preprocessor`: `(bool)` 控制是否启用文档预处理子产线
1455-
- `use_layout_detection`: `(bool)` 控制是否启用版面检测模块
1456-
- `use_chart_recognition`: `(bool)` 控制是否开启图表识别功能
1457-
- `format_block_content`: `(bool)` 控制是否在`JSON`中保存格式化后的markdown内容
1458-
1459-
- `doc_preprocessor_res`: `(Dict[str, Union[List[float], str]])` 文档预处理结果dict,仅当`use_doc_preprocessor=True`时存在
1460-
- `input_path`: `(str)` 文档预处理子接受的图像路径,当输入为`numpy.ndarray`时,保存为`None`,此处为`None`
1461-
- `page_index`: `None`,此处的输入为`numpy.ndarray`,所以值为`None`
1462-
- `model_settings`: `(Dict[str, bool])` 文档预处理子的模型配置参数
1463-
- `use_doc_orientation_classify`: `(bool)` 控制是否启用文档图像方向分类子模块
1464-
- `use_doc_unwarping`: `(bool)` 控制是否启用文本图像扭曲矫正子模块
1465-
- `angle`: `(int)` 文档图像方向分类子模块的预测结果,启用时返回实际角度值
1466-
1467-
- `parsing_res_list`: `(List[Dict])` 解析结果的列表,每个元素为一个字典,列表顺序为解析后的阅读顺序。
1468-
- `block_bbox`: `(np.ndarray)` 版面区域的边界框。
1469-
- `block_label`: `(str)` 版面区域的标签,例如`text`, `table`等。
1470-
- `block_content`: `(str)` 内容为版面区域内的内容。
1471-
- `block_id`: `(int)` 版面区域的索引,用于显示版面排序结果。
1472-
- `block_order` `(int)` 版面区域的顺序,用于显示版面阅读顺序,对于非排序部分,默认值为 `None`
1473-
- 调用`save_to_img()` 方法会将可视化结果保存到指定的 `save_path` 中,如果指定为目录,则会将版面区域检测可视化图像、全局OCR可视化图像、版面阅读顺序可视化图像等内容保存,如果指定为文件,则直接保存到该文件中。
1474-
- 调用`save_to_markdown()` 方法会将转化后的 Markdown 文件保存到指定的 `save_path` 中,保存的文件路径为`save_path/{your_img_basename}.md`,如果输入是 PDF 文件,建议直接指定目录,否责多个 markdown 文件会被覆盖。
1475-
1476-
此外,也支持通过属性获取带结果的可视化图像和预测结果,具体如下:
1418+
<li>此外,也支持通过属性获取带结果的可视化图像和预测结果,具体如下:
14771419
<table>
14781420
<thead>
14791421
<tr>
@@ -1507,7 +1449,7 @@ output = pipeline.predict(["imgs/file1.png", "imgs/file2.png", "imgs/file3.png"]
15071449
<li><code>json</code> 属性获取的预测结果为dict类型的数据,相关内容与调用 <code>save_to_json()</code> 方法保存的内容一致。</li>
15081450
<li><code>img</code> 属性返回的预测结果是一个dict类型的数据。其中,键分别为 <code>ocr_res_img</code> 和 <code>preprocessed_img</code>,对应的值是两个 <code>Image.Image</code> 对象:一个用于显示 OCR 结果的可视化图像,另一个用于展示图像预处理的可视化图像。如果没有使用图像预处理子模块,则dict中只包含 <code>ocr_res_img</code>。</li>
15091451
</ul>
1510-
1452+
</li>
15111453
</details>
15121454

15131455

@@ -1629,7 +1571,7 @@ paddleocr genai_server --model_name PaddleOCR-VL-1.5-0.9B --backend vllm --port
16291571

16301572
### 3.2 客户端使用方法
16311573

1632-
启动 VLM 推理服务后,客户端即可通过 PaddleOCR 调用该服务。**请注意,由于客户端需要调用版面检测的顺序模型,仍建议在 GPU 等加速设备上运行客户端,以获得更稳定和高效的性能。客户端环境配置请参考第 1 节,3.1 节介绍的环境配置仅适用于启动服务,不适用于客户端。**
1574+
启动 VLM 推理服务后,客户端即可通过 PaddleOCR 调用该服务。**请注意,由于客户端需要调用版面检测模型,仍建议在 GPU 等加速设备上运行客户端,以获得更稳定和高效的性能。客户端环境配置请参考第 1 节,3.1 节介绍的环境配置仅适用于启动服务,不适用于客户端。**
16331575

16341576
#### 3.2.1 CLI 调用
16351577

mkdocs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,8 @@ nav:
308308
- PaddleOCR-VL-1.5简介: version3.x/algorithm/PaddleOCR-VL/PaddleOCR-VL-1.5.md
309309
- PaddleOCR-VL简介: version3.x/algorithm/PaddleOCR-VL/PaddleOCR-VL.md
310310
- PaddleOCR-VL NVIDIA Blackwell 架构 GPU 环境配置教程: version3.x/pipeline_usage/PaddleOCR-VL-NVIDIA-Blackwell.md
311-
- PaddleOCR-VL 昆仑芯 XPU 环境配置教程: version3.x/pipeline_usage/PaddleOCR-VL-Kunlunxin-XPU.md
312-
- PaddleOCR-VL 海光 DCU 环境配置教程: version3.x/pipeline_usage/PaddleOCR-VL-Hygon-DCU.md
311+
- PaddleOCR-VL 昆仑芯 XPU 环境配置教程: version3.x/pipeline_usage/PaddleOCR-VL-KUNLUNXIN-XPU.md
312+
- PaddleOCR-VL 海光 DCU 环境配置教程: version3.x/pipeline_usage/PaddleOCR-VL-HYGON-DCU.md
313313
- PaddleOCR-VL 沐曦 GPU 环境配置教程: version3.x/pipeline_usage/PaddleOCR-VL-MetaX-GPU.md
314314
- PaddleOCR-VL 天数 GPU 环境配置教程: version3.x/pipeline_usage/PaddleOCR-VL-Iluvatar-GPU.md
315315
- PaddleOCR-VL 华为昇腾 NPU 环境配置教程: version3.x/pipeline_usage/PaddleOCR-VL-Huawei-Ascend-NPU.md

0 commit comments

Comments
 (0)