Skip to content

Commit

Permalink
Revert changes to keep hausdorff_score with seg task
Browse files Browse the repository at this point in the history
  • Loading branch information
mariehbourget committed Aug 2, 2022
1 parent a01efa2 commit 94a3e09
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions ivadomed/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,7 @@ def run_command(context, n_gif=0, thr_increment=None, resume_training=False, no_
'requires_undo': True}}, device=device,
cuda_available=cuda_available)

eval_params = context[ConfigKW.EVALUATION_PARAMETERS]
metric_fns = imed_metrics.get_metric_fns(ds_test.task, eval_params)
metric_fns = imed_metrics.get_metric_fns(ds_test.task)

if ModelParamsKW.FILM_LAYERS in model_params and any(model_params[ModelParamsKW.FILM_LAYERS]):
ds_test, model_params = update_film_model_params(context, ds_test, model_params, path_output)
Expand All @@ -536,7 +535,7 @@ def run_command(context, n_gif=0, thr_increment=None, resume_training=False, no_
# RUN EVALUATION
df_results = imed_evaluation.evaluate(bids_df, path_output=path_output,
target_suffix=loader_params[LoaderParamsKW.TARGET_SUFFIX],
eval_params=eval_params)
eval_params=context[ConfigKW.EVALUATION_PARAMETERS])
return df_results, pred_metrics


Expand Down
4 changes: 2 additions & 2 deletions ivadomed/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@


# METRICS
def get_metric_fns(task, eval_params=None):
def get_metric_fns(task):
metric_fns = [dice_score,
multi_class_dice_score,
precision_score,
recall_score,
specificity_score,
intersection_over_union,
accuracy_score]
if task == "segmentation" and (eval_params and eval_params['object_detection_metrics']):
if task == "segmentation":
metric_fns = metric_fns + [hausdorff_score]

return metric_fns
Expand Down

0 comments on commit 94a3e09

Please sign in to comment.