فهرست منبع

add API change log (#3332)

Tingquan Gao 9 ماه پیش
والد
کامیت
2a32fdc62d
2فایلهای تغییر یافته به همراه222 افزوده شده و 0 حذف شده
  1. 111 0
      docs/API_change_log/v3.0.0rc.en.md
  2. 111 0
      docs/API_change_log/v3.0.0rc.md

+ 111 - 0
docs/API_change_log/v3.0.0rc.en.md

@@ -0,0 +1,111 @@
+# Interface Change Documentation
+
+## 1. Model and Module Related
+
+### 1.1 Model Configuration Files
+
+- **Storage Directory Change**: `paddlex/configs` has been updated to `paddlex/configs/modules`.
+- **Module Name Changes**, and related configuration file paths have also been updated:
+  - `anomaly_detection` updated to `image_anomaly_detection`
+  - `face_recognition` updated to `face_feature`
+  - `general_recognition` updated to `image_feature`
+  - `multilabel_classification` updated to `image_multilabel_classification`
+  - `pedestrian_attribute` updated to `pedestrian_attribute_recognition`
+  - `structure_analysis` updated to `layout_detection`
+  - `table_recognition` updated to `table_structure_recognition`
+  - `text_detection_seal` updated to `seal_text_detection`
+  - `vehicle_attribute` updated to `vehicle_attribute_recognition`
+
+### 1.2 Module Inference
+
+#### 1. `create_model()`
+
+- **Parameter Change**:
+  - `model_name`: Only accepts model name.
+  - **New Parameters**:
+    - `model_dir`: Specifies the local directory for inference model files, defaults to `None`, which means automatically downloading and using the official model.
+    - `batch_size`: Specifies the batch size during inference, defaults to `1`.
+    - Supports specifying common model inference hyperparameters, with specific parameters related to the module, as detailed in the module tutorial documentation. For example, image classification module support `topk`.
+    - `use_hpip` and `hpi_params`: For supporting high-performance inference, not enabled by default.
+
+- **Function Updates**:
+  - Supports using PDF files as input samples for CV modules.
+  - Prediction results remain of `dict` type, but the format has changed: from `{'key1': val}` to `{"res": {'key': val}}`, using `"res"` as the key with the original result data as the value.
+  - When using the `save_to_xxx()` method to save prediction results, if `save_path` is a directory, the name for stored files has changed. For example, saving in JSON format is `{input_file_prefix}_res.json`; saving in image format is `{input_file_prefix}_res_img.{input_file_extension}`.
+
+## 2. Pipeline Related
+
+### 2.1 Pipeline Configuration Files
+
+- **Configuration File Storage Directory Change**: `paddlex/pipelines` updated to `paddlex/configs/pipelines`.
+- **Pipeline Name Changes**:
+  - `ts_fc` updated to `ts_forecast`
+  - `ts_ad` updated to `ts_anomaly_detection`
+  - `ts_cls` updated to `ts_classification`
+
+### 2.2 Pipeline Inference
+
+#### 1. CLI Inference for Pipelines
+
+- **New Support**:
+  - Inference hyperparameters, specific parameters related to the pipeline, detailed in the pipeline tutorial documentation. For example, image classification pipeline supports the `--topk` parameter to specify the `topk` results to return.
+- **Removed**:
+  - `--serial_number`, high-performance inference no longer requires the serial number.
+
+#### 2. `create_pipeline()`
+
+- **Removed**:
+  - The `serial_number` parameter in high-performance inference `hpi_params`, high-performance inference no longer requires the serial number.
+- **No Longer Supported**:
+  - Setting pipeline inference hyperparameters, all related parameters must be set through the pipeline configuration file, such as `batch_size`, thresholds, etc.
+- **Function Updates**:
+  1. When using the `save_to_xxx()` method to save prediction results, if `save_path` is a directory, the name for stored files has updated.
+  2. CV model prediction results have a new `page_index` field, which indicates the page number of the current prediction result only when the input sample is a PDF file.
+  3. Model pipeline prediction results have new pipeline inference parameter fields, such as the `text_det_params` field in the OCR pipeline, with values for the post-processing settings of the text detection model.
+- **Configuration File Format Update**:
+  - After updating the content of the pipeline configuration file, it is divided into three parts: pipeline name, pipeline-related parameter settings, and sub-pipelines and sub-modules composition. For example:
+
+    ```yaml
+    pipeline_name: pipeline # Pipeline Name
+    threshold: 0.5 # Pipeline Inference Related Parameters
+    SubPipelines: # Sub-pipelines
+      DocPreprocessor:
+        pipeline_name: doc_preprocessor
+        use_doc_unwarping: True # Settings related to the sub-pipeline DocPreprocessor
+    SubModules: # Sub-modules
+      TextDetection:
+        module_name: text_detection
+        model_name: PP-OCRv4_mobile_det
+        model_dir: null
+        limit_side_len: 960 # Settings related to the sub-module TextDetection
+        limit_type: max
+        thresh: 0.3
+        box_thresh: 0.6
+        unclip_ratio: 2.0
+    ```
+
+## 3. Pipeline Features Changes
+
+### 3.1 OCR Pipeline
+
+- **New Features**:
+  - Document Preprocessing: Supports whole image direction classification and correction, controlled by relevant parameters in the `OCR.yaml` configuration file.
+  - Text Line Direction Classification: Controlled by relevant parameters in the configuration file.
+  - Support for modifying model inference hyperparameters, such as post-processing parameters of the text detection model, controlled by relevant parameters in the configuration file.
+
+### 3.2 Seal Recognition and Formula Recognition Pipeline
+
+- **New Features**:
+  - Document Preprocessing: Supports whole image direction classification and correction, controlled by relevant parameters in the configuration file.
+  - Option to use the layout detection model: Controlled by relevant parameters in the configuration file.
+
+### 3.3 Table Recognition Pipeline
+
+- **New Features**:
+  - Document Preprocessing: Supports whole image direction classification and correction, controlled by relevant parameters in the configuration file.
+  - Option to use the OCR pipeline for text detection and recognition: Controlled by relevant parameters in the configuration file.
+
+### 3.4 Layout Analysis Pipeline
+
+- **Updated Features**:
+  - Supports more inference hyperparameter settings, such as document preprocessing, text recognition, and model post-processing parameter settings, all of which can be configured in the pipeline configuration file.

+ 111 - 0
docs/API_change_log/v3.0.0rc.md

@@ -0,0 +1,111 @@
+# 接口变化说明文档
+
+## 一、模型模块相关
+
+### 1.1 模型配置文件
+
+- **存储目录变更**:`paddlex/configs` 更新为 `paddlex/configs/modules`。
+- **模块名变更**,相关配置文件路径同样更新:
+  - `anomaly_detection` 更新为 `image_anomaly_detection`
+  - `face_recognition` 更新为 `face_feature`
+  - `general_recognition` 更新为 `image_feature`
+  - `multilabel_classification` 更新为 `image_multilabel_classification`
+  - `pedestrian_attribute` 更新为 `pedestrian_attribute_recognition`
+  - `structure_analysis` 更新为 `layout_detection`
+  - `table_recognition` 更新为 `table_structure_recognition`
+  - `text_detection_seal` 更新为 `seal_text_detection`
+  - `vehicle_attribute` 更新为 `vehicle_attribute_recognition`
+
+### 1.2 模型推理
+
+#### 1. `create_model()`
+
+- **参数修改**:
+  - `model_name`:只能传入字符串类型的模型名。
+  - **新增参数**:
+    - `model_dir`:指定本地推理模型文件目录,默认为 `None`,表示自动下载官方模型并使用。
+    - `batch_size`:指定推理时批处理的大小,默认为 `1`。
+    - 支持指定模型常见超参数,具体参数与模型任务相关,详见模型文档。例如,图像分类模型支持 `topk`。
+    - `use_hpip` 和 `hpi_params`:用于支持高性能推理,默认不开启。
+
+- **功能更新**:
+  - 支持 CV 类模型使用 PDF 文件作为输入样本。
+  - 预测结果仍为 `dict` 类型,但格式有所变化:`{'key1': val}` 改为 `{"res": {'key': val}}`,即以 `"res"` 作为键,原结果数据作为值。
+  - 使用 `save_to_xxx()` 方法保存预测结果时,若 `save_path` 为目录,存储文件命名方式有变更。例如,保存为 JSON 格式时为 `输入文件前缀名_res.json`;保存为图像格式时为 `输入文件前缀名_res_img.输入文件后缀名`。
+
+## 二、模型产线相关
+
+### 2.1 产线配置文件
+
+- **配置文件存储目录变更**:`paddlex/pipelines` 更新为 `paddlex/configs/pipelines`。
+- **产线名称变更**:
+  - `ts_fc` 更新为 `ts_forecast`
+  - `ts_ad` 更新为 `ts_anomaly_detection`
+  - `ts_cls` 更新为 `ts_classification`
+
+### 2.2 产线推理
+
+#### 1. 模型产线命令行推理
+
+- **新增支持**:
+  - 推理超参数,具体参数与产线相关,详见产线文档。例如,图像分类产线支持 `--topk` 参数,指定返回的前 n 个结果。
+- **删除**:
+  - `--serial_number`,高性能推理不再需要传入序列号。
+
+#### 2. `create_pipeline()`
+
+- **删除**:
+  - 高性能推理 `hpi_params` 参数中的 `serial_number` 参数,高性能推理不再需要传入序列号。
+- **不再支持**:
+  - 产线推理超参数设置,相关参数设置均需通过产线配置文件完成,如 `batch_size`、阈值等。
+- **功能更新**:
+  1. 使用 `save_to_xxx()` 方法保存预测结果时,若 `save_path` 为目录,存储文件命名方式更新。
+  2. CV类模型预测结果新增 `page_index` 字段,仅当输入的预测样本为PDF文件时,标志当前预测结果的页码序号。
+  3. 模型产线预测结果新增产线推理参数字段,如 OCR 产线中新增 `text_det_params` 字段,值为文本检测模型的后处理设置。
+- **配置文件格式更新**:
+  - 产线配置文件内容更新后,分为三部分:产线名称、产线相关参数设置、子产线与子模块构成。例如:
+
+    ```yaml
+    pipeline_name: pipeline # 产线名称
+    threshold: 0.5 # 产线推理相关参数
+    SubPipelines: # 子产线
+      DocPreprocessor:
+        pipeline_name: doc_preprocessor
+        use_doc_unwarping: True # 子产线 DocPreprocessor 的相关设置
+    SubModules: # 子模块
+      TextDetection:
+        module_name: text_detection
+        model_name: PP-OCRv4_mobile_det
+        model_dir: null
+        limit_side_len: 960 # 子模块 TextDetection 的相关设置
+        limit_type: max
+        thresh: 0.3
+        box_thresh: 0.6
+        unclip_ratio: 2.0
+    ```
+
+## 三、产线功能变更
+
+### 3.1 OCR 产线
+
+- **新增功能**:
+  - 文档预处理:支持整图方向分类与矫正,可通过配置文件 `OCR.yaml` 中相关参数控制。
+  - 文本行方向分类:可通过配置文件中相关参数控制。
+  - 支持修改模型推理超参数,如文本检测模型的后处理参数,可通过配置文件中相关参数控制。
+
+### 3.2 印章识别与公式识别产线
+
+- **新增功能**:
+  - 文档预处理:支持整图方向分类与矫正,可通过配置文件中相关参数控制。
+  - 是否使用版面检测模型:可通过配置文件中相关参数控制。
+
+### 3.3 表格识别产线
+
+- **新增功能**:
+  - 文档预处理:支持整图方向分类与矫正,可通过配置文件中相关参数控制。
+  - 是否使用 OCR 产线进行文本检测与识别:可通过配置文件中相关参数控制。
+
+### 3.4 版面解析产线
+
+- **更新功能**:
+  - 支持更多推理超参数设置,如文档预处理、文本识别及模型后处理参数设置,均可在产线配置文件中进行设置。