Skip to content

Commit

Permalink
Merge pull request #9 from JosefBuchner/handle_missing_predictions
Browse files Browse the repository at this point in the history
return instance_dice of 0.0 instead of NaN when missing predictions
  • Loading branch information
neuronflow authored Nov 10, 2023
2 parents 582e176 + 49a6c0a commit dd51f79
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions panoptica/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ def instance_dice(self) -> float:
Returns:
float: Average Dice coefficient.
"""
if self.tp == 0:
return 0.0
return np.sum(self._dice_list) / self.tp

@property
Expand Down

0 comments on commit dd51f79

Please sign in to comment.