class_docstr: Head of PAAAssignment: Probabilistic Anchor Assignment with IoU
  Prediction for Object Detection.
  
  Code is modified from the `official github repo
  <https://github.com/kkhoot/PAA/blob/master/paa_core
  /modeling/rpn/paa/loss.py>`_.
  
  More details can be found in the `paper
  <https://arxiv.org/abs/2007.08103>`_ .
  
  Args:
      topk (int): Select topk samples with smallest loss in
          each level.
      score_voting (bool): Whether to use score voting in post-process.
      covariance_type : String describing the type of covariance parameters
          to be used in :class:`sklearn.mixture.GaussianMixture`.
          It must be one of:
  
          - 'full': each component has its own general covariance matrix
          - 'tied': all components share the same general covariance matrix
          - 'diag': each component has its own diagonal covariance matrix
          - 'spherical': each component has its own single variance
          Default: 'diag'. From 'full' to 'spherical', the gmm fitting
          process is faster yet the performance could be influenced. For most
          cases, 'diag' should be a good choice.
class_docstr_tok: ["Head","of","PAAAssignment",":","Probabilistic","Anchor","Assignment","with","IoU","Prediction","for","Object","Detection",".","Code","is","modified","from","the","`","official","github","repo","<","https",":","\/\/github.com\/kkhoot\/PAA\/blob\/master\/paa_core","\/modeling\/rpn\/paa\/loss.py",">","`","_",".","More","details","can","be","found","in","the","`","paper","<","https",":","\/\/arxiv.org\/abs\/2007.08103",">","`","_",".","Args",":","topk","(","int",")",":","Select","topk","samples","with","smallest","loss","in","each","level",".","score_voting","(","bool",")",":","Whether","to","use","score","voting","in","post-process",".","covariance_type",":","String","describing","the","type","of","covariance","parameters","to","be","used","in",":","class",":","`","sklearn.mixture.GaussianMixture","`",".","It","must","be","one","of",":","-","'full","'",":","each","component","has","its","own","general","covariance","matrix","-","'tied","'",":","all","components","share","the","same","general","covariance","matrix","-","'diag","'",":","each","component","has","its","own","diagonal","covariance","matrix","-","'spherical","'",":","each","component","has","its","own","single","variance","Default",":","'diag","'",".","From","'full","'","to","'spherical","'",",","the","gmm","fitting","process","is","faster","yet","the","performance","could","be","influenced",".","For","most","cases",",","'diag","'","should","be","a","good","choice","."]
docstr: Compute regression and classification targets for anchors in a
  single image.
  
  This method is same as `AnchorHead._get_targets_single()`.
docstr_tok: ["Compute","regression","and","classification","targets","for","anchors","in","a","single","image",".","This","method","is","same","as","`","AnchorHead._get_targets_single","(",")","`","."]
code: def _get_targets_single(
      self,
      flat_anchors,
      valid_flags,
      gt_bboxes,
      gt_bboxes_ignore,
      gt_labels,
      img_meta,
      label_channels=1,
      unmap_outputs=True,
  ):
      """Compute regression and classification targets for anchors in a
      single image.
  
      This method is same as `AnchorHead._get_targets_single()`.
      """
      assert unmap_outputs, (
          "We must map outputs back to the original"
          "set of anchors in PAAhead"
      )
      return super(ATSSHead, self)._get_targets_single(
          flat_anchors,
          valid_flags,
          gt_bboxes,
          gt_bboxes_ignore,
          gt_labels,
          img_meta,
          label_channels=1,
          unmap_outputs=True,
      )
  
file_path: insightface/detection/scrfd/mmdet/models/dense_heads/paa_head.py
imports: import numpy
  import torch
  from mmcv.runner import force_fp32
  from mmdet.core import multi_apply, multiclass_nms
  from mmdet.core.bbox.iou_calculators import bbox_overlaps
  from mmdet.models import HEADS
  from mmdet.models.dense_heads import ATSSHead
label_desc: Use image node_id 7 for calling the PAAHead obj's underlying member method code with example usage: obj._get_targets_single(flat_anchors, valid_flags, gt_bboxes, gt_bboxes_ignore, gt_labels, img_meta, label_channels, unmap_outputs) and returns: super