Skip to content
This repository has been archived by the owner on Jul 2, 2021. It is now read-only.

Commit

Permalink
reorder arguments for _fast_hist
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyu2172 committed May 11, 2017
1 parent 7ff91f6 commit e67f929
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chainercv/evaluations/eval_semantic_segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from chainer import cuda


def _fast_hist(gt_label, pred_label, n_class):
def _fast_hist(pred_label, gt_label, n_class):
# Construct histogram for label evaluation.

mask = (gt_label >= 0) & (gt_label < n_class)
Expand Down Expand Up @@ -102,7 +102,7 @@ class labels as values, which is obtained from inference.
fwavacc = np.zeros((N,))
for i in six.moves.range(len(pred_label)):
hist = _fast_hist(
gt_label[i].flatten(), pred_label[i].flatten(), n_class)
pred_label[i].flatten(), gt_label[i].flatten(), n_class)
acc[i] = np.diag(hist).sum() / hist.sum()
acc_cls_i = np.diag(hist) / hist.sum(axis=1)
acc_cls[i] = np.nanmean(acc_cls_i)
Expand Down

0 comments on commit e67f929

Please sign in to comment.