class_docstr: RCNN mask branch foreground accuracy. 
docstr: Updates the internal evaluation result. 
docstr_tok: ["Updates","the","internal","evaluation","result","."]
code: def update(self, labels, preds):
      """Updates the internal evaluation result."""
      # label = [rcnn_mask_target, rcnn_mask_weight]
      # pred = [rcnn_mask]
      rcnn_mask_target, _ = labels
      rcnn_mask = preds[0]
  
      # calculate num_inst
      num_inst = mx.nd.sum(rcnn_mask_target)
  
      # rcnn_mask (b, n, c, h, w)
      pred_label = mx.nd.sigmoid(rcnn_mask) >= 0.5
      label = rcnn_mask_target >= 0.5
      # label (b, n, c, h, w)
      num_acc = mx.nd.sum((pred_label == label) * label)
  
      self.sum_metric += num_acc.asscalar()
      self.num_inst += num_inst.asscalar()
  
imports: import mxnet
label_desc: Use image node_id 2 for calling the MaskFGAccMetric obj's underlying member method code with example usage: obj.update(labels, preds) without return types