mirror of
https://github.com/PaddlePaddle/PaddleOCR.git
synced 2025-12-30 00:28:47 +00:00
change '736,min' -> '64,min' (#15486)
* refine ocr pipeline docs * refine ocr module docs * refine ocr pipeline docs * refine ocr pipeline docs * fixed ocr docs * change '736,min' -> '64,min'
This commit is contained in:
parent
7f159145bf
commit
528bdcb281
@ -8,7 +8,7 @@ comments: true
|
||||
|
||||
OCR is a technology that converts text from images into editable text. It is widely used in fields such as document digitization, information extraction, and data processing. OCR can recognize printed text, handwritten text, and even certain types of fonts and symbols.
|
||||
|
||||
The general OCR pipeline is used to solve text recognition tasks by extracting text information from images and outputting it in text form. This pipeline supports the use of PP-OCRv3, PP-OCRv4, and PP-OCRv5 models, with the default model being the PP-OCRv5_mobile model released by PaddleOCR 3.0, which improves by 13 percentage points over PP-OCRv4_mobile in various scenarios.
|
||||
The general OCR pipeline is used to solve text recognition tasks by extracting text information from images and outputting it in text form. This pipeline supports the use of PP-OCRv3, PP-OCRv4, and PP-OCRv5 models, with the default model being the PP-OCRv5_server model released by PaddleOCR 3.0, which improves by 13 percentage points over PP-OCRv4_server in various scenarios.
|
||||
|
||||
<img src="https://raw.githubusercontent.com/cuicheng01/PaddleX_doc_images/main/images/pipelines/ocr/01.png"/>
|
||||
|
||||
@ -648,7 +648,7 @@ paddleocr ocr -i ./general_ocr_002.png --ocr_version PP-OCRv4
|
||||
<tr>
|
||||
<td><code>text_det_limit_side_len</code></td>
|
||||
<td>Maximum side length limit for text detection.
|
||||
Any integer greater than <code>0</code>. If not set, the pipeline's initialized value for this parameter (initialized to <code>736</code>) will be used.
|
||||
Any integer greater than <code>0</code>. If not set, the pipeline's initialized value for this parameter (initialized to <code>64</code>) will be used.
|
||||
</td>
|
||||
<td><code>int</code></td>
|
||||
<td></td>
|
||||
@ -911,12 +911,12 @@ ocr = PaddleOCR(
|
||||
# ocr = PaddleOCR(ocr_version="PP-OCRv4") # Uses other PP-OCR versions via version parameter
|
||||
# ocr = PaddleOCR(device="gpu") # Enables GPU acceleration for model inference via device parameter
|
||||
# ocr = PaddleOCR(
|
||||
# text_detection_model_name="PP-OCRv5_server_det",
|
||||
# text_recognition_model_name="PP-OCRv5_server_rec",
|
||||
# text_detection_model_name="PP-OCRv5_mobile_det",
|
||||
# text_recognition_model_name="PP-OCRv5_mobile_rec",
|
||||
# use_doc_orientation_classify=False,
|
||||
# use_doc_unwarping=False,
|
||||
# use_textline_orientation=False,
|
||||
# ) # Switch to PP-OCRv5_server models
|
||||
# ) # Switch to PP-OCRv5_mobile models
|
||||
result = ocr.predict("./general_ocr_002.png")
|
||||
for res in result:
|
||||
res.print()
|
||||
@ -1033,7 +1033,7 @@ In the above Python script, the following steps are performed:
|
||||
<td>Maximum side length limit for text detection.
|
||||
<ul>
|
||||
<li><b>int</b>: Any integer greater than <code>0</code>;</li>
|
||||
<li><b>None</b>: If set to <code>None</code>, the pipeline's initialized value for this parameter (initialized to <code>736</code>) will be used.</li>
|
||||
<li><b>None</b>: If set to <code>None</code>, the pipeline's initialized value for this parameter (initialized to <code>64</code>) will be used.</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td><code>int</code></td>
|
||||
@ -1723,8 +1723,8 @@ Command line mode:
|
||||
# Specify the local model path via --text_detection_model_dir
|
||||
paddleocr ocr -i ./general_ocr_002.png --text_detection_model_dir your_det_model_path
|
||||
|
||||
# PP-OCRv5_mobile_det model is used as the default text detection model. If you do not fine-tune this model, modify the model name by using --text_detection_model_name
|
||||
paddleocr ocr -i ./general_ocr_002.png --text_detection_model_name PP-OCRv5_server_det --text_detection_model_dir your_v5_server_det_model_path
|
||||
# PP-OCRv5_server_det model is used as the default text detection model. If you do not fine-tune this model, modify the model name by using --text_detection_model_name
|
||||
paddleocr ocr -i ./general_ocr_002.png --text_detection_model_name PP-OCRv5_mobile_det --text_detection_model_dir your_v5_mobile_det_model_path
|
||||
```
|
||||
|
||||
Script mode:
|
||||
@ -1736,8 +1736,8 @@ from paddleocr import PaddleOCR
|
||||
# Specify the local model path via text_detection_model_dir
|
||||
pipeline = PaddleOCR(text_detection_model_dir="./your_det_model_path")
|
||||
|
||||
# PP-OCRv5_mobile_det model is used as the default text detection model. If you do not fine-tune this model, modify the model name by using text_detection_model_name
|
||||
# pipeline = PaddleOCR(text_detection_model_name="PP-OCRv5_server_det", text_detection_model_dir="./your_v5_server_det_model_path")
|
||||
# PP-OCRv5_server_det model is used as the default text detection model. If you do not fine-tune this model, modify the model name by using text_detection_model_name
|
||||
# pipeline = PaddleOCR(text_detection_model_name="PP-OCRv5_mobile_det", text_detection_model_dir="./your_v5_mobile_det_model_path")
|
||||
|
||||
```
|
||||
|
||||
@ -1763,7 +1763,7 @@ After obtaining the default pipeline configuration file, replace the paths of th
|
||||
SubModules:
|
||||
TextDetection:
|
||||
box_thresh: 0.6
|
||||
limit_side_len: 736
|
||||
limit_side_len: 64
|
||||
limit_type: min
|
||||
max_side_limit: 4000
|
||||
model_dir: null # Replace with the path to your fine-tuned text detection model weights
|
||||
|
||||
@ -8,7 +8,7 @@ comments: true
|
||||
|
||||
OCR(光学字符识别,Optical Character Recognition)是一种将图像中的文字转换为可编辑文本的技术。它广泛应用于文档数字化、信息提取和数据处理等领域。OCR 可以识别印刷文本、手写文本,甚至某些类型的字体和符号。
|
||||
|
||||
通用 OCR 产线用于解决文字识别任务,提取图片中的文字信息以文本形式输出,本产线支持PP-OCRv3、PP-OCRv4、PP-OCRv5模型的使用,其中默认模型为 PaddleOCR3.0 发布的 PP-OCRv5_mobile 模型,其在多个场景中较 PP-OCRv4_mobile 提升 13 个百分点。
|
||||
通用 OCR 产线用于解决文字识别任务,提取图片中的文字信息以文本形式输出,本产线支持PP-OCRv3、PP-OCRv4、PP-OCRv5模型的使用,其中默认模型为 PaddleOCR3.0 发布的 PP-OCRv5_server 模型,其在多个场景中较 PP-OCRv4_server 提升 13 个百分点。
|
||||
|
||||
<img src="https://raw.githubusercontent.com/cuicheng01/PaddleX_doc_images/main/images/pipelines/ocr/01.png"/>
|
||||
|
||||
@ -648,7 +648,7 @@ paddleocr ocr -i ./general_ocr_002.png --ocr_version PP-OCRv4
|
||||
<tr>
|
||||
<td><code>text_det_limit_side_len</code></td>
|
||||
<td>文本检测的最大边长度限制。
|
||||
大于 <code>0</code> 的任意整数。如果不设置,将默认使用产线初始化的该参数值,初始化为 <code>736</code>。
|
||||
大于 <code>0</code> 的任意整数。如果不设置,将默认使用产线初始化的该参数值,初始化为 <code>64</code>。
|
||||
</td>
|
||||
<td><code>int</code></td>
|
||||
<td></td>
|
||||
@ -1031,7 +1031,7 @@ for res in result:
|
||||
<td>文本检测的最大边长度限制。
|
||||
<ul>
|
||||
<li><b>int</b>:大于 <code>0</code> 的任意整数;</li>
|
||||
<li><b>None</b>:如果设置为<code>None</code>, 将默认使用产线初始化的该参数值,初始化为 <code>736</code>。</li>
|
||||
<li><b>None</b>:如果设置为<code>None</code>, 将默认使用产线初始化的该参数值,初始化为 <code>64</code>。</li>
|
||||
</ur>
|
||||
</td>
|
||||
<td><code>int</code></td>
|
||||
@ -1723,8 +1723,8 @@ for i, res in enumerate(result["ocrResults"]):
|
||||
# 通过 --text_detection_model_dir 指定本地模型路径
|
||||
paddleocr ocr -i ./general_ocr_002.png --text_detection_model_dir your_det_model_path
|
||||
|
||||
# 默认使用 PP-OCRv5_mobile_det 模型作为默认文本检测模型,如果微调的不是该模型,通过 --text_detection_model_name 修改模型名称
|
||||
paddleocr ocr -i ./general_ocr_002.png --text_detection_model_name PP-OCRv5_server_det --text_detection_model_dir your_v5_server_det_model_path
|
||||
# 默认使用 PP-OCRv5_server_det 模型作为默认文本检测模型,如果微调的不是该模型,通过 --text_detection_model_name 修改模型名称
|
||||
paddleocr ocr -i ./general_ocr_002.png --text_detection_model_name PP-OCRv5_mobile_det --text_detection_model_dir your_v5_mobile_det_model_path
|
||||
```
|
||||
|
||||
脚本方式:
|
||||
@ -1736,8 +1736,8 @@ from paddleocr import PaddleOCR
|
||||
# 通过 text_detection_model_dir 指定本地模型路径
|
||||
pipeline = PaddleOCR(text_detection_model_dir="./your_det_model_path")
|
||||
|
||||
# 默认使用 PP-OCRv5_mobile_det 模型作为默认文本检测模型,如果微调的不是该模型,通过 text_detection_model_name 修改模型名称
|
||||
# pipeline = PaddleOCR(text_detection_model_name="PP-OCRv5_server_det", text_detection_model_dir="./your_v5_server_det_model_path")
|
||||
# 默认使用 PP-OCRv5_server_det 模型作为默认文本检测模型,如果微调的不是该模型,通过 text_detection_model_name 修改模型名称
|
||||
# pipeline = PaddleOCR(text_detection_model_name="PP-OCRv5_mobile_det", text_detection_model_dir="./your_v5_mobile_det_model_path")
|
||||
|
||||
```
|
||||
|
||||
@ -1765,7 +1765,7 @@ pipeline.export_paddlex_config_to_yaml("PaddleOCR.yaml")
|
||||
SubModules:
|
||||
TextDetection:
|
||||
box_thresh: 0.6
|
||||
limit_side_len: 736
|
||||
limit_side_len: 64
|
||||
limit_type: min
|
||||
max_side_limit: 4000
|
||||
model_dir: null # 替换为微调后的文本测模型权重路径
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user