class_docstr: Head of CornerNet: Detecting Objects as Paired Keypoints.
  
  Code is modified from the `official github repo
  <https://github.com/princeton-vl/CornerNet/blob/master/models/py_utils/
  kp.py#L73>`_ .
  
  More details can be found in the `paper
  <https://arxiv.org/abs/1808.01244>`_ .
  
  Args:
      num_classes (int): Number of categories excluding the background
          category.
      in_channels (int): Number of channels in the input feature map.
      num_feat_levels (int): Levels of feature from the previous module. 2
          for HourglassNet-104 and 1 for HourglassNet-52. Because
          HourglassNet-104 outputs the final feature and intermediate
          supervision feature and HourglassNet-52 only outputs the final
          feature. Default: 2.
      corner_emb_channels (int): Channel of embedding vector. Default: 1.
      train_cfg (dict | None): Training config. Useless in CornerHead,
          but we keep this variable for SingleStageDetector. Default: None.
      test_cfg (dict | None): Testing config of CornerHead. Default: None.
      loss_heatmap (dict | None): Config of corner heatmap loss. Default:
          GaussianFocalLoss.
      loss_embedding (dict | None): Config of corner embedding loss. Default:
          AssociativeEmbeddingLoss.
      loss_offset (dict | None): Config of corner offset loss. Default:
          SmoothL1Loss.
class_docstr_tok: ["Head","of","CornerNet",":","Detecting","Objects","as","Paired","Keypoints",".","Code","is","modified","from","the","`","official","github","repo","<","https",":","\/\/github.com\/princeton-vl\/CornerNet\/blob\/master\/models\/py_utils\/","kp.py","#","L73",">","`","_",".","More","details","can","be","found","in","the","`","paper","<","https",":","\/\/arxiv.org\/abs\/1808.01244",">","`","_",".","Args",":","num_classes","(","int",")",":","Number","of","categories","excluding","the","background","category",".","in_channels","(","int",")",":","Number","of","channels","in","the","input","feature","map",".","num_feat_levels","(","int",")",":","Levels","of","feature","from","the","previous","module",".","2","for","HourglassNet-104","and","1","for","HourglassNet-52",".","Because","HourglassNet-104","outputs","the","final","feature","and","intermediate","supervision","feature","and","HourglassNet-52","only","outputs","the","final","feature",".","Default",":","2.","corner_emb_channels","(","int",")",":","Channel","of","embedding","vector",".","Default",":","1.","train_cfg","(","dict","|","None",")",":","Training","config",".","Useless","in","CornerHead",",","but","we","keep","this","variable","for","SingleStageDetector",".","Default",":","None",".","test_cfg","(","dict","|","None",")",":","Testing","config","of","CornerHead",".","Default",":","None",".","loss_heatmap","(","dict","|","None",")",":","Config","of","corner","heatmap","loss",".","Default",":","GaussianFocalLoss",".","loss_embedding","(","dict","|","None",")",":","Config","of","corner","embedding","loss",".","Default",":","AssociativeEmbeddingLoss",".","loss_offset","(","dict","|","None",")",":","Config","of","corner","offset","loss",".","Default",":","SmoothL1Loss","."]
docstr: Transform network output for a batch into bbox predictions.
  
  Args:
      tl_heats (list[Tensor]): Top-left corner heatmaps for each level
          with shape (N, num_classes, H, W).
      br_heats (list[Tensor]): Bottom-right corner heatmaps for each
          level with shape (N, num_classes, H, W).
      tl_embs (list[Tensor]): Top-left corner embeddings for each level
          with shape (N, corner_emb_channels, H, W).
      br_embs (list[Tensor]): Bottom-right corner embeddings for each
          level with shape (N, corner_emb_channels, H, W).
      tl_offs (list[Tensor]): Top-left corner offsets for each level
          with shape (N, corner_offset_channels, H, W).
      br_offs (list[Tensor]): Bottom-right corner offsets for each level
          with shape (N, corner_offset_channels, H, W).
      img_metas (list[dict]): Meta information of each image, e.g.,
          image size, scaling factor, etc.
      rescale (bool): If True, return boxes in original image space.
          Default: False.
      with_nms (bool): If True, do nms before return boxes.
          Default: True.
