Skip to content
Snippets Groups Projects
Commit 77ec6575 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

[scripts.evaluate] Add meta data saving also for evaluation

parent 3090c288
No related branches found
No related tags found
1 merge request!24Implement fixes on evaluation (closes #20), and prepare for handling issue #60
Pipeline #84549 failed
...@@ -97,10 +97,16 @@ def evaluate( ...@@ -97,10 +97,16 @@ def evaluate(
aggregate_summaries, aggregate_summaries,
run_binary, run_binary,
) )
from .utils import execution_metadata, save_json_with_backup
with predictions.open("r") as f: with predictions.open("r") as f:
predict_data = json.load(f) predict_data = json.load(f)
# register metadata
json_data: dict[str, typing.Any] = execution_metadata()
json_data = {k.replace("_", "-"): v for k, v in json_data.items()}
save_json_with_backup(output.with_suffix(".meta.json"), json_data)
if threshold in predict_data: if threshold in predict_data:
# it is the name of a split # it is the name of a split
# first run evaluation for reference dataset # first run evaluation for reference dataset
......
...@@ -392,6 +392,7 @@ def test_evaluate_pasa_montgomery(temporary_basedir): ...@@ -392,6 +392,7 @@ def test_evaluate_pasa_montgomery(temporary_basedir):
_assert_exit_0(result) _assert_exit_0(result)
assert output_path.exists() assert output_path.exists()
assert output_path.with_suffix(".meta.json").exists()
assert output_path.with_suffix(".rst").exists() assert output_path.with_suffix(".rst").exists()
assert output_path.with_suffix(".pdf").exists() assert output_path.with_suffix(".pdf").exists()
...@@ -462,6 +463,7 @@ def test_experiment(temporary_basedir): ...@@ -462,6 +463,7 @@ def test_experiment(temporary_basedir):
== 1 == 1
) )
assert (output_folder / "evaluation.json").exists() assert (output_folder / "evaluation.json").exists()
assert (output_folder / "evaluation.meta.json").exists()
assert (output_folder / "evaluation.rst").exists() assert (output_folder / "evaluation.rst").exists()
assert (output_folder / "evaluation.pdf").exists() assert (output_folder / "evaluation.pdf").exists()
assert (output_folder / "gradcam" / "saliencies").exists() assert (output_folder / "gradcam" / "saliencies").exists()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment