浏览代码

update pp-chatocrv3 doc (#2989)

cuicheng01 9 月之前
父节点
当前提交
daccc2c82c
共有 24 个文件被更改,包括 848 次插入202 次删除
  1. 2 0
      docs/pipeline_usage/tutorials/cv_pipelines/human_keypoint_detection.md
  2. 4 1
      docs/pipeline_usage/tutorials/cv_pipelines/image_anomaly_detection.md
  3. 4 1
      docs/pipeline_usage/tutorials/cv_pipelines/image_classification.md
  4. 4 1
      docs/pipeline_usage/tutorials/cv_pipelines/image_multi_label_classification.md
  5. 4 1
      docs/pipeline_usage/tutorials/cv_pipelines/instance_segmentation.md
  6. 3 0
      docs/pipeline_usage/tutorials/cv_pipelines/object_detection.md
  7. 4 1
      docs/pipeline_usage/tutorials/cv_pipelines/pedestrian_attribute_recognition.md
  8. 4 1
      docs/pipeline_usage/tutorials/cv_pipelines/rotated_object_detection.md
  9. 4 1
      docs/pipeline_usage/tutorials/cv_pipelines/semantic_segmentation.md
  10. 4 1
      docs/pipeline_usage/tutorials/cv_pipelines/small_object_detection.md
  11. 4 1
      docs/pipeline_usage/tutorials/cv_pipelines/vehicle_attribute_recognition.md
  12. 754 176
      docs/pipeline_usage/tutorials/information_extraction_pipelines/document_scene_information_extraction.md
  13. 4 1
      docs/pipeline_usage/tutorials/ocr_pipelines/OCR.md
  14. 3 1
      docs/pipeline_usage/tutorials/ocr_pipelines/doc_preprocessor.md
  15. 3 1
      docs/pipeline_usage/tutorials/ocr_pipelines/formula_recognition.md
  16. 5 3
      docs/pipeline_usage/tutorials/ocr_pipelines/seal_recognition.md
  17. 4 1
      docs/pipeline_usage/tutorials/ocr_pipelines/table_recognition.md
  18. 4 1
      docs/pipeline_usage/tutorials/ocr_pipelines/table_recognition_v2.md
  19. 3 1
      docs/pipeline_usage/tutorials/time_series_pipelines/time_series_anomaly_detection.md
  20. 3 1
      docs/pipeline_usage/tutorials/time_series_pipelines/time_series_classification.md
  21. 3 1
      docs/pipeline_usage/tutorials/time_series_pipelines/time_series_forecasting.md
  22. 4 1
      docs/pipeline_usage/tutorials/video_pipelines/video_classification.md
  23. 3 1
      docs/pipeline_usage/tutorials/video_pipelines/video_detection.md
  24. 14 4
      paddlex/inference/pipelines/pp_chatocr/pipeline_v3.py

+ 2 - 0
docs/pipeline_usage/tutorials/cv_pipelines/human_keypoint_detection.md

@@ -593,4 +593,6 @@ paddlex --pipeline human_keypoint_detection \
         --device npu:0
 ```
 
+当然,您也可以在 Python 脚本中 `create_pipeline()` 时或者 `predict()` 时指定硬件设备。
+
 若您想在更多种类的硬件上使用通用图像识别产线,请参考[PaddleX多硬件使用指南](../../../other_devices_support/multi_devices_use_guide.md)。

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

@@ -799,9 +799,12 @@ SubModules:
 ##  5. 多硬件支持
 PaddleX 支持英伟达 GPU、昆仑芯 XPU、昇腾 NPU和寒武纪 MLU 等多种主流硬件设备,<b>仅需修改 `--device`</b> 参数即可完成不同硬件之间的无缝切换。
 
-例如,您使用昇腾 NPU 进行图像异常检测产线的推理,使用的 Python 命令为:
+例如,您使用昇腾 NPU 进行图像异常检测产线的推理,使用的 CLI 命令为:
 
 ```bash
 paddlex --pipeline anomaly_detection --input uad_grid.png --device npu:0
 ```
+
+当然,您也可以在 Python 脚本中 `create_pipeline()` 时或者 `predict()` 时指定硬件设备。
+
 若您想在更多种类的硬件上使用图像异常检测产线,请参考[PaddleX多硬件使用指南](../../../other_devices_support/multi_devices_use_guide.md)。

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

@@ -1537,7 +1537,7 @@ SubModules:
 ##  5. 多硬件支持
 PaddleX 支持英伟达 GPU、昆仑芯 XPU、昇腾 NPU和寒武纪 MLU 等多种主流硬件设备,<b>仅需修改 `--device`参数</b>即可完成不同硬件之间的无缝切换。
 
-例如,您使用昇腾 NPU 进行通用图像分类产线的推理,使用的 Python 命令为:
+例如,您使用昇腾 NPU 进行通用图像分类产线的推理,使用的 CLI 命令为:
 
 ```bash
 paddlex --pipeline image_classification \
@@ -1545,4 +1545,7 @@ paddlex --pipeline image_classification \
         --save_path ./output \
         --device npu:0
 ```
+
+当然,您也可以在 Python 脚本中 `create_pipeline()` 时或者 `predict()` 时指定硬件设备。
+
 若您想在更多种类的硬件上使用通用图像分类产线,请参考[PaddleX多硬件使用指南](../../../other_devices_support/multi_devices_use_guide.md)。

+ 4 - 1
docs/pipeline_usage/tutorials/cv_pipelines/image_multi_label_classification.md

@@ -912,11 +912,14 @@ SubModules:
 ##  5. 多硬件支持
 PaddleX 支持英伟达 GPU、昆仑芯 XPU、昇腾 NPU和寒武纪 MLU 等多种主流硬件设备,<b>仅需修改 `--device`参数</b>即可完成不同硬件之间的无缝切换。
 
-例如,您使用昇腾 NPU 进行通用图像多标签分类产线的推理,使用的 Python 命令为:
+例如,您使用昇腾 NPU 进行通用图像多标签分类产线的推理,使用的 CLI 命令为:
 
 ```bash
 paddlex --pipeline image_multilabel_classification \
         --input general_image_classification_001.jpg \
         --device npu:0
 ```
+
+当然,您也可以在 Python 脚本中 `create_pipeline()` 时或者 `predict()` 时指定硬件设备。
+
 若您想在更多种类的硬件上使用通用OCR产线,请参考[PaddleX多硬件使用指南](../../../other_devices_support/multi_devices_use_guide.md)。

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

@@ -1066,7 +1066,7 @@ SubModules:
 ## 5. 多硬件支持
 PaddleX 支持英伟达 GPU、昆仑芯 XPU、昇腾 NPU和寒武纪 MLU 等多种主流硬件设备,<b>仅需修改 `--device`参数</b>即可完成不同硬件之间的无缝切换。
 
-例如,您使用昇腾 NPU 进行 实例分割 产线的推理,使用的 Python 命令为:
+例如,您使用昇腾 NPU 进行 实例分割 产线的推理,使用的 CLI 命令为:
 
 ```bash
 paddlex --pipeline instance_segmentation \
@@ -1075,4 +1075,7 @@ paddlex --pipeline instance_segmentation \
         --save_path ./output \
         --device npu:0
 ```
+
+当然,您也可以在 Python 脚本中 `create_pipeline()` 时或者 `predict()` 时指定硬件设备。
+
 若您想在更多种类的硬件上使用通用实例分割产线,请参考[PaddleX多硬件使用指南](../../../other_devices_support/multi_devices_use_guide.md)。

+ 3 - 0
docs/pipeline_usage/tutorials/cv_pipelines/object_detection.md

@@ -1201,4 +1201,7 @@ paddlex --pipeline object_detection \
         --save_path ./output/ \
         --device npu:0
 ```
+
+当然,您也可以在 Python 脚本中 `create_pipeline()` 时或者 `predict()` 时指定硬件设备。
+
 若您想在更多种类的硬件上使用通用目标检测产线,请参考[PaddleX多硬件使用指南](../../../other_devices_support/multi_devices_use_guide.md)。

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

@@ -614,11 +614,14 @@ SubModules:
 ##  5. 多硬件支持
 PaddleX 支持英伟达 GPU、昆仑芯 XPU、昇腾 NPU和寒武纪 MLU 等多种主流硬件设备,<b>仅需修改 `--device`参数</b>即可完成不同硬件之间的无缝切换。
 
-例如,您使用昇腾 NPU 进行行人属性识别产线的推理,使用的 Python 命令为:
+例如,您使用昇腾 NPU 进行行人属性识别产线的推理,使用的 CLI 命令为:
 
 ```bash
 paddlex --pipeline pedestrian_attribute_recognition \
         --input pedestrian_attribute_002.jpg \
         --device npu:0
 ```
+
+当然,您也可以在 Python 脚本中 `create_pipeline()` 时或者 `predict()` 时指定硬件设备。
+
 若您想在更多种类的硬件上使用通用OCR产线,请参考[PaddleX多硬件使用指南](../../../other_devices_support/multi_devices_use_guide.md)。

+ 4 - 1
docs/pipeline_usage/tutorials/cv_pipelines/rotated_object_detection.md

@@ -909,7 +909,7 @@ SubModules:
 ## 5. 多硬件支持
 PaddleX 支持英伟达 GPU、昆仑芯 XPU、昇腾 NPU和寒武纪 MLU 等多种主流硬件设备,<b>仅需修改 `--device`参数</b>即可完成不同硬件之间的无缝切换。
 
-例如,您使用昇腾 NPU 进行 旋转目标检测 产线的推理,使用的 Python 命令为:
+例如,您使用昇腾 NPU 进行 旋转目标检测 产线的推理,使用的 CLI 命令为:
 
 ```bash
 paddlex --pipeline rotated_object_detection \
@@ -918,4 +918,7 @@ paddlex --pipeline rotated_object_detection \
         --save_path ./output \
         --device npu:0
 ```
+
+当然,您也可以在 Python 脚本中 `create_pipeline()` 时或者 `predict()` 时指定硬件设备。
+
 若您想在更多种类的硬件上使用旋转目标检测产线,请参考[PaddleX多硬件使用指南](../../../other_devices_support/multi_devices_use_guide.md)。

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

@@ -1022,7 +1022,7 @@ SubModules:
 ## 5. 多硬件支持
 PaddleX 支持英伟达 GPU、昆仑芯 XPU、昇腾 NPU和寒武纪 MLU 等多种主流硬件设备,<b>仅需修改 `--device`参数</b>即可完成不同硬件之间的无缝切换。
 
-例如,您使用昇腾 NPU 进行 语义分割 产线的推理,使用的 Python 命令为:
+例如,您使用昇腾 NPU 进行 语义分割 产线的推理,使用的 CLI 命令为:
 
 ```bash
 paddlex --pipeline semantic_segmentation \
@@ -1031,4 +1031,7 @@ paddlex --pipeline semantic_segmentation \
         --save_path ./output \
         --device npu:0
 ```
+
+当然,您也可以在 Python 脚本中 `create_pipeline()` 时或者 `predict()` 时指定硬件设备。
+
 若您想在更多种类的硬件上使用通用语义分割产线,请参考[PaddleX多硬件使用指南](../../../other_devices_support/multi_devices_use_guide.md)。

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

@@ -914,7 +914,7 @@ SubModules:
 ## 5. 多硬件支持
 PaddleX 支持英伟达 GPU、昆仑芯 XPU、昇腾 NPU和寒武纪 MLU 等多种主流硬件设备,<b>仅需修改 `--device`参数</b>即可完成不同硬件之间的无缝切换。
 
-例如,您使用昇腾 NPU 进行 小目标检测 产线的推理,使用的 Python 命令为:
+例如,您使用昇腾 NPU 进行 小目标检测 产线的推理,使用的 CLI 命令为:
 
 ```bash
 paddlex --pipeline small_object_detection \
@@ -923,4 +923,7 @@ paddlex --pipeline small_object_detection \
         --save_path ./output \
         --device npu:0
 ```
+
+当然,您也可以在 Python 脚本中 `create_pipeline()` 时或者 `predict()` 时指定硬件设备。
+
 若您想在更多种类的硬件上使用通用小目标检测产线,请参考[PaddleX多硬件使用指南](../../../other_devices_support/multi_devices_use_guide.md)。

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

@@ -611,11 +611,14 @@ SubModules:
 ##  5. 多硬件支持
 PaddleX 支持英伟达 GPU、昆仑芯 XPU、昇腾 NPU和寒武纪 MLU 等多种主流硬件设备,<b>仅需修改 `--device`参数</b>即可完成不同硬件之间的无缝切换。
 
-例如,您使用昇腾 NPU 进行车辆属性识别产线的推理,使用的 Python 命令为:
+例如,您使用昇腾 NPU 进行车辆属性识别产线的推理,使用的 CLI 命令为:
 
 ```bash
 paddlex --pipeline vehicle_attribute_recognition \
         --input vehicle_attribute_002.jpg \
         --device npu:0
 ```
+
+当然,您也可以在 Python 脚本中 `create_pipeline()` 时或者 `predict()` 时指定硬件设备。
+
 若您想在更多种类的硬件上使用通用OCR产线,请参考[PaddleX多硬件使用指南](../../../other_devices_support/multi_devices_use_guide.md)。

文件差异内容过多而无法显示
+ 754 - 176
docs/pipeline_usage/tutorials/information_extraction_pipelines/document_scene_information_extraction.md


+ 4 - 1
docs/pipeline_usage/tutorials/ocr_pipelines/OCR.md

@@ -1161,7 +1161,7 @@ SubModules:
 ##  5. 多硬件支持
 PaddleX 支持英伟达 GPU、昆仑芯 XPU、昇腾 NPU和寒武纪 MLU 等多种主流硬件设备,<b>仅需修改 `--device`参数</b>即可完成不同硬件之间的无缝切换。
 
-例如,您使用昇腾 NPU 进行 OCR 产线的推理,使用的 Python 命令为:
+例如,您使用昇腾 NPU 进行 OCR 产线的推理,使用的 CLI 命令为:
 
 ```bash
 paddlex --pipeline OCR \
@@ -1172,4 +1172,7 @@ paddlex --pipeline OCR \
         --save_path ./output \
         --device npu:0
 ```
+
+当然,您也可以在 Python 脚本中 `create_pipeline()` 时或者 `predict()` 时指定硬件设备。
+
 若您想在更多种类的硬件上使用通用OCR产线,请参考[PaddleX多硬件使用指南](../../../other_devices_support/multi_devices_use_guide.md)。

+ 3 - 1
docs/pipeline_usage/tutorials/ocr_pipelines/doc_preprocessor.md

@@ -627,7 +627,7 @@ for i, res in enumerate(result[&quot;docPreprocessorResult&quot;]):
 ##  5. 多硬件支持
 PaddleX 支持英伟达 GPU、昆仑芯 XPU、昇腾 NPU和寒武纪 MLU 等多种主流硬件设备,<b>仅需修改 `--device`参数</b>即可完成不同硬件之间的无缝切换。
 
-例如,您使用昇腾 NPU 进行文档图像预处理产线的推理,使用的 Python 命令为:
+例如,您使用昇腾 NPU 进行文档图像预处理产线的推理,使用的 CLI 命令为:
 
 ```bash
 paddlex --pipeline doc_preprocessor \
@@ -637,4 +637,6 @@ paddlex --pipeline doc_preprocessor \
         --save_path ./output \
         --device npu:0
 ```
+当然,您也可以在 Python 脚本中 `create_pipeline()` 时或者 `predict()` 时指定硬件设备。
+
 若您想在更多种类的硬件上使用文档图像预处理产线,请参考[PaddleX多硬件使用指南](../../../other_devices_support/multi_devices_use_guide.md)。

+ 3 - 1
docs/pipeline_usage/tutorials/ocr_pipelines/formula_recognition.md

@@ -987,7 +987,7 @@ SubPipelines:
 ##  5. 多硬件支持
 PaddleX 支持英伟达 GPU、昆仑芯 XPU、昇腾 NPU和寒武纪 MLU 等多种主流硬件设备,<b>仅需修改 `--device`参数</b>即可完成不同硬件之间的无缝切换。
 
-例如,您使用昇腾 NPU 进行 公式识别产线的推理,使用的 Python 命令为:
+例如,您使用昇腾 NPU 进行 公式识别产线的推理,使用的 CLI 命令为:
 
 ```bash
 paddlex --pipeline formula_recognition \
@@ -1003,4 +1003,6 @@ paddlex --pipeline formula_recognition \
         --device npu:0
 
 ```
+当然,您也可以在 Python 脚本中 `create_pipeline()` 时或者 `predict()` 时指定硬件设备。
+
 若您想在更多种类的硬件上使用公式识别产线,请参考[PaddleX多硬件使用指南](../../../other_devices_support/multi_devices_use_guide.md)。

+ 5 - 3
docs/pipeline_usage/tutorials/ocr_pipelines/seal_recognition.md

@@ -1462,8 +1462,8 @@ for i, res in enumerate(result[&quot;sealRecResults&quot;]):
       <td><a href="../../../module_usage/tutorials/ocr_modules/layout_detection.md">链接</a></td>
     </tr>
     <tr>
-      <td>文本存在漏检</td>
-      <td>文本检测模块</td>
+      <td>印章文本存在漏检</td>
+      <td>印章文本检测模块</td>
       <td><a href="../../../module_usage/tutorials/ocr_modules/seal_text_detection.md">链接</a></td>
     </tr>
     <tr>
@@ -1510,7 +1510,7 @@ for i, res in enumerate(result[&quot;sealRecResults&quot;]):
 
 PaddleX 支持英伟达 GPU、昆仑芯 XPU、昇腾 NPU和寒武纪 MLU 等多种主流硬件设备,<b>仅需修改 `--device` 参数</b>即可完成不同硬件之间的无缝切换。
 
-例如,您使用昇腾 NPU 进行印章文本识别产线的推理,使用的 Python 命令为:
+例如,您使用昇腾 NPU 进行印章文本识别产线的推理,使用的 CLI 命令为:
 
 ```bash
 paddlex --pipeline seal_recognition \
@@ -1520,4 +1520,6 @@ paddlex --pipeline seal_recognition \
     --device npu:0 \
     --save_path ./output
 ```
+当然,您也可以在 Python 脚本中 `create_pipeline()` 时或者 `predict()` 时指定硬件设备。
+
 若您想在更多种类的硬件上使用印章文本识别产线,请参考[PaddleX多硬件使用指南](../../../other_devices_support/multi_devices_use_guide.md)。

+ 4 - 1
docs/pipeline_usage/tutorials/ocr_pipelines/table_recognition.md

@@ -1153,7 +1153,7 @@ SubPipelines:
 ##  5. 多硬件支持
 PaddleX 支持英伟达 GPU、昆仑芯 XPU、昇腾 NPU和寒武纪 MLU 等多种主流硬件设备,<b>仅需修改 `--device` 参数</b>即可完成不同硬件之间的无缝切换。
 
-例如,您使用昇腾 NPU 进行 OCR 产线的推理,使用的 Python 命令为:
+例如,您使用昇腾 NPU 进行 OCR 产线的推理,使用的 CLI 命令为:
 
 ```bash
 paddlex --pipeline table_recognition \
@@ -1161,4 +1161,7 @@ paddlex --pipeline table_recognition \
         --save_path ./output \
         --device npu:0
 ```
+
+当然,您也可以在 Python 脚本中 `create_pipeline()` 时或者 `predict()` 时指定硬件设备。
+
 若您想在更多种类的硬件上使用通用表格识别产线,请参考[PaddleX多硬件使用指南](../../../other_devices_support/multi_devices_use_guide.md)。

+ 4 - 1
docs/pipeline_usage/tutorials/ocr_pipelines/table_recognition_v2.md

@@ -1225,7 +1225,7 @@ SubPipelines:
 ##  5. 多硬件支持
 PaddleX 支持英伟达 GPU、昆仑芯 XPU、昇腾 NPU和寒武纪 MLU 等多种主流硬件设备,<b>仅需修改 `--device` 参数</b>即可完成不同硬件之间的无缝切换。
 
-例如,您使用昇腾 NPU 进行 OCR 产线的推理,使用的 Python 命令为:
+例如,您使用昇腾 NPU 进行 OCR 产线的推理,使用的 CLI 命令为:
 
 ```bash
 paddlex --pipeline table_recognition_v2 \
@@ -1233,4 +1233,7 @@ paddlex --pipeline table_recognition_v2 \
         --save_path ./output \
         --device npu:0
 ```
+
+当然,您也可以在 Python 脚本中 `create_pipeline()` 时或者 `predict()` 时指定硬件设备。
+
 若您想在更多种类的硬件上使用通用表格识别产线v2,请参考[PaddleX多硬件使用指南](../../../other_devices_support/multi_devices_use_guide.md)。

+ 3 - 1
docs/pipeline_usage/tutorials/time_series_pipelines/time_series_anomaly_detection.md

@@ -824,10 +824,12 @@ SubModules:
 ##  5. 多硬件支持
 PaddleX 支持英伟达 GPU、昆仑芯 XPU、昇腾 NPU和寒武纪 MLU 等多种主流硬件设备,<b>仅需修改 `--device` 参数</b>即可完成不同硬件之间的无缝切换。
 
-例如,您使用昇腾 NPU 进行时序异常检测产线的推理,使用的 Python 命令为:
+例如,您使用昇腾 NPU 进行时序异常检测产线的推理,使用的 CLI 命令为:
 
 ```bash
 paddlex --pipeline ts_anomaly_detection --input ts_ad.csv --device npu:0
 ```
 
+当然,您也可以在 Python 脚本中 `create_pipeline()` 时或者 `predict()` 时指定硬件设备。
+
 若您想在更多种类的硬件上使用通用时序异常检测产线,请参考[PaddleX多硬件使用指南](../../../other_devices_support/multi_devices_use_guide.md)。

+ 3 - 1
docs/pipeline_usage/tutorials/time_series_pipelines/time_series_classification.md

@@ -745,10 +745,12 @@ SubModules:
 ##  5. 多硬件支持
 PaddleX 支持英伟达 GPU、昆仑芯 XPU、昇腾 NPU和寒武纪 MLU 等多种主流硬件设备,<b>仅需修改 `--device` 参数</b>即可完成不同硬件之间的无缝切换。
 
-例如,您使用昇腾 NPU 进行时序分类产线的推理,使用的 Python 命令为:
+例如,您使用昇腾 NPU 进行时序分类产线的推理,使用的 CLI 命令为:
 
 ```bash
 paddlex --pipeline ts_classification --input ts_cls.csv --device npu:0
 ```
 
+当然,您也可以在 Python 脚本中 `create_pipeline()` 时或者 `predict()` 时指定硬件设备。
+
 若您想在更多种类的硬件上使用通用时序分类产线,请参考[PaddleX多硬件使用指南](../../../other_devices_support/multi_devices_use_guide.md)。

+ 3 - 1
docs/pipeline_usage/tutorials/time_series_pipelines/time_series_forecasting.md

@@ -856,10 +856,12 @@ SubModules:
 ##  5. 多硬件支持
 PaddleX 支持英伟达 GPU、昆仑芯 XPU、昇腾 NPU和寒武纪 MLU 等多种主流硬件设备,<b>仅需修改 `--device` 参数</b>即可完成不同硬件之间的无缝切换。
 
-例如,您使用昇腾 NPU 进行时序预测产线的推理,使用的 Python 命令为:
+例如,您使用昇腾 NPU 进行时序预测产线的推理,使用的 CLI 命令为:
 
 ```bash
 paddlex --pipeline ts_forecast --input ts_fc.csv --device npu:0
 ```
 
+当然,您也可以在 Python 脚本中 `create_pipeline()` 时或者 `predict()` 时指定硬件设备。
+
 若您想在更多种类的硬件上使用通用时序预测产线,请参考[PaddleX多硬件使用指南](../../../other_devices_support/multi_devices_use_guide.md)。

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

@@ -896,7 +896,7 @@ SubModules:
 ##  5. 多硬件支持
 PaddleX 支持英伟达 GPU、昆仑芯 XPU、昇腾 NPU和寒武纪 MLU 等多种主流硬件设备,<b>仅需修改 `--device`参数</b>即可完成不同硬件之间的无缝切换。
 
-例如,您使用昇腾 NPU 进行 视频分类产线的推理,使用的 Python 命令为:
+例如,您使用昇腾 NPU 进行 视频分类产线的推理,使用的 CLI 命令为:
 
 ```bash
 paddlex --pipeline video_classification \
@@ -905,4 +905,7 @@ paddlex --pipeline video_classification \
     --save_path ./output \
     --device npu:0
 ```
+
+当然,您也可以在 Python 脚本中 `create_pipeline()` 时或者 `predict()` 时指定硬件设备。
+
 若您想在更多种类的硬件上使用通用视频分类产线,请参考[PaddleX多硬件使用指南](../../../other_devices_support/multi_devices_use_guide.md)。

+ 3 - 1
docs/pipeline_usage/tutorials/video_pipelines/video_detection.md

@@ -896,9 +896,11 @@ Pipeline:
 ##  5. 多硬件支持
 PaddleX 支持英伟达 GPU、昆仑芯 XPU、昇腾 NPU和寒武纪 MLU 等多种主流硬件设备,<b>仅需修改 `--device` 参数</b>即可完成不同硬件之间的无缝切换。
 
-例如,您使用昇腾 NPU 进行视频检测产线的推理,使用的命令为:
+例如,您使用昇腾 NPU 进行视频检测产线的推理,使用的 CLI 命令为:
 
 ```bash
 paddlex --pipeline video_detection --input HorseRiding.avi --device npu:0
 ```
+当然,您也可以在 Python 脚本中 `create_pipeline()` 时或者 `predict()` 时指定硬件设备。
+
 若您想在更多种类的硬件上使用通用视频检测产线,请参考[PaddleX多硬件使用指南](../../../other_devices_support/multi_devices_use_guide.md)。

+ 14 - 4
paddlex/inference/pipelines/pp_chatocr/pipeline_v3.py

@@ -13,6 +13,7 @@
 # limitations under the License.
 
 from typing import Any, Dict, Optional, Union, List, Tuple
+import os
 import re
 import json
 import numpy as np
@@ -21,6 +22,7 @@ from .pipeline_base import PP_ChatOCR_Pipeline
 from ...common.reader import ReadImage
 from ...common.batch_sampler import ImageBatchSampler
 from ....utils import logging
+from ....utils.file_interface import custom_open
 from ...utils.pp_option import PaddlePredictorOption
 from ..layout_parsing.result import LayoutParsingResult
 
@@ -250,7 +252,11 @@ class PP_ChatOCRv3_Pipeline(PP_ChatOCR_Pipeline):
         else:
             visual_info_list = visual_info
 
-        with open(save_path, "w") as fout:
+        directory = os.path.dirname(save_path)
+        if not os.path.exists(directory):
+            os.makedirs(directory)
+
+        with custom_open(save_path, "w") as fout:
             fout.write(json.dumps(visual_info_list, ensure_ascii=False) + "\n")
         return
 
@@ -264,7 +270,7 @@ class PP_ChatOCRv3_Pipeline(PP_ChatOCR_Pipeline):
         Returns:
             list[dict]: A list of dict objects parsed from the JSON file.
         """
-        with open(data_path, "r") as fin:
+        with custom_open(data_path, "r") as fin:
             data = fin.readline()
             visual_info_list = json.loads(data)
         return visual_info_list
@@ -356,13 +362,17 @@ class PP_ChatOCRv3_Pipeline(PP_ChatOCR_Pipeline):
         return vector_info
 
     def save_vector(self, vector_info: dict, save_path: str) -> None:
-        with open(save_path, "w") as fout:
+        directory = os.path.dirname(save_path)
+        if not os.path.exists(directory):
+            os.makedirs(directory)
+
+        with custom_open(save_path, "w") as fout:
             fout.write(json.dumps(vector_info, ensure_ascii=False) + "\n")
         return
 
     def load_vector(self, data_path: str) -> dict:
         vector_info = None
-        with open(data_path, "r") as fin:
+        with custom_open(data_path, "r") as fin:
             data = fin.readline()
             vector_info = json.loads(data)
             if (

部分文件因为文件数量过多而无法显示