Skip to content

Commit 7e70e2d

Browse files
committed
Update interface (#3662)
1 parent a591090 commit 7e70e2d

File tree

8 files changed

+136
-94
lines changed

8 files changed

+136
-94
lines changed

docs/pipeline_usage/tutorials/ocr_pipelines/PP-StructureV3.en.md

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,6 +1510,30 @@ Below is the API reference for basic serving deployment and examples of service
15101510
<td>No</td>
15111511
</tr>
15121512
<tr>
1513+
<td><code>layoutThreshold</code></td>
1514+
<td><code>number</code> | <code>null</code></td>
1515+
<td>Please refer to the description of the <code>layout_threshold</code> parameter of the pipeline object's <code>predict</code> method.</td>
1516+
<td>No</td>
1517+
</tr>
1518+
<tr>
1519+
<td><code>layoutNms</code></td>
1520+
<td><code>boolean</code> | <code>null</code></td>
1521+
<td>Please refer to the description of the <code>layout_nms</code> parameter of the pipeline object's <code>predict</code> method.</td>
1522+
<td>No</td>
1523+
</tr>
1524+
<tr>
1525+
<td><code>layoutUnclipRatio</code></td>
1526+
<td><code>number</code> | <code>array</code> | <code>object</code> | <code>null</code></td>
1527+
<td>Please refer to the description of the <code>layout_unclip_ratio</code> parameter of the pipeline object's <code>predict</code> method.</td>
1528+
<td>No</td>
1529+
</tr>
1530+
<tr>
1531+
<td><code>layoutMergeBboxesMode</code></td>
1532+
<td><code>string</code> | <code>object</code> | <code>null</code></td>
1533+
<td>Please refer to the description of the <code>layout_merge_bboxes_mode</code> parameter of the pipeline object's <code>predict</code> method.</td>
1534+
<td>No</td>
1535+
</tr>
1536+
<tr>
15131537
<td><code>textDetLimitSideLen</code></td>
15141538
<td><code>integer</code> | <code>null</code></td>
15151539
<td>Please refer to the description of the <code>text_det_limit_side_len</code> parameter of the pipeline object's <code>predict</code> method.</td>
@@ -1582,27 +1606,21 @@ Below is the API reference for basic serving deployment and examples of service
15821606
<td>No</td>
15831607
</tr>
15841608
<tr>
1585-
<td><code>layoutThreshold</code></td>
1586-
<td><code>number</code> | <code>null</code></td>
1587-
<td>Please refer to the description of the <code>layout_threshold</code> parameter of the pipeline object's <code>predict</code> method.</td>
1588-
<td>No</td>
1589-
</tr>
1590-
<tr>
1591-
<td><code>layoutNms</code></td>
1592-
<td><code>boolean</code> | <code>null</code></td>
1593-
<td>Please refer to the description of the <code>layout_nms</code> parameter of the pipeline object's <code>predict</code> method.</td>
1609+
<td><code>useTableCellsOcrResults</code></td>
1610+
<td><code>boolean</code></td>
1611+
<td>Please refer to the description of the <code>use_table_cells_ocr_results</code> parameter of the pipeline object's <code>predict</code> method.</td>
15941612
<td>No</td>
15951613
</tr>
15961614
<tr>
1597-
<td><code>layoutUnclipRatio</code></td>
1598-
<td><code>number</code> | <code>array</code> | <code>object</code> | <code>null</code></td>
1599-
<td>Please refer to the description of the <code>layout_unclip_ratio</code> parameter of the pipeline object's <code>predict</code> method.</td>
1615+
<td><code>useE2eWiredTableRecModel</code></td>
1616+
<td><code>boolean</code></td>
1617+
<td>Please refer to the description of the <code>use_e2e_wired_table_rec_model</code> parameter of the pipeline object's <code>predict</code> method.</td>
16001618
<td>No</td>
16011619
</tr>
16021620
<tr>
1603-
<td><code>layoutMergeBboxesMode</code></td>
1604-
<td><code>string</code> | <code>object</code> | <code>null</code></td>
1605-
<td>Please refer to the description of the <code>layout_merge_bboxes_mode</code> parameter of the pipeline object's <code>predict</code> method.</td>
1621+
<td><code>useE2eWirelessTableRecModel</code></td>
1622+
<td><code>boolean</code></td>
1623+
<td>Please refer to the description of the <code>use_e2e_wireless_table_rec_model</code> parameter of the pipeline object's <code>predict</code> method.</td>
16061624
<td>No</td>
16071625
</tr>
16081626
</tbody>

docs/pipeline_usage/tutorials/ocr_pipelines/PP-StructureV3.md

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,6 +1456,30 @@ for res in output:
14561456
<td>否</td>
14571457
</tr>
14581458
<tr>
1459+
<td><code>layoutThreshold</code></td>
1460+
<td><code>number</code> | <code>null</code></td>
1461+
<td>请参阅产线对象中 <code>predict</code> 方法的 <code>layout_threshold</code> 参数相关说明。</td>
1462+
<td>否</td>
1463+
</tr>
1464+
<tr>
1465+
<td><code>layoutNms</code></td>
1466+
<td><code>boolean</code> | <code>null</code></td>
1467+
<td>请参阅产线对象中 <code>predict</code> 方法的 <code>layout_nms</code> 参数相关说明。</td>
1468+
<td>否</td>
1469+
</tr>
1470+
<tr>
1471+
<td><code>layoutUnclipRatio</code></td>
1472+
<td><code>number</code> | <code>array</code> | <code>object</code> | <code>null</code></td>
1473+
<td>请参阅产线对象中 <code>predict</code> 方法的 <code>layout_unclip_ratio</code> 参数相关说明。</td>
1474+
<td>否</td>
1475+
</tr>
1476+
<tr>
1477+
<td><code>layoutMergeBboxesMode</code></td>
1478+
<td><code>string</code> | <code>object</code> | <code>null</code></td>
1479+
<td>请参阅产线对象中 <code>predict</code> 方法的 <code>layout_merge_bboxes_mode</code> 参数相关说明。</td>
1480+
<td>否</td>
1481+
</tr>
1482+
<tr>
14591483
<td><code>textDetLimitSideLen</code></td>
14601484
<td><code>integer</code> | <code>null</code></td>
14611485
<td>请参阅产线对象中 <code>predict</code> 方法的 <code>text_det_limit_side_len</code> 参数相关说明。</td>
@@ -1528,27 +1552,21 @@ for res in output:
15281552
<td>否</td>
15291553
</tr>
15301554
<tr>
1531-
<td><code>layoutThreshold</code></td>
1532-
<td><code>number</code> | <code>null</code></td>
1533-
<td>请参阅产线对象中 <code>predict</code> 方法的 <code>layout_threshold</code> 参数相关说明。</td>
1534-
<td>否</td>
1535-
</tr>
1536-
<tr>
1537-
<td><code>layoutNms</code></td>
1538-
<td><code>boolean</code> | <code>null</code></td>
1539-
<td>请参阅产线对象中 <code>predict</code> 方法的 <code>layout_nms</code> 参数相关说明。</td>
1555+
<td><code>useTableCellsOcrResults</code></td>
1556+
<td><code>boolean</code></td>
1557+
<td>请参阅产线对象中 <code>predict</code> 方法的 <code>use_table_cells_ocr_results</code> 参数相关说明。</td>
15401558
<td>否</td>
15411559
</tr>
15421560
<tr>
1543-
<td><code>layoutUnclipRatio</code></td>
1544-
<td><code>number</code> | <code>array</code> | <code>object</code> | <code>null</code></td>
1545-
<td>请参阅产线对象中 <code>predict</code> 方法的 <code>layout_unclip_ratio</code> 参数相关说明。</td>
1561+
<td><code>useE2eWiredTableRecModel</code></td>
1562+
<td><code>boolean</code></td>
1563+
<td>请参阅产线对象中 <code>predict</code> 方法的 <code>use_e2e_wired_table_rec_model</code> 参数相关说明。</td>
15461564
<td>否</td>
15471565
</tr>
15481566
<tr>
1549-
<td><code>layoutMergeBboxesMode</code></td>
1550-
<td><code>string</code> | <code>object</code> | <code>null</code></td>
1551-
<td>请参阅产线对象中 <code>predict</code> 方法的 <code>layout_merge_bboxes_mode</code> 参数相关说明。</td>
1567+
<td><code>useE2eWirelessTableRecModel</code></td>
1568+
<td><code>boolean</code></td>
1569+
<td>请参阅产线对象中 <code>predict</code> 方法的 <code>use_e2e_wireless_table_rec_model</code> 参数相关说明。</td>
15521570
<td>否</td>
15531571
</tr>
15541572
</tbody>

docs/pipeline_usage/tutorials/ocr_pipelines/layout_parsing.en.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,6 +1306,30 @@ Below are the API reference and multi-language service invocation examples for t
13061306
<td>No</td>
13071307
</tr>
13081308
<tr>
1309+
<td><code>layoutThreshold</code></td>
1310+
<td><code>number</code> | <code>null</code></td>
1311+
<td>Please refer to the description of the <code>layout_threshold</code> parameter of the pipeline object's <code>predict</code> method.</td>
1312+
<td>No</td>
1313+
</tr>
1314+
<tr>
1315+
<td><code>layoutNms</code></td>
1316+
<td><code>boolean</code> | <code>null</code></td>
1317+
<td>Please refer to the description of the <code>layout_nms</code> parameter of the pipeline object's <code>predict</code> method.</td>
1318+
<td>No</td>
1319+
</tr>
1320+
<tr>
1321+
<td><code>layoutUnclipRatio</code></td>
1322+
<td><code>number</code> | <code>array</code> | <code>null</code></td>
1323+
<td>Please refer to the description of the <code>layout_unclip_ratio</code> parameter of the pipeline object's <code>predict</code> method.</td>
1324+
<td>No</td>
1325+
</tr>
1326+
<tr>
1327+
<td><code>layoutMergeBboxesMode</code></td>
1328+
<td><code>string</code> | <code>null</code></td>
1329+
<td>Please refer to the description of the <code>layout_merge_bboxes_mode</code> parameter of the pipeline object's <code>predict</code> method.</td>
1330+
<td>No</td>
1331+
</tr>
1332+
<tr>
13091333
<td><code>textDetLimitSideLen</code></td>
13101334
<td><code>integer</code> | <code>null</code></td>
13111335
<td>Please refer to the description of the <code>text_det_limit_side_len</code> parameter of the pipeline object's <code>predict</code> method.</td>
@@ -1377,30 +1401,6 @@ Below are the API reference and multi-language service invocation examples for t
13771401
<td>Please refer to the description of the <code>seal_rec_score_thresh</code> parameter of the pipeline object's <code>predict</code> method.</td>
13781402
<td>No</td>
13791403
</tr>
1380-
<tr>
1381-
<td><code>layoutThreshold</code></td>
1382-
<td><code>number</code> | <code>null</code></td>
1383-
<td>Please refer to the description of the <code>layout_threshold</code> parameter of the pipeline object's <code>predict</code> method.</td>
1384-
<td>No</td>
1385-
</tr>
1386-
<tr>
1387-
<td><code>layoutNms</code></td>
1388-
<td><code>boolean</code> | <code>null</code></td>
1389-
<td>Please refer to the description of the <code>layout_nms</code> parameter of the pipeline object's <code>predict</code> method.</td>
1390-
<td>No</td>
1391-
</tr>
1392-
<tr>
1393-
<td><code>layoutUnclipRatio</code></td>
1394-
<td><code>number</code> | <code>array</code> | <code>null</code></td>
1395-
<td>Please refer to the description of the <code>layout_unclip_ratio</code> parameter of the pipeline object's <code>predict</code> method.</td>
1396-
<td>No</td>
1397-
</tr>
1398-
<tr>
1399-
<td><code>layoutMergeBboxesMode</code></td>
1400-
<td><code>string</code> | <code>null</code></td>
1401-
<td>Please refer to the description of the <code>layout_merge_bboxes_mode</code> parameter of the pipeline object's <code>predict</code> method.</td>
1402-
<td>No</td>
1403-
</tr>
14041404
</tbody>
14051405
</table>
14061406
<ul>

docs/pipeline_usage/tutorials/ocr_pipelines/layout_parsing.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,6 +1359,30 @@ for res in output:
13591359
<td>否</td>
13601360
</tr>
13611361
<tr>
1362+
<td><code>layoutThreshold</code></td>
1363+
<td><code>number</code> | <code>null</code></td>
1364+
<td>请参阅产线对象中 <code>predict</code> 方法的 <code>layout_threshold</code> 参数相关说明。</td>
1365+
<td>否</td>
1366+
</tr>
1367+
<tr>
1368+
<td><code>layoutNms</code></td>
1369+
<td><code>boolean</code> | <code>null</code></td>
1370+
<td>请参阅产线对象中 <code>predict</code> 方法的 <code>layout_nms</code> 参数相关说明。</td>
1371+
<td>否</td>
1372+
</tr>
1373+
<tr>
1374+
<td><code>layoutUnclipRatio</code></td>
1375+
<td><code>number</code> | <code>array</code> | <code>null</code></td>
1376+
<td>请参阅产线对象中 <code>predict</code> 方法的 <code>layout_unclip_ratio</code> 参数相关说明。</td>
1377+
<td>否</td>
1378+
</tr>
1379+
<tr>
1380+
<td><code>layoutMergeBboxesMode</code></td>
1381+
<td><code>string</code> | <code>null</code></td>
1382+
<td>请参阅产线对象中 <code>predict</code> 方法的 <code>layout_merge_bboxes_mode</code> 参数相关说明。</td>
1383+
<td>否</td>
1384+
</tr>
1385+
<tr>
13621386
<td><code>textDetLimitSideLen</code></td>
13631387
<td><code>integer</code> | <code>null</code></td>
13641388
<td>请参阅产线对象中 <code>predict</code> 方法的 <code>text_det_limit_side_len</code> 参数相关说明。</td>
@@ -1430,30 +1454,6 @@ for res in output:
14301454
<td>请参阅产线对象中 <code>predict</code> 方法的 <code>seal_rec_score_thresh</code> 参数相关说明。</td>
14311455
<td>否</td>
14321456
</tr>
1433-
<tr>
1434-
<td><code>layoutThreshold</code></td>
1435-
<td><code>number</code> | <code>null</code></td>
1436-
<td>请参阅产线对象中 <code>predict</code> 方法的 <code>layout_threshold</code> 参数相关说明。</td>
1437-
<td>否</td>
1438-
</tr>
1439-
<tr>
1440-
<td><code>layoutNms</code></td>
1441-
<td><code>boolean</code> | <code>null</code></td>
1442-
<td>请参阅产线对象中 <code>predict</code> 方法的 <code>layout_nms</code> 参数相关说明。</td>
1443-
<td>否</td>
1444-
</tr>
1445-
<tr>
1446-
<td><code>layoutUnclipRatio</code></td>
1447-
<td><code>number</code> | <code>array</code> | <code>null</code></td>
1448-
<td>请参阅产线对象中 <code>predict</code> 方法的 <code>layout_unclip_ratio</code> 参数相关说明。</td>
1449-
<td>否</td>
1450-
</tr>
1451-
<tr>
1452-
<td><code>layoutMergeBboxesMode</code></td>
1453-
<td><code>string</code> | <code>null</code></td>
1454-
<td>请参阅产线对象中 <code>predict</code> 方法的 <code>layout_merge_bboxes_mode</code> 参数相关说明。</td>
1455-
<td>否</td>
1456-
</tr>
14571457
</tbody>
14581458
</table>
14591459
<ul>

paddlex/inference/serving/basic_serving/_pipeline_apps/layout_parsing.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ async def _infer(
5555
use_seal_recognition=request.useSealRecognition,
5656
use_table_recognition=request.useTableRecognition,
5757
use_formula_recognition=request.useFormulaRecognition,
58+
layout_threshold=request.layoutThreshold,
59+
layout_nms=request.layoutNms,
60+
layout_unclip_ratio=request.layoutUnclipRatio,
61+
layout_merge_bboxes_mode=request.layoutMergeBboxesMode,
5862
text_det_limit_side_len=request.textDetLimitSideLen,
5963
text_det_limit_type=request.textDetLimitType,
6064
text_det_thresh=request.textDetThresh,
@@ -67,10 +71,6 @@ async def _infer(
6771
seal_det_box_thresh=request.sealDetBoxThresh,
6872
seal_det_unclip_ratio=request.sealDetUnclipRatio,
6973
seal_rec_score_thresh=request.sealRecScoreThresh,
70-
layout_threshold=request.layoutThreshold,
71-
layout_nms=request.layoutNms,
72-
layout_unclip_ratio=request.layoutUnclipRatio,
73-
layout_merge_bboxes_mode=request.layoutMergeBboxesMode,
7474
)
7575

7676
layout_parsing_results: List[Dict[str, Any]] = []

paddlex/inference/serving/basic_serving/_pipeline_apps/pp_structurev3.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ async def _infer(
5555
use_seal_recognition=request.useSealRecognition,
5656
use_table_recognition=request.useTableRecognition,
5757
use_formula_recognition=request.useFormulaRecognition,
58+
layout_threshold=request.layoutThreshold,
59+
layout_nms=request.layoutNms,
60+
layout_unclip_ratio=request.layoutUnclipRatio,
61+
layout_merge_bboxes_mode=request.layoutMergeBboxesMode,
5862
text_det_limit_side_len=request.textDetLimitSideLen,
5963
text_det_limit_type=request.textDetLimitType,
6064
text_det_thresh=request.textDetThresh,
@@ -67,10 +71,9 @@ async def _infer(
6771
seal_det_box_thresh=request.sealDetBoxThresh,
6872
seal_det_unclip_ratio=request.sealDetUnclipRatio,
6973
seal_rec_score_thresh=request.sealRecScoreThresh,
70-
layout_threshold=request.layoutThreshold,
71-
layout_nms=request.layoutNms,
72-
layout_unclip_ratio=request.layoutUnclipRatio,
73-
layout_merge_bboxes_mode=request.layoutMergeBboxesMode,
74+
use_table_cells_ocr_results=request.useTableCellsOcrResults,
75+
use_e2e_wired_table_rec_model=request.useE2eWiredTableRecModel,
76+
use_e2e_wireless_table_rec_model=request.useE2eWirelessTableRecModel,
7477
)
7578

7679
layout_parsing_results: List[Dict[str, Any]] = []

paddlex/inference/serving/schemas/layout_parsing.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ class InferRequest(ocr.BaseInferRequest):
3838
useSealRecognition: Optional[bool] = None
3939
useTableRecognition: Optional[bool] = None
4040
useFormulaRecognition: Optional[bool] = None
41+
layoutThreshold: Optional[float] = None
42+
layoutNms: Optional[bool] = None
43+
layoutUnclipRatio: Optional[Union[float, Tuple[float, float]]] = None
44+
layoutMergeBboxesMode: Optional[str] = None
4145
textDetLimitSideLen: Optional[int] = None
4246
textDetLimitType: Optional[str] = None
4347
textDetThresh: Optional[float] = None
@@ -50,10 +54,6 @@ class InferRequest(ocr.BaseInferRequest):
5054
sealDetBoxThresh: Optional[float] = None
5155
sealDetUnclipRatio: Optional[float] = None
5256
sealRecScoreThresh: Optional[float] = None
53-
layoutThreshold: Optional[float] = None
54-
layoutNms: Optional[bool] = None
55-
layoutUnclipRatio: Optional[Union[float, Tuple[float, float]]] = None
56-
layoutMergeBboxesMode: Optional[str] = None
5757

5858

5959
class LayoutParsingResult(BaseModel):

paddlex/inference/serving/schemas/pp_structurev3.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ class InferRequest(ocr.BaseInferRequest):
3939
useSealRecognition: Optional[bool] = None
4040
useTableRecognition: Optional[bool] = None
4141
useFormulaRecognition: Optional[bool] = None
42+
layoutThreshold: Optional[float] = None
43+
layoutNms: Optional[bool] = None
44+
layoutUnclipRatio: Optional[Union[float, Tuple[float, float], dict]] = None
45+
layoutMergeBboxesMode: Optional[Union[str, dict]] = None
4246
textDetLimitSideLen: Optional[int] = None
4347
textDetLimitType: Optional[str] = None
4448
textDetThresh: Optional[float] = None
@@ -51,10 +55,9 @@ class InferRequest(ocr.BaseInferRequest):
5155
sealDetBoxThresh: Optional[float] = None
5256
sealDetUnclipRatio: Optional[float] = None
5357
sealRecScoreThresh: Optional[float] = None
54-
layoutThreshold: Optional[float] = None
55-
layoutNms: Optional[bool] = None
56-
layoutUnclipRatio: Optional[Union[float, Tuple[float, float], dict]] = None
57-
layoutMergeBboxesMode: Optional[Union[str, dict]] = None
58+
useTableCellsOcrResults: bool = False
59+
useE2eWiredTableRecModel: bool = False
60+
useE2eWirelessTableRecModel: bool = False
5861

5962

6063
class MarkdownData(BaseModel):

0 commit comments

Comments
 (0)