Skip to content

Commit

Permalink
fix accuracy.p bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Wenliang Dai committed Jul 23, 2018
1 parent dba042a commit ef2db7a
Show file tree
Hide file tree
Showing 3 changed files with 186 additions and 15 deletions.
2 changes: 1 addition & 1 deletion train_multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def main(args):
totalclasswise_gtpixels_test[1] = totalclasswise_gtpixels_test[1].reshape((-1, n_classes[1]))
totalclasswise_predpixels_test[1] = totalclasswise_predpixels_test[1].reshape((-1, n_classes[1]))

if isinstance(avg_pixel_acc, np.ndarray):
if isinstance(avg_pixel_acc, list):
avg_pixel_acc[0] = np.vstack((avg_pixel_acc[0], np.sum(totalclasswise_pixel_acc[0], axis=1) / np.sum(totalclasswise_gtpixels[0], axis=1)))
mean_class_acc[0] = np.vstack((mean_class_acc[0], np.mean(totalclasswise_pixel_acc[0] / totalclasswise_gtpixels[0], axis=1)))
mIoU[0] = np.vstack((mIoU[0], np.mean(totalclasswise_pixel_acc[0] / (totalclasswise_gtpixels[0] + totalclasswise_predpixels[0] - totalclasswise_pixel_acc[0]), axis=1)))
Expand Down
2 changes: 1 addition & 1 deletion train_multi_human.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def main(args):
totalclasswise_gtpixels_test[1] = totalclasswise_gtpixels_test[1].reshape((-1, n_classes[1]))
totalclasswise_predpixels_test[1] = totalclasswise_predpixels_test[1].reshape((-1, n_classes[1]))

if isinstance(avg_pixel_acc, np.ndarray):
if isinstance(avg_pixel_acc, list):
avg_pixel_acc[0] = np.vstack((avg_pixel_acc[0], np.sum(totalclasswise_pixel_acc[0], axis=1) / np.sum(totalclasswise_gtpixels[0], axis=1)))
mean_class_acc[0] = np.vstack((mean_class_acc[0], np.mean(totalclasswise_pixel_acc[0] / totalclasswise_gtpixels[0], axis=1)))
mIoU[0] = np.vstack((mIoU[0], np.mean(totalclasswise_pixel_acc[0] / (totalclasswise_gtpixels[0] + totalclasswise_predpixels[0] - totalclasswise_pixel_acc[0]), axis=1)))
Expand Down
Loading

0 comments on commit ef2db7a

Please sign in to comment.