class_docstr: Evaluate semantic segmentation
  
  Args:
      num_classes (int): number of classes
      ignore_index (int, optional): value in semantic segmentation ground truth. Predictions for the
      corresponding pixels should be ignored. Default: 255.
class_docstr_tok: ["Evaluate","semantic","segmentation","Args",":","num_classes","(","int",")",":","number","of","classes","ignore_index","(","int",",","optional",")",":","value","in","semantic","segmentation","ground","truth",".","Predictions","for","the","corresponding","pixels","should","be","ignored",".","Default",":","255","."]
docstr: Evaluates standard semantic segmentation metrics (http://cocodataset.org/#stuff-eval):
  * Mean intersection-over-union averaged across classes (mIoU)
  * Frequency Weighted IoU (fwIoU)
  * Mean pixel accuracy averaged across classes (mACC)
  * Pixel Accuracy (pACC)
docstr_tok: ["Evaluates","standard","semantic","segmentation","metrics","(","http",":","\/\/cocodataset.org\/","#","stuff-eval",")",":","*","Mean","intersection-over-union","averaged","across","classes","(","mIoU",")","*","Frequency","Weighted","IoU","(","fwIoU",")","*","Mean","pixel","accuracy","averaged","across","classes","(","mACC",")","*","Pixel","Accuracy","(","pACC",")"]
code: def evaluate(self):
      """
      Evaluates standard semantic segmentation metrics (http://cocodataset.org/#stuff-eval):
      * Mean intersection-over-union averaged across classes (mIoU)
      * Frequency Weighted IoU (fwIoU)
      * Mean pixel accuracy averaged across classes (mACC)
      * Pixel Accuracy (pACC)
      """
      acc = np.zeros(self._num_classes, dtype=np.float)
      iou = np.zeros(self._num_classes, dtype=np.float)
      tp = self._conf_matrix.diagonal()[:-1].astype(np.float)
      pos_gt = np.sum(self._conf_matrix[:-1, :-1], axis=0).astype(
          np.float
      )
      class_weights = pos_gt / np.sum(pos_gt)
      pos_pred = np.sum(self._conf_matrix[:-1, :-1], axis=1).astype(
          np.float
      )
  
      acc_valid = pos_pred > 0
      acc[acc_valid] = tp[acc_valid] / pos_pred[acc_valid]
      iou_valid = (pos_gt + pos_pred) > 0
      union = pos_gt + pos_pred - tp
      iou[acc_valid] = tp[acc_valid] / union[acc_valid]
      macc = np.sum(acc) / np.sum(acc_valid)
      miou = np.sum(iou) / np.sum(iou_valid)
      fiou = np.sum(iou * class_weights)
      pacc = np.sum(tp) / np.sum(pos_gt)
  
      res = {}
      res["mIoU"] = 100 * miou
      res["fwIoU"] = 100 * fiou
      res["mACC"] = 100 * macc
      res["pACC"] = 100 * pacc
  
      results = OrderedDict({"sem_seg": res})
      return results
  
imports: from collections import OrderedDict
  import numpy
label_desc: Use image node_id 3 for calling the SemanticEvaluator obj's underlying member method code with example usage: obj.evaluate() and returns: results