def eval_2015(res_folder): params = {} current_folder = os.path.join(os.path.dirname(__file__)) submitfile = os.path.join(current_folder, 'submit.zip') #print(submitfile) filenames = os.listdir(res_folder) zip = zipfile.ZipFile(submitfile, "w", zipfile.ZIP_DEFLATED) for filename in filenames: filepath = os.path.join(res_folder, filename) zip.write(filepath, filename) zip.close() gtfile = os.path.join(current_folder, 'gt.zip') params['g'] = gtfile params['s'] = submitfile rrc_evaluation_funcs.main_evaluation(params, default_evaluation_params, validate_data, evaluate_method)
def eval_dataset(est_folder, gt_folder, eval_folder, dataset_type='ic15'): submit_fname = 'submit.zip' gt_fname = 'gt.zip' compress_files(est_folder, eval_folder, submit_fname) compress_files(gt_folder, eval_folder, gt_fname) params = {} params['g'] = os.path.join(eval_folder, gt_fname) params['s'] = os.path.join(eval_folder, submit_fname) if dataset_type == 'ic15': evaluation_params = default_evaluation_params elif dataset_type == 'mathflat': evaluation_params = mathflat_evaluation_params rrc_evaluation_funcs.main_evaluation( params, evaluation_params, validate_data, evaluate_method ) # default_eval_params = default_evaluation_params(mode='mathflat')