提交 1cc7ad34 编写于 作者: 文幕地方's avatar 文幕地方

update layout dict in whl

上级 5f0c84a8
......@@ -289,7 +289,8 @@ MODEL_URLS = {
'ch': {
'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_dict/layout_publaynet_dict.txt'
}
}
}
......
......@@ -181,14 +181,21 @@ def create_predictor(args, mode, logger):
return sess, sess.get_inputs()[0], None, None
else:
model_file_path = model_dir + "/inference.pdmodel"
params_file_path = model_dir + "/inference.pdiparams"
file_names = ['model', 'inference']
for file_name in file_names:
model_file_path = '{}/{}.pdmodel'.format(model_dir, file_name)
params_file_path = '{}/{}.pdiparams'.format(model_dir, file_name)
if os.path.exists(model_file_path) and os.path.exists(
params_file_path):
break
if not os.path.exists(model_file_path):
raise ValueError("not find model file path {}".format(
model_file_path))
raise ValueError(
"not find model.pdmodel or inference.pdmodel in {}".format(
model_dir))
if not os.path.exists(params_file_path):
raise ValueError("not find params file path {}".format(
params_file_path))
raise ValueError(
"not find model.pdiparams or inference.pdiparams in {}".format(
model_dir))
config = inference.Config(model_file_path, params_file_path)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册