Skip to content

Commit

Permalink
Fix Accuracy metric (qubvel#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisiron authored Apr 21, 2020
1 parent ecc848f commit a48886c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion segmentation_models_pytorch/utils/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def accuracy(pr, gt, threshold=0.5, ignore_channels=None):
pr = _threshold(pr, threshold=threshold)
pr, gt = _take_channels(pr, gt, ignore_channels=ignore_channels)

tp = torch.sum(gt == pr)
tp = torch.sum(gt == pr, dtype=pr.dtype)
score = tp / gt.view(-1).shape[0]
return score

Expand Down

0 comments on commit a48886c

Please sign in to comment.