From 042034b61d3f6e1961db11ecafe60649b9e95b94 Mon Sep 17 00:00:00 2001 From: WenmuZhou Date: Thu, 10 Dec 2020 17:14:58 +0800 Subject: [PATCH] The parameters of export are consistent with the static image --- tools/export_model.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/tools/export_model.py b/tools/export_model.py index b6c03efb..51c06178 100755 --- a/tools/export_model.py +++ b/tools/export_model.py @@ -28,21 +28,15 @@ from ppocr.modeling.architectures import build_model from ppocr.postprocess import build_post_process from ppocr.utils.save_load import init_model from ppocr.utils.logging import get_logger -from tools.program import load_config - - -def parse_args(): - parser = argparse.ArgumentParser() - parser.add_argument("-c", "--config", help="configuration file to use") - parser.add_argument( - "-o", "--output_path", type=str, default='./output/infer/') - return parser.parse_args() +from tools.program import load_config, merge_config,ArgsParser def main(): - FLAGS = parse_args() + FLAGS = ArgsParser().parse_args() config = load_config(FLAGS.config) + merge_config(FLAGS.opt) logger = get_logger() + print(config) # build post process post_process_class = build_post_process(config['PostProcess'], @@ -57,7 +51,7 @@ def main(): init_model(config, model, logger) model.eval() - save_path = '{}/inference'.format(FLAGS.output_path) + save_path = '{}/inference'.format(config['Global']['save_inference_dir']) infer_shape = [3, 32, 100] if config['Architecture'][ 'model_type'] != "det" else [3, 640, 640] model = to_static( -- GitLab