Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test_gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@ jobs:
python -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
python -m pip install pytest
if [ -f requirements.txt ]; then python -m pip install -r requirements.txt; fi
python -m pip install -e .
python -m pip install -e ".[all]"
python -m pytest --verbose tests/
'
3 changes: 1 addition & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ jobs:
pip install pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install paddlepaddle==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cpu/
pip install -e .
python -m pip install 'paddlex@git+https://github.com/PaddlePaddle/PaddleX.git@develop'
python -m pip install -e '.[all]' 'paddlex@git+https://github.com/PaddlePaddle/PaddleX.git@develop'
- name: Test with pytest
run: |
pytest --verbose tests/
8 changes: 6 additions & 2 deletions docs/quick_start.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,14 @@ python -m pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn

#### 2. Install `paddleocr`

```bash linenums="1"
python -m pip install paddleocr
Install the full functionality of PaddleOCR by running the following command:

```bash
python -m pip install "paddleocr[all]"
```

PaddleOCR also supports installing specific features as needed. For details, please refer to the [PaddleOCR installation documentation](version3.x/installation.en.md).

### Command Line Usage

=== "PP-OCRv5"
Expand Down
6 changes: 5 additions & 1 deletion docs/quick_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@ python -m pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn

#### 2. 安装`paddleocr`

执行如下命令安装 PaddleOCR 的完整功能:

```bash
pip install paddleocr
python -m pip install "paddleocr[all]"
```

PaddleOCR 也支持根据需要安装部分功能,详情请参考 [PaddleOCR 安装文档](version3.x/installation.md)。

### 命令行使用

=== "PP-OCRv5"
Expand Down
19 changes: 18 additions & 1 deletion docs/version3.x/installation.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,32 @@ If you only want to use the inference capabilities of PaddleOCR, please refer to
Install the latest version of the PaddleOCR inference package from PyPI:

```bash
# If you only want to use the basic text recognition feature (returning text position coordinates and content)
python -m pip install paddleocr
# If you want to use all functionalities, such as document parsing, document understanding, document translation, and key information extraction
# python -m pip install "paddleocr[all]"
```

Or install from source (default is the development branch):

```bash
python -m pip install "git+https://github.com/PaddlePaddle/PaddleOCR.git"
# If you only want to use the basic text recognition feature (returning text position coordinates and content)
python -m pip install "paddleocr@git+https://github.com/PaddlePaddle/PaddleOCR.git"
# If you want to use all functionalities, such as document parsing, document understanding, document translation, and key information extraction
# python -m pip install "paddleocr[all]@git+https://github.com/PaddlePaddle/PaddleOCR.git"
```

In addition to the `all` dependency group demonstrated above, PaddleOCR also supports installing specific optional features by specifying other dependency groups. The available dependency groups provided by PaddleOCR are as follows:

| Dependency Group | Functionality |
| ---------------- | ------------------------ |
| `doc-parser` | Document parsing, which can be used to extract layout elements in a document such as tables, formulas, stamps, and images. |
| `ie` | Information extraction, which can be used to extract key information from documents, such as names, dates, addresses, amounts, and more. |
| `trans` | Document translation, which can be used to translate a document from one language to another. |
| `all` | Full functionality. |

The general OCR pipeline (e.g., PP-OCRv3/v4/v5) and the document image preprocessing pipeline can be used without installing any additional dependency groups. Apart from these two pipelines, each remaining pipeline belongs to one and only one dependency group. You can refer to the usage documentation of each pipeline to determine which group it belongs to. For individual functional modules, installing any dependency group that includes the module will enable access to its core functionality.

## 2.2 Install Training Dependencies

To perform model training, exporting, etc., first clone the repository to your local machine:
Expand Down
19 changes: 18 additions & 1 deletion docs/version3.x/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,32 @@ comments: true
从 PyPI 安装最新版本 PaddleOCR 推理包:

```bash
# 只希望使用基础文字识别功能(返回文字位置坐标和文本内容)
python -m pip install paddleocr
# 希望使用文档解析、文档理解、文档翻译、关键信息抽取等全部功能
# python -m pip install "paddleocr[all]"
```

或者从源码安装(默认为开发分支):

```bash
python -m pip install "git+https://github.com/PaddlePaddle/PaddleOCR.git"
# 只希望使用基础文字识别功能(返回文字位置坐标和文本内容)
python -m pip install "paddleocr@git+https://github.com/PaddlePaddle/PaddleOCR.git"
# 希望使用文档解析、文档理解、文档翻译、关键信息抽取等全部功能
# python -m pip install "paddleocr[all]@git+https://github.com/PaddlePaddle/PaddleOCR.git"
```

除了上面演示的 `all` 依赖组以外,PaddleOCR 也支持通过指定其它依赖组,安装部分可选功能。PaddleOCR 提供的所有依赖组如下:

| 依赖组名称 | 对应的功能 |
| - | - |
| `doc-parser` | 文档解析,可用于提取文档中的表格、公式、印章、图片等版面元素 |
| `ie` | 信息抽取,可用于从文档中提取关键信息,如姓名、日期、地址、金额等 |
| `trans` | 文档翻译,可用于将文档从一种语言翻译为另一种语言 |
| `all` | 完整功能 |

通用 OCR 产线(如 PP-OCRv3/v4/v5)、文档图像预处理产线的功能无需安装额外的依赖组即可使用。除了这两条产线外,每一条产线属于且仅属于一个依赖组。在各产线的使用文档中可以了解产线属于哪一依赖组。对于单功能模块,安装任意包含该模块的产线对应的依赖组后即可使用相关的基础功能。

## 2.2 安装训练依赖

要进行模型训练、导出等,需要首先将仓库克隆到本地:
Expand Down
4 changes: 1 addition & 3 deletions docs/version3.x/pipeline_usage/PP-ChatOCRv4.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -965,12 +965,10 @@ devanagari_PP-OCRv3_mobile_rec_infer.tar">Inference Model</a>/<a href="https://p

## 2. Quick Start

The pre-trained pipelines provided by PaddleOCR allow for quick experience of their effects. You can locally use Python to experience the effects of the PP-ChatOCRv4-doc pipeline.
Before using the PP-ChatOCRv4-doc pipeline locally, ensure you have completed the installation of the PaddleOCR wheel package according to the [PaddleOCR Local Installation Tutorial](../installation.en.md). If you prefer to install dependencies selectively, please refer to the relevant instructions in the installation documentation. The corresponding dependency group for this pipeline is `ie`.

Please note: If you encounter issues such as the program becoming unresponsive, unexpected program termination, running out of memory resources, or extremely slow inference during execution, please try adjusting the configuration according to the documentation, such as disabling unnecessary features or using lighter-weight models.

Before using the PP-ChatOCRv4-doc pipeline locally, ensure you have completed the installation of the PaddleOCR wheel package according to the [PaddleOCR Local Installation Tutorial](../installation.en.md). If you wish to selectively install dependencies, please refer to the relevant instructions in the installation guide. The dependency group corresponding to this pipeline is `ie`.

Before performing model inference, you first need to prepare the API key for the large language model. PP-ChatOCRv4 supports large model services on the [Baidu Cloud Qianfan Platform](https://console.bce.baidu.com/qianfan/ais/console/onlineService) or the locally deployed standard OpenAI interface. If using the Baidu Cloud Qianfan Platform, refer to [Authentication and Authorization](https://cloud.baidu.com/doc/qianfan-api/s/ym9chdsy5) to obtain the API key. If using a locally deployed large model service, refer to the [PaddleNLP Large Model Deployment Documentation](https://github.com/PaddlePaddle/PaddleNLP/tree/develop/llm) for deployment of the dialogue interface and vectorization interface for large models, and fill in the corresponding `base_url` and `api_key`. If you need to use a multimodal large model for data fusion, refer to the OpenAI service deployment in the [PaddleMIX Model Documentation](https://github.com/PaddlePaddle/PaddleMIX/tree/develop/paddlemix/examples/ppdocbee2) for multimodal large model deployment, and fill in the corresponding `base_url` and `api_key`.

**Note**: If local deployment of a multimodal large model is restricted due to the local environment, you can comment out the lines containing the `mllm` variable in the code and only use the large language model for information extraction.
Expand Down
2 changes: 1 addition & 1 deletion docs/version3.x/pipeline_usage/PP-ChatOCRv4.md
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ devanagari_PP-OCRv3_mobile_rec_infer.tar">推理模型</a>/<a href="https://padd

## 2. 快速开始

在本地使用 PP-ChatOCRv4 产线前,请确保您已经按照[安装教程](../installation.md)完成了wheel包安装。
在本地使用 PP-ChatOCRv4 产线前,请确保您已经按照[安装教程](../installation.md)完成了wheel包安装。如果您希望选择性安装依赖,请参考安装教程中的相关说明。该产线对应的依赖分组为 `ie`。

**请注意,如果在执行过程中遇到程序失去响应、程序异常退出、内存资源耗尽、推理速度极慢等问题,请尝试参考文档调整配置,例如关闭不需要使用的功能或使用更轻量的模型。**

Expand Down
2 changes: 1 addition & 1 deletion docs/version3.x/pipeline_usage/PP-DocTranslation.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ devanagari_PP-OCRv3_mobile_rec_infer.tar">Inference Model</a>/<a href="https://p

## 2. Quick Start

Before using the PP-DocTranslation pipeline locally, please ensure that you have completed the installation of the wheel package according to the [Installation Tutorial](../installation.en.md).
Before using the PP-DocTranslation pipeline locally, please ensure that you have completed the installation of the wheel package according to the [Installation Tutorial](../installation.en.md). If you prefer to install dependencies selectively, please refer to the relevant instructions in the installation documentation. The corresponding dependency group for this pipeline is `trans`.

Please note: If you encounter issues such as the program becoming unresponsive, unexpected program termination, running out of memory resources, or extremely slow inference during execution, please try adjusting the configuration according to the documentation, such as disabling unnecessary features or using lighter-weight models.

Expand Down
2 changes: 1 addition & 1 deletion docs/version3.x/pipeline_usage/PP-DocTranslation.md
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ devanagari_PP-OCRv3_mobile_rec_infer.tar">推理模型</a>/<a href="https://padd

## 2. 快速开始

在本地使用 PP-DocTranslation 产线前,请确保您已经按照[安装教程](../installation.md)完成了wheel包安装。
在本地使用 PP-DocTranslation 产线前,请确保您已经按照[安装教程](../installation.md)完成了wheel包安装。如果您希望选择性安装依赖,请参考安装教程中的相关说明。该产线对应的依赖分组为 `trans`。

**请注意,如果在执行过程中遇到程序失去响应、程序异常退出、内存资源耗尽、推理速度极慢等问题,请尝试参考文档调整配置,例如关闭不需要使用的功能或使用更轻量的模型。**

Expand Down
2 changes: 1 addition & 1 deletion docs/version3.x/pipeline_usage/PP-StructureV3.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ devanagari_PP-OCRv3_mobile_rec_infer.tar">Inference Model</a>/<a href="https://p

## 2. Quick Start

Before using the PP-StructureV3 pipeline locally, please make sure you have completed the installation of the wheel package according to the [installation guide](../installation.en.md). After installation, you can use it via command line or Python integration.
Before using the PP-StructureV3 pipeline locally, please make sure you have completed the installation of the wheel package according to the [installation guide](../installation.en.md). If you prefer to install dependencies selectively, please refer to the relevant instructions in the installation documentation. The corresponding dependency group for this pipeline is `doc-parser`. After installation, you can use it via command line or Python integration.

Please note: If you encounter issues such as the program becoming unresponsive, unexpected program termination, running out of memory resources, or extremely slow inference during execution, please try adjusting the configuration according to the documentation, such as disabling unnecessary features or using lighter-weight models.

Expand Down
2 changes: 1 addition & 1 deletion docs/version3.x/pipeline_usage/PP-StructureV3.md
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ devanagari_PP-OCRv3_mobile_rec_infer.tar">推理模型</a>/<a href="https://padd

## 2. 快速开始

在本地使用 PP-StructureV3 产线前,请确保您已经按照[安装教程](../installation.md)完成了wheel包安装。安装完成后,可以在本地使用命令行体验或 Python 集成。
在本地使用 PP-StructureV3 产线前,请确保您已经按照[安装教程](../installation.md)完成了wheel包安装。安装完成后,可以在本地使用命令行体验或 Python 集成。如果您希望选择性安装依赖,请参考安装教程中的相关说明。该产线对应的依赖分组为 `doc-parser`。

**请注意,如果在执行过程中遇到程序失去响应、程序异常退出、内存资源耗尽、推理速度极慢等问题,请尝试参考文档调整配置,例如关闭不需要使用的功能或使用更轻量的模型。**

Expand Down
2 changes: 1 addition & 1 deletion docs/version3.x/pipeline_usage/doc_understanding.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ In this pipeline, you can choose the model to use based on the benchmark data be

## 2. Quick Start

Before using the document understanding pipeline locally, ensure that you have completed the installation of the wheel package according to the [installation tutorial](../installation.en.md). After installation, you can experience it locally using the command line or Python integration.
Before using the document understanding pipeline locally, ensure that you have completed the installation of the wheel package according to the [installation tutorial](../installation.en.md). If you prefer to install dependencies selectively, please refer to the relevant instructions in the installation documentation. The corresponding dependency group for this pipeline is `doc-parser`. After installation, you can experience it locally using the command line or Python integration.

Please note: If you encounter issues such as the program becoming unresponsive, unexpected program termination, running out of memory resources, or extremely slow inference during execution, please try adjusting the configuration according to the documentation, such as disabling unnecessary features or using lighter-weight models.

Expand Down
2 changes: 1 addition & 1 deletion docs/version3.x/pipeline_usage/doc_understanding.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ comments: true

## 2. 快速开始

在本地使用文档理解产线前,请确保您已经按照[安装教程](../installation.md)完成了wheel包安装。安装完成后,可以在本地使用命令行体验或 Python 集成。
在本地使用文档理解产线前,请确保您已经按照[安装教程](../installation.md)完成了wheel包安装。如果您希望选择性安装依赖,请参考安装教程中的相关说明。该产线对应的依赖分组为 `doc-parser`。安装完成后,可以在本地使用命令行体验或 Python 集成。

**请注意,如果在执行过程中遇到程序失去响应、程序异常退出、内存资源耗尽、推理速度极慢等问题,请尝试参考文档调整配置,例如关闭不需要使用的功能或使用更轻量的模型。**

Expand Down
2 changes: 1 addition & 1 deletion docs/version3.x/pipeline_usage/formula_recognition.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ In this pipeline, you can choose the model you want to use based on the benchmar

## 2. Quick Start

Before using the formula recognition pipeline locally, please ensure that you have completed the wheel package installation according to the [installation guide](../installation.en.md). Once installed, you can experience it locally via the command line or integrate it with Python.
Before using the formula recognition pipeline locally, please ensure that you have completed the wheel package installation according to the [installation guide](../installation.en.md). If you prefer to install dependencies selectively, please refer to the relevant instructions in the installation documentation. The corresponding dependency group for this pipeline is `doc-parser`. Once installed, you can experience it locally via the command line or integrate it with Python.

Please note: If you encounter issues such as the program becoming unresponsive, unexpected program termination, running out of memory resources, or extremely slow inference during execution, please try adjusting the configuration according to the documentation, such as disabling unnecessary features or using lighter-weight models.

Expand Down
2 changes: 1 addition & 1 deletion docs/version3.x/pipeline_usage/formula_recognition.md
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ comments: true

## 2. 快速开始

在本地使用公式识别产线前,请确保您已经按照[安装教程](../installation.md)完成了wheel包安装。安装完成后,可以在本地使用命令行体验或 Python 集成。
在本地使用公式识别产线前,请确保您已经按照[安装教程](../installation.md)完成了wheel包安装。如果您希望选择性安装依赖,请参考安装教程中的相关说明。该产线对应的依赖分组为 `doc-parser`。安装完成后,可以在本地使用命令行体验或 Python 集成。

**请注意,如果在执行过程中遇到程序失去响应、程序异常退出、内存资源耗尽、推理速度极慢等问题,请尝试参考文档调整配置,例如关闭不需要使用的功能或使用更轻量的模型。**

Expand Down
2 changes: 1 addition & 1 deletion docs/version3.x/pipeline_usage/seal_recognition.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ devanagari_PP-OCRv3_mobile_rec_infer.tar">Inference Model</a>/<a href="https://p

## 2. Quick Start

Before using the seal text recognition pipeline locally, please ensure that you have completed the installation of the wheel package according to the [installation tutorial](../installation.md). Once the installation is complete, you can experience it locally via the command line or integrate it with Python.
Before using the seal text recognition pipeline locally, please ensure that you have completed the installation of the wheel package according to the [installation tutorial](../installation.md). If you prefer to install dependencies selectively, please refer to the relevant instructions in the installation documentation. The corresponding dependency group for this pipeline is `doc-parser`. Once the installation is complete, you can experience it locally via the command line or integrate it with Python.

Please note: If you encounter issues such as the program becoming unresponsive, unexpected program termination, running out of memory resources, or extremely slow inference during execution, please try adjusting the configuration according to the documentation, such as disabling unnecessary features or using lighter-weight models.

Expand Down
2 changes: 1 addition & 1 deletion docs/version3.x/pipeline_usage/seal_recognition.md
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ devanagari_PP-OCRv3_mobile_rec_infer.tar">推理模型</a>/<a href="https://padd

## 2. 快速开始

在本地使用印章文本识别产线前,请确保您已经按照[安装教程](../installation.md)完成了wheel包安装。安装完成后,可以在本地使用命令行体验或 Python 集成。
在本地使用印章文本识别产线前,请确保您已经按照[安装教程](../installation.md)完成了wheel包安装。如果您希望选择性安装依赖,请参考安装教程中的相关说明。该产线对应的依赖分组为 `doc-parser`。安装完成后,可以在本地使用命令行体验或 Python 集成。

**请注意,如果在执行过程中遇到程序失去响应、程序异常退出、内存资源耗尽、推理速度极慢等问题,请尝试参考文档调整配置,例如关闭不需要使用的功能或使用更轻量的模型。**

Expand Down
Loading
Loading