|
@@ -32,13 +32,26 @@ table_engine = PPStructure(layout=False,
|
|
|
table=True,
|
|
|
use_gpu=use_gpu,
|
|
|
show_log=True,
|
|
|
- table_model_dir="./SLANet")
|
|
|
+ det_model_dir="./det_table_1014",
|
|
|
+ table_model_dir="./SLAnet_1004")
|
|
|
|
|
|
+table_engine1 = PPStructure(layout=False,
|
|
|
+ table=True,
|
|
|
+ use_gpu=use_gpu,
|
|
|
+ show_log=True,
|
|
|
+ det_model_dir="./det_table_1012",
|
|
|
+ table_model_dir="./SLAnet_1004")
|
|
|
|
|
|
+table_engine2 = PPStructure(layout=False,
|
|
|
+ table=True,
|
|
|
+ use_gpu=use_gpu,
|
|
|
+ show_log=True,
|
|
|
+ table_model_dir="./SLAnet_1011")
|
|
|
|
|
|
|
|
|
class TableInfo(BaseModel):
|
|
|
image: str
|
|
|
+ det: str
|
|
|
|
|
|
|
|
|
@app.get("/ping")
|
|
@@ -46,12 +59,16 @@ def ping():
|
|
|
return 'pong!'
|
|
|
|
|
|
|
|
|
-
|
|
|
@app.post("/ocr_system/table")
|
|
|
@web_try()
|
|
|
def table(image: TableInfo):
|
|
|
img = base64_to_np(image.image)
|
|
|
- res = table_engine(img)
|
|
|
+ if image.det == 'no':
|
|
|
+ res = table_engine(img)
|
|
|
+ elif image.det == 'yes':
|
|
|
+ res = table_engine1(img)
|
|
|
+ elif image.det == 'spe':
|
|
|
+ res = table_engine2(img)
|
|
|
return res[0]['res']
|
|
|
|
|
|
|