docstr: Args:
      img (Tensor): Input images of shape (N, C, H, W).
          Typically these should be mean centered and std scaled.
      img_metas (list[dict]): A List of image info dict where each dict
          has: 'img_shape', 'scale_factor', 'flip', and may also contain
          'filename', 'ori_shape', 'pad_shape', and 'img_norm_cfg'.
          For details on the values of these keys see
          :class:`mmdet.datasets.pipelines.Collect`.
      gt_bboxes (list[Tensor]): Each item are the truth boxes for each
          image in [tl_x, tl_y, br_x, br_y] format.
      gt_labels (list[Tensor]): Class indices corresponding to each box
      gt_bboxes_ignore (None | list[Tensor]): Specify which bounding
          boxes can be ignored when computing the loss.
  
  Returns:
      dict[str, Tensor]: A dictionary of loss components.
docstr_tok: ["Args",":","img","(","Tensor",")",":","Input","images","of","shape","(","N",",","C",",","H",",","W",")",".","Typically","these","should","be","mean","centered","and","std","scaled",".","img_metas","(","list","[","dict","]",")",":","A","List","of","image","info","dict","where","each","dict","has",":","'img_shape","'",",","'scale_factor","'",",","'flip","'",",","and","may","also","contain","'filename","'",",","'ori_shape","'",",","'pad_shape","'",",","and","'img_norm_cfg","'",".","For","details","on","the","values","of","these","keys","see",":","class",":","`","mmdet.datasets.pipelines.Collect","`",".","gt_bboxes","(","list","[","Tensor","]",")",":","Each","item","are","the","truth","boxes","for","each","image","in","[","tl_x",",","tl_y",",","br_x",",","br_y","]","format",".","gt_labels","(","list","[","Tensor","]",")",":","Class","indices","corresponding","to","each","box","gt_bboxes_ignore","(","None","|","list","[","Tensor","]",")",":","Specify","which","bounding","boxes","can","be","ignored","when","computing","the","loss",".","Returns",":","dict","[","str",",","Tensor","]",":","A","dictionary","of","loss","components","."]
code: def forward_train(
      self,
      img,
      img_metas,
      gt_bboxes,
      gt_labels,
      gt_keypointss=None,
      gt_bboxes_ignore=None,
  ):
      """
      Args:
          img (Tensor): Input images of shape (N, C, H, W).
              Typically these should be mean centered and std scaled.
          img_metas (list[dict]): A List of image info dict where each dict
              has: 'img_shape', 'scale_factor', 'flip', and may also contain
              'filename', 'ori_shape', 'pad_shape', and 'img_norm_cfg'.
              For details on the values of these keys see
              :class:`mmdet.datasets.pipelines.Collect`.
          gt_bboxes (list[Tensor]): Each item are the truth boxes for each
              image in [tl_x, tl_y, br_x, br_y] format.
          gt_labels (list[Tensor]): Class indices corresponding to each box
          gt_bboxes_ignore (None | list[Tensor]): Specify which bounding
              boxes can be ignored when computing the loss.
  
      Returns:
          dict[str, Tensor]: A dictionary of loss components.
      """
      super(SingleStageDetector, self).forward_train(img, img_metas)
      x = self.extract_feat(img)
      losses = self.bbox_head.forward_train(
          x,
          img_metas,
          gt_bboxes,
          gt_labels,
          gt_keypointss,
          gt_bboxes_ignore,
      )
      return losses
  
file_path: insightface/detection/scrfd/mmdet/models/detectors/scrfd.py
imports: from mmdet.core import bbox2result
  from ..builder import DETECTORS
  from .single_stage import SingleStageDetector
  import torch
label_desc: Use image node_id 2 for calling the SCRFD obj's underlying member method code with example usage: obj.forward_train(img, img_metas, gt_bboxes, gt_labels, gt_keypointss, gt_bboxes_ignore) and returns: losses