Skip to content

Commit

Permalink
Update GANDLF/metrics/generic.py
Browse files Browse the repository at this point in the history
Co-authored-by: Sarthak Pati <patis@iu.edu>
  • Loading branch information
szmazurek and sarthakpati authored Nov 20, 2023
1 parent 1c962d7 commit 429b59e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions GANDLF/metrics/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ def iou_score(output, label, params):
elif params["problem_type"] == "segmentation":
label = one_hot(label, params["model"]["class_list"])
task = determine_task(params)
recall = sys.float_info.max
if task == "binary":
recall = JaccardIndex(
task=task,
Expand All @@ -117,8 +118,8 @@ def iou_score(output, label, params):
threshold=params["metrics"]["iou"]["threshold"],
)
else:
raise NotImplementedError(
"IoU score is not implemented for multilabel problems"
print(
f"IoU score is not implemented for multilabel problems, setting recall to {recall}"
)

return generic_function_output_with_check(
Expand Down

0 comments on commit 429b59e

Please sign in to comment.