Skip to content

Commit

Permalink
fix a bug in metric
Browse files Browse the repository at this point in the history
  • Loading branch information
speedinghzl authored Aug 28, 2018
1 parent 160c5b4 commit 89a49c2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions deeplab/metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ def jaccard(self):
jaccard = 0.0
jaccard_perclass = []
for i in xrange(self.nclass):
if not self.M[i, i] == 0:
jaccard_perclass.append(self.M[i, i] / (np.sum(self.M[i, :]) + np.sum(self.M[:, i]) - self.M[i, i]))
jaccard_perclass.append(self.M[i, i] / (np.sum(self.M[i, :]) + np.sum(self.M[:, i]) - self.M[i, i]))

return np.sum(jaccard_perclass)/len(jaccard_perclass), jaccard_perclass, self.M

Expand Down

0 comments on commit 89a49c2

Please sign in to comment.