def mean_pixel_accuracy(pixel_correct, pixel_labeled): mean_pixel_accuracy = 1.0 * np.sum(pixel_correct) / ( np.spacing(1) + np.sum(pixel_labeled)) return mean_pixel_accuracy