class_docstr: `PointRend <https://arxiv.org/abs/1912.08193>`_.
class_docstr_tok: ["`","PointRend","<","https",":","\/\/arxiv.org\/abs\/1912.08193",">","`","_","."]
docstr: Run forward function and calculate loss for mask head and point head
  in training.
docstr_tok: ["Run","forward","function","and","calculate","loss","for","mask","head","and","point","head","in","training","."]
code: def _mask_forward_train(
      self, x, sampling_results, bbox_feats, gt_masks, img_metas
  ):
      """Run forward function and calculate loss for mask head and point head
      in training."""
      mask_results = super()._mask_forward_train(
          x, sampling_results, bbox_feats, gt_masks, img_metas
      )
      if mask_results["loss_mask"] is not None:
          loss_point = self._mask_point_forward_train(
              x,
              sampling_results,
              mask_results["mask_pred"],
              gt_masks,
              img_metas,
          )
          mask_results["loss_mask"].update(loss_point)
  
      return mask_results
  
file_path: insightface/detection/scrfd/mmdet/models/roi_heads/point_rend_roi_head.py
imports: import torch
  import torch.nn.functional
  from mmcv.ops import point_sample, rel_roi_point_to_rel_img_point
  from mmdet.core import bbox2roi, bbox_mapping, merge_aug_masks
  from ..None import builder
  from ..builder import HEADS
  from .standard_roi_head import StandardRoIHead
label_desc: Use image node_id 4 for calling the PointRendRoIHead obj's underlying member method code with example usage: obj._mask_forward_train(x, sampling_results, bbox_feats, gt_masks, img_metas) and returns: mask_results