3 Commits 2fc720fbe9 ... e0ccdf7550

Author SHA1 Message Date
  xujiayue e0ccdf7550 update model 2 years ago
  xujiayue 21c08c222f 模型更改 2 years ago
  xujiayue a489fe246c 模型更改 2 years ago

BIN
SLANet/inference.pdmodel


BIN
SLAnet_1004/inference.pdiparams


+ 0 - 0
SLANet/inference.pdiparams.info → SLAnet_1004/inference.pdiparams.info


BIN
SLAnet_1004/inference.pdmodel


BIN
SLANet/inference.pdiparams → SLAnet_1011/inference.pdiparams


BIN
SLAnet_1011/inference.pdiparams.info


BIN
SLAnet_1011/inference.pdmodel


BIN
det_table_1012/inference.pdiparams


BIN
det_table_1012/inference.pdiparams.info


BIN
det_table_1012/inference.pdmodel


BIN
det_table_1014/inference.pdiparams


BIN
det_table_1014/inference.pdiparams.info


BIN
det_table_1014/inference.pdmodel


+ 20 - 3
server.py

@@ -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']