示例#1
0
def compute_and_save_errors(results, error_metrics, method_name, output_dir):
    json = {}
    for error_name, error_metric in error_metrics:
        # error_name may be a path or a predefined
        name = Path(error_name).name.replace('.', '_')
        json[name] = [float(error_metric(np.array(r['gt']),
                                         np.array(r['result']['final'])))
                      for r in results.values()]
    save_json(json, str(output_dir / '{}.json'.format(method_name)),
              pretty=True)
示例#2
0
def save_test_results(results, method_name, output_dir, matlab=False):
    save_json(results, str(output_dir / '{}.json'.format(method_name)),
              pretty=True)
    if matlab:
        print('TODO: export .mat file here.')