Skip to content

Commit

Permalink
Add missing columns to get_metrics function
Browse files Browse the repository at this point in the history
  • Loading branch information
cmalinmayor committed Aug 15, 2024
1 parent 251e159 commit 302c577
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@
# %% [markdown]
# ## Import packages

# %%
# %load_ext autoreload
# %autoreload 2
# TODO: remove
import motile

# %%
import time
from pathlib import Path
Expand Down Expand Up @@ -620,8 +614,9 @@ def make_gt_detections(data_shape, gt_tracks, radius):

gt_dets = make_gt_detections(data_root["raw"].shape, gt_tracks, 10)


# %%
import pandas as pd

def get_metrics(gt_graph, labels, run, results_df):
"""Calculate metrics for linked tracks by comparing to ground truth.
Expand Down Expand Up @@ -656,7 +651,7 @@ def get_metrics(gt_graph, labels, run, results_df):
matcher=IOUMatcher(iou_threshold=0.3, one_to_one=True),
metrics=[CTCMetrics(), DivisionMetrics()],
)

columns = ["fp_nodes", "fn_nodes", "fp_edges", "fn_edges", "TRA", "True Positive Divisions", "False Positive Divisions", "False Negative Divisions"]
results_filtered = {}
results_filtered.update(results[0]["results"])
results_filtered.update(results[1]["results"]["Frame Buffer 0"])
Expand Down Expand Up @@ -931,7 +926,7 @@ def get_ssvm_solution(cand_graph, solver_weights):
return solution_graph

solution_graph = get_ssvm_solution(cand_graph, optimal_weights)


# %% [markdown]
# Finally, we can visualize and compute metrics on the solution found using the weights discovered by the SSVM.
Expand Down

0 comments on commit 302c577

Please sign in to comment.