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

add layout model

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