Browse Source

Switch default OCR model from OCRv4 to OCRv5 in OCR pipeline (#4026)

学卿 6 months ago
parent
commit
1ae49bc929

+ 2 - 2
docs/pipeline_usage/tutorials/ocr_pipelines/OCR.en.md

@@ -645,7 +645,7 @@ In the above Python script, the following steps are executed:
 <td>
 <ul>
 <li><b>int</b>: Any integer greater than <code>0</code></li>
-<li><b>None</b>: If set to <code>None</code>, the default value from the pipeline initialization will be used, which is <code>960</code></li>
+<li><b>None</b>: If set to <code>None</code>, the default value from the pipeline initialization will be used, which is <code>736</code></li>
 </ul>
 </td>
 <td><code>None</code></td>
@@ -657,7 +657,7 @@ In the above Python script, the following steps are executed:
 <td>
 <ul>
 <li><b>str</b>: Supports <code>min</code> and <code>max</code>. <code>min</code> ensures that the shortest side of the image is not less than <code>det_limit_side_len</code>, while <code>max</code> ensures that the longest side is not greater than <code>limit_side_len</code></li>
-<li><b>None</b>: If set to <code>None</code>, the default value from the pipeline initialization will be used, which is <code>max</code></li>
+<li><b>None</b>: If set to <code>None</code>, the default value from the pipeline initialization will be used, which is <code>min</code></li>
 </ul>
 </td>
 <td><code>None</code></td>

+ 2 - 2
docs/pipeline_usage/tutorials/ocr_pipelines/OCR.md

@@ -653,7 +653,7 @@ for res in output:
 <td>
 <ul>
 <li><b>int</b>:大于 <code>0</code> 的任意整数;</li>
-<li><b>None</b>:如果设置为 <code>None</code>, 将默认使用产线初始化的该参数值,初始化为 <code>960</code>;</li>
+<li><b>None</b>:如果设置为 <code>None</code>, 将默认使用产线初始化的该参数值,初始化为 <code>736</code>;</li>
 </ul>
 </td>
 <td><code>None</code></td>
@@ -664,7 +664,7 @@ for res in output:
 <td>
 <ul>
 <li><b>str</b>:支持 <code>min</code> 和 <code>max</code>,<code>min</code> 表示保证图像最短边不小于 <code>det_limit_side_len</code>,<code>max</code> 表示保证图像最长边不大于 <code>limit_side_len</code></li>
-<li><b>None</b>:如果设置为 <code>None</code>, 将默认使用产线初始化的该参数值,初始化为 <code>max</code>;</li>
+<li><b>None</b>:如果设置为 <code>None</code>, 将默认使用产线初始化的该参数值,初始化为 <code>min</code>;</li>
 </ul>
 </td>
 <td><code>None</code></td>

+ 4 - 4
paddlex/configs/pipelines/OCR.yaml

@@ -24,10 +24,10 @@ SubPipelines:
 SubModules:
   TextDetection:
     module_name: text_detection
-    model_name: PP-OCRv4_mobile_det
+    model_name: PP-OCRv5_mobile_det
     model_dir: null
-    limit_side_len: 960
-    limit_type: max
+    limit_side_len: 736
+    limit_type: min
     max_side_limit: 4000
     thresh: 0.3
     box_thresh: 0.6
@@ -39,7 +39,7 @@ SubModules:
     batch_size: 6    
   TextRecognition:
     module_name: text_recognition
-    model_name: PP-OCRv4_mobile_rec 
+    model_name: PP-OCRv5_mobile_rec 
     model_dir: null
     batch_size: 6
     score_thresh: 0.0