From 560f2f49848657d8f268126bdbee08f4428de88a Mon Sep 17 00:00:00 2001 From: tink2123 Date: Tue, 28 Sep 2021 16:25:43 +0800 Subject: [PATCH] fix eval --- tools/eval.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/eval.py b/tools/eval.py index 39a26ffe..28247bc5 100755 --- a/tools/eval.py +++ b/tools/eval.py @@ -54,8 +54,7 @@ def main(): config['Architecture']["Head"]['out_channels'] = char_num model = build_model(config['Architecture']) - use_srn = config['Architecture']['algorithm'] == "SRN" - use_sar = config['Architecture']['algorithm'] == "SAR" + extra_input = config['Architecture']['algorithm'] in ["SRN", "SAR"] if "model_type" in config['Architecture'].keys(): model_type = config['Architecture']['model_type'] else: @@ -72,7 +71,7 @@ def main(): # start eval metric = program.eval(model, valid_dataloader, post_process_class, - eval_class, model_type, use_srn, use_sar) + eval_class, model_type, extra_input) logger.info('metric eval ***************') for k, v in metric.items(): logger.info('{}:{}'.format(k, v)) -- GitLab