提交 604f531b 编写于 作者: 文幕地方's avatar 文幕地方

add layout model

上级 6b6606fe
...@@ -287,7 +287,8 @@ MODEL_URLS = { ...@@ -287,7 +287,8 @@ MODEL_URLS = {
}, },
'layout': { 'layout': {
'ch': { 'ch': {
'url': '', 'url':
'https://paddleocr.bj.bcebos.com/ppstructure/models/layout/picodet_lcnet_x1_0_layout_infer.tar',
'dict_path': 'ppocr/utils/dict/layout_publaynet_dict.txt' 'dict_path': 'ppocr/utils/dict/layout_publaynet_dict.txt'
} }
} }
......
...@@ -41,9 +41,7 @@ def download_with_progressbar(url, save_path): ...@@ -41,9 +41,7 @@ def download_with_progressbar(url, save_path):
def maybe_download(model_storage_directory, url): def maybe_download(model_storage_directory, url):
# using custom model # using custom model
tar_file_name_list = [ tar_file_name_list = ['.pdiparams', '.pdiparams.info', '.pdmodel']
'inference.pdiparams', 'inference.pdiparams.info', 'inference.pdmodel'
]
if not os.path.exists( if not os.path.exists(
os.path.join(model_storage_directory, 'inference.pdiparams') os.path.join(model_storage_directory, 'inference.pdiparams')
) or not os.path.exists( ) or not os.path.exists(
...@@ -57,8 +55,8 @@ def maybe_download(model_storage_directory, url): ...@@ -57,8 +55,8 @@ def maybe_download(model_storage_directory, url):
for member in tarObj.getmembers(): for member in tarObj.getmembers():
filename = None filename = None
for tar_file_name in tar_file_name_list: for tar_file_name in tar_file_name_list:
if tar_file_name in member.name: if member.name.endswith(tar_file_name):
filename = tar_file_name filename = 'inference' + tar_file_name
if filename is None: if filename is None:
continue continue
file = tarObj.extractfile(member) file = tarObj.extractfile(member)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册