From 51cba2007f05047adfe1184847a11b57cc85a8c1 Mon Sep 17 00:00:00 2001 From: Tushar Date: Mon, 7 Oct 2024 07:46:19 +0530 Subject: [PATCH] renamed eval_dir to evaluations_dir and updated 2-omr-marker to include should_export_explanation_csv --- samples/2-omr-marker/evaluation.json | 3 ++- src/algorithm/template/template.py | 4 ++-- src/entry.py | 2 +- src/schemas/defaults/evaluation.py | 1 + src/utils/file.py | 4 ++-- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/samples/2-omr-marker/evaluation.json b/samples/2-omr-marker/evaluation.json index 0e5fe84e..3702f5f9 100644 --- a/samples/2-omr-marker/evaluation.json +++ b/samples/2-omr-marker/evaluation.json @@ -90,6 +90,7 @@ } }, "outputs_configuration": { - "should_explain_scoring": true + "should_explain_scoring": true, + "should_export_explanation_csv": true, } } diff --git a/src/algorithm/template/template.py b/src/algorithm/template/template.py index fb7d70a1..5267b06f 100644 --- a/src/algorithm/template/template.py +++ b/src/algorithm/template/template.py @@ -122,8 +122,8 @@ def get_multi_marked_dir(self): def get_errors_dir(self): return self.directory_handler.path_utils.errors_dir - def get_eval_dir(self): - return self.directory_handler.path_utils.eval_dir + def get_evaluations_dir(self): + return self.directory_handler.path_utils.evaluations_dir def read_omr_response(self, input_gray_image, colored_image, file_path): # Convert posix path to string diff --git a/src/entry.py b/src/entry.py index aeef3aa6..2a3fcde7 100644 --- a/src/entry.py +++ b/src/entry.py @@ -331,7 +331,7 @@ def process_directory_files( explanation_table = evaluation_config_for_response.get_explanation_table() explanation_table = table_to_df(explanation_table) explanation_table.to_csv( - template.get_eval_dir().joinpath(file_name + ".csv"), + template.get_evaluations_dir().joinpath(file_name + ".csv"), quoting=QUOTE_NONNUMERIC, index=False, ) diff --git a/src/schemas/defaults/evaluation.py b/src/schemas/defaults/evaluation.py index 677b2225..063108c3 100644 --- a/src/schemas/defaults/evaluation.py +++ b/src/schemas/defaults/evaluation.py @@ -9,6 +9,7 @@ "conditional_sets": [], "outputs_configuration": { "should_explain_scoring": False, + "should_export_explanation_csv": False, "draw_score": { "enabled": False, "position": [200, 200], diff --git a/src/utils/file.py b/src/utils/file.py index 31e67ed2..7425c0e5 100644 --- a/src/utils/file.py +++ b/src/utils/file.py @@ -62,7 +62,7 @@ def __init__(self, output_dir): self.manual_dir = output_dir.joinpath("Manual") self.errors_dir = self.manual_dir.joinpath("ErrorFiles") self.multi_marked_dir = self.manual_dir.joinpath("MultiMarkedFiles") - self.eval_dir = output_dir.joinpath("Evaluations") + self.evaluations_dir = output_dir.joinpath("Evaluations") self.debug_dir = output_dir.joinpath("Debug") def create_output_directories(self): @@ -97,7 +97,7 @@ def create_output_directories(self): for save_output_dir in [ self.results_dir, self.image_metrics_dir, - self.eval_dir, + self.evaluations_dir, ]: if not os.path.exists(save_output_dir): logger.info(f"Created : {save_output_dir}")