10 classifier_name =
'probability_image_classifier'
13 super(ProbabilityImageClassifier, self).
__init__()
16 proba = np.nansum(proba_img, axis=(0, 1)).astype(np.float32)
21 assert proba.ndim == 1
22 n_labels = proba.shape[0]
25 rospy.logwarn_throttle(
26 10,
"The max label value in '~ignore_labels' exceeds "
27 "the number of labels of input probability image.")
31 proba[ignore_labels] = 0
32 label = np.argmax(proba)
33 proba = proba / proba.sum()
38 if __name__ ==
'__main__':
39 rospy.init_node(
'probability_image_classifier')