xujiayue 2 anni fa
parent
commit
a489fe246c

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_1009/inference.pdiparams


BIN
SLAnet_1009/inference.pdiparams.info


BIN
SLAnet_1009/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


+ 13 - 4
server.py

@@ -32,13 +32,20 @@ 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",
+                            able_model_dir="./SLAnet_1004")
 
 
 class TableInfo(BaseModel):
     image: str
+    det: str
 
 
 @app.get("/ping")
@@ -46,12 +53,14 @@ 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)
     return res[0]['res']