Преглед на файлове

fix model_dir, add en_ppocr_table_model

zeke-chin преди 2 години
родител
ревизия
d046d2d764

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)

+ 5 - 1
server.py

@@ -31,7 +31,11 @@ if os.getenv('USE_CUDA') == 'gpu':
 print(f'use gpu: {use_gpu}')
 
 # 初始化模型
-table_engine = PPStructure(layout=False, table=True, show_log=True, table_model_dir="./tabel_ocr_infer")
+table_engine = PPStructure(layout=False,
+                           table=True,
+                           use_gpu=use_gpu,
+                           show_log=True,
+                           table_model_dir="./tabel_ocr_infer")
 
 
 class TableInfo(BaseModel):