(args)
| 18 | return args |
| 19 | |
| 20 | def main(args): |
| 21 | real_logdir, metrics = evaluation.compute_metrics(args.config, args.config_args, args.section, args.inferred, args.logdir) |
| 22 | |
| 23 | if args.output: |
| 24 | if real_logdir: |
| 25 | output_path = args.output.replace('__LOGDIR__', real_logdir) |
| 26 | else: |
| 27 | output_path = args.output |
| 28 | with open(output_path, 'w') as f: |
| 29 | json.dump(metrics, f) |
| 30 | print('Wrote eval results to {}'.format(output_path)) |
| 31 | else: |
| 32 | print(metrics) |
| 33 | |
| 34 | |
| 35 | if __name__ == '__main__': |