Skip to content

Commit

Permalink
Added intermediate Measures from TRA (AOGM etc.) to the output. (Sugg…
Browse files Browse the repository at this point in the history
…ested by JoOkuma #11)
  • Loading branch information
TimoK93 committed Oct 11, 2024
1 parent 7044521 commit 21cc37a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ctc_metrics/metrics/technical/tra.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ def tra(
AOGM_0 = w_fn * num_vertices + w_ea * num_edges
# Calculate DET
TRA = 1 - min(AOGM, AOGM_0) / AOGM_0
return float(TRA)
return float(TRA), AOGM, AOGM_0

8 changes: 6 additions & 2 deletions ctc_metrics/scripts/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,12 @@ def calculate_metrics(
results["SEG"] = seg(segm["labels_ref"], segm["ious"])

if "TRA" in metrics:
results["TRA"] = tra(**graph_operations)
_tra, _aogm, _aogm0 = tra(**graph_operations)
results["TRA"] = _tra
results["AOGM"] = _aogm
results["AOGM_0"] = _aogm0
for key in ["NS", "FN", "FP", "ED", "EA", "EC"]:
results[f"AOGM_{key}"] = graph_operations[key]

if "LNK" in metrics:
results["LNK"] = lnk(**graph_operations)
Expand Down Expand Up @@ -265,7 +270,6 @@ def calculate_metrics(
results.update(faf(
traj["labels_comp_merged"], traj["mapped_comp_merged"]))


return results


Expand Down

0 comments on commit 21cc37a

Please sign in to comment.