Sfoglia il codice sorgente

Merge branch 'master' of https://gogsb.soaringnova.com/chenguilong/ocr-table

Conflicts:
	server.py

	modified:   server.py
	SLANet/
	inference.pdiparams
	inference.pdiparams.info
	inference.pdmodel
liutao 2 anni fa
parent
commit
7b1ecb00eb

BIN
en_ppocr_mobile_v2.0_table_structure_infer/inference.pdiparams


BIN
en_ppocr_mobile_v2.0_table_structure_infer/inference.pdiparams.info


BIN
en_ppocr_mobile_v2.0_table_structure_infer/inference.pdmodel


+ 11 - 0
run.py

@@ -0,0 +1,11 @@
+if __name__ == '__main__':
+    import uvicorn
+    import argparse
+
+    parser = argparse.ArgumentParser()
+    parser.add_argument('--host', default='0.0.0.0')
+    parser.add_argument('--port', default=8080)
+    opt = parser.parse_args()
+
+    app_str = 'server:app'  # make the app string equal to whatever the name of this file is
+    uvicorn.run(app_str, host=opt.host, port=int(opt.port), reload=True)

+ 8 - 0
server.py

@@ -31,7 +31,15 @@ if os.getenv('USE_CUDA') == 'gpu':
 print(f'use gpu: {use_gpu}')
 
 # 初始化模型
+<<<<<<< HEAD
 table_engine = PPStructure(layout=False, table=True, show_log=True, table_model_dir="/Users/sxkj/opt/python-workspace/yili-ocr/ocr-table/SLANet/")
+=======
+table_engine = PPStructure(layout=False,
+                           table=True,
+                           use_gpu=use_gpu,
+                           show_log=True,
+                           table_model_dir="./tabel_ocr_infer")
+>>>>>>> d046d2d76465ba7ba4d8c3e2cdad1ec5e7ac3b69
 
 
 class TableInfo(BaseModel):