Răsfoiți Sursa

update api ref (#2942)

* merge develop

* merge develop

* merge develop

* merge develop

* merge develop

* update

* merge develop

* merge develop

* update module_usage docs

* pdate
zhang-prog 9 luni în urmă
părinte
comite
9f5275efc1
54 a modificat fișierele cu 1711 adăugiri și 1537 ștergeri
  1. 2 0
      docs/module_usage/tutorials/cv_modules/anomaly_detection.md
  2. 2 0
      docs/module_usage/tutorials/cv_modules/face_detection.md
  3. 2 0
      docs/module_usage/tutorials/cv_modules/face_feature.md
  4. 2 0
      docs/module_usage/tutorials/cv_modules/human_detection.md
  5. 2 0
      docs/module_usage/tutorials/cv_modules/image_classification.md
  6. 2 0
      docs/module_usage/tutorials/cv_modules/image_feature.md
  7. 2 0
      docs/module_usage/tutorials/cv_modules/image_multilabel_classification.md
  8. 2 0
      docs/module_usage/tutorials/cv_modules/instance_segmentation.md
  9. 2 0
      docs/module_usage/tutorials/cv_modules/mainbody_detection.md
  10. 2 0
      docs/module_usage/tutorials/cv_modules/object_detection.md
  11. 2 0
      docs/module_usage/tutorials/cv_modules/pedestrian_attribute_recognition.md
  12. 2 0
      docs/module_usage/tutorials/cv_modules/semantic_segmentation.md
  13. 2 0
      docs/module_usage/tutorials/cv_modules/small_object_detection.md
  14. 2 0
      docs/module_usage/tutorials/cv_modules/vehicle_attribute_recognition.md
  15. 2 0
      docs/module_usage/tutorials/cv_modules/vehicle_detection.md
  16. 2 0
      docs/module_usage/tutorials/ocr_modules/doc_img_orientation_classification.md
  17. 2 0
      docs/module_usage/tutorials/ocr_modules/formula_recognition.md
  18. 2 0
      docs/module_usage/tutorials/ocr_modules/layout_detection.md
  19. 2 0
      docs/module_usage/tutorials/ocr_modules/seal_text_detection.md
  20. 2 0
      docs/module_usage/tutorials/ocr_modules/table_structure_recognition.md
  21. 2 0
      docs/module_usage/tutorials/ocr_modules/text_detection.md
  22. 2 0
      docs/module_usage/tutorials/ocr_modules/text_image_unwarping.md
  23. 2 0
      docs/module_usage/tutorials/ocr_modules/text_recognition.md
  24. 2 0
      docs/module_usage/tutorials/time_series_modules/time_series_anomaly_detection.md
  25. 2 0
      docs/module_usage/tutorials/time_series_modules/time_series_classification.md
  26. 2 0
      docs/module_usage/tutorials/time_series_modules/time_series_forecasting.md
  27. 172 0
      docs/pipeline_usage/tutorials/cv_pipelines/3d_bev_detection.md
  28. 27 3
      docs/pipeline_usage/tutorials/cv_pipelines/face_recognition.md
  29. 27 3
      docs/pipeline_usage/tutorials/cv_pipelines/general_image_recognition.md
  30. 159 4
      docs/pipeline_usage/tutorials/cv_pipelines/human_keypoint_detection.md
  31. 1 1
      docs/pipeline_usage/tutorials/cv_pipelines/image_anomaly_detection.md
  32. 4 23
      docs/pipeline_usage/tutorials/cv_pipelines/image_classification.md
  33. 3 22
      docs/pipeline_usage/tutorials/cv_pipelines/image_multi_label_classification.md
  34. 12 1
      docs/pipeline_usage/tutorials/cv_pipelines/instance_segmentation.md
  35. 14 1
      docs/pipeline_usage/tutorials/cv_pipelines/object_detection.md
  36. 1 1
      docs/pipeline_usage/tutorials/cv_pipelines/open_vocabulary_detection.md
  37. 27 334
      docs/pipeline_usage/tutorials/cv_pipelines/open_vocabulary_segmentation.md
  38. 13 1
      docs/pipeline_usage/tutorials/cv_pipelines/pedestrian_attribute_recognition.md
  39. 11 0
      docs/pipeline_usage/tutorials/cv_pipelines/rotated_object_detection.md
  40. 7 1
      docs/pipeline_usage/tutorials/cv_pipelines/semantic_segmentation.md
  41. 14 1
      docs/pipeline_usage/tutorials/cv_pipelines/small_object_detection.md
  42. 13 1
      docs/pipeline_usage/tutorials/cv_pipelines/vehicle_attribute_recognition.md
  43. 157 313
      docs/pipeline_usage/tutorials/information_extraction_pipelines/document_scene_information_extraction.md
  44. 64 52
      docs/pipeline_usage/tutorials/ocr_pipelines/OCR.md
  45. 29 44
      docs/pipeline_usage/tutorials/ocr_pipelines/doc_preprocessor.md
  46. 33 37
      docs/pipeline_usage/tutorials/ocr_pipelines/formula_recognition.md
  47. 152 62
      docs/pipeline_usage/tutorials/ocr_pipelines/layout_parsing.md
  48. 174 42
      docs/pipeline_usage/tutorials/ocr_pipelines/layout_parsing_v2.md
  49. 94 51
      docs/pipeline_usage/tutorials/ocr_pipelines/seal_recognition.md
  50. 100 41
      docs/pipeline_usage/tutorials/ocr_pipelines/table_recognition.md
  51. 83 45
      docs/pipeline_usage/tutorials/ocr_pipelines/table_recognition_v2.md
  52. 230 0
      docs/pipeline_usage/tutorials/speech_pipelines/multilingual_speech_recognition.md
  53. 4 82
      docs/pipeline_usage/tutorials/video_pipelines/video_classification.md
  54. 34 371
      docs/pipeline_usage/tutorials/video_pipelines/video_detection.md

+ 2 - 0
docs/module_usage/tutorials/cv_modules/anomaly_detection.md

@@ -359,3 +359,5 @@ python main.py -c paddlex/configs/modules/image_anomaly_detection/STFPM.yaml \
 2.<b>模块集成</b>
 
 您产出的权重可以直接集成到图像异常检测模块中,可以参考[快速集成](#三快速集成)的 Python 示例代码,只需要将模型替换为你训练的到的模型路径即可。
+
+您也可以利用 PaddleX 高性能推理插件来优化您模型的推理过程,进一步提升效率,详细的流程请参考[PaddleX高性能推理指南](../../../pipeline_deploy/high_performance_inference.md)。

+ 2 - 0
docs/module_usage/tutorials/cv_modules/face_detection.md

@@ -453,3 +453,5 @@ python main.py -c paddlex/configs/modules/face_detection/PicoDet_LCNet_x2_5_face
 2.<b>模块集成</b>
 
 您产出的权重可以直接集成到人脸检测模块中,可以参考[快速集成](#三快速集成)的 Python 示例代码,只需要将模型替换为你训练的到的模型路径即可。
+
+您也可以利用 PaddleX 高性能推理插件来优化您模型的推理过程,进一步提升效率,详细的流程请参考[PaddleX高性能推理指南](../../../pipeline_deploy/high_performance_inference.md)。

+ 2 - 0
docs/module_usage/tutorials/cv_modules/face_feature.md

@@ -436,3 +436,5 @@ python main.py -c paddlex/configs/modules/face_feature/MobileFaceNet.yaml \
 2.<b>模块集成</b>
 
 您产出的权重可以直接集成到人脸特征模块中,可以参考[快速集成](#三快速集成)的 Python 示例代码,只需要将模型替换为你训练的到的模型路径即可。
+
+您也可以利用 PaddleX 高性能推理插件来优化您模型的推理过程,进一步提升效率,详细的流程请参考[PaddleX高性能推理指南](../../../pipeline_deploy/high_performance_inference.md)。

+ 2 - 0
docs/module_usage/tutorials/cv_modules/human_detection.md

@@ -432,3 +432,5 @@ python main.py -c paddlex/configs/modules/human_detection/PP-YOLOE-S_human.yaml
 2.**模块集成**
 
 您产出的权重可以直接集成到行人检测模块中,可以参考[快速集成](#三快速集成)的 Python 示例代码,只需要将模型替换为你训练的到的模型路径即可。
+
+您也可以利用 PaddleX 高性能推理插件来优化您模型的推理过程,进一步提升效率,详细的流程请参考[PaddleX高性能推理指南](../../../pipeline_deploy/high_performance_inference.md)。

+ 2 - 0
docs/module_usage/tutorials/cv_modules/image_classification.md

@@ -1060,3 +1060,5 @@ python main.py -c paddlex/configs/modules/image_classification/PP-LCNet_x1_0.yam
 2.<b>模块集成</b>
 
 您产出的权重可以直接集成到图像分类模块中,可以参考[快速集成](#三快速集成)的 Python 示例代码,只需要将模型替换为你训练的到的模型路径即可。
+
+您也可以利用 PaddleX 高性能推理插件来优化您模型的推理过程,进一步提升效率,详细的流程请参考[PaddleX高性能推理指南](../../../pipeline_deploy/high_performance_inference.md)。

+ 2 - 0
docs/module_usage/tutorials/cv_modules/image_feature.md

@@ -453,3 +453,5 @@ python main.py -c paddlex/configs/modules/image_feature/PP-ShiTuV2_rec.yaml  \
 2.<b>模块集成</b>
 
 您产出的权重可以直接集成到图像特征模块中,可以参考[快速集成](#三快速集成)的 Python 示例代码,只需要将模型替换为你训练的到的模型路径即可。
+
+您也可以利用 PaddleX 高性能推理插件来优化您模型的推理过程,进一步提升效率,详细的流程请参考[PaddleX高性能推理指南](../../../pipeline_deploy/high_performance_inference.md)。

+ 2 - 0
docs/module_usage/tutorials/cv_modules/image_multilabel_classification.md

@@ -496,3 +496,5 @@ python main.py -c paddlex/configs/modules/image_multilabel_classification/PP-LCN
 2.<b>模块集成</b>
 
 您产出的权重可以直接集成到图像多标签分类模块中,可以参考[快速集成](#三快速集成)的 Python 示例代码,只需要将模型替换为你训练的到的模型路径即可。
+
+您也可以利用 PaddleX 高性能推理插件来优化您模型的推理过程,进一步提升效率,详细的流程请参考[PaddleX高性能推理指南](../../../pipeline_deploy/high_performance_inference.md)。

+ 2 - 0
docs/module_usage/tutorials/cv_modules/instance_segmentation.md

@@ -577,3 +577,5 @@ python main.py -c paddlex/configs/modules/instance_segmentation/Mask-RT-DETR-L.y
 
 2.<b>模块集成</b>
 您产出的权重可以直接集成到实例分割模块中,可以参考[快速集成](#三快速集成)的 Python 示例代码,只需要将模型替换为你训练的到的模型路径即可。
+
+您也可以利用 PaddleX 高性能推理插件来优化您模型的推理过程,进一步提升效率,详细的流程请参考[PaddleX高性能推理指南](../../../pipeline_deploy/high_performance_inference.md)。

+ 2 - 0
docs/module_usage/tutorials/cv_modules/mainbody_detection.md

@@ -420,3 +420,5 @@ python main.py -c paddlex/configs/modules/mainbody_detection/PP-ShiTuV2_det.yaml
 2.<b>模块集成</b>
 
 您产出的权重可以直接集成到主体检测模块中,可以参考[快速集成](#三快速集成)的 Python 示例代码,只需要将模型替换为你训练的到的模型路径即可。
+
+您也可以利用 PaddleX 高性能推理插件来优化您模型的推理过程,进一步提升效率,详细的流程请参考[PaddleX高性能推理指南](../../../pipeline_deploy/high_performance_inference.md)。

+ 2 - 0
docs/module_usage/tutorials/cv_modules/object_detection.md

@@ -817,3 +817,5 @@ python main.py -c paddlex/configs/modules/object_detection/PicoDet-S.yaml  \
 2.<b>模块集成</b>
 
 您产出的权重可以直接集成到目标检测模块中,可以参考[快速集成](#三快速集成)的 Python 示例代码,只需要将模型替换为你训练的到的模型路径即可。
+
+您也可以利用 PaddleX 高性能推理插件来优化您模型的推理过程,进一步提升效率,详细的流程请参考[PaddleX高性能推理指南](../../../pipeline_deploy/high_performance_inference.md)。

+ 2 - 0
docs/module_usage/tutorials/cv_modules/pedestrian_attribute_recognition.md

@@ -267,3 +267,5 @@ python main.py -c paddlex/configs/modules/pedestrian_attribute_recognition/PP-LC
 2.<b>模块集成</b>
 
 您产出的权重可以直接集成到行人属性识别模块中,可以参考[快速集成](#三快速集成)的 Python 示例代码,只需要将模型替换为你训练的到的模型路径即可。
+
+您也可以利用 PaddleX 高性能推理插件来优化您模型的推理过程,进一步提升效率,详细的流程请参考[PaddleX高性能推理指南](../../../pipeline_deploy/high_performance_inference.md)。

+ 2 - 0
docs/module_usage/tutorials/cv_modules/semantic_segmentation.md

@@ -625,3 +625,5 @@ python main.py -c paddlex/configs/modules/semantic_segmentation/PP-LiteSeg-T.yam
 2.<b>模块集成</b>
 
 您产出的权重可以直接集成到语义分割模块中,可以参考[快速集成](#三快速集成)的 Python 示例代码,只需要将模型替换为你训练的到的模型路径即可。
+
+您也可以利用 PaddleX 高性能推理插件来优化您模型的推理过程,进一步提升效率,详细的流程请参考[PaddleX高性能推理指南](../../../pipeline_deploy/high_performance_inference.md)。

+ 2 - 0
docs/module_usage/tutorials/cv_modules/small_object_detection.md

@@ -466,3 +466,5 @@ python main.py -c paddlex/configs/modules/small_object_detection/PP-YOLOE_plus_S
 2.<b>模块集成</b>
 
 您产出的权重可以直接集成到小目标检测模块中,可以参考[快速集成](#三快速集成)的 Python 示例代码,只需要将模型替换为你训练的到的模型路径即可。
+
+您也可以利用 PaddleX 高性能推理插件来优化您模型的推理过程,进一步提升效率,详细的流程请参考[PaddleX高性能推理指南](../../../pipeline_deploy/high_performance_inference.md)。

+ 2 - 0
docs/module_usage/tutorials/cv_modules/vehicle_attribute_recognition.md

@@ -251,3 +251,5 @@ python main.py -c paddlex/configs/modules/vehicle_attribute_recognition/PP-LCNet
 2.<b>模块集成</b>
 
 您产出的权重可以直接集成到车辆属性识别模块中,可以参考[快速集成](#三快速集成)的 Python 示例代码,只需要将模型替换为你训练的到的模型路径即可。
+
+您也可以利用 PaddleX 高性能推理插件来优化您模型的推理过程,进一步提升效率,详细的流程请参考[PaddleX高性能推理指南](../../../pipeline_deploy/high_performance_inference.md)。

+ 2 - 0
docs/module_usage/tutorials/cv_modules/vehicle_detection.md

@@ -427,3 +427,5 @@ python main.py -c paddlex/configs/modules/vehicle_detection/PP-YOLOE-S_vehicle.y
 
 #### 4.4.2 模型集成
 您产出的权重可以直接集成到车辆检测模块中,可以参考[快速集成](#三快速集成)的 Python 示例代码,只需要将模型替换为你训练的到的模型路径即可。
+
+您也可以利用 PaddleX 高性能推理插件来优化您模型的推理过程,进一步提升效率,详细的流程请参考[PaddleX高性能推理指南](../../../pipeline_deploy/high_performance_inference.md)。

+ 2 - 0
docs/module_usage/tutorials/ocr_modules/doc_img_orientation_classification.md

@@ -434,3 +434,5 @@ python main.py -c paddlex/configs/modules/doc_text_orientation/PP-LCNet_x1_0_doc
 2.<b>模块集成</b>
 
 您产出的权重可以直接集成到文档图像方向分类模块中,可以参考[快速集成](#三快速集成)的 Python 示例代码,只需要将模型替换为你训练的到的模型路径即可。
+
+您也可以利用 PaddleX 高性能推理插件来优化您模型的推理过程,进一步提升效率,详细的流程请参考[PaddleX高性能推理指南](../../../pipeline_deploy/high_performance_inference.md)。

+ 2 - 0
docs/module_usage/tutorials/ocr_modules/formula_recognition.md

@@ -460,3 +460,5 @@ python main.py -c paddlex/configs/modules/formula_recognition/PP-FormulaNet-S.ya
 #### 4.4.2 模型集成
 
 您产出的权重可以直接集成到公式识别模块中,可以参考[快速集成](#三快速集成)的 Python 示例代码,只需要将模型替换为你训练的到的模型路径即可。
+
+您也可以利用 PaddleX 高性能推理插件来优化您模型的推理过程,进一步提升效率,详细的流程请参考[PaddleX高性能推理指南](../../../pipeline_deploy/high_performance_inference.md)。

+ 2 - 0
docs/module_usage/tutorials/ocr_modules/layout_detection.md

@@ -667,3 +667,5 @@ python main.py -c paddlex/configs/modules/layout_detection/PicoDet-L_layout_3cls
 
 1. <b>模块集成</b>
 您产出的权重可以直接集成到版面区域检测模块中,可以参考[快速集成](#三快速集成)的 Python 示例代码,只需要将模型替换为你训练的到的模型路径即可。
+
+您也可以利用 PaddleX 高性能推理插件来优化您模型的推理过程,进一步提升效率,详细的流程请参考[PaddleX高性能推理指南](../../../pipeline_deploy/high_performance_inference.md)。

+ 2 - 0
docs/module_usage/tutorials/ocr_modules/seal_text_detection.md

@@ -568,3 +568,5 @@ python main.py -c paddlex/configs/modules/seal_text_detection/PP-OCRv4_server_se
 2.<b>模块集成</b>
 
 您产出的权重可以直接集成到印章文本检测模块中,可以参考[快速集成](#三快速集成)的 Python 示例代码,只需要将模型替换为你训练的到的模型路径即可。
+
+您也可以利用 PaddleX 高性能推理插件来优化您模型的推理过程,进一步提升效率,详细的流程请参考[PaddleX高性能推理指南](../../../pipeline_deploy/high_performance_inference.md)。

+ 2 - 0
docs/module_usage/tutorials/ocr_modules/table_structure_recognition.md

@@ -410,3 +410,5 @@ python main.py -c paddlex/configs/modules/table_structure_recognition/SLANet.yam
 2.<b>模块集成</b>
 
 您产出的权重可以直接集成到表格结构识别模块中,可以参考[快速集成](#三快速集成)的 Python 示例代码,只需要将模型替换为你训练的到的模型路径即可。
+
+您也可以利用 PaddleX 高性能推理插件来优化您模型的推理过程,进一步提升效率,详细的流程请参考[PaddleX高性能推理指南](../../../pipeline_deploy/high_performance_inference.md)。

+ 2 - 0
docs/module_usage/tutorials/ocr_modules/text_detection.md

@@ -535,3 +535,5 @@ python main.py -c paddlex/configs/modules/text_detection/PP-OCRv4_mobile_det.yam
 2.<b>模块集成</b>
 
 您产出的权重可以直接集成到文本检测模块中,可以参考[快速集成](#三快速集成)的 Python 示例代码,只需要将模型替换为你训练的到的模型路径即可。
+
+您也可以利用 PaddleX 高性能推理插件来优化您模型的推理过程,进一步提升效率,详细的流程请参考[PaddleX高性能推理指南](../../../pipeline_deploy/high_performance_inference.md)。

+ 2 - 0
docs/module_usage/tutorials/ocr_modules/text_image_unwarping.md

@@ -215,3 +215,5 @@ for res in output:
 
 ## 四、二次开发
 当前模块暂时不支持微调训练,仅支持推理集成。关于该模块的微调训练,计划在未来支持。
+
+您也可以利用 PaddleX 高性能推理插件来优化您模型的推理过程,进一步提升效率,详细的流程请参考[PaddleX高性能推理指南](../../../pipeline_deploy/high_performance_inference.md)。

+ 2 - 0
docs/module_usage/tutorials/ocr_modules/text_recognition.md

@@ -658,3 +658,5 @@ python main.py -c paddlex/configs/modules/text_recognition/PP-OCRv4_mobile_rec.y
 2.<b>模块集成</b>
 
 您产出的权重可以直接集成到文本识别模块中,可以参考[快速集成](#三快速集成)的 Python 示例代码,只需要将模型替换为你训练的到的模型路径即可。
+
+您也可以利用 PaddleX 高性能推理插件来优化您模型的推理过程,进一步提升效率,详细的流程请参考[PaddleX高性能推理指南](../../../pipeline_deploy/high_performance_inference.md)。

+ 2 - 0
docs/module_usage/tutorials/time_series_modules/time_series_anomaly_detection.md

@@ -488,3 +488,5 @@ python main.py -c paddlex/configs/modules/ts_anomaly_detection/AutoEncoder_ad.ya
 2.<b>模块集成</b>
 
 您产出的权重可以直接集成到时序异常检测模块中,可以参考[快速集成](#三快速集成)的 Python 示例代码,只需要将模型替换为你训练的到的模型路径即可。
+
+您也可以利用 PaddleX 高性能推理插件来优化您模型的推理过程,进一步提升效率,详细的流程请参考[PaddleX高性能推理指南](../../../pipeline_deploy/high_performance_inference.md)。

+ 2 - 0
docs/module_usage/tutorials/time_series_modules/time_series_classification.md

@@ -466,3 +466,5 @@ python main.py -c paddlex/configs/modules/ts_classification/TimesNet_cls.yaml \
 2.<b>模块集成</b>
 
 您产出的权重可以直接集成到时序分类模块中,可以参考[快速集成](#三快速集成)的 Python 示例代码,只需要将模型替换为你训练的到的模型路径即可。
+
+您也可以利用 PaddleX 高性能推理插件来优化您模型的推理过程,进一步提升效率,详细的流程请参考[PaddleX高性能推理指南](../../../pipeline_deploy/high_performance_inference.md)。

+ 2 - 0
docs/module_usage/tutorials/time_series_modules/time_series_forecasting.md

@@ -534,3 +534,5 @@ python main.py -c paddlex/configs/modules/ts_forecast/DLinear.yaml \
 2.<b>模块集成</b>
 
 您产出的权重可以直接集成到时序预测模块中,可以参考[快速集成](#三快速集成)的 Python 示例代码,只需要将模型替换为你训练的到的模型路径即可。
+
+您也可以利用 PaddleX 高性能推理插件来优化您模型的推理过程,进一步提升效率,详细的流程请参考[PaddleX高性能推理指南](../../../pipeline_deploy/high_performance_inference.md)。

+ 172 - 0
docs/pipeline_usage/tutorials/cv_pipelines/3d_bev_detection.md

@@ -250,6 +250,178 @@ for res in output:
 
 ☁️ <b>服务化部署</b>:服务化部署是实际生产环境中常见的一种部署形式。通过将推理功能封装为服务,客户端可以通过网络请求来访问这些服务,以获取推理结果。PaddleX 支持多种产线服务化部署方案,详细的产线服务化部署流程请参考[PaddleX服务化部署指南](../../../pipeline_deploy/serving.md)。
 
+<details><summary>API参考</summary>
+
+<p>对于服务提供的主要操作:</p>
+<ul>
+<li>HTTP请求方法为POST。</li>
+<li>请求体和响应体均为JSON数据(JSON对象)。</li>
+<li>当请求处理成功时,响应状态码为<code>200</code>,响应体的属性如下:</li>
+</ul>
+<table>
+<thead>
+<tr>
+<th>名称</th>
+<th>类型</th>
+<th>含义</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>logId</code></td>
+<td><code>string</code></td>
+<td>请求的UUID。</td>
+</tr>
+<tr>
+<td><code>errorCode</code></td>
+<td><code>integer</code></td>
+<td>错误码。固定为<code>0</code>。</td>
+</tr>
+<tr>
+<td><code>errorMsg</code></td>
+<td><code>string</code></td>
+<td>错误说明。固定为<code>"Success"</code>。</td>
+</tr>
+<tr>
+<td><code>result</code></td>
+<td><code>object</code></td>
+<td>操作结果。</td>
+</tr>
+</tbody>
+</table>
+<ul>
+<li>当请求处理未成功时,响应体的属性如下:</li>
+</ul>
+<table>
+<thead>
+<tr>
+<th>名称</th>
+<th>类型</th>
+<th>含义</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>logId</code></td>
+<td><code>string</code></td>
+<td>请求的UUID。</td>
+</tr>
+<tr>
+<td><code>errorCode</code></td>
+<td><code>integer</code></td>
+<td>错误码。与响应状态码相同。</td>
+</tr>
+<tr>
+<td><code>errorMsg</code></td>
+<td><code>string</code></td>
+<td>错误说明。</td>
+</tr>
+</tbody>
+</table>
+<p>服务提供的主要操作如下:</p>
+<ul>
+<li><b><code>infer</code></b></li>
+</ul>
+<p>进行3D多模态融合检测。</p>
+<p><code>POST /bev-3d-object-detection</code></p>
+<ul>
+<li>请求体的属性如下:</li>
+</ul>
+<table>
+<thead>
+<tr>
+<th>名称</th>
+<th>类型</th>
+<th>含义</th>
+<th>是否必填</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>tar</code></td>
+<td><code>string</code></td>
+<td>服务器可访问的tar文件的URL或路径。</td>
+<td>是</td>
+</tr>
+</tbody>
+</table>
+<ul>
+<li>请求处理成功时,响应体的<code>result</code>具有如下属性:</li>
+</ul>
+<table>
+<thead>
+<tr>
+<th>名称</th>
+<th>类型</th>
+<th>含义</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>detectedObjects</code></td>
+<td><code>array</code></td>
+<td>目标的位置、类别等信息。</td>
+</tr>
+</tbody>
+</table>
+<p><code>detectedObjects</code>中的每个元素为一个<code>object</code>,具有如下属性:</p>
+<table>
+<thead>
+<tr>
+<th>名称</th>
+<th>类型</th>
+<th>含义</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>bbox</code></td>
+<td><code>array</code></td>
+<td>长度为9的列表, 0: 中心点x坐标、1: 中心点y坐标、2: 中心点z坐标、3: 检测框宽度、4: 检测框长度、5: 检测框高度、6: 旋转角度、7: 坐标系x方向速度、8: 坐标系y方向速度</td>
+</tr>
+<tr>
+<td><code>categoryId</code></td>
+<td><code>integer</code></td>
+<td>目标类别ID。</td>
+</tr>
+<tr>
+<td><code>score</code></td>
+<td><code>number</code></td>
+<td>目标得分。</td>
+</tr>
+</tbody>
+</table>
+</details>
+
+<details><summary>多语言调用服务示例</summary>
+
+<details>
+<summary>Python</summary>
+
+
+<pre><code class="language-python">
+import requests
+
+API_URL = &quot;http://localhost:8080/bev-3d-object-detection&quot; # 服务URL
+tar_path = &quot;./nuscenes_demo_infer.tar&quot;
+
+payload = {&quot;tar&quot;: tar_path}
+
+# 调用API
+response = requests.post(API_URL, json=payload)
+
+# 处理接口返回数据
+assert response.status_code == 200
+result = response.json()[&quot;result&quot;]
+with open(output_image_path, &quot;wb&quot;) as file:
+    file.write(base64.b64decode(result[&quot;image&quot;]))
+print(f&quot;Output image saved at {output_image_path}&quot;)
+print(&quot;Detected objects:&quot;)
+print(result[&quot;detectedObjects&quot;])
+</code></pre></details>
+</details>
+<br/>
+
 📱 <b>端侧部署</b>:端侧部署是一种将计算和数据处理功能放在用户设备本身上的方式,设备可以直接处理数据,而不需要依赖远程的服务器。PaddleX 支持将模型部署在 Android 等端侧设备上,详细的端侧部署流程请参考[PaddleX端侧部署指南](../../../pipeline_deploy/edge_deploy.md)。
 
 您可以根据需要选择合适的方式部署模型产线,进而进行后续的 AI 应用集成。

+ 27 - 3
docs/pipeline_usage/tutorials/cv_pipelines/face_recognition.md

@@ -732,7 +732,7 @@ data_root             # 数据集根目录,目录名称可以改变
 <td><code>indexKey</code></td>
 <td><code>string</code></td>
 <td>索引对应的键。由<code>buildIndex</code>操作提供。</td>
-<td></td>
+<td></td>
 </tr>
 </tbody>
 </table>
@@ -805,7 +805,7 @@ data_root             # 数据集根目录,目录名称可以改变
 <td><code>indexKey</code></td>
 <td><code>string</code></td>
 <td>索引对应的键。由<code>buildIndex</code>操作提供。</td>
-<td></td>
+<td></td>
 </tr>
 </tbody>
 </table>
@@ -858,6 +858,30 @@ data_root             # 数据集根目录,目录名称可以改变
 <td>索引对应的键。由<code>buildIndex</code>操作提供。</td>
 <td>否</td>
 </tr>
+<tr>
+<td><code>detThreshold</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>det_threshold</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>recThreshold</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>rec_threshold</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>hammingRadius</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>hamming_radius</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>topk</code></td>
+<td><code>integer</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>topk</code> 参数说明。</td>
+<td>否</td>
+</tr>
 </tbody>
 </table>
 <ul>
@@ -879,7 +903,7 @@ data_root             # 数据集根目录,目录名称可以改变
 </tr>
 <tr>
 <td><code>image</code></td>
-<td><code>string</code></td>
+<td><code>string</code> | <code>null</code></td>
 <td>识别结果图。图像为JPEG格式,使用Base64编码。</td>
 </tr>
 </tbody>

+ 27 - 3
docs/pipeline_usage/tutorials/cv_pipelines/general_image_recognition.md

@@ -696,7 +696,7 @@ data_root             # 数据集根目录,目录名称可以改变
 <td><code>indexKey</code></td>
 <td><code>string</code></td>
 <td>索引对应的键。由<code>buildIndex</code>操作提供。</td>
-<td></td>
+<td></td>
 </tr>
 </tbody>
 </table>
@@ -769,7 +769,7 @@ data_root             # 数据集根目录,目录名称可以改变
 <td><code>indexKey</code></td>
 <td><code>string</code></td>
 <td>索引对应的键。由<code>buildIndex</code>操作提供。</td>
-<td></td>
+<td></td>
 </tr>
 </tbody>
 </table>
@@ -822,6 +822,30 @@ data_root             # 数据集根目录,目录名称可以改变
 <td>索引对应的键。由<code>buildIndex</code>操作提供。</td>
 <td>否</td>
 </tr>
+<tr>
+<td><code>detThreshold</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>det_threshold</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>recThreshold</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>rec_threshold</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>hammingRadius</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>hamming_radius</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>topk</code></td>
+<td><code>integer</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>topk</code> 参数说明。</td>
+<td>否</td>
+</tr>
 </tbody>
 </table>
 <ul>
@@ -843,7 +867,7 @@ data_root             # 数据集根目录,目录名称可以改变
 </tr>
 <tr>
 <td><code>image</code></td>
-<td><code>string</code></td>
+<td><code>string</code> | <code>null</code></td>
 <td>识别结果图。图像为JPEG格式,使用Base64编码。</td>
 </tr>
 </tbody>

+ 159 - 4
docs/pipeline_usage/tutorials/cv_pipelines/human_keypoint_detection.md

@@ -496,6 +496,161 @@ for res in output:
 以下是基础服务化部署的API参考与多语言服务调用示例:
 
 <details><summary>API参考</summary>
+<p>对于服务提供的主要操作:</p>
+<ul>
+<li>HTTP请求方法为POST。</li>
+<li>请求体和响应体均为JSON数据(JSON对象)。</li>
+<li>当请求处理成功时,响应状态码为<code>200</code>,响应体的属性如下:</li>
+</ul>
+<table>
+<thead>
+<tr>
+<th>名称</th>
+<th>类型</th>
+<th>含义</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>logId</code></td>
+<td><code>string</code></td>
+<td>请求的UUID。</td>
+</tr>
+<tr>
+<td><code>errorCode</code></td>
+<td><code>integer</code></td>
+<td>错误码。固定为<code>0</code>。</td>
+</tr>
+<tr>
+<td><code>errorMsg</code></td>
+<td><code>string</code></td>
+<td>错误说明。固定为<code>"Success"</code>。</td>
+</tr>
+<tr>
+<td><code>result</code></td>
+<td><code>object</code></td>
+<td>操作结果。</td>
+</tr>
+</tbody>
+</table>
+<ul>
+<li>当请求处理未成功时,响应体的属性如下:</li>
+</ul>
+<table>
+<thead>
+<tr>
+<th>名称</th>
+<th>类型</th>
+<th>含义</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>logId</code></td>
+<td><code>string</code></td>
+<td>请求的UUID。</td>
+</tr>
+<tr>
+<td><code>errorCode</code></td>
+<td><code>integer</code></td>
+<td>错误码。与响应状态码相同。</td>
+</tr>
+<tr>
+<td><code>errorMsg</code></td>
+<td><code>string</code></td>
+<td>错误说明。</td>
+</tr>
+</tbody>
+</table>
+<p>服务提供的主要操作如下:</p>
+<ul>
+<li><b><code>infer</code></b></li>
+</ul>
+<p>对图像进行人体关键点检测。</p>
+<p><code>POST /human-keypoint-detection</code></p>
+<ul>
+<li>请求体的属性如下:</li>
+</ul>
+<table>
+<thead>
+<tr>
+<th>名称</th>
+<th>类型</th>
+<th>含义</th>
+<th>是否必填</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>image</code></td>
+<td><code>string</code></td>
+<td>服务器可访问的图像文件的URL或图像文件内容的Base64编码结果。</td>
+<td>是</td>
+</tr>
+<tr>
+<td><code>detThreshold</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>人体检测模型阈值</td>
+<td>否</td>
+</tr>
+</tbody>
+</table>
+<ul>
+<li>请求处理成功时,响应体的<code>result</code>具有如下属性:</li>
+</ul>
+<table>
+<thead>
+<tr>
+<th>名称</th>
+<th>类型</th>
+<th>含义</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>image</code></td>
+<td><code>string</code></td>
+<td>服务器可访问的图像文件的URL或图像文件内容的Base64编码结果。</td>
+</tr>
+<tr>
+<td><code>persons</code></td>
+<td><code>array</code></td>
+<td>人体关键点检测结果。</td>
+</tr>
+</tbody>
+</table>
+<p><code>persons</code>中的每个元素为一个<code>object</code>,具有如下属性:</p>
+<table>
+<thead>
+<tr>
+<th>名称</th>
+<th>类型</th>
+<th>含义</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>bbox</code></td>
+<td><code>array</code></td>
+<td>目标位置。数组中元素依次为边界框左上角x坐标、左上角y坐标、右下角x坐标以及右下角y坐标。</td>
+</tr>
+<tr>
+<td><code>kpts</code></td>
+<td><code>array</code></td>
+<td>关键点坐标。</td>
+</tr>
+<tr>
+<td><code>detScore</code></td>
+<td><code>number</code></td>
+<td>检测得分。</td>
+</tr>
+<tr>
+<td><code>kptScore</code></td>
+<td><code>number</code></td>
+<td>关键点得分。</td>
+</tr>
+</tbody>
+</table>
 </details>
 <details><summary>多语言调用服务示例</summary>
 <details>
@@ -503,7 +658,7 @@ for res in output:
 <pre><code class="language-python">import base64
 import requests
 
-API_URL = "http://localhost:8080/ocr" # 服务URL
+API_URL = "http://localhost:8080/human-keypoint-detection" # 服务URL
 image_path = "./demo.jpg"
 output_image_path = "./out.jpg"
 
@@ -523,12 +678,12 @@ result = response.json()["result"]
 with open(output_image_path, "wb") as file:
     file.write(base64.b64decode(result["image"]))
 print(f"Output image saved at {output_image_path}")
-print("\nDetected texts:")
-print(result["texts"])
+print("\nDetected persons:")
+print(result["persons"])
 </code></pre>
 </details>
 </details>
-
+<br />
 
 📱 <b>端侧部署</b>:端侧部署是一种将计算和数据处理功能放在用户设备本身上的方式,设备可以直接处理数据,而不需要依赖远程的服务器。PaddleX 支持将模型部署在 Android 等端侧设备上,详细的端侧部署流程请参考[PaddleX端侧部署指南](../../../pipeline_deploy/edge_deploy.md)。
 您可以根据需要选择合适的方式部署模型产线,进而进行后续的 AI 应用集成。

+ 1 - 1
docs/pipeline_usage/tutorials/cv_pipelines/image_anomaly_detection.md

@@ -374,7 +374,7 @@ for res in output:
 <tbody>
 <tr>
 <td><code>image</code></td>
-<td><code>string</code></td>
+<td><code>string</code> | <code>null</code></td>
 <td>服务器可访问的图像文件的URL或图像文件内容的Base64编码结果。</td>
 <td>是</td>
 </tr>

+ 4 - 23
docs/pipeline_usage/tutorials/cv_pipelines/image_classification.md

@@ -1037,28 +1037,9 @@ for res in output:
 <td>是</td>
 </tr>
 <tr>
-<td><code>inferenceParams</code></td>
-<td><code>object</code></td>
-<td>推理参数。</td>
-<td>否</td>
-</tr>
-</tbody>
-</table>
-<p><code>inferenceParams</code>的属性如下:</p>
-<table>
-<thead>
-<tr>
-<th>名称</th>
-<th>类型</th>
-<th>含义</th>
-<th>是否必填</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td><code>topK</code></td>
-<td><code>integer</code></td>
-<td>结果中将只保留得分最高的<code>topK</code>个类别。</td>
+<td><code>topk</code></td>
+<td><code>integer</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>topk</code> 参数说明。</td>
 <td>否</td>
 </tr>
 </tbody>
@@ -1082,7 +1063,7 @@ for res in output:
 </tr>
 <tr>
 <td><code>image</code></td>
-<td><code>string</code></td>
+<td><code>string</code> | <code>null</code></td>
 <td>图像分类结果图。图像为JPEG格式,使用Base64编码。</td>
 </tr>
 </tbody>

+ 3 - 22
docs/pipeline_usage/tutorials/cv_pipelines/image_multi_label_classification.md

@@ -414,28 +414,9 @@ for res in output:
 <td>是</td>
 </tr>
 <tr>
-<td><code>inferenceParams</code></td>
-<td><code>object</code></td>
-<td>推理参数。</td>
-<td>否</td>
-</tr>
-</tbody>
-</table>
-<p><code>inferenceParams</code>的属性如下:</p>
-<table>
-<thead>
-<tr>
-<th>名称</th>
-<th>类型</th>
-<th>含义</th>
-<th>是否必填</th>
-</tr>
-</thead>
-<tbody>
-<tr>
 <td><code>threshold</code></td>
-<td><code>number</code></td>
-<td>类别得分阈值。</td>
+<td><code>number</code> | <code>array</code> | <code>object</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>threshold</code> 参数说明。</td>
 <td>否</td>
 </tr>
 </tbody>
@@ -459,7 +440,7 @@ for res in output:
 </tr>
 <tr>
 <td><code>image</code></td>
-<td><code>string</code></td>
+<td><code>string</code> | <code>null</code></td>
 <td>图像分类结果图。图像为JPEG格式,使用Base64编码。</td>
 </tr>
 </tbody>

+ 12 - 1
docs/pipeline_usage/tutorials/cv_pipelines/instance_segmentation.md

@@ -542,6 +542,12 @@ for res in output:
 <td>服务器可访问的图像文件的URL或图像文件内容的Base64编码结果。</td>
 <td>是</td>
 </tr>
+<tr>
+<td><code>threshold</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>threshold</code> 参数说明。</td>
+<td>否</td>
+</tr>
 </tbody>
 </table>
 <ul>
@@ -563,7 +569,7 @@ for res in output:
 </tr>
 <tr>
 <td><code>image</code></td>
-<td><code>string</code></td>
+<td><code>string</code> | <code>null</code></td>
 <td>实例分割结果图。图像为JPEG格式,使用Base64编码。</td>
 </tr>
 </tbody>
@@ -589,6 +595,11 @@ for res in output:
 <td>实例类别ID。</td>
 </tr>
 <tr>
+<td><code>categoryName</code></td>
+<td><code>string</code></td>
+<td>实例类别标签名。</td>
+</tr>
+<tr>
 <td><code>score</code></td>
 <td><code>number</code></td>
 <td>实例得分。</td>

+ 14 - 1
docs/pipeline_usage/tutorials/cv_pipelines/object_detection.md

@@ -718,6 +718,12 @@ for res in output:
 <td>服务器可访问的图像文件的URL或图像文件内容的Base64编码结果。</td>
 <td>是</td>
 </tr>
+<tr>
+<td><code>threshold</code></td>
+<td><code>number</code> | <code>object</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>threshold</code> 参数说明。</td>
+<td>否</td>
+</tr>
 </tbody>
 </table>
 <ul>
@@ -739,7 +745,7 @@ for res in output:
 </tr>
 <tr>
 <td><code>image</code></td>
-<td><code>string</code></td>
+<td><code>string</code> | <code>null</code></td>
 <td>目标检测结果图。图像为JPEG格式,使用Base64编码。</td>
 </tr>
 </tbody>
@@ -765,6 +771,11 @@ for res in output:
 <td>目标类别ID。</td>
 </tr>
 <tr>
+<td><code>categoryName</code></td>
+<td><code>string</code></td>
+<td>目标类别名称。</td>
+</tr>
+<tr>
 <td><code>score</code></td>
 <td><code>number</code></td>
 <td>目标得分。</td>
@@ -782,6 +793,7 @@ for res in output:
 285.4187316894531
 ],
 "categoryId": 0,
+"categoryName": "oranage",
 "score": 0.7418514490127563
 },
 {
@@ -792,6 +804,7 @@ for res in output:
 167.4235382080078
 ],
 "categoryId": 1,
+"categoryName": "banana",
 "score": 0.7328268885612488
 }
 ],

+ 1 - 1
docs/pipeline_usage/tutorials/cv_pipelines/open_vocabulary_detection.md

@@ -428,7 +428,7 @@ for res in output:
 </tr>
 <tr>
 <td><code>thresholds</code></td>
-<td><code>dict[str, float]</code></td>
+<td><code>object</code> | <code>null</code></td>
 <td>模型预测使用的阈值。</td>
 <td>否</td>
 </tr>

+ 27 - 334
docs/pipeline_usage/tutorials/cv_pipelines/open_vocabulary_segmentation.md

@@ -427,13 +427,13 @@ for res in output:
 </tr>
 <tr>
 <td><code>prompt</code></td>
-<td><code>list[list[float]]</code></td>
+<td><code>array</code></td>
 <td>预测使用的提示。</td>
 <td>是</td>
 </tr>
 <tr>
-<td><code>prompt_type</code></td>
-<td><code>str</code></td>
+<td><code>promptType</code></td>
+<td><code>string</code></td>
 <td>预测使用的提示类型。</td>
 <td>是</td>
 </tr>
@@ -457,7 +457,7 @@ for res in output:
 <td>分割的预测结果。</td>
 </tr>
 <tr>
-<td><code>mask_infos</code></td>
+<td><code>maskInfos</code></td>
 <td><code>array</code></td>
 <td>和masks字段中的元素一一对应,记录masks中对应分割结果所使用的对应prompt。</td>
 </tr>
@@ -469,7 +469,29 @@ for res in output:
 </tbody>
 </table>
 <b>注意</b>:考虑到网络传输, masks字段中记录的分割结果经过<code>rle</code>编码结果, 实际使用时需要使用<code>pycocotools.mask.decode</code>做对应的解码即可获得原始的分割结果。
-
+</br>
+<p><code>detectedObjects</code>中的每个元素为一个<code>object</code>,具有如下属性:</p>
+<table>
+<thead>
+<tr>
+<th>名称</th>
+<th>类型</th>
+<th>含义</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>label</code></td>
+<td><code>string</code></td>
+<td>生成mask所使用的prompt类别。</td>
+</tr>
+<tr>
+<td><code>prompt</code></td>
+<td><code>array</code></td>
+<td>prompt数组。</td>
+</tr>
+</tbody>
+</table>
 
 <p><code>result</code>示例如下:</p>
 <pre><code class="language-python">
@@ -522,335 +544,6 @@ print(f"Output image saved at {output_image_path}")
 print("\nresult(with rle encoded binary mask):")
 print(result)
 </code></pre></details>
-
-<details><summary>C++</summary>
-
-<pre><code class="language-cpp">#include &lt;iostream&gt;
-#include &quot;cpp-httplib/httplib.h&quot; // https://github.com/Huiyicc/cpp-httplib
-#include &quot;nlohmann/json.hpp&quot; // https://github.com/nlohmann/json
-#include &quot;base64.hpp&quot; // https://github.com/tobiaslocker/base64
-
-int main() {
-    httplib::Client client(&quot;localhost:8080&quot;);
-    const std::string imagePath = &quot;./demo.jpg&quot;;
-    const std::string outputImagePath = &quot;./out.jpg&quot;;
-
-    httplib::Headers headers = {
-        {&quot;Content-Type&quot;, &quot;application/json&quot;}
-    };
-
-    // 对本地图像进行Base64编码
-    std::ifstream file(imagePath, std::ios::binary | std::ios::ate);
-    std::streamsize size = file.tellg();
-    file.seekg(0, std::ios::beg);
-
-    std::vector&lt;char&gt; buffer(size);
-    if (!file.read(buffer.data(), size)) {
-        std::cerr &lt;&lt; &quot;Error reading file.&quot; &lt;&lt; std::endl;
-        return 1;
-    }
-    std::string bufferStr(reinterpret_cast&lt;const char*&gt;(buffer.data()), buffer.size());
-    std::string encodedImage = base64::to_base64(bufferStr);
-
-    nlohmann::json jsonObj;
-    jsonObj[&quot;image&quot;] = encodedImage;
-    std::string body = jsonObj.dump();
-
-    // 调用API
-    auto response = client.Post(&quot;/small-object-segmentation&quot;, headers, body, &quot;application/json&quot;);
-    // 处理接口返回数据
-    if (response &amp;&amp; response-&gt;status == 200) {
-        nlohmann::json jsonResponse = nlohmann::json::parse(response-&gt;body);
-        auto result = jsonResponse[&quot;result&quot;];
-
-        encodedImage = result[&quot;image&quot;];
-        std::string decodedString = base64::from_base64(encodedImage);
-        std::vector&lt;unsigned char&gt; decodedImage(decodedString.begin(), decodedString.end());
-        std::ofstream outputImage(outPutImagePath, std::ios::binary | std::ios::out);
-        if (outputImage.is_open()) {
-            outputImage.write(reinterpret_cast&lt;char*&gt;(decodedImage.data()), decodedImage.size());
-            outputImage.close();
-            std::cout &lt;&lt; &quot;Output image saved at &quot; &lt;&lt; outPutImagePath &lt;&lt; std::endl;
-        } else {
-            std::cerr &lt;&lt; &quot;Unable to open file for writing: &quot; &lt;&lt; outPutImagePath &lt;&lt; std::endl;
-        }
-
-        auto detectedObjects = result[&quot;detectedObjects&quot;];
-        std::cout &lt;&lt; &quot;\nDetected objects:&quot; &lt;&lt; std::endl;
-        for (const auto&amp; category : detectedObjects) {
-            std::cout &lt;&lt; category &lt;&lt; std::endl;
-        }
-    } else {
-        std::cout &lt;&lt; &quot;Failed to send HTTP request.&quot; &lt;&lt; std::endl;
-        return 1;
-    }
-
-    return 0;
-}
-</code></pre></details>
-
-<details><summary>Java</summary>
-
-<pre><code class="language-java">import okhttp3.*;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.Base64;
-
-public class Main {
-    public static void main(String[] args) throws IOException {
-        String API_URL = &quot;http://localhost:8080/small-object-segmentation&quot;; // 服务URL
-        String imagePath = &quot;./demo.jpg&quot;; // 本地图像
-        String outputImagePath = &quot;./out.jpg&quot;; // 输出图像
-
-        // 对本地图像进行Base64编码
-        File file = new File(imagePath);
-        byte[] fileContent = java.nio.file.Files.readAllBytes(file.toPath());
-        String imageData = Base64.getEncoder().encodeToString(fileContent);
-
-        ObjectMapper objectMapper = new ObjectMapper();
-        ObjectNode params = objectMapper.createObjectNode();
-        params.put(&quot;image&quot;, imageData); // Base64编码的文件内容或者图像URL
-
-        // 创建 OkHttpClient 实例
-        OkHttpClient client = new OkHttpClient();
-        MediaType JSON = MediaType.Companion.get(&quot;application/json; charset=utf-8&quot;);
-        RequestBody body = RequestBody.Companion.create(params.toString(), JSON);
-        Request request = new Request.Builder()
-                .url(API_URL)
-                .post(body)
-                .build();
-
-        // 调用API并处理接口返回数据
-        try (Response response = client.newCall(request).execute()) {
-            if (response.isSuccessful()) {
-                String responseBody = response.body().string();
-                JsonNode resultNode = objectMapper.readTree(responseBody);
-                JsonNode result = resultNode.get(&quot;result&quot;);
-                String base64Image = result.get(&quot;image&quot;).asText();
-                JsonNode detectedObjects = result.get(&quot;detectedObjects&quot;);
-
-                byte[] imageBytes = Base64.getDecoder().decode(base64Image);
-                try (FileOutputStream fos = new FileOutputStream(outputImagePath)) {
-                    fos.write(imageBytes);
-                }
-                System.out.println(&quot;Output image saved at &quot; + outputImagePath);
-                System.out.println(&quot;\nDetected objects: &quot; + detectedObjects.toString());
-            } else {
-                System.err.println(&quot;Request failed with code: &quot; + response.code());
-            }
-        }
-    }
-}
-</code></pre></details>
-
-<details><summary>Go</summary>
-
-<pre><code class="language-go">package main
-
-import (
-    &quot;bytes&quot;
-    &quot;encoding/base64&quot;
-    &quot;encoding/json&quot;
-    &quot;fmt&quot;
-    &quot;io/ioutil&quot;
-    &quot;net/http&quot;
-)
-
-func main() {
-    API_URL := &quot;http://localhost:8080/small-object-segmentation&quot;
-    imagePath := &quot;./demo.jpg&quot;
-    outputImagePath := &quot;./out.jpg&quot;
-
-    // 对本地图像进行Base64编码
-    imageBytes, err := ioutil.ReadFile(imagePath)
-    if err != nil {
-        fmt.Println(&quot;Error reading image file:&quot;, err)
-        return
-    }
-    imageData := base64.StdEncoding.EncodeToString(imageBytes)
-
-    payload := map[string]string{&quot;image&quot;: imageData} // Base64编码的文件内容或者图像URL
-    payloadBytes, err := json.Marshal(payload)
-    if err != nil {
-        fmt.Println(&quot;Error marshaling payload:&quot;, err)
-        return
-    }
-
-    // 调用API
-    client := &amp;http.Client{}
-    req, err := http.NewRequest(&quot;POST&quot;, API_URL, bytes.NewBuffer(payloadBytes))
-    if err != nil {
-        fmt.Println(&quot;Error creating request:&quot;, err)
-        return
-    }
-
-    res, err := client.Do(req)
-    if err != nil {
-        fmt.Println(&quot;Error sending request:&quot;, err)
-        return
-    }
-    defer res.Body.Close()
-
-    // 处理接口返回数据
-    body, err := ioutil.ReadAll(res.Body)
-    if err != nil {
-        fmt.Println(&quot;Error reading response body:&quot;, err)
-        return
-    }
-    type Response struct {
-        Result struct {
-            Image      string   `json:&quot;image&quot;`
-            DetectedObjects []map[string]interface{} `json:&quot;detectedObjects&quot;`
-        } `json:&quot;result&quot;`
-    }
-    var respData Response
-    err = json.Unmarshal([]byte(string(body)), &amp;respData)
-    if err != nil {
-        fmt.Println(&quot;Error unmarshaling response body:&quot;, err)
-        return
-    }
-
-    outputImageData, err := base64.StdEncoding.DecodeString(respData.Result.Image)
-    if err != nil {
-        fmt.Println(&quot;Error decoding base64 image data:&quot;, err)
-        return
-    }
-    err = ioutil.WriteFile(outputImagePath, outputImageData, 0644)
-    if err != nil {
-        fmt.Println(&quot;Error writing image to file:&quot;, err)
-        return
-    }
-    fmt.Printf(&quot;Image saved at %s.jpg\n&quot;, outputImagePath)
-    fmt.Println(&quot;\nDetected objects:&quot;)
-    for _, category := range respData.Result.DetectedObjects {
-        fmt.Println(category)
-    }
-}
-</code></pre></details>
-
-<details><summary>C#</summary>
-
-<pre><code class="language-csharp">using System;
-using System.IO;
-using System.Net.Http;
-using System.Net.Http.Headers;
-using System.Text;
-using System.Threading.Tasks;
-using Newtonsoft.Json.Linq;
-
-class Program
-{
-    static readonly string API_URL = &quot;http://localhost:8080/small-object-segmentation&quot;;
-    static readonly string imagePath = &quot;./demo.jpg&quot;;
-    static readonly string outputImagePath = &quot;./out.jpg&quot;;
-
-    static async Task Main(string[] args)
-    {
-        var httpClient = new HttpClient();
-
-        // 对本地图像进行Base64编码
-        byte[] imageBytes = File.ReadAllBytes(imagePath);
-        string image_data = Convert.ToBase64String(imageBytes);
-
-        var payload = new JObject{ { &quot;image&quot;, image_data } }; // Base64编码的文件内容或者图像URL
-        var content = new StringContent(payload.ToString(), Encoding.UTF8, &quot;application/json&quot;);
-
-        // 调用API
-        HttpResponseMessage response = await httpClient.PostAsync(API_URL, content);
-        response.EnsureSuccessStatusCode();
-
-        // 处理接口返回数据
-        string responseBody = await response.Content.ReadAsStringAsync();
-        JObject jsonResponse = JObject.Parse(responseBody);
-
-        string base64Image = jsonResponse[&quot;result&quot;][&quot;image&quot;].ToString();
-        byte[] outputImageBytes = Convert.FromBase64String(base64Image);
-
-        File.WriteAllBytes(outputImagePath, outputImageBytes);
-        Console.WriteLine($&quot;Output image saved at {outputImagePath}&quot;);
-        Console.WriteLine(&quot;\nDetected objects:&quot;);
-        Console.WriteLine(jsonResponse[&quot;result&quot;][&quot;detectedObjects&quot;].ToString());
-    }
-}
-</code></pre></details>
-
-<details><summary>Node.js</summary>
-
-<pre><code class="language-js">const axios = require('axios');
-const fs = require('fs');
-
-const API_URL = 'http://localhost:8080/small-object-segmentation'
-const imagePath = './demo.jpg'
-const outputImagePath = &quot;./out.jpg&quot;;
-
-let config = {
-   method: 'POST',
-   maxBodyLength: Infinity,
-   url: API_URL,
-   data: JSON.stringify({
-    'image': encodeImageToBase64(imagePath)  // Base64编码的文件内容或者图像URL
-  })
-};
-
-// 对本地图像进行Base64编码
-function encodeImageToBase64(filePath) {
-  const bitmap = fs.readFileSync(filePath);
-  return Buffer.from(bitmap).toString('base64');
-}
-
-// 调用API
-axios.request(config)
-.then((response) =&gt; {
-    // 处理接口返回数据
-    const result = response.data[&quot;result&quot;];
-    const imageBuffer = Buffer.from(result[&quot;image&quot;], 'base64');
-    fs.writeFile(outputImagePath, imageBuffer, (err) =&gt; {
-      if (err) throw err;
-      console.log(`Output image saved at ${outputImagePath}`);
-    });
-    console.log(&quot;\nDetected objects:&quot;);
-    console.log(result[&quot;detectedObjects&quot;]);
-})
-.catch((error) =&gt; {
-  console.log(error);
-});
-</code></pre></details>
-
-<details><summary>PHP</summary>
-
-<pre><code class="language-php">&lt;?php
-
-$API_URL = &quot;http://localhost:8080/small-object-segmentation&quot;; // 服务URL
-$image_path = &quot;./demo.jpg&quot;;
-$output_image_path = &quot;./out.jpg&quot;;
-
-// 对本地图像进行Base64编码
-$image_data = base64_encode(file_get_contents($image_path));
-$payload = array(&quot;image&quot; =&gt; $image_data); // Base64编码的文件内容或者图像URL
-
-// 调用API
-$ch = curl_init($API_URL);
-curl_setopt($ch, CURLOPT_POST, true);
-curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
-curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
-curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
-$response = curl_exec($ch);
-curl_close($ch);
-
-// 处理接口返回数据
-$result = json_decode($response, true)[&quot;result&quot;];
-file_put_contents($output_image_path, base64_decode($result[&quot;image&quot;]));
-echo &quot;Output image saved at &quot; . $output_image_path . &quot;\n&quot;;
-echo &quot;\nDetected objects:\n&quot;;
-print_r($result[&quot;detectedObjects&quot;]);
-
-?&gt;
-</code></pre></details>
 </details>
 <br/>
 

+ 13 - 1
docs/pipeline_usage/tutorials/cv_pipelines/pedestrian_attribute_recognition.md

@@ -441,6 +441,18 @@ for res in output:
 <td>服务器可访问的图像文件的URL或图像文件内容的Base64编码结果。</td>
 <td>是</td>
 </tr>
+<tr>
+<td><code>detThreshold</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>det_threshold</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>clsThreshold</code></td>
+<td><code>number</code> | <code>array</code> | <code>object</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>cls_threshold</code> 参数说明。</td>
+<td>否</td>
+</tr>
 </tbody>
 </table>
 <ul>
@@ -462,7 +474,7 @@ for res in output:
 </tr>
 <tr>
 <td><code>image</code></td>
-<td><code>string</code></td>
+<td><code>string</code> | <code>null</code></td>
 <td>行人属性识别结果图。图像为JPEG格式,使用Base64编码。</td>
 </tr>
 </tbody>

+ 11 - 0
docs/pipeline_usage/tutorials/cv_pipelines/rotated_object_detection.md

@@ -408,6 +408,12 @@ for res in output:
 <td>服务器可访问的图像文件的URL或图像文件内容的Base64编码结果。</td>
 <td>是</td>
 </tr>
+<tr>
+<td><code>threshold</code></td>
+<td><code>number</code> | <code>object</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>threshold</code> 参数说明。</td>
+<td>否</td>
+</tr>
 </tbody>
 </table>
 <ul>
@@ -455,6 +461,11 @@ for res in output:
 <td>目标类别ID。</td>
 </tr>
 <tr>
+<td><code>categoryName</code></td>
+<td><code>string</code></td>
+<td>目标类别名称。</td>
+</tr>
+<tr>
 <td><code>score</code></td>
 <td><code>number</code></td>
 <td>目标得分。</td>

+ 7 - 1
docs/pipeline_usage/tutorials/cv_pipelines/semantic_segmentation.md

@@ -572,6 +572,12 @@ for res in output:
 <td>服务器可访问的图像文件的URL或图像文件内容的Base64编码结果。</td>
 <td>是</td>
 </tr>
+<tr>
+<td><code>targetSize</code></td>
+<td><code>integer</code> | <code>array</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>target_size</code> 参数说明。</td>
+<td>否</td>
+</tr>
 </tbody>
 </table>
 <ul>
@@ -598,7 +604,7 @@ for res in output:
 </tr>
 <tr>
 <td><code>image</code></td>
-<td><code>string</code></td>
+<td><code>string</code> | <code>null</code></td>
 <td>语义分割结果图。图像为JPEG格式,使用Base64编码。</td>
 </tr>
 </tbody>

+ 14 - 1
docs/pipeline_usage/tutorials/cv_pipelines/small_object_detection.md

@@ -417,6 +417,12 @@ for res in output:
 <td>服务器可访问的图像文件的URL或图像文件内容的Base64编码结果。</td>
 <td>是</td>
 </tr>
+<tr>
+<td><code>threshold</code></td>
+<td><code>number</code> | <code>object</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>threshold</code> 参数说明。</td>
+<td>否</td>
+</tr>
 </tbody>
 </table>
 <ul>
@@ -438,7 +444,7 @@ for res in output:
 </tr>
 <tr>
 <td><code>image</code></td>
-<td><code>string</code></td>
+<td><code>string</code> | <code>null</code></td>
 <td>目标检测结果图。图像为JPEG格式,使用Base64编码。</td>
 </tr>
 </tbody>
@@ -464,6 +470,11 @@ for res in output:
 <td>目标类别ID。</td>
 </tr>
 <tr>
+<td><code>categoryName</code></td>
+<td><code>string</code></td>
+<td>目标类别名称。</td>
+</tr>
+<tr>
 <td><code>score</code></td>
 <td><code>number</code></td>
 <td>目标得分。</td>
@@ -481,6 +492,7 @@ for res in output:
 285.4187316894531
 ],
 "categoryId": 0,
+"categoryName": "person",
 "score": 0.7418514490127563
 },
 {
@@ -491,6 +503,7 @@ for res in output:
 167.4235382080078
 ],
 "categoryId": 1,
+"categoryName": "bottle",
 "score": 0.7328268885612488
 }
 ],

+ 13 - 1
docs/pipeline_usage/tutorials/cv_pipelines/vehicle_attribute_recognition.md

@@ -441,6 +441,18 @@ for res in output:
 <td>服务器可访问的图像文件的URL或图像文件内容的Base64编码结果。</td>
 <td>是</td>
 </tr>
+<tr>
+<td><code>detThreshold</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>det_threshold</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>clsThreshold</code></td>
+<td><code>number</code> | <code>array</code> | <code>object</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>cls_threshold</code> 参数说明。</td>
+<td>否</td>
+</tr>
 </tbody>
 </table>
 <ul>
@@ -462,7 +474,7 @@ for res in output:
 </tr>
 <tr>
 <td><code>image</code></td>
-<td><code>string</code></td>
+<td><code>string</code> | <code>null</code></td>
 <td>车辆属性识别结果图。图像为JPEG格式,使用Base64编码。</td>
 </tr>
 </tbody>

+ 157 - 313
docs/pipeline_usage/tutorials/information_extraction_pipelines/document_scene_information_extraction.md

@@ -1179,122 +1179,117 @@ for res in visual_predict_res:
 </tr>
 <tr>
 <td><code>fileType</code></td>
-<td><code>integer</code></td>
+<td><code>integer</code> | <code>null</code></td>
 <td>文件类型。<code>0</code>表示PDF文件,<code>1</code>表示图像文件。若请求体无此属性,则将根据URL推断文件类型。</td>
 <td>否</td>
 </tr>
 <tr>
-<td><code>useImgOrientationCls</code></td>
-<td><code>boolean</code></td>
-<td>是否启用文档图像方向分类功能。默认启用该功能。</td>
+<td><code>useDocOrientationClassify</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_doc_orientation_classify</code> 参数说明。</td>
 <td>否</td>
 </tr>
 <tr>
-<td><code>useImgUnwarping</code></td>
-<td><code>boolean</code></td>
-<td>是否启用文本图像矫正功能。默认启用该功能。</td>
+<td><code>useDocUnwarping</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_doc_unwarping</code> 参数说明。</td>
 <td>否</td>
 </tr>
 <tr>
-<td><code>useSealTextDet</code></td>
-<td><code>boolean</code></td>
-<td>是否启用印章文本检测功能。默认启用该功能。</td>
+<td><code>useGeneralOcr</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_general_ocr</code> 参数说明。</td>
 <td>否</td>
 </tr>
 <tr>
-<td><code>inferenceParams</code></td>
-<td><code>object</code></td>
-<td>推理参数。</td>
+<td><code>useSealRecognition</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_seal_recognition</code> 参数说明。</td>
 <td>否</td>
 </tr>
-</tbody>
-</table>
-<p><code>inferenceParams</code>的属性如下:</p>
-<table>
-<thead>
 <tr>
-<th>名称</th>
-<th>类型</th>
-<th>含义</th>
-<th>是否必填</th>
+<td><code>useTableRecognition</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_table_recognition</code> 参数说明。</td>
+<td>否</td>
 </tr>
-</thead>
-<tbody>
 <tr>
-<td><code>maxLongSide</code></td>
-<td><code>integer</code></td>
-<td>推理时,若文本检测模型的输入图像较长边的长度大于<code>maxLongSide</code>,则将对图像进行缩放,使其较长边的长度等于<code>maxLongSide</code>。</td>
+<td><code>textDetLimitSideLen</code></td>
+<td><code>integer</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_det_limit_side_len</code> 参数说明。</td>
 <td>否</td>
 </tr>
-</tbody>
-</table>
-<ul>
-<li>请求处理成功时,响应体的<code>result</code>具有如下属性:</li>
-</ul>
-<table>
-<thead>
 <tr>
-<th>名称</th>
-<th>类型</th>
-<th>含义</th>
+<td><code>textDetLimitType</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_det_limit_type</code> 参数说明。</td>
+<td>否</td>
 </tr>
-</thead>
-<tbody>
 <tr>
-<td><code>visualResults</code></td>
-<td><code>array</code></td>
-<td>使用计算机视觉模型得到的分析结果。数组长度为1(对于图像输入)或文档页数与10中的较小者(对于PDF输入)。对于PDF输入,数组中的每个元素依次表示PDF文件中每一页的处理结果。</td>
+<td><code>textDetThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_det_thresh</code> 参数说明。</td>
+<td>否</td>
 </tr>
 <tr>
-<td><code>visualInfo</code></td>
-<td><code>object</code></td>
-<td>图像中的关键信息,可用作其他操作的输入。</td>
+<td><code>textDetBoxThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_det_box_thresh</code> 参数说明。</td>
+<td>否</td>
 </tr>
 <tr>
-<td><code>dataInfo</code></td>
-<td><code>object</code></td>
-<td>输入数据信息。</td>
+<td><code>textDetUnclipRatio</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_det_unclip_ratio</code> 参数说明。</td>
+<td>否</td>
 </tr>
-</tbody>
-</table>
-<p><code>visualResults</code>中的每个元素为一个<code>object</code>,具有如下属性:</p>
-<table>
-<thead>
 <tr>
-<th>名称</th>
-<th>类型</th>
-<th>含义</th>
+<td><code>textRecScoreThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_rec_score_thresh</code> 参数说明。</td>
+<td>否</td>
 </tr>
-</thead>
-<tbody>
 <tr>
-<td><code>texts</code></td>
-<td><code>array</code></td>
-<td>文本位置、内容和得分。</td>
+<td><code>sealDetLimitSideLen</code></td>
+<td><code>integer</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>seal_det_limit_side_len</code> 参数说明。</td>
+<td>否</td>
 </tr>
 <tr>
-<td><code>tables</code></td>
-<td><code>array</code></td>
-<td>表格位置和内容。</td>
+<td><code>sealDetLimitType</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>seal_det_limit_type</code> 参数说明。</td>
+<td>否</td>
 </tr>
 <tr>
-<td><code>inputImage</code></td>
-<td><code>string</code></td>
-<td>输入图像。图像为JPEG格式,使用Base64编码。</td>
+<td><code>sealDetThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>seal_det_thresh</code> 参数说明。</td>
+<td>否</td>
 </tr>
 <tr>
-<td><code>layoutImage</code></td>
-<td><code>string</code></td>
-<td>版面区域检测结果图。图像为JPEG格式,使用Base64编码。</td>
+<td><code>sealDetBoxThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>seal_det_box_thresh</code> 参数说明。</td>
+<td>否</td>
 </tr>
 <tr>
-<td><code>ocrImage</code></td>
-<td><code>string</code></td>
-<td>OCR结果图。图像为JPEG格式,使用Base64编码。</td>
+<td><code>sealDetUnclipRatio</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>seal_det_unclip_ratio</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>sealRecScoreThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>seal_rec_score_thresh</code> 参数说明。</td>
+<td>否</td>
 </tr>
 </tbody>
 </table>
-<p><code>texts</code>中的每个元素为一个<code>object</code>,具有如下属性:</p>
+<ul>
+<li>请求处理成功时,响应体的<code>result</code>具有如下属性:</li>
+</ul>
 <table>
 <thead>
 <tr>
@@ -1305,23 +1300,23 @@ for res in visual_predict_res:
 </thead>
 <tbody>
 <tr>
-<td><code>poly</code></td>
+<td><code>layoutParsingResults</code></td>
 <td><code>array</code></td>
-<td>文本位置。数组中元素依次为包围文本的多边形的顶点坐标。</td>
+<td>使用计算机视觉模型得到的分析结果。数组长度为1(对于图像输入)或文档页数与10中的较小者(对于PDF输入)。对于PDF输入,数组中的每个元素依次表示PDF文件中每一页的处理结果。</td>
 </tr>
 <tr>
-<td><code>text</code></td>
-<td><code>string</code></td>
-<td>文本内容。</td>
+<td><code>visualInfo</code></td>
+<td><code>array</code></td>
+<td>图像中的关键信息,可用作其他操作的输入。</td>
 </tr>
 <tr>
-<td><code>score</code></td>
-<td><code>number</code></td>
-<td>文本识别得分。</td>
+<td><code>dataInfo</code></td>
+<td><code>object</code></td>
+<td>输入数据信息。</td>
 </tr>
 </tbody>
 </table>
-<p><code>tables</code>中的每个元素为一个<code>object</code>,具有如下属性:</p>
+<p><code>layoutParsingResults</code>中的每个元素为一个<code>object</code>,具有如下属性:</p>
 <table>
 <thead>
 <tr>
@@ -1332,14 +1327,19 @@ for res in visual_predict_res:
 </thead>
 <tbody>
 <tr>
-<td><code>bbox</code></td>
-<td><code>array</code></td>
-<td>表格位置。数组中元素依次为边界框左上角x坐标、左上角y坐标、右下角x坐标以及右下角y坐标。</td>
+<td><code>prunedResult</code></td>
+<td><code>object</code></td>
+<td>产线对象的 <code>predict</code> 方法生成结果的 JSON 表示中 <code>res</code> 字段的简化版本,其中去除了 <code>input_path</code> 字段</td>
 </tr>
 <tr>
-<td><code>html</code></td>
-<td><code>string</code></td>
-<td>HTML格式的表格识别结果。</td>
+<td><code>outputImages</code></td>
+<td><code>object</code> | <code>null</code></td>
+<td>输入图像和预测结果图像的键值对。图像为JPEG格式,使用Base64编码。</td>
+</tr>
+<tr>
+<td><code>inputImage</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>输入图像。图像为JPEG格式,使用Base64编码。</td>
 </tr>
 </tbody>
 </table>
@@ -1363,48 +1363,24 @@ for res in visual_predict_res:
 <tbody>
 <tr>
 <td><code>visualInfo</code></td>
-<td><code>object</code></td>
+<td><code>array</code></td>
 <td>图像中的关键信息。由<code>analyzeImages</code>操作提供。</td>
 <td>是</td>
 </tr>
 <tr>
-<td><code>minChars</code></td>
-<td><code>integer</code></td>
+<td><code>minCharacters</code></td>
+<td><code>integer</code> | <code>null</code></td>
 <td>启用向量数据库的最小数据长度。</td>
 <td>否</td>
 </tr>
 <tr>
 <td><code>llmRequestInterval</code></td>
-<td><code>number</code></td>
+<td><code>number</code> | <code>null</code></td>
 <td>调用大语言模型API的间隔时间。</td>
 <td>否</td>
 </tr>
-<tr>
-<td><code>llmName</code></td>
-<td><code>string</code></td>
-<td>大语言模型名称。</td>
-<td>否</td>
-</tr>
-<tr>
-<td><code>llmParams</code></td>
-<td><code>object</code></td>
-<td>大语言模型API参数。</td>
-<td>否</td>
-</tr>
 </tbody>
 </table>
-<p>当前,<code>llmParams</code> 可以采用如下形式之一:</p>
-<pre><code class="language-json">{
-"apiType": "qianfan",
-"apiKey": "{千帆平台API key}",
-"secretKey": "{千帆平台secret key}"
-}
-</code></pre>
-<pre><code class="language-json">{
-"apiType": "aistudio",
-"accessToken": "{星河社区access token}"
-}
-</code></pre>
 <ul>
 <li>请求处理成功时,响应体的<code>result</code>具有如下属性:</li>
 </ul>
@@ -1418,17 +1394,17 @@ for res in visual_predict_res:
 </thead>
 <tbody>
 <tr>
-<td><code>vectorStore</code></td>
-<td><code>string</code></td>
+<td><code>vectorInfo</code></td>
+<td><code>object</code></td>
 <td>向量数据库序列化结果,可用作其他操作的输入。</td>
 </tr>
 </tbody>
 </table>
 <ul>
-<li><b><code>retrieveKnowledge</code></b></li>
+<li><b><code>chat</code></b></li>
 </ul>
-<p>进行知识检索。</p>
-<p><code>POST /chatocr-retrieval</code></p>
+<p>与大语言模型交互,利用大语言模型提炼关键信息。</p>
+<p><code>POST /chatocr-chat</code></p>
 <ul>
 <li>请求体的属性如下:</li>
 </ul>
@@ -1443,154 +1419,97 @@ for res in visual_predict_res:
 </thead>
 <tbody>
 <tr>
-<td><code>keys</code></td>
+<td><code>keyList</code></td>
 <td><code>array</code></td>
 <td>关键词列表。</td>
 <td>是</td>
 </tr>
 <tr>
-<td><code>vectorStore</code></td>
-<td><code>string</code></td>
-<td>向量数据库序列化结果。由<code>buildVectorStore</code>操作提供。</td>
+<td><code>visualInfo</code></td>
+<td><code>object</code></td>
+<td>图像中的关键信息。由<code>analyzeImages</code>操作提供。</td>
 <td>是</td>
 </tr>
 <tr>
-<td><code>llmName</code></td>
-<td><code>string</code></td>
-<td>大语言模型名称。</td>
+<td><code>useVectorRetrieval</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_vector_retrieval</code> 参数说明。</td>
 <td>否</td>
 </tr>
 <tr>
-<td><code>llmParams</code></td>
-<td><code>object</code></td>
-<td>大语言模型API参数。</td>
+<td><code>vectorInfo</code></td>
+<td><code>object</code> | <code>null</code></td>
+<td>向量数据库序列化结果。由<code>buildVectorStore</code>操作提供。</td>
 <td>否</td>
 </tr>
-</tbody>
-</table>
-<p>当前,<code>llmParams</code> 可以采用如下形式之一:</p>
-<pre><code class="language-json">{
-"apiType": "qianfan",
-"apiKey": "{千帆平台API key}",
-"secretKey": "{千帆平台secret key}"
-}
-</code></pre>
-<pre><code class="language-json">{
-"apiType": "aistudio",
-"accessToken": "{星河社区access token}"
-}
-</code></pre>
-<ul>
-<li>请求处理成功时,响应体的<code>result</code>具有如下属性:</li>
-</ul>
-<table>
-<thead>
-<tr>
-<th>名称</th>
-<th>类型</th>
-<th>含义</th>
-</tr>
-</thead>
-<tbody>
 <tr>
-<td><code>retrievalResult</code></td>
-<td><code>string</code></td>
-<td>知识检索结果,可用作其他操作的输入。</td>
-</tr>
-</tbody>
-</table>
-<ul>
-<li><b><code>chat</code></b></li>
-</ul>
-<p>与大语言模型交互,利用大语言模型提炼关键信息。</p>
-<p><code>POST /chatocr-chat</code></p>
-<ul>
-<li>请求体的属性如下:</li>
-</ul>
-<table>
-<thead>
-<tr>
-<th>名称</th>
-<th>类型</th>
-<th>含义</th>
-<th>是否必填</th>
+<td><code>minCharacters</code></td>
+<td><code>integer</code></td>
+<td>启用向量数据库的最小数据长度</td>
+<td>否</td>
 </tr>
-</thead>
-<tbody>
 <tr>
-<td><code>keys</code></td>
-<td><code>array</code></td>
-<td>关键词列表。</td>
-<td></td>
+<td><code>textTaskDescription</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_task_description</code> 参数说明。</td>
+<td>否</td>
 </tr>
 <tr>
-<td><code>visualInfo</code></td>
-<td><code>object</code></td>
-<td>图像中的关键信息。由<code>analyzeImages</code>操作提供。</td>
-<td></td>
+<td><code>textOutputFormat</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_output_format</code> 参数说明。</td>
+<td>否</td>
 </tr>
 <tr>
-<td><code>vectorStore</code></td>
-<td><code>string</code></td>
-<td>向量数据库序列化结果。由<code>buildVectorStore</code>操作提供。</td>
+<td><code>textRulesStr</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_rules_str</code> 参数说明。</td>
 <td>否</td>
 </tr>
 <tr>
-<td><code>retrievalResult</code></td>
-<td><code>string</code></td>
-<td>知识检索结果。由<code>retrieveKnowledge</code>操作提供。</td>
+<td><code>textFewShotDemoTextContent</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_few_shot_demo_text_content</code> 参数说明。</td>
 <td>否</td>
 </tr>
 <tr>
-<td><code>taskDescription</code></td>
-<td><code>string</code></td>
-<td>提示词任务。</td>
+<td><code>textFewShotDemoKeyValueList</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_few_shot_demo_key_value_list</code> 参数说明。</td>
 <td>否</td>
 </tr>
 <tr>
-<td><code>rules</code></td>
-<td><code>string</code></td>
-<td>提示词规则。用于自定义信息抽取规则,例如规范输出格式。</td>
+<td><code>tableTaskDescription</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>table_task_description</code> 参数说明。</td>
 <td>否</td>
 </tr>
 <tr>
-<td><code>fewShot</code></td>
-<td><code>string</code></td>
-<td>提示词示例。</td>
+<td><code>tableOutputFormat</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>table_output_format</code> 参数说明。</td>
 <td>否</td>
 </tr>
 <tr>
-<td><code>llmName</code></td>
-<td><code>string</code></td>
-<td>大语言模型名称。</td>
+<td><code>tableRulesStr</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>table_rules_str</code> 参数说明。</td>
 <td>否</td>
 </tr>
 <tr>
-<td><code>llmParams</code></td>
-<td><code>object</code></td>
-<td>大语言模型API参数。</td>
-<td></td>
+<td><code>tableFewShotDemoTextContent</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>table_few_shot_demo_text_content</code> 参数说明。</td>
 </tr>
 <tr>
-<td><code>returnPrompts</code></td>
-<td><code>boolean</code></td>
-<td>是否返回使用的提示词。默认禁用。</td>
+<td><code>tableFewShotDemoKeyValueList</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>table_few_shot_demo_key_value_list</code> 参数说明。</td>
 <td>否</td>
 </tr>
 </tbody>
 </table>
-<p>当前,<code>llmParams</code> 可以采用如下形式之一:</p>
-<pre><code class="language-json">{
-"apiType": "qianfan",
-"apiKey": "{千帆平台API key}",
-"secretKey": "{千帆平台secret key}"
-}
-</code></pre>
-<pre><code class="language-json">{
-"apiType": "aistudio",
-"accessToken": "{星河社区access token}"
-}
-</code></pre>
 <ul>
 <li>请求处理成功时,响应体的<code>result</code>具有如下属性:</li>
 </ul>
@@ -1608,38 +1527,6 @@ for res in visual_predict_res:
 <td><code>object</code></td>
 <td>关键信息抽取结果。</td>
 </tr>
-<tr>
-<td><code>prompts</code></td>
-<td><code>object</code></td>
-<td>使用的提示词。</td>
-</tr>
-</tbody>
-</table>
-<p><code>prompts</code>的属性如下:</p>
-<table>
-<thead>
-<tr>
-<th>名称</th>
-<th>类型</th>
-<th>含义</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td><code>ocr</code></td>
-<td><code>array</code></td>
-<td>OCR提示词。</td>
-</tr>
-<tr>
-<td><code>table</code></td>
-<td><code>array</code></td>
-<td>表格提示词。</td>
-</tr>
-<tr>
-<td><code>html</code></td>
-<td><code>array</code></td>
-<td>HTML提示词。</td>
-</tr>
 </tbody>
 </table></details>
 <details><summary>多语言调用服务示例</summary>
@@ -1653,17 +1540,9 @@ import requests
 
 
 API_BASE_URL = "http://0.0.0.0:8080"
-API_KEY = "{千帆平台API key}"
-SECRET_KEY = "{千帆平台secret key}"
-LLM_NAME = "ernie-3.5"
-LLM_PARAMS = {
-    "apiType": "qianfan",
-    "apiKey": API_KEY,
-    "secretKey": SECRET_KEY,
-}
 
 file_path = "./demo.jpg"
-keys = ["电话"]
+keys = ["姓名"]
 
 with open(file_path, "rb") as file:
     file_bytes = file.read()
@@ -1672,9 +1551,6 @@ with open(file_path, "rb") as file:
 payload = {
     "file": file_data,
     "fileType": 1,
-    "useImgOrientationCls": True,
-    "useImgUnwarping": True,
-    "useSealTextDet": True,
 }
 resp_visual = requests.post(url=f"{API_BASE_URL}/chatocr-visual", json=payload)
 if resp_visual.status_code != 200:
@@ -1686,25 +1562,16 @@ if resp_visual.status_code != 200:
     sys.exit(1)
 result_visual = resp_visual.json()["result"]
 
-for i, res in enumerate(result_visual["visualResults"]):
-    print("Texts:")
-    pprint.pp(res["texts"])
-    print("Tables:")
-    pprint.pp(res["tables"])
-    layout_img_path = f"layout_{i}.jpg"
-    with open(layout_img_path, "wb") as f:
-        f.write(base64.b64decode(res["layoutImage"]))
-    ocr_img_path = f"ocr_{i}.jpg"
-    with open(ocr_img_path, "wb") as f:
-        f.write(base64.b64decode(res["ocrImage"]))
-    print(f"Output images saved at {layout_img_path} and {ocr_img_path}")
+for i, res in enumerate(result_visual["layoutParsingResults"]):
+    print(res["prunedResult"])
+    for img_name, img in res["outputImages"].items():
+        img_path = f"{img_name}_{i}.jpg"
+        with open(img_path, "wb") as f:
+            f.write(base64.b64decode(img))
+        print(f"Output image saved at {img_path}")
 
 payload = {
     "visualInfo": result_visual["visualInfo"],
-    "minChars": 200,
-    "llmRequestInterval": 1000,
-    "llmName": LLM_NAME,
-    "llmParams": LLM_PARAMS,
 }
 resp_vector = requests.post(url=f"{API_BASE_URL}/chatocr-vector", json=payload)
 if resp_vector.status_code != 200:
@@ -1717,33 +1584,12 @@ if resp_vector.status_code != 200:
 result_vector = resp_vector.json()["result"]
 
 payload = {
-    "keys": keys,
-    "vectorStore": result_vector["vectorStore"],
-    "llmName": LLM_NAME,
-    "llmParams": LLM_PARAMS,
-}
-resp_retrieval = requests.post(url=f"{API_BASE_URL}/chatocr-retrieval", json=payload)
-if resp_retrieval.status_code != 200:
-    print(
-        f"Request to chatocr-retrieval failed with status code {resp_retrieval.status_code}.",
-        file=sys.stderr,
-    )
-    pprint.pp(resp_retrieval.json())
-    sys.exit(1)
-result_retrieval = resp_retrieval.json()["result"]
-
-payload = {
-    "keys": keys,
+    "keyList": keys,
     "visualInfo": result_visual["visualInfo"],
-    "vectorStore": result_vector["vectorStore"],
-    "retrievalResult": result_retrieval["retrievalResult"],
-    "taskDescription": "",
-    "rules": "",
-    "fewShot": "",
-    "llmName": LLM_NAME,
-    "llmParams": LLM_PARAMS,
-    "returnPrompts": True,
+    "useVectorRetrieval": True,
+    "vectorInfo": result_vector["vectorInfo"],
 }
+
 resp_chat = requests.post(url=f"{API_BASE_URL}/chatocr-chat", json=payload)
 if resp_chat.status_code != 200:
     print(
@@ -1753,8 +1599,6 @@ if resp_chat.status_code != 200:
     pprint.pp(resp_chat.json())
     sys.exit(1)
 result_chat = resp_chat.json()["result"]
-print("\nPrompts:")
-pprint.pp(result_chat["prompts"])
 print("Final result:")
 print(result_chat["chatResult"])
 </code></pre>

+ 64 - 52
docs/pipeline_usage/tutorials/ocr_pipelines/OCR.md

@@ -906,33 +906,63 @@ for res in output:
 </tr>
 <tr>
 <td><code>fileType</code></td>
-<td><code>integer</code></td>
+<td><code>integer</code> | <code>null</code></td>
 <td>文件类型。<code>0</code>表示PDF文件,<code>1</code>表示图像文件。若请求体无此属性,则将根据URL推断文件类型。</td>
 <td>否</td>
 </tr>
 <tr>
-<td><code>inferenceParams</code></td>
-<td><code>object</code></td>
-<td>推理参数。</td>
+<td><code>useDocOrientationClassify</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_doc_orientation_classify</code> 参数说明。</td>
 <td>否</td>
 </tr>
-</tbody>
-</table>
-<p><code>inferenceParams</code>的属性如下:</p>
-<table>
-<thead>
 <tr>
-<th>名称</th>
-<th>类型</th>
-<th>含义</th>
-<th>是否必填</th>
+<td><code>useDocUnwarping</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_doc_unwarping</code> 参数说明。</td>
+<td>否</td>
 </tr>
-</thead>
-<tbody>
 <tr>
-<td><code>maxLongSide</code></td>
-<td><code>integer</code></td>
-<td>推理时,若文本检测模型的输入图像较长边的长度大于<code>maxLongSide</code>,则将对图像进行缩放,使其较长边的长度等于<code>maxLongSide</code>。</td>
+<tr>
+<td><code>useTextlineOrientation</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_textline_orientation</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>textDetLimitSideLen</code></td>
+<td><code>integer</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_det_limit_side_len</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>textDetLimitType</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_det_limit_type</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>textDetThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_det_thresh</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>textDetBoxThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_det_box_thresh</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>textDetUnclipRatio</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_det_unclip_ratio</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>textRecScoreThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_rec_score_thresh</code> 参数说明。</td>
 <td>否</td>
 </tr>
 </tbody>
@@ -972,41 +1002,24 @@ for res in output:
 </thead>
 <tbody>
 <tr>
-<td><code>texts</code></td>
-<td><code>array</code></td>
-<td>文本位置、内容和得分。</td>
+<td><code>prunedResult</code></td>
+<td><code>object</code></td>
+<td>产线对象的 <code>predict</code> 方法生成结果的 JSON 表示中 <code>res</code> 字段的简化版本,其中去除了 <code>input_path</code> 字段</td>
 </tr>
 <tr>
-<td><code>image</code></td>
-<td><code>string</code></td>
+<td><code>ocrImage</code></td>
+<td><code>string</code> | <code>null</code></td>
 <td>OCR结果图,其中标注检测到的文本位置。图像为JPEG格式,使用Base64编码。</td>
 </tr>
-</tbody>
-</table>
-<p><code>texts</code>中的每个元素为一个<code>object</code>,具有如下属性:</p>
-<table>
-<thead>
-<tr>
-<th>名称</th>
-<th>类型</th>
-<th>含义</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td><code>poly</code></td>
-<td><code>array</code></td>
-<td>文本位置。数组中元素依次为包围文本的多边形的顶点坐标。</td>
-</tr>
 <tr>
-<td><code>text</code></td>
-<td><code>string</code></td>
-<td>文本内容。</td>
+<td><code>docPreprocessingImage</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>可视化结果图像。图像为JPEG格式,使用Base64编码。</td>
 </tr>
 <tr>
-<td><code>score</code></td>
-<td><code>number</code></td>
-<td>文本识别得分。</td>
+<td><code>inputImage</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>输入图像。图像为JPEG格式,使用Base64编码。</td>
 </tr>
 </tbody>
 </table>
@@ -1031,12 +1044,11 @@ response = requests.post(API_URL, json=payload)
 assert response.status_code == 200
 result = response.json()["result"]
 for i, res in enumerate(result["ocrResults"]):
-    print("Detected texts:")
-    print(res["texts"])
-    output_img_path = f"out_{i}.jpg"
-    with open(output_img_path, "wb") as f:
-        f.write(base64.b64decode(res["image"]))
-    print(f"Output image saved at {output_img_path}")
+    print(res["prunedResult"])
+    ocr_img_path = f"ocr_{i}.jpg"
+    with open(ocr_img_path, "wb") as f:
+        f.write(base64.b64decode(res["ocrImage"]))
+    print(f"Output image saved at {ocr_img_path}")
 </code></pre></details>
 </details>
 <br/>

+ 29 - 44
docs/pipeline_usage/tutorials/ocr_pipelines/doc_preprocessor.md

@@ -447,39 +447,20 @@ for res in output:
 </tr>
 <tr>
 <td><code>fileType</code></td>
-<td><code>integer</code></td>
+<td><code>integer</code> | <code>null</code></td>
 <td>文件类型。<code>0</code>表示PDF文件,<code>1</code>表示图像文件。若请求体无此属性,则将根据URL推断文件类型。</td>
 <td>否</td>
 </tr>
 <tr>
-<td><code>inferenceParams</code></td>
-<td><code>object</code></td>
-<td>推理参数。</td>
-<td>否</td>
-</tr>
-</tbody>
-</table>
-<p><code>inferenceParams</code>的属性如下:</p>
-<table>
-<thead>
-<tr>
-<th>名称</th>
-<th>类型</th>
-<th>含义</th>
-<th>是否必填</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td><code>use_doc_orientation_classify</code></td>
-<td><code>bool</code></td>
-<td>推理时,是否使用方向分类模块<code>use_doc_orientation_classify</code>为True,则将对图像进行方向调整,使其转为正常的文字阅读方向。</td>
+<td><code>useDocOrientationClassify</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_doc_orientation_classify</code> 参数说明。</td>
 <td>否</td>
 </tr>
 <tr>
-<td><code>use_doc_unwarping</code></td>
-<td><code>bool</code></td>
-<td>推理时,是否使用矫正模块<code>use_doc_unwarping</code>为True,则将对图像进行矫正。</td>
+<td><code>useDocUnwarping</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_doc_unwarping</code> 参数说明。</td>
 <td>否</td>
 </tr>
 </tbody>
@@ -497,7 +478,7 @@ for res in output:
 </thead>
 <tbody>
 <tr>
-<td><code>docPreprocessorResult</code></td>
+<td><code>docPreprocessingResults</code></td>
 <td><code>object</code></td>
 <td>文档图像预处理结果。数组长度为1(对于图像输入)或文档页数与10中的较小者(对于PDF输入)。对于PDF输入,数组中的每个元素依次表示PDF文件中每一页的处理结果。</td>
 </tr>
@@ -508,7 +489,7 @@ for res in output:
 </tr>
 </tbody>
 </table>
-<p><code>docPreprocessorResult</code>中的每个元素为一个<code>object</code>,具有如下属性:</p>
+<p><code>docPreprocessingResults</code>中的每个元素为一个<code>object</code>,具有如下属性:</p>
 <table>
 <thead>
 <tr>
@@ -519,19 +500,24 @@ for res in output:
 </thead>
 <tbody>
 <tr>
-<td><code>inputImage</code></td>
+<td><code>outputImage</code></td>
 <td><code>string</code></td>
-<td>输入图像。图像为JPEG格式,使用Base64编码。</td>
+<td>经过预处理的图像。图像为PNG格式,使用Base64编码。</td>
 </tr>
 <tr>
-<td><code>warpImage</code></td>
-<td><code>string</code></td>
-<td>矫正结果图。图像为JPEG格式,使用Base64编码。</td>
+<td><code>prunedResult</code></td>
+<td><code>object</code></td>
+<td>产线对象的 <code>predict</code> 方法生成结果的 JSON 表示中 <code>res</code> 字段的简化版本,其中去除了 <code>input_path</code> 字段</td>
 </tr>
 <tr>
-<td><code>angle</code></td>
-<td><code>int</code></td>
-<td>角度分类结果。</td>
+<td><code>docPreprocessingImage</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>可视化结果图。图像为JPEG格式,使用Base64编码。</td>
+</tr>
+<tr>
+<td><code>inputImage</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>输入图像。图像为JPEG格式,使用Base64编码。</td>
 </tr>
 </tbody>
 </table>
@@ -542,7 +528,7 @@ for res in output:
 <pre><code class="language-python">import base64
 import requests
 
-API_URL = "http://localhost:8080/doc-preprocessor"
+API_URL = "http://localhost:8080/document-preprocessing"
 file_path = "./demo.jpg"
 
 with open(file_path, "rb") as file:
@@ -555,13 +541,12 @@ response = requests.post(API_URL, json=payload)
 
 assert response.status_code == 200
 result = response.json()["result"]
-for i, res in enumerate(result["docPreprocessorResult"]):
-    print("Detected docwarps:")
-    print(res["docwarps"])
-    layout_img_path = f"layout_{i}.jpg"
-    with open(layout_img_path, "wb") as f:
-        f.write(base64.b64decode(res["layoutImage"]))
-    print(f"Output image saved at {layout_img_path}")
+for i, res in enumerate(result["docPreprocessingResults"]):
+    print(res["prunedResult"])
+    output_img_path = f"out_{i}.png"
+    with open(output_img_path, "wb") as f:
+        f.write(base64.b64decode(res["outputImage"]))
+    print(f"Output image saved at {output_img_path}")
 </code></pre></details>
 </details>
 <br/>

+ 33 - 37
docs/pipeline_usage/tutorials/ocr_pipelines/formula_recognition.md

@@ -762,10 +762,28 @@ for res in output:
 </tr>
 <tr>
 <td><code>fileType</code></td>
-<td><code>integer</code></td>
+<td><code>integer</code> | <code>null</code></td>
 <td>文件类型。<code>0</code>表示PDF文件,<code>1</code>表示图像文件。若请求体无此属性,则将根据URL推断文件类型。</td>
 <td>否</td>
 </tr>
+<tr>
+<td><code>useDocOrientationClassify</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_doc_orientation_classify</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>useDocUnwarping</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_doc_unwarping</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>useLayoutDetection</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_layout_detection</code> 参数说明。</td>
+<td>否</td>
+</tr>
 </tbody>
 </table>
 <ul>
@@ -803,41 +821,19 @@ for res in output:
 </thead>
 <tbody>
 <tr>
-<td><code>formulas</code></td>
-<td><code>array</code></td>
-<td>公式位置和内容。</td>
-</tr>
-<tr>
-<td><code>inputImage</code></td>
-<td><code>string</code></td>
-<td>输入图像。图像为JPEG格式,使用Base64编码。</td>
-</tr>
-<tr>
-<td><code>layoutImage</code></td>
-<td><code>string</code></td>
-<td>版面区域检测结果图。图像为JPEG格式,使用Base64编码。</td>
-</tr>
-</tbody>
-</table>
-<p><code>formulas</code>中的每个元素为一个<code>object</code>,具有如下属性:</p>
-<table>
-<thead>
-<tr>
-<th>名称</th>
-<th>类型</th>
-<th>含义</th>
+<td><code>prunedResult</code></td>
+<td><code>object</code></td>
+<td>产线对象的 <code>predict</code> 方法生成结果的 JSON 表示中 <code>res</code> 字段的简化版本,其中去除了 <code>input_path</code> 字段</td>
 </tr>
-</thead>
-<tbody>
 <tr>
-<td><code>poly</code></td>
-<td><code>array</code></td>
-<td>公式位置。数组中元素依次为包围文本的多边形的顶点坐标。</td>
+<td><code>outputImages</code></td>
+<td><code>object</code> | <code>null</code></td>
+<td>输入图像和预测结果图像的键值对。图像为JPEG格式,使用Base64编码。</td>
 </tr>
 <tr>
-<td><code>latex</code></td>
+<td><code>inputImage</code> | <code>null</code></td>
 <td><code>string</code></td>
-<td>公式内容。</td>
+<td>输入图像。图像为JPEG格式,使用Base64编码。</td>
 </tr>
 </tbody>
 </table>
@@ -862,12 +858,12 @@ response = requests.post(API_URL, json=payload)
 assert response.status_code == 200
 result = response.json()["result"]
 for i, res in enumerate(result["formulaRecResults"]):
-    print("Detected formulas:")
-    print(res["formulas"])
-    layout_img_path = f"layout_{i}.jpg"
-    with open(layout_img_path, "wb") as f:
-        f.write(base64.b64decode(res["layoutImage"]))
-    print(f"Output image saved at {layout_img_path}")
+    print(res["prunedResult"])
+    for img_name, img in res["outputImages"].items():
+        img_path = f"{img_name}_{i}.jpg"
+        with open(img_path, "wb") as f:
+            f.write(base64.b64decode(img))
+        print(f"Output image saved at {img_path}")
 </code></pre></details>
 </details>
 <br/>

+ 152 - 62
docs/pipeline_usage/tutorials/ocr_pipelines/layout_parsing.md

@@ -1330,26 +1330,147 @@ for res in output:
 </tr>
 <tr>
 <td><code>fileType</code></td>
-<td><code>integer</code></td>
+<td><code>integer</code>|<code>null</code></td>
 <td>文件类型。<code>0</code>表示PDF文件,<code>1</code>表示图像文件。若请求体无此属性,则将根据URL推断文件类型。</td>
 <td>否</td>
 </tr>
+
+<tr>
+<td><code>useDocOrientationClassify</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_doc_orientation_classify</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>useDocUnwarping</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_doc_unwarping</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>useTextlineOrientation</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_textline_orientation</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>useGeneralOcr</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_general_ocr</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>useSealRecognition</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_seal_recognition</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>useTableRecognition</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_table_recognition</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>useFormulaRecognition</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_formula_recognition</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>textDetLimitSideLen</code></td>
+<td><code>integer</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_det_limit_side_len</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>textDetLimitType</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_det_limit_type</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>textDetThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_det_thresh</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>textDetBoxThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_det_box_thresh</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>textDetUnclipRatio</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_det_unclip_ratio</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>textRecScoreThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_rec_score_thresh</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>sealDetLimitSideLen</code></td>
+<td><code>integer</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>seal_det_limit_side_len</code> 参数说明。</td>
+<td>否</td>
+</tr>
 <tr>
-<td><code>useImgOrientationCls</code></td>
-<td><code>boolean</code></td>
-<td>是否启用文档图像方向分类功能。默认启用该功能。</td>
+<td><code>sealDetLimitType</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>seal_det_limit_type</code> 参数说明。</td>
 <td>否</td>
 </tr>
 <tr>
-<td><code>useImgUnwarping</code></td>
-<td><code>boolean</code></td>
-<td>是否启用文本图像矫正功能。默认启用该功能。</td>
+<td><code>sealDetThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>seal_det_thresh</code> 参数说明。</td>
 <td>否</td>
 </tr>
 <tr>
-<td><code>useSealTextDet</code></td>
-<td><code>boolean</code></td>
-<td>是否启用印章文本检测功能。默认启用该功能。</td>
+<td><code>sealDetBoxThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>seal_det_box_thresh</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>sealDetUnclipRatio</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>seal_det_unclip_ratio</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>sealRecScoreThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>seal_rec_score_thresh</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>layoutThreshold</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>layout_threshold</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>layoutNms</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>layout_nms</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>layoutUnclipRatio</code></td>
+<td><code>number</code> | <code>array</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>layout_unclip_ratio</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>layoutMergeBboxesMode</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>layout_merge_bboxes_mode</code> 参数说明。</td>
 <td>否</td>
 </tr>
 </tbody>
@@ -1389,46 +1510,19 @@ for res in output:
 </thead>
 <tbody>
 <tr>
-<td><code>layoutElements</code></td>
-<td><code>array</code></td>
-<td>版面元素信息。</td>
-</tr>
-</tbody>
-</table>
-<p><code>layoutElements</code>中的每个元素为一个<code>object</code>,具有如下属性:</p>
-<table>
-<thead>
-<tr>
-<th>名称</th>
-<th>类型</th>
-<th>含义</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td><code>bbox</code></td>
-<td><code>array</code></td>
-<td>版面元素位置。数组中元素依次为边界框左上角x坐标、左上角y坐标、右下角x坐标以及右下角y坐标。</td>
-</tr>
-<tr>
-<td><code>label</code></td>
-<td><code>string</code></td>
-<td>版面元素标签。</td>
-</tr>
-<tr>
-<td><code>text</code></td>
-<td><code>string</code></td>
-<td>版面元素包含的文本。</td>
+<td><code>prunedResult</code></td>
+<td><code>object</code></td>
+<td>产线对象的 <code>predict</code> 方法生成结果的 JSON 表示中 <code>res</code> 字段的简化版本,其中去除了 <code>input_path</code> 字段</td>
 </tr>
 <tr>
-<td><code>layoutType</code></td>
-<td><code>string</code></td>
-<td>版面元素排列方式。</td>
+<td><code>outputImages</code></td>
+<td><code>object</code> | <code>null</code></td>
+<td>输入图像和预测结果图像的键值对。图像为JPEG格式,使用Base64编码。</td>
 </tr>
 <tr>
-<td><code>image</code></td>
-<td><code>string</code></td>
-<td>版面元素图像,JPEG格式,使用Base64编码。</td>
+<td><code>inputImage</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>输入图像。图像为JPEG格式,使用Base64编码。</td>
 </tr>
 </tbody>
 </table></details>
@@ -1439,20 +1533,15 @@ for res in output:
 import requests
 
 API_URL = "http://localhost:8080/layout-parsing" # 服务URL
+file_path = "./demo.jpg"
 
-image_path = "./demo.jpg"
-
-# 对本地图像进行Base64编码
-with open(image_path, "rb") as file:
-    image_bytes = file.read()
-    image_data = base64.b64encode(image_bytes).decode("ascii")
+with open(file_path, "rb") as file:
+    file_bytes = file.read()
+    file_data = base64.b64encode(file_bytes).decode("ascii")
 
 payload = {
-    "file": image_data, # Base64编码的文件内容或者文件URL
+    "file": file_data, # Base64编码的文件内容或者文件URL
     "fileType": 1,
-    "useImgOrientationCls": True,
-    "useImgUnwarping": True,
-    "useSealTextDet": True,
 }
 
 # 调用API
@@ -1462,12 +1551,13 @@ response = requests.post(API_URL, json=payload)
 assert response.status_code == 200
 result = response.json()["result"]
 print("\nDetected layout elements:")
-for res in result["layoutParsingResults"]:
-    for ele in res["layoutElements"]:
-        print("===============================")
-        print("bbox:", ele["bbox"])
-        print("label:", ele["label"])
-        print("text:", repr(ele["text"]))
+for i, res in enumerate(result["layoutParsingResults"]):
+    print(res["prunedResult"])
+    for img_name, img in res["outputImages"].items():
+        img_path = f"{img_name}_{i}.jpg"
+        with open(img_path, "wb") as f:
+            f.write(base64.b64decode(img))
+        print(f"Output image saved at {img_path}")
 </code></pre></details>
 </details>
 <br/>

+ 174 - 42
docs/pipeline_usage/tutorials/ocr_pipelines/layout_parsing_v2.md

@@ -1376,26 +1376,147 @@ for res in output:
 </tr>
 <tr>
 <td><code>fileType</code></td>
-<td><code>integer</code></td>
+<td><code>integer</code>|<code>null</code></td>
 <td>文件类型。<code>0</code>表示PDF文件,<code>1</code>表示图像文件。若请求体无此属性,则将根据URL推断文件类型。</td>
 <td>否</td>
 </tr>
+
+<tr>
+<td><code>useDocOrientationClassify</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_doc_orientation_classify</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>useDocUnwarping</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_doc_unwarping</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>useTextlineOrientation</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_textline_orientation</code> 参数说明。</td>
+<td>否</td>
+</tr>
 <tr>
-<td><code>useImgOrientationCls</code></td>
-<td><code>boolean</code></td>
-<td>是否启用文档图像方向分类功能。默认启用该功能。</td>
+<td><code>useGeneralOcr</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_general_ocr</code> 参数说明。</td>
 <td>否</td>
 </tr>
 <tr>
-<td><code>useImgUnwarping</code></td>
-<td><code>boolean</code></td>
-<td>是否启用文本图像矫正功能。默认启用该功能。</td>
+<td><code>useSealRecognition</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_seal_recognition</code> 参数说明。</td>
 <td>否</td>
 </tr>
 <tr>
-<td><code>useSealTextDet</code></td>
-<td><code>boolean</code></td>
-<td>是否启用印章文本检测功能。默认启用该功能。</td>
+<td><code>useTableRecognition</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_table_recognition</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>useFormulaRecognition</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_formula_recognition</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>textDetLimitSideLen</code></td>
+<td><code>integer</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_det_limit_side_len</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>textDetLimitType</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_det_limit_type</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>textDetThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_det_thresh</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>textDetBoxThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_det_box_thresh</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>textDetUnclipRatio</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_det_unclip_ratio</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>textRecScoreThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_rec_score_thresh</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>sealDetLimitSideLen</code></td>
+<td><code>integer</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>seal_det_limit_side_len</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>sealDetLimitType</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>seal_det_limit_type</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>sealDetThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>seal_det_thresh</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>sealDetBoxThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>seal_det_box_thresh</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>sealDetUnclipRatio</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>seal_det_unclip_ratio</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>sealRecScoreThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>seal_rec_score_thresh</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>layoutThreshold</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>layout_threshold</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>layoutNms</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>layout_nms</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>layoutUnclipRatio</code></td>
+<td><code>number</code> | <code>array</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>layout_unclip_ratio</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>layoutMergeBboxesMode</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>layout_merge_bboxes_mode</code> 参数说明。</td>
 <td>否</td>
 </tr>
 </tbody>
@@ -1435,13 +1556,28 @@ for res in output:
 </thead>
 <tbody>
 <tr>
-<td><code>layoutElements</code></td>
-<td><code>array</code></td>
-<td>版面元素信息。</td>
+<td><code>prunedResult</code></td>
+<td><code>object</code></td>
+<td>产线对象的 <code>predict</code> 方法生成结果的 JSON 表示中 <code>res</code> 字段的简化版本,其中去除了 <code>input_path</code> 字段</td>
+</tr>
+<tr>
+<td><code>markdown</code></td>
+<td><code>object</code></td>
+<td>markdown结果。</td>
+</tr>
+<tr>
+<td><code>outputImages</code></td>
+<td><code>object</code> | <code>null</code></td>
+<td>输入图像和预测结果图像的键值对。图像为JPEG格式,使用Base64编码。</td>
+</tr>
+<tr>
+<td><code>inputImage</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>输入图像。图像为JPEG格式,使用Base64编码。</td>
 </tr>
 </tbody>
 </table>
-<p><code>layoutElements</code>中的每个元素为一个<code>object</code>,具有如下属性:</p>
+<p><code>markdown</code>为一个<code>object</code>,具有如下属性:</p>
 <table>
 <thead>
 <tr>
@@ -1452,32 +1588,23 @@ for res in output:
 </thead>
 <tbody>
 <tr>
-<td><code>bbox</code></td>
-<td><code>array</code></td>
-<td>版面元素位置。数组中元素依次为边界框左上角x坐标、左上角y坐标、右下角x坐标以及右下角y坐标。</td>
-</tr>
-<tr>
-<td><code>label</code></td>
-<td><code>string</code></td>
-<td>版面元素标签。</td>
-</tr>
-<tr>
 <td><code>text</code></td>
 <td><code>string</code></td>
-<td>版面元素包含的文本。</td>
-</tr>
-<tr>
-<td><code>layoutType</code></td>
-<td><code>string</code></td>
-<td>版面元素排列方式。</td>
+<td>Markdown文本。</td>
 </tr>
 <tr>
-<td><code>image</code></td>
-<td><code>string</code></td>
-<td>版面元素图像,JPEG格式,使用Base64编码。</td>
+<td><code>images</code></td>
+<td><code>object</code></td>
+<td>Markdown图片相对路径和base64编码图像的键值对。</td>
 </tr>
 </tbody>
+<<<<<<< HEAD
 </table></details>
+=======
+</table>
+</details>
+
+>>>>>>> 6c84cdc9 (update)
 <details><summary>多语言调用服务示例</summary>
 <details>
 <summary>Python</summary>
@@ -1495,10 +1622,6 @@ with open(image_path, "rb") as file:
 
 payload = {
     "file": image_data, # Base64编码的文件内容或者文件URL
-    "fileType": 1,
-    "useImgOrientationCls": True,
-    "useImgUnwarping": True,
-    "useSealTextDet": True,
 }
 
 # 调用API
@@ -1509,11 +1632,20 @@ assert response.status_code == 200
 result = response.json()["result"]
 print("\nDetected layout elements:")
 for res in result["layoutParsingResults"]:
-    for ele in res["layoutElements"]:
-        print("===============================")
-        print("bbox:", ele["bbox"])
-        print("label:", ele["label"])
-        print("text:", repr(ele["text"]))
+    print(res["prunedResult"])
+    md_dir = pathlib.Path(f"markdown_{i}")
+    md_dir.mkdir(exist_ok=True)
+    (md_dir / "doc.md").write_text(res["markdown"]["text"])
+    for img_path, img in res["markdown"]["images"].items():
+        img_path = md_dir / img_path
+        img_path.parent.mkdir(parents=True, exist_ok=True)
+        img_path.write_bytes(base64.b64decode(img))
+    print(f"Markdown document saved at {md_dir / 'doc.md'}")
+    for img_name, img in res["outputImages"].items():
+        img_path = f"{img_name}_{i}.jpg"
+        with open(img_path, "wb") as f:
+            f.write(base64.b64decode(img))
+        print(f"Output image saved at {img_path}")
 </code></pre></details>
 </details>
 <br/>

+ 94 - 51
docs/pipeline_usage/tutorials/ocr_pipelines/seal_recognition.md

@@ -1292,10 +1292,88 @@ for res in output:
 </tr>
 <tr>
 <td><code>fileType</code></td>
-<td><code>integer</code></td>
+<td><code>integer</code> | <code>null</code></td>
 <td>文件类型。<code>0</code>表示PDF文件,<code>1</code>表示图像文件。若请求体无此属性,则将根据URL推断文件类型。</td>
 <td>否</td>
 </tr>
+<tr>
+<td><code>useDocOrientationClassify</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_doc_orientation_classify</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>useDocUnwarping</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_doc_unwarping</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>useLayoutDetection</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_layout_detection</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>layoutThreshold</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>layout_threshold</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>layoutNms</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>layout_nms</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>layoutUnclipRatio</code></td>
+<td><code>number</code> | <code>array</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>layout_unclip_ratio</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>layoutMergeBboxesMode</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>layout_merge_bboxes_mode</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>sealDetLimitSideLen</code></td>
+<td><code>integer</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>seal_det_limit_side_len</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>sealDetLimitType</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>seal_det_limit_type</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>sealDetThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>seal_det_thresh</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>sealDetBoxThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>seal_det_box_thresh</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>sealDetUnclipRatio</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>seal_det_unclip_ratio</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>sealRecScoreThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>seal_rec_score_thresh</code> 参数说明。</td>
+<td>否</td>
+</tr>
 </tbody>
 </table>
 <ul>
@@ -1333,51 +1411,19 @@ for res in output:
 </thead>
 <tbody>
 <tr>
-<td><code>texts</code></td>
-<td><code>array</code></td>
-<td>文本位置、内容和得分。</td>
-</tr>
-<tr>
-<td><code>inputImage</code></td>
-<td><code>string</code></td>
-<td>输入图像。图像为JPEG格式,使用Base64编码。</td>
-</tr>
-<tr>
-<td><code>layoutImage</code></td>
-<td><code>string</code></td>
-<td>版面区域检测结果图。图像为JPEG格式,使用Base64编码。</td>
-</tr>
-<tr>
-<td><code>ocrImage</code></td>
-<td><code>string</code></td>
-<td>OCR结果图。图像为JPEG格式,使用Base64编码。</td>
-</tr>
-</tbody>
-</table>
-<p><code>texts</code>中的每个元素为一个<code>object</code>,具有如下属性:</p>
-<table>
-<thead>
-<tr>
-<th>名称</th>
-<th>类型</th>
-<th>含义</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td><code>poly</code></td>
-<td><code>array</code></td>
-<td>文本位置。数组中元素依次为包围文本的多边形的顶点坐标。</td>
+<td><code>prunedResult</code></td>
+<td><code>object</code></td>
+<td>产线对象的 <code>predict</code> 方法生成结果的 JSON 表示中 <code>res</code> 字段的简化版本,其中去除了 <code>input_path</code> 字段</td>
 </tr>
 <tr>
-<td><code>text</code></td>
-<td><code>string</code></td>
-<td>文本内容。</td>
+<td><code>outputImages</code></td>
+<td><code>object</code> | <code>null</code></td>
+<td>输入图像和预测结果图像的键值对。图像为JPEG格式,使用Base64编码。</td>
 </tr>
 <tr>
-<td><code>score</code></td>
-<td><code>number</code></td>
-<td>文本识别得分。</td>
+<td><code>inputImage</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>输入图像。图像为JPEG格式,使用Base64编码。</td>
 </tr>
 </tbody>
 </table></details>
@@ -1401,15 +1447,12 @@ response = requests.post(API_URL, json=payload)
 assert response.status_code == 200
 result = response.json()["result"]
 for i, res in enumerate(result["sealRecResults"]):
-    print("Detected texts:")
-    print(res["texts"])
-    layout_img_path = f"layout_{i}.jpg"
-    with open(layout_img_path, "wb") as f:
-        f.write(base64.b64decode(res["layoutImage"]))
-    ocr_img_path = f"ocr_{i}.jpg"
-    with open(ocr_img_path, "wb") as f:
-        f.write(base64.b64decode(res["ocrImage"]))
-    print(f"Output images saved at {layout_img_path} and {ocr_img_path}")
+    print(res["prunedResult"])
+    for img_name, img in res["outputImages"].items():
+        img_path = f"{img_name}_{i}.jpg"
+        with open(img_path, "wb") as f:
+            f.write(base64.b64decode(img))
+        print(f"Output image saved at {img_path}")
 </code></pre></details>
 </details>
 <br/>

+ 100 - 41
docs/pipeline_usage/tutorials/ocr_pipelines/table_recognition.md

@@ -892,10 +892,94 @@ for res in output:
 </tr>
 <tr>
 <td><code>fileType</code></td>
-<td><code>integer</code></td>
+<td><code>integer</code> | <code>null</code></td>
 <td>文件类型。<code>0</code>表示PDF文件,<code>1</code>表示图像文件。若请求体无此属性,则将根据URL推断文件类型。</td>
 <td>否</td>
 </tr>
+<tr>
+<td><code>useDocOrientationClassify</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_doc_orientation_classify</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>useDocUnwarping</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_doc_unwarping</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>useLayoutDetection</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_layout_detection</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>useOcrModel</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_ocr_model</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>layoutThreshold</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>layout_threshold</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>layoutNms</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>layout_nms</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>layoutUnclipRatio</code></td>
+<td><code>number</code> | <code>array</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>layout_unclip_ratio</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>layoutMergeBboxesMode</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>layout_merge_bboxes_mode</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>textDetLimitSideLen</code></td>
+<td><code>integer</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_det_limit_side_len</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>textDetLimitType</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_det_limit_type</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>textDetThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_det_thresh</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>textDetBoxThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_det_box_thresh</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>textDetUnclipRatio</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_det_unclip_ratio</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>textRecScoreThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_rec_score_thresh</code> 参数说明。</td>
+<td>否</td>
+</tr>
 </tbody>
 </table>
 <ul>
@@ -933,41 +1017,19 @@ for res in output:
 </thead>
 <tbody>
 <tr>
-<td><code>tables</code></td>
-<td><code>array</code></td>
-<td>表格位置和内容。</td>
-</tr>
-<tr>
-<td><code>layoutImage</code></td>
-<td><code>string</code></td>
-<td>版面区域检测结果图。图像为JPEG格式,使用Base64编码。</td>
-</tr>
-<tr>
-<td><code>ocrImage</code></td>
-<td><code>string</code></td>
-<td>OCR结果图。图像为JPEG格式,使用Base64编码。</td>
-</tr>
-</tbody>
-</table>
-<p><code>tables</code>中的每个元素为一个<code>object</code>,具有如下属性:</p>
-<table>
-<thead>
-<tr>
-<th>名称</th>
-<th>类型</th>
-<th>含义</th>
+<td><code>prunedResult</code></td>
+<td><code>object</code></td>
+<td>产线对象的 <code>predict</code> 方法生成结果的 JSON 表示中 <code>res</code> 字段的简化版本,其中去除了 <code>input_path</code> 字段</td>
 </tr>
-</thead>
-<tbody>
 <tr>
-<td><code>bbox</code></td>
-<td><code>array</code></td>
-<td>表格位置。数组中元素依次为边界框左上角x坐标、左上角y坐标、右下角x坐标以及右下角y坐标。</td>
+<td><code>outputImages</code></td>
+<td><code>object</code> | <code>null</code></td>
+<td>输入图像和预测结果图像的键值对。图像为JPEG格式,使用Base64编码。</td>
 </tr>
 <tr>
-<td><code>html</code></td>
-<td><code>string</code></td>
-<td>HTML格式的表格识别结果。</td>
+<td><code>inputImage</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>输入图像。图像为JPEG格式,使用Base64编码。</td>
 </tr>
 </tbody>
 </table></details>
@@ -991,15 +1053,12 @@ response = requests.post(API_URL, json=payload)
 assert response.status_code == 200
 result = response.json()["result"]
 for i, res in enumerate(result["tableRecResults"]):
-    print("Detected tables:")
-    print(res["tables"])
-    layout_img_path = f"layout_{i}.jpg"
-    with open(layout_img_path, "wb") as f:
-        f.write(base64.b64decode(res["layoutImage"]))
-    ocr_img_path = f"ocr_{i}.jpg"
-    with open(ocr_img_path, "wb") as f:
-        f.write(base64.b64decode(res["ocrImage"]))
-    print(f"Output images saved at {layout_img_path} and {ocr_img_path}")
+    print(res["prunedResult"])
+    for img_name, img in res["outputImages"].items():
+        img_path = f"{img_name}_{i}.jpg"
+        with open(img_path, "wb") as f:
+            f.write(base64.b64decode(img))
+        print(f"Output image saved at {img_path}")
 </code></pre></details>
 </details>
 <br/>

+ 83 - 45
docs/pipeline_usage/tutorials/ocr_pipelines/table_recognition_v2.md

@@ -1096,64 +1096,97 @@ for res in output:
 </tr>
 <tr>
 <td><code>fileType</code></td>
-<td><code>integer</code></td>
+<td><code>integer</code> | <code>null</code></td>
 <td>文件类型。<code>0</code>表示PDF文件,<code>1</code>表示图像文件。若请求体无此属性,则将根据URL推断文件类型。</td>
 <td>否</td>
 </tr>
-</tbody>
-</table>
-<ul>
-<li>请求处理成功时,响应体的<code>result</code>具有如下属性:</li>
-</ul>
-<table>
-<thead>
 <tr>
-<th>名称</th>
-<th>类型</th>
-<th>含义</th>
+<td><code>useDocOrientationClassify</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_doc_orientation_classify</code> 参数说明。</td>
+<td>否</td>
 </tr>
-</thead>
-<tbody>
 <tr>
-<td><code>tableRecResults</code></td>
-<td><code>object</code></td>
-<td>表格识别结果。数组长度为1(对于图像输入)或文档页数与10中的较小者(对于PDF输入)。对于PDF输入,数组中的每个元素依次表示PDF文件中每一页的处理结果。</td>
+<td><code>useDocUnwarping</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_doc_unwarping</code> 参数说明。</td>
+<td>否</td>
 </tr>
 <tr>
-<td><code>dataInfo</code></td>
-<td><code>object</code></td>
-<td>输入数据信息。</td>
+<td><code>useLayoutDetection</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_layout_detection</code> 参数说明。</td>
+<td>否</td>
 </tr>
-</tbody>
-</table>
-<p><code>tableRecResults</code>中的每个元素为一个<code>object</code>,具有如下属性:</p>
-<table>
-<thead>
 <tr>
-<th>名称</th>
-<th>类型</th>
-<th>含义</th>
+<td><code>useOcrModel</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>use_ocr_model</code> 参数说明。</td>
+<td>否</td>
 </tr>
-</thead>
-<tbody>
 <tr>
-<td><code>tables</code></td>
-<td><code>array</code></td>
-<td>表格位置和内容。</td>
+<td><code>layoutThreshold</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>layout_threshold</code> 参数说明。</td>
+<td>否</td>
 </tr>
 <tr>
-<td><code>layoutImage</code></td>
-<td><code>string</code></td>
-<td>版面区域检测结果图。图像为JPEG格式,使用Base64编码。</td>
+<td><code>layoutNms</code></td>
+<td><code>boolean</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>layout_nms</code> 参数说明。</td>
+<td>否</td>
 </tr>
 <tr>
-<td><code>ocrImage</code></td>
-<td><code>string</code></td>
-<td>OCR结果图。图像为JPEG格式,使用Base64编码。</td>
+<td><code>layoutUnclipRatio</code></td>
+<td><code>number</code> | <code>array</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>layout_unclip_ratio</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>layoutMergeBboxesMode</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>layout_merge_bboxes_mode</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>textDetLimitSideLen</code></td>
+<td><code>integer</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_det_limit_side_len</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>textDetLimitType</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_det_limit_type</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>textDetThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_det_thresh</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>textDetBoxThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_det_box_thresh</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>textDetUnclipRatio</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_det_unclip_ratio</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>textRecScoreThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>text_rec_score_thresh</code> 参数说明。</td>
+<td>否</td>
 </tr>
 </tbody>
 </table>
-<p><code>tables</code>中的每个元素为一个<code>object</code>,具有如下属性:</p>
+<p><code>tableRecResults</code>中的每个元素为一个<code>object</code>,具有如下属性:</p>
 <table>
 <thead>
 <tr>
@@ -1164,14 +1197,19 @@ for res in output:
 </thead>
 <tbody>
 <tr>
-<td><code>bbox</code></td>
-<td><code>array</code></td>
-<td>表格位置。数组中元素依次为边界框左上角x坐标、左上角y坐标、右下角x坐标以及右下角y坐标。</td>
+<td><code>prunedResult</code></td>
+<td><code>object</code></td>
+<td>产线对象的 <code>predict</code> 方法生成结果的 JSON 表示中 <code>res</code> 字段的简化版本,其中去除了 <code>input_path</code> 字段</td>
 </tr>
 <tr>
-<td><code>html</code></td>
-<td><code>string</code></td>
-<td>HTML格式的表格识别结果。</td>
+<td><code>outputImages</code></td>
+<td><code>object</code> | <code>null</code></td>
+<td>输入图像和预测结果图像的键值对。图像为JPEG格式,使用Base64编码。</td>
+</tr>
+<tr>
+<td><code>inputImage</code></td>
+<td><code>string</code> | <code>null</code></td>
+<td>输入图像。图像为JPEG格式,使用Base64编码。</td>
 </tr>
 </tbody>
 </table></details>

+ 230 - 0
docs/pipeline_usage/tutorials/speech_pipelines/multilingual_speech_recognition.md

@@ -283,3 +283,233 @@ for res in output:
 ```
 
 <b>注:</b> 配置文件中的参数为产线初始化参数,如果希望更改 multilingual_speech_recognition 产线初始化参数,可以直接修改配置文件中的参数,并加载配置文件进行预测。同时,CLI 预测也支持传入配置文件,`--pipeline` 指定配置文件的路径即可。
+
+## 3. 开发集成/部署
+
+如果产线可以达到您对产线推理速度和精度的要求,您可以直接进行开发集成/部署。
+
+若您需要将产线直接应用在您的Python项目中,可以参考 [2.2.2 Python脚本方式](#222-python脚本方式集成)中的示例代码。
+
+此外,PaddleX 也提供了其他三种部署方式,详细说明如下:
+
+🚀 <b>高性能推理</b>:在实际生产环境中,许多应用对部署策略的性能指标(尤其是响应速度)有着较严苛的标准,以确保系统的高效运行与用户体验的流畅性。为此,PaddleX 提供高性能推理插件,旨在对模型推理及前后处理进行深度性能优化,实现端到端流程的显著提速,详细的高性能推理流程请参考[PaddleX高性能推理指南](../../../pipeline_deploy/high_performance_inference.md)。
+
+☁️ <b>服务化部署</b>:服务化部署是实际生产环境中常见的一种部署形式。通过将推理功能封装为服务,客户端可以通过网络请求来访问这些服务,以获取推理结果。PaddleX 支持多种产线服务化部署方案,详细的产线服务化部署流程请参考[PaddleX服务化部署指南](../../../pipeline_deploy/serving.md)。
+
+以下是基础服务化部署的API参考与多语言服务调用示例:
+
+<details><summary>API参考</summary>
+
+<p>对于服务提供的主要操作:</p>
+<ul>
+<li>HTTP请求方法为POST。</li>
+<li>请求体和响应体均为JSON数据(JSON对象)。</li>
+<li>当请求处理成功时,响应状态码为<code>200</code>,响应体的属性如下:</li>
+</ul>
+<table>
+<thead>
+<tr>
+<th>名称</th>
+<th>类型</th>
+<th>含义</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>logId</code></td>
+<td><code>string</code></td>
+<td>请求的UUID。</td>
+</tr>
+<tr>
+<td><code>errorCode</code></td>
+<td><code>integer</code></td>
+<td>错误码。固定为<code>0</code>。</td>
+</tr>
+<tr>
+<td><code>errorMsg</code></td>
+<td><code>string</code></td>
+<td>错误说明。固定为<code>"Success"</code>。</td>
+</tr>
+<tr>
+<td><code>result</code></td>
+<td><code>object</code></td>
+<td>操作结果。</td>
+</tr>
+</tbody>
+</table>
+<ul>
+<li>当请求处理未成功时,响应体的属性如下:</li>
+</ul>
+<table>
+<thead>
+<tr>
+<th>名称</th>
+<th>类型</th>
+<th>含义</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>logId</code></td>
+<td><code>string</code></td>
+<td>请求的UUID。</td>
+</tr>
+<tr>
+<td><code>errorCode</code></td>
+<td><code>integer</code></td>
+<td>错误码。与响应状态码相同。</td>
+</tr>
+<tr>
+<td><code>errorMsg</code></td>
+<td><code>string</code></td>
+<td>错误说明。</td>
+</tr>
+</tbody>
+</table>
+<p>服务提供的主要操作如下:</p>
+<ul>
+<li><b><code>infer</code></b></li>
+</ul>
+<p>对音频进行多语种语音识别。</p>
+<p><code>POST /multilingual-speech-recognition</code></p>
+<ul>
+<li>请求体的属性如下:</li>
+</ul>
+<table>
+<thead>
+<tr>
+<th>名称</th>
+<th>类型</th>
+<th>含义</th>
+<th>是否必填</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>audio</code></td>
+<td><code>string</code></td>
+<td>服务器可访问的音频文件的URL或路径。</td>
+<td>是</td>
+</tr>
+</tbody>
+</table>
+<ul>
+<li>请求处理成功时,响应体的<code>result</code>具有如下属性:</li>
+</ul>
+<table>
+<thead>
+<tr>
+<th>名称</th>
+<th>类型</th>
+<th>含义</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>text</code></td>
+<td><code>string</code></td>
+<td>语音识别结果文本。</td>
+</tr>
+<tr>
+<td><code>segments</code></td>
+<td><code>array</code></td>
+<td>带时间戳的结果文本。</td>
+</tr>
+<tr>
+<td><code>language</code></td>
+<td><code>string</code></td>
+<td>识别语种。</td>
+</tr>
+</tbody>
+</table>
+<p><code>segments</code>中的每个元素为一个<code>object</code>,具有如下属性:</p>
+<table>
+<thead>
+<tr>
+<th>名称</th>
+<th>类型</th>
+<th>含义</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>id</code></td>
+<td><code>integer</code></td>
+<td>语音片段ID。</td>
+</tr>
+<tr>
+<td><code>seek</code></td>
+<td><code>integer</code></td>
+<td>语音片段指针。</td>
+</tr>
+<tr>
+<td><code>start</code></td>
+<td><code>number</code></td>
+<td>语音片段开始时间。</td>
+</tr>
+<tr>
+<td><code>end</code></td>
+<td><code>number</code></td>
+<td>语音片段结束时间。</td>
+</tr>
+<tr>
+<td><code>text</code></td>
+<td><code>string</code></td>
+<td>语音片段识别文本。</td>
+</tr>
+<tr>
+<td><code>tokens</code></td>
+<td><code>array</code></td>
+<td>语音片段的token id。</td>
+</tr>
+<tr>
+<td><code>temperature</code></td>
+<td><code>number</code></td>
+<td>变速比例</td>
+</tr>
+<tr>
+<td><code>avgLogProb</code></td>
+<td><code>number</code></td>
+<td>平均log概率。</td>
+</tr>
+<tr>
+<td><code>compressionRatio</code></td>
+<td><code>number</code></td>
+<td>压缩比。</td>
+</tr>
+<tr>
+<td><code>noSpeechProb</code></td>
+<td><code>number</code></td>
+<td>非语音概率。</td>
+</tr>
+</tbody>
+</table>
+</details>
+
+<details><summary>多语言调用服务示例</summary>
+
+<details>
+<summary>Python</summary>
+
+
+<pre><code class="language-python">
+import requests
+
+API_URL = &quot;http://localhost:8080/multilingual-speech-recognition&quot; # 服务URL
+audio_path = &quot;./zh.wav&quot;
+
+payload = {&quot;audio&quot;: audio_path}
+
+# 调用API
+response = requests.post(API_URL, json=payload)
+
+# 处理接口返回数据
+assert response.status_code == 200
+result = response.json()[&quot;result&quot;]
+print(result)
+</code></pre></details>
+</details>
+<br/>
+
+📱 <b>端侧部署</b>:端侧部署是一种将计算和数据处理功能放在用户设备本身上的方式,设备可以直接处理数据,而不需要依赖远程的服务器。PaddleX 支持将模型部署在 Android 等端侧设备上,详细的端侧部署流程请参考[PaddleX端侧部署指南](../../../pipeline_deploy/edge_deploy.md)。
+您可以根据需要选择合适的方式部署模型产线,进而进行后续的 AI 应用集成。

+ 4 - 82
docs/pipeline_usage/tutorials/video_pipelines/video_classification.md

@@ -401,32 +401,12 @@ for res in output:
 <td>是</td>
 </tr>
 <tr>
-<td><code>inferenceParams</code></td>
-<td><code>object</code></td>
-<td>推理参数。</td>
+<td><code>topk</code></td>
+<td><code>integer</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>topk</code> 参数说明。</td>
 <td>否</td>
 </tr>
 </tbody>
-</table>
-<p><code>inferenceParams</code>的属性如下:</p>
-<table>
-<thead>
-<tr>
-<th>名称</th>
-<th>类型</th>
-<th>含义</th>
-<th>是否必填</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td><code>topK</code></td>
-<td><code>integer</code></td>
-<td>结果中将只保留得分最高的<code>topK</code>个类别。</td>
-<td>否</td>
-</tr>
-</tbody>
-</table>
 <ul>
 <li>请求处理成功时,响应体的<code>result</code>具有如下属性:</li>
 </ul>
@@ -444,11 +424,6 @@ for res in output:
 <td><code>array</code></td>
 <td>视频类别信息。</td>
 </tr>
-<tr>
-<td><code>video</code></td>
-<td><code>string</code></td>
-<td>视频分类结果图。视频为JPEG格式,使用Base64编码。</td>
-</tr>
 </tbody>
 </table>
 <p><code>categories</code>中的每个元素为一个<code>object</code>,具有如下属性:</p>
@@ -517,10 +492,7 @@ response = requests.post(API_URL, json=payload)
 # 处理接口返回数据
 assert response.status_code == 200
 result = response.json()[&quot;result&quot;]
-with open(output_video_path, &quot;wb&quot;) as file:
-    file.write(base64.b64decode(result[&quot;video&quot;]))
-print(f&quot;Output video saved at {output_video_path}&quot;)
-print(&quot;\nCategories:&quot;)
+print(&quot;Categories:&quot;)
 print(result[&quot;categories&quot;])
 </code></pre></details>
 <details><summary>C++</summary>
@@ -533,7 +505,6 @@ print(result[&quot;categories&quot;])
 int main() {
     httplib::Client client(&quot;localhost:8080&quot;);
     const std::string videoPath = &quot;./demo.mp4&quot;;
-    const std::string outputImagePath = &quot;./out.mp4&quot;;
 
     httplib::Headers headers = {
         {&quot;Content-Type&quot;, &quot;application/json&quot;}
@@ -562,19 +533,6 @@ int main() {
     if (response &amp;&amp; response-&gt;status == 200) {
         nlohmann::json jsonResponse = nlohmann::json::parse(response-&gt;body);
         auto result = jsonResponse[&quot;result&quot;];
-
-        encodedImage = result[&quot;video&quot;];
-        std::string decodedString = base64::from_base64(encodedImage);
-        std::vector&lt;unsigned char&gt; decodedImage(decodedString.begin(), decodedString.end());
-        std::ofstream outputImage(outPutImagePath, std::ios::binary | std::ios::out);
-        if (outputImage.is_open()) {
-            outputImage.write(reinterpret_cast&lt;char*&gt;(decodedImage.data()), decodedImage.size());
-            outputImage.close();
-            std::cout &lt;&lt; &quot;Output video saved at &quot; &lt;&lt; outPutImagePath &lt;&lt; std::endl;
-        } else {
-            std::cerr &lt;&lt; &quot;Unable to open file for writing: &quot; &lt;&lt; outPutImagePath &lt;&lt; std::endl;
-        }
-
         auto categories = result[&quot;categories&quot;];
         std::cout &lt;&lt; &quot;\nCategories:&quot; &lt;&lt; std::endl;
         for (const auto&amp; category : categories) {
@@ -605,7 +563,6 @@ public class Main {
     public static void main(String[] args) throws IOException {
         String API_URL = &quot;http://localhost:8080/video-classification&quot;; // 服务URL
         String videoPath = &quot;./demo.mp4&quot;; // 本地视频
-        String outputImagePath = &quot;./out.mp4&quot;; // 输出视频
 
         // 对本地视频进行Base64编码
         File file = new File(videoPath);
@@ -631,14 +588,7 @@ public class Main {
                 String responseBody = response.body().string();
                 JsonNode resultNode = objectMapper.readTree(responseBody);
                 JsonNode result = resultNode.get(&quot;result&quot;);
-                String base64Image = result.get(&quot;video&quot;).asText();
                 JsonNode categories = result.get(&quot;categories&quot;);
-
-                byte[] videoBytes = Base64.getDecoder().decode(base64Image);
-                try (FileOutputStream fos = new FileOutputStream(outputImagePath)) {
-                    fos.write(videoBytes);
-                }
-                System.out.println(&quot;Output video saved at &quot; + outputImagePath);
                 System.out.println(&quot;\nCategories: &quot; + categories.toString());
             } else {
                 System.err.println(&quot;Request failed with code: &quot; + response.code());
@@ -664,7 +614,6 @@ import (
 func main() {
     API_URL := &quot;http://localhost:8080/video-classification&quot;
     videoPath := &quot;./demo.mp4&quot;
-    outputImagePath := &quot;./out.mp4&quot;
 
     // 对本地视频进行Base64编码
     videoBytes, err := ioutil.ReadFile(videoPath)
@@ -704,7 +653,6 @@ func main() {
     }
     type Response struct {
         Result struct {
-            Image      string   `json:&quot;video&quot;`
             Categories []map[string]interface{} `json:&quot;categories&quot;`
         } `json:&quot;result&quot;`
     }
@@ -715,17 +663,6 @@ func main() {
         return
     }
 
-    outputImageData, err := base64.StdEncoding.DecodeString(respData.Result.Image)
-    if err != nil {
-        fmt.Println(&quot;Error decoding base64 video data:&quot;, err)
-        return
-    }
-    err = ioutil.WriteFile(outputImagePath, outputImageData, 0644)
-    if err != nil {
-        fmt.Println(&quot;Error writing video to file:&quot;, err)
-        return
-    }
-    fmt.Printf(&quot;Image saved at %s.mp4\n&quot;, outputImagePath)
     fmt.Println(&quot;\nCategories:&quot;)
     for _, category := range respData.Result.Categories {
         fmt.Println(category)
@@ -747,7 +684,6 @@ class Program
 {
     static readonly string API_URL = &quot;http://localhost:8080/video-classification&quot;;
     static readonly string videoPath = &quot;./demo.mp4&quot;;
-    static readonly string outputImagePath = &quot;./out.mp4&quot;;
 
     static async Task Main(string[] args)
     {
@@ -768,11 +704,6 @@ class Program
         string responseBody = await response.Content.ReadAsStringAsync();
         JObject jsonResponse = JObject.Parse(responseBody);
 
-        string base64Image = jsonResponse[&quot;result&quot;][&quot;video&quot;].ToString();
-        byte[] outputImageBytes = Convert.FromBase64String(base64Image);
-
-        File.WriteAllBytes(outputImagePath, outputImageBytes);
-        Console.WriteLine($&quot;Output video saved at {outputImagePath}&quot;);
         Console.WriteLine(&quot;\nCategories:&quot;);
         Console.WriteLine(jsonResponse[&quot;result&quot;][&quot;categories&quot;].ToString());
     }
@@ -786,7 +717,6 @@ const fs = require('fs');
 
 const API_URL = 'http://localhost:8080/video-classification'
 const videoPath = './demo.mp4'
-const outputImagePath = &quot;./out.mp4&quot;;
 
 let config = {
    method: 'POST',
@@ -808,11 +738,6 @@ axios.request(config)
 .then((response) =&gt; {
     // 处理接口返回数据
     const result = response.data[&quot;result&quot;];
-    const videoBuffer = Buffer.from(result[&quot;video&quot;], 'base64');
-    fs.writeFile(outputImagePath, videoBuffer, (err) =&gt; {
-      if (err) throw err;
-      console.log(`Output video saved at ${outputImagePath}`);
-    });
     console.log(&quot;\nCategories:&quot;);
     console.log(result[&quot;categories&quot;]);
 })
@@ -826,7 +751,6 @@ axios.request(config)
 
 $API_URL = &quot;http://localhost:8080/video-classification&quot;; // 服务URL
 $video_path = &quot;./demo.mp4&quot;;
-$output_video_path = &quot;./out.mp4&quot;;
 
 // 对本地视频进行Base64编码
 $video_data = base64_encode(file_get_contents($video_path));
@@ -842,8 +766,6 @@ curl_close($ch);
 
 // 处理接口返回数据
 $result = json_decode($response, true)[&quot;result&quot;];
-file_put_contents($output_video_path, base64_decode($result[&quot;video&quot;]));
-echo &quot;Output video saved at &quot; . $output_video_path . &quot;\n&quot;;
 echo &quot;\nCategories:\n&quot;;
 print_r($result[&quot;categories&quot;]);
 ?&gt;

+ 34 - 371
docs/pipeline_usage/tutorials/video_pipelines/video_detection.md

@@ -401,7 +401,7 @@ for res in output:
 <li><b><code>infer</code></b></li>
 </ul>
 <p>对视频进行分类。</p>
-<p><code>POST /video-classification</code></p>
+<p><code>POST /video-detection</code></p>
 <ul>
 <li>请求体的属性如下:</li>
 </ul>
@@ -422,35 +422,39 @@ for res in output:
 <td>是</td>
 </tr>
 <tr>
-<td><code>inferenceParams</code></td>
-<td><code>object</code></td>
-<td>推理参数。</td>
+<td><code>nmsThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>nms_thresh</code> 参数说明。</td>
+<td>否</td>
+</tr>
+<tr>
+<td><code>scoreThresh</code></td>
+<td><code>number</code> | <code>null</code></td>
+<td>参见产线 <code>predict</code> 方法中的 <code>score_thresh</code> 参数说明。</td>
 <td>否</td>
 </tr>
 </tbody>
 </table>
-<p><code>inferenceParams</code>的属性如下:</p>
+<ul>
+<li>请求处理成功时,响应体的<code>result</code>具有如下属性:</li>
+</ul>
 <table>
 <thead>
 <tr>
 <th>名称</th>
 <th>类型</th>
 <th>含义</th>
-<th>是否必填</th>
 </tr>
 </thead>
 <tbody>
 <tr>
-<td><code>score_threshold</code></td>
-<td><code>integer</code></td>
-<td>结果中将只保留得分高于该阈值<code>score_threshold</code>的框。</td>
-<td>否</td>
+<td><code>frames</code></td>
+<td><code>array</code></td>
+<td>每一帧的检测结果。</td>
 </tr>
 </tbody>
 </table>
-<ul>
-<li>请求处理成功时,响应体的<code>result</code>具有如下属性:</li>
-</ul>
+<p><code>frames</code>中的每个元素为一个<code>object</code>,具有如下属性:</p>
 <table>
 <thead>
 <tr>
@@ -459,20 +463,19 @@ for res in output:
 <th>含义</th>
 </tr>
 </thead>
-<tbody>
 <tr>
-<td><code>categories</code></td>
-<td><code>array</code></td>
-<td>视频类别信息。</td>
+<td><code>index</code></td>
+<td><code>integer</code></td>
+<td>从 0 开始的帧编号</td>
 </tr>
 <tr>
-<td><code>video</code></td>
-<td><code>string</code></td>
-<td>视频检测结果图。视频为JPEG格式,使用Base64编码。</td>
+<td><code>detectedObjects</code></td>
+<td><code>array</code></td>
+<td>目标的位置、类别等信息。</td>
 </tr>
 </tbody>
 </table>
-<p><code>categories</code>中的每个元素为一个<code>object</code>,具有如下属性:</p>
+<p><code>detectedObjects</code>中的每个元素为一个<code>object</code>,具有如下属性:</p>
 <table>
 <thead>
 <tr>
@@ -483,34 +486,23 @@ for res in output:
 </thead>
 <tbody>
 <tr>
-<td><code>id</code></td>
-<td><code>integer</code></td>
-<td>类别ID。</td>
+<td><code>bbox</code></td>
+<td><code>array</code></td>
+<td>目标位置。数组中元素依次为边界框左上角x坐标、左上角y坐标、右下角x坐标以及右下角y坐标。</td>
 </tr>
 <tr>
-<td><code>name</code></td>
+<td><code>categoryName</code></td>
 <td><code>string</code></td>
-<td>类别名称。</td>
+<td>目标类别名称。</td>
 </tr>
 <tr>
 <td><code>score</code></td>
 <td><code>number</code></td>
-<td>类别得分。</td>
+<td>目标得分。</td>
 </tr>
 </tbody>
 </table>
-<p><code>result</code>示例如下:</p>
-<pre><code class="language-json">{
-&quot;categories&quot;: [
-{
-&quot;id&quot;: 5,
-&quot;name&quot;: &quot;兔子&quot;,
-&quot;score&quot;: 0.93
-}
-],
-&quot;video&quot;: &quot;xxxxxx&quot;
-}
-</code></pre></details>
+</details>
 
 <details><summary>多语言调用服务示例</summary>
 
@@ -521,9 +513,8 @@ for res in output:
 <pre><code class="language-python">import base64
 import requests
 
-API_URL = &quot;http://localhost:8080/video-classification&quot; # 服务URL
+API_URL = &quot;http://localhost:8080/video-detection&quot; # 服务URL
 video_path = &quot;./demo.mp4&quot;
-output_video_path = &quot;./out.mp4&quot;
 
 # 对本地视频进行Base64编码
 with open(video_path, &quot;rb&quot;) as file:
@@ -538,336 +529,8 @@ response = requests.post(API_URL, json=payload)
 # 处理接口返回数据
 assert response.status_code == 200
 result = response.json()[&quot;result&quot;]
-with open(output_video_path, &quot;wb&quot;) as file:
-    file.write(base64.b64decode(result[&quot;video&quot;]))
-print(f&quot;Output video saved at {output_video_path}&quot;)
-print(&quot;\nCategories:&quot;)
-print(result[&quot;categories&quot;])
-</code></pre></details>
-<details><summary>C++</summary>
-
-<pre><code class="language-cpp">#include &lt;iostream&gt;
-#include &quot;cpp-httplib/httplib.h&quot; // https://github.com/Huiyicc/cpp-httplib
-#include &quot;nlohmann/json.hpp&quot; // https://github.com/nlohmann/json
-#include &quot;base64.hpp&quot; // https://github.com/tobiaslocker/base64
-
-int main() {
-    httplib::Client client(&quot;localhost:8080&quot;);
-    const std::string videoPath = &quot;./demo.mp4&quot;;
-    const std::string outputImagePath = &quot;./out.mp4&quot;;
-
-    httplib::Headers headers = {
-        {&quot;Content-Type&quot;, &quot;application/json&quot;}
-    };
-
-    // 对本地视频进行Base64编码
-    std::ifstream file(videoPath, std::ios::binary | std::ios::ate);
-    std::streamsize size = file.tellg();
-    file.seekg(0, std::ios::beg);
-
-    std::vector&lt;char&gt; buffer(size);
-    if (!file.read(buffer.data(), size)) {
-        std::cerr &lt;&lt; &quot;Error reading file.&quot; &lt;&lt; std::endl;
-        return 1;
-    }
-    std::string bufferStr(reinterpret_cast&lt;const char*&gt;(buffer.data()), buffer.size());
-    std::string encodedImage = base64::to_base64(bufferStr);
-
-    nlohmann::json jsonObj;
-    jsonObj[&quot;video&quot;] = encodedImage;
-    std::string body = jsonObj.dump();
-
-    // 调用API
-    auto response = client.Post(&quot;/video-classification&quot;, headers, body, &quot;application/json&quot;);
-    // 处理接口返回数据
-    if (response &amp;&amp; response-&gt;status == 200) {
-        nlohmann::json jsonResponse = nlohmann::json::parse(response-&gt;body);
-        auto result = jsonResponse[&quot;result&quot;];
-
-        encodedImage = result[&quot;video&quot;];
-        std::string decodedString = base64::from_base64(encodedImage);
-        std::vector&lt;unsigned char&gt; decodedImage(decodedString.begin(), decodedString.end());
-        std::ofstream outputImage(outPutImagePath, std::ios::binary | std::ios::out);
-        if (outputImage.is_open()) {
-            outputImage.write(reinterpret_cast&lt;char*&gt;(decodedImage.data()), decodedImage.size());
-            outputImage.close();
-            std::cout &lt;&lt; &quot;Output video saved at &quot; &lt;&lt; outPutImagePath &lt;&lt; std::endl;
-        } else {
-            std::cerr &lt;&lt; &quot;Unable to open file for writing: &quot; &lt;&lt; outPutImagePath &lt;&lt; std::endl;
-        }
-
-        auto categories = result[&quot;categories&quot;];
-        std::cout &lt;&lt; &quot;\nCategories:&quot; &lt;&lt; std::endl;
-        for (const auto&amp; category : categories) {
-            std::cout &lt;&lt; category &lt;&lt; std::endl;
-        }
-    } else {
-        std::cout &lt;&lt; &quot;Failed to send HTTP request.&quot; &lt;&lt; std::endl;
-        return 1;
-    }
-
-    return 0;
-}
-</code></pre></details>
-
-<details><summary>Java</summary>
-
-<pre><code class="language-java">import okhttp3.*;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.Base64;
-
-public class Main {
-    public static void main(String[] args) throws IOException {
-        String API_URL = &quot;http://localhost:8080/video-classification&quot;; // 服务URL
-        String videoPath = &quot;./demo.mp4&quot;; // 本地视频
-        String outputImagePath = &quot;./out.mp4&quot;; // 输出视频
-
-        // 对本地视频进行Base64编码
-        File file = new File(videoPath);
-        byte[] fileContent = java.nio.file.Files.readAllBytes(file.toPath());
-        String videoData = Base64.getEncoder().encodeToString(fileContent);
-
-        ObjectMapper objectMapper = new ObjectMapper();
-        ObjectNode params = objectMapper.createObjectNode();
-        params.put(&quot;video&quot;, videoData); // Base64编码的文件内容或者视频URL
-
-        // 创建 OkHttpClient 实例
-        OkHttpClient client = new OkHttpClient();
-        MediaType JSON = MediaType.Companion.get(&quot;application/json; charset=utf-8&quot;);
-        RequestBody body = RequestBody.Companion.create(params.toString(), JSON);
-        Request request = new Request.Builder()
-                .url(API_URL)
-                .post(body)
-                .build();
-
-        // 调用API并处理接口返回数据
-        try (Response response = client.newCall(request).execute()) {
-            if (response.isSuccessful()) {
-                String responseBody = response.body().string();
-                JsonNode resultNode = objectMapper.readTree(responseBody);
-                JsonNode result = resultNode.get(&quot;result&quot;);
-                String base64Image = result.get(&quot;video&quot;).asText();
-                JsonNode categories = result.get(&quot;categories&quot;);
-
-                byte[] videoBytes = Base64.getDecoder().decode(base64Image);
-                try (FileOutputStream fos = new FileOutputStream(outputImagePath)) {
-                    fos.write(videoBytes);
-                }
-                System.out.println(&quot;Output video saved at &quot; + outputImagePath);
-                System.out.println(&quot;\nCategories: &quot; + categories.toString());
-            } else {
-                System.err.println(&quot;Request failed with code: &quot; + response.code());
-            }
-        }
-    }
-}
-</code></pre></details>
-
-<details><summary>Go</summary>
-
-<pre><code class="language-go">package main
-
-import (
-    &quot;bytes&quot;
-    &quot;encoding/base64&quot;
-    &quot;encoding/json&quot;
-    &quot;fmt&quot;
-    &quot;io/ioutil&quot;
-    &quot;net/http&quot;
-)
-
-func main() {
-    API_URL := &quot;http://localhost:8080/video-classification&quot;
-    videoPath := &quot;./demo.mp4&quot;
-    outputImagePath := &quot;./out.mp4&quot;
-
-    // 对本地视频进行Base64编码
-    videoBytes, err := ioutil.ReadFile(videoPath)
-    if err != nil {
-        fmt.Println(&quot;Error reading video file:&quot;, err)
-        return
-    }
-    videoData := base64.StdEncoding.EncodeToString(videoBytes)
-
-    payload := map[string]string{&quot;video&quot;: videoData} // Base64编码的文件内容或者视频URL
-    payloadBytes, err := json.Marshal(payload)
-    if err != nil {
-        fmt.Println(&quot;Error marshaling payload:&quot;, err)
-        return
-    }
-
-    // 调用API
-    client := &amp;http.Client{}
-    req, err := http.NewRequest(&quot;POST&quot;, API_URL, bytes.NewBuffer(payloadBytes))
-    if err != nil {
-        fmt.Println(&quot;Error creating request:&quot;, err)
-        return
-    }
-
-    res, err := client.Do(req)
-    if err != nil {
-        fmt.Println(&quot;Error sending request:&quot;, err)
-        return
-    }
-    defer res.Body.Close()
-
-    // 处理接口返回数据
-    body, err := ioutil.ReadAll(res.Body)
-    if err != nil {
-        fmt.Println(&quot;Error reading response body:&quot;, err)
-        return
-    }
-    type Response struct {
-        Result struct {
-            Image      string   `json:&quot;video&quot;`
-            Categories []map[string]interface{} `json:&quot;categories&quot;`
-        } `json:&quot;result&quot;`
-    }
-    var respData Response
-    err = json.Unmarshal([]byte(string(body)), &amp;respData)
-    if err != nil {
-        fmt.Println(&quot;Error unmarshaling response body:&quot;, err)
-        return
-    }
-
-    outputImageData, err := base64.StdEncoding.DecodeString(respData.Result.Image)
-    if err != nil {
-        fmt.Println(&quot;Error decoding base64 video data:&quot;, err)
-        return
-    }
-    err = ioutil.WriteFile(outputImagePath, outputImageData, 0644)
-    if err != nil {
-        fmt.Println(&quot;Error writing video to file:&quot;, err)
-        return
-    }
-    fmt.Printf(&quot;Image saved at %s.mp4\n&quot;, outputImagePath)
-    fmt.Println(&quot;\nCategories:&quot;)
-    for _, category := range respData.Result.Categories {
-        fmt.Println(category)
-    }
-}
-</code></pre></details>
-
-<details><summary>C#</summary>
-
-<pre><code class="language-csharp">using System;
-using System.IO;
-using System.Net.Http;
-using System.Net.Http.Headers;
-using System.Text;
-using System.Threading.Tasks;
-using Newtonsoft.Json.Linq;
-
-class Program
-{
-    static readonly string API_URL = &quot;http://localhost:8080/video-classification&quot;;
-    static readonly string videoPath = &quot;./demo.mp4&quot;;
-    static readonly string outputImagePath = &quot;./out.mp4&quot;;
-
-    static async Task Main(string[] args)
-    {
-        var httpClient = new HttpClient();
-
-        // 对本地视频进行Base64编码
-        byte[] videoBytes = File.ReadAllBytes(videoPath);
-        string video_data = Convert.ToBase64String(videoBytes);
-
-        var payload = new JObject{ { &quot;video&quot;, video_data } }; // Base64编码的文件内容或者视频URL
-        var content = new StringContent(payload.ToString(), Encoding.UTF8, &quot;application/json&quot;);
-
-        // 调用API
-        HttpResponseMessage response = await httpClient.PostAsync(API_URL, content);
-        response.EnsureSuccessStatusCode();
-
-        // 处理接口返回数据
-        string responseBody = await response.Content.ReadAsStringAsync();
-        JObject jsonResponse = JObject.Parse(responseBody);
-
-        string base64Image = jsonResponse[&quot;result&quot;][&quot;video&quot;].ToString();
-        byte[] outputImageBytes = Convert.FromBase64String(base64Image);
-
-        File.WriteAllBytes(outputImagePath, outputImageBytes);
-        Console.WriteLine($&quot;Output video saved at {outputImagePath}&quot;);
-        Console.WriteLine(&quot;\nCategories:&quot;);
-        Console.WriteLine(jsonResponse[&quot;result&quot;][&quot;categories&quot;].ToString());
-    }
-}
-</code></pre></details>
-
-<details><summary>Node.js</summary>
-
-<pre><code class="language-js">const axios = require('axios');
-const fs = require('fs');
-
-const API_URL = 'http://localhost:8080/video-classification'
-const videoPath = './demo.mp4'
-const outputImagePath = &quot;./out.mp4&quot;;
-
-let config = {
-   method: 'POST',
-   maxBodyLength: Infinity,
-   url: API_URL,
-   data: JSON.stringify({
-    'video': encodeImageToBase64(videoPath)  // Base64编码的文件内容或者视频URL
-  })
-};
-
-// 对本地视频进行Base64编码
-function encodeImageToBase64(filePath) {
-  const bitmap = fs.readFileSync(filePath);
-  return Buffer.from(bitmap).toString('base64');
-}
-
-// 调用API
-axios.request(config)
-.then((response) =&gt; {
-    // 处理接口返回数据
-    const result = response.data[&quot;result&quot;];
-    const videoBuffer = Buffer.from(result[&quot;video&quot;], 'base64');
-    fs.writeFile(outputImagePath, videoBuffer, (err) =&gt; {
-      if (err) throw err;
-      console.log(`Output video saved at ${outputImagePath}`);
-    });
-    console.log(&quot;\nCategories:&quot;);
-    console.log(result[&quot;categories&quot;]);
-})
-.catch((error) =&gt; {
-  console.log(error);
-});
-</code></pre></details>
-<details><summary>PHP</summary>
-
-<pre><code class="language-php">&lt;?php
-
-$API_URL = &quot;http://localhost:8080/video-classification&quot;; // 服务URL
-$video_path = &quot;./demo.mp4&quot;;
-$output_video_path = &quot;./out.mp4&quot;;
-
-// 对本地视频进行Base64编码
-$video_data = base64_encode(file_get_contents($video_path));
-$payload = array(&quot;video&quot; =&gt; $video_data); // Base64编码的文件内容或者视频URL
-
-// 调用API
-$ch = curl_init($API_URL);
-curl_setopt($ch, CURLOPT_POST, true);
-curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
-curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
-$response = curl_exec($ch);
-curl_close($ch);
-
-// 处理接口返回数据
-$result = json_decode($response, true)[&quot;result&quot;];
-file_put_contents($output_video_path, base64_decode($result[&quot;video&quot;]));
-echo &quot;Output video saved at &quot; . $output_video_path . &quot;\n&quot;;
-echo &quot;\nCategories:\n&quot;;
-print_r($result[&quot;categories&quot;]);
-?&gt;
+print(&quot;\nFrames:&quot;)
+print(result[&quot;frames&quot;])
 </code></pre></details>
 </details>
 <br/>