mirror of
https://github.com/open-mmlab/mmocr.git
synced 2025-06-03 21:54:47 +08:00
When testing my model with tools/test.py, my config will be messed up by the "--save-preds" option. (#2052)
* fix tools/test.py * fix tools/test.py * Update tools/test.py --------- Co-authored-by: Tong Gao <gaotongxiao@gmail.com>
This commit is contained in:
parent
1d3b1cafd6
commit
e9d5b46cb4
@ -121,6 +121,11 @@ def main():
|
||||
if isinstance(cfg.test_evaluator, (list, tuple)):
|
||||
cfg.test_evaluator = list(cfg.test_evaluator)
|
||||
cfg.test_evaluator.append(dump_metric)
|
||||
elif isinstance(cfg.test_evaluator, dict):
|
||||
if 'metrics' in cfg.test_evaluator:
|
||||
cfg.test_evaluator['metrics'].append(dump_metric)
|
||||
else:
|
||||
cfg.test_evaluator['metrics'] = [dump_metric]
|
||||
else:
|
||||
cfg.test_evaluator = [cfg.test_evaluator, dump_metric]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user