docstr_tok: ["Transform","network","output","for","a","batch","into","bbox","predictions",".","Args",":","tl_heats","(","list","[","Tensor","]",")",":","Top-left","corner","heatmaps","for","each","level","with","shape","(","N",",","num_classes",",","H",",","W",")",".","br_heats","(","list","[","Tensor","]",")",":","Bottom-right","corner","heatmaps","for","each","level","with","shape","(","N",",","num_classes",",","H",",","W",")",".","tl_embs","(","list","[","Tensor","]",")",":","Top-left","corner","embeddings","for","each","level","with","shape","(","N",",","corner_emb_channels",",","H",",","W",")",".","br_embs","(","list","[","Tensor","]",")",":","Bottom-right","corner","embeddings","for","each","level","with","shape","(","N",",","corner_emb_channels",",","H",",","W",")",".","tl_offs","(","list","[","Tensor","]",")",":","Top-left","corner","offsets","for","each","level","with","shape","(","N",",","corner_offset_channels",",","H",",","W",")",".","br_offs","(","list","[","Tensor","]",")",":","Bottom-right","corner","offsets","for","each","level","with","shape","(","N",",","corner_offset_channels",",","H",",","W",")",".","img_metas","(","list","[","dict","]",")",":","Meta","information","of","each","image",",","e.g.",",","image","size",",","scaling","factor",",","etc",".","rescale","(","bool",")",":","If","True",",","return","boxes","in","original","image","space",".","Default",":","False",".","with_nms","(","bool",")",":","If","True",",","do","nms","before","return","boxes",".","Default",":","True","."]
code: def get_bboxes(
      self,
      tl_heats,
      br_heats,
      tl_embs,
      br_embs,
      tl_offs,
      br_offs,
      img_metas,
      rescale=False,
      with_nms=True,
  ):
      """Transform network output for a batch into bbox predictions.
  
      Args:
          tl_heats (list[Tensor]): Top-left corner heatmaps for each level
              with shape (N, num_classes, H, W).
          br_heats (list[Tensor]): Bottom-right corner heatmaps for each
              level with shape (N, num_classes, H, W).
          tl_embs (list[Tensor]): Top-left corner embeddings for each level
              with shape (N, corner_emb_channels, H, W).
          br_embs (list[Tensor]): Bottom-right corner embeddings for each
              level with shape (N, corner_emb_channels, H, W).
          tl_offs (list[Tensor]): Top-left corner offsets for each level
              with shape (N, corner_offset_channels, H, W).
          br_offs (list[Tensor]): Bottom-right corner offsets for each level
              with shape (N, corner_offset_channels, H, W).
          img_metas (list[dict]): Meta information of each image, e.g.,
              image size, scaling factor, etc.
          rescale (bool): If True, return boxes in original image space.
              Default: False.
          with_nms (bool): If True, do nms before return boxes.
              Default: True.
      """
      assert (
          tl_heats[-1].shape[0]
          == br_heats[-1].shape[0]
          == len(img_metas)
      )
      result_list = []
      for img_id in range(len(img_metas)):
          result_list.append(
              self._get_bboxes_single(
                  tl_heats[-1][img_id : img_id + 1, :],
                  br_heats[-1][img_id : img_id + 1, :],
                  tl_offs[-1][img_id : img_id + 1, :],
                  br_offs[-1][img_id : img_id + 1, :],
                  img_metas[img_id],
                  tl_emb=tl_embs[-1][img_id : img_id + 1, :],
                  br_emb=br_embs[-1][img_id : img_id + 1, :],
                  rescale=rescale,
                  with_nms=with_nms,
              )
          )
  
      return result_list
  
imports: from math import ceil, log
  import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.cnn import ConvModule, bias_init_with_prob
  from mmcv.ops import CornerPool, batched_nms
  from mmdet.core import multi_apply
  from ..builder import HEADS, build_loss
  from ..utils import gaussian_radius, gen_gaussian_target
  from .base_dense_head import BaseDenseHead
label_desc: Use image node_id 12 for calling the CornerHead obj's underlying member method code with example usage: obj.get_bboxes(tl_heats, br_heats, tl_embs, br_embs, tl_offs, br_offs, img_metas, rescale, with_nms) and returns: result_list