class_docstr: A mask point head use in PointRend.
  
  ``MaskPointHead`` use shared multi-layer perceptron (equivalent to
  nn.Conv1d) to predict the logit of input points. The fine-grained feature
  and coarse feature will be concatenate together for predication.
  
  Args:
      num_fcs (int): Number of fc layers in the head. Default: 3.
      in_channels (int): Number of input channels. Default: 256.
      fc_channels (int): Number of fc channels. Default: 256.
      num_classes (int): Number of classes for logits. Default: 80.
      class_agnostic (bool): Whether use class agnostic classification.
          If so, the output channels of logits will be 1. Default: False.
      coarse_pred_each_layer (bool): Whether concatenate coarse feature with
          the output of each fc layer. Default: True.
      conv_cfg (dict | None): Dictionary to construct and config conv layer.
          Default: dict(type='Conv1d'))
      norm_cfg (dict | None): Dictionary to construct and config norm layer.
          Default: None.
      loss_point (dict): Dictionary to construct and config loss layer of
          point head. Default: dict(type='CrossEntropyLoss', use_mask=True,
          loss_weight=1.0).
docstr: Calculate loss for MaskPointHead.
  
  Args:
      point_pred (Tensor): Point predication result, shape
          (num_rois, num_classes, num_points).
      point_targets (Tensor): Point targets, shape (num_roi, num_points).
      labels (Tensor): Class label of corresponding boxes,
          shape (num_rois, )
  
  Returns:
      dict[str, Tensor]: a dictionary of point loss components
docstr_tok: ["Calculate","loss","for","MaskPointHead",".","Args",":","point_pred","(","Tensor",")",":","Point","predication","result",",","shape","(","num_rois",",","num_classes",",","num_points",")",".","point_targets","(","Tensor",")",":","Point","targets",",","shape","(","num_roi",",","num_points",")",".","labels","(","Tensor",")",":","Class","label","of","corresponding","boxes",",","shape","(","num_rois",",",")","Returns",":","dict","[","str",",","Tensor","]",":","a","dictionary","of","point","loss","components"]
code: def loss(self, point_pred, point_targets, labels):
      """Calculate loss for MaskPointHead.
  
      Args:
          point_pred (Tensor): Point predication result, shape
              (num_rois, num_classes, num_points).
          point_targets (Tensor): Point targets, shape (num_roi, num_points).
          labels (Tensor): Class label of corresponding boxes,
              shape (num_rois, )
  
      Returns:
          dict[str, Tensor]: a dictionary of point loss components
      """
  
      loss = dict()
      if self.class_agnostic:
          loss_point = self.loss_point(
              point_pred, point_targets, torch.zeros_like(labels)
          )
      else:
          loss_point = self.loss_point(
              point_pred, point_targets, labels
          )
      loss["loss_point"] = loss_point
      return loss
  
file_path: insightface/detection/scrfd/mmdet/models/roi_heads/mask_heads/mask_point_head.py
imports: import torch
  import torch.nn
  from mmcv.cnn import ConvModule, normal_init
  from mmcv.ops import point_sample, rel_roi_point_to_rel_img_point
  from mmdet.models.builder import HEADS, build_loss
label_desc: Use image node_id 6 for calling the MaskPointHead obj's underlying member method code with example usage: obj.loss(point_pred, point_targets, labels) and returns: loss