class_docstr: Objects as Points Head. CenterHead use center_point to indicate object's
  position. Paper link <https://arxiv.org/abs/1904.07850>
  
  Args:
      in_channels (int): Number of channel in the input feature map.
      feat_channels (int): Number of channel in the intermediate feature map.
      num_classes (int): Number of categories excluding the background
          category.
      loss_center_heatmap (:obj:`ConfigDict` or dict): Config of center
          heatmap loss. Defaults to
          dict(type='GaussianFocalLoss', loss_weight=1.0)
      loss_wh (:obj:`ConfigDict` or dict): Config of wh loss. Defaults to
           dict(type='L1Loss', loss_weight=0.1).
      loss_offset (:obj:`ConfigDict` or dict): Config of offset loss.
          Defaults to dict(type='L1Loss', loss_weight=1.0).
      train_cfg (:obj:`ConfigDict` or dict, optional): Training config.
          Useless in CenterNet, but we keep this variable for
          SingleStageDetector.
      test_cfg (:obj:`ConfigDict` or dict, optional): Testing config
          of CenterNet.
      init_cfg (:obj:`ConfigDict` or dict or list[dict] or
          list[:obj:`ConfigDict`], optional): Initialization
          config dict.
docstr: Transform outputs of a single image into bbox results.
  
  Args:
      center_heatmap_pred (Tensor): Center heatmap for current level with
          shape (1, num_classes, H, W).
      wh_pred (Tensor): WH heatmap for current level with shape
          (1, num_classes, H, W).
      offset_pred (Tensor): Offset for current level with shape
          (1, corner_offset_channels, H, W).
      img_meta (dict): Meta information of current image, e.g.,
          image size, scaling factor, etc.
      rescale (bool): If True, return boxes in original image space.
          Defaults to True.
      with_nms (bool): If True, do nms before return boxes.
          Defaults to False.
  
  Returns:
      :obj:`InstanceData`: Detection results of each image
      after the post process.
      Each item usually contains following keys.
  
          - scores (Tensor): Classification scores, has a shape
            (num_instance, )
          - labels (Tensor): Labels of bboxes, has a shape
            (num_instances, ).
          - bboxes (Tensor): Has a shape (num_instances, 4),
            the last dimension 4 arrange as (x1, y1, x2, y2).
docstr_tok: ["Transform","outputs","of","a","single","image","into","bbox","results",".","Args",":","center_heatmap_pred","(","Tensor",")",":","Center","heatmap","for","current","level","with","shape","(","1",",","num_classes",",","H",",","W",")",".","wh_pred","(","Tensor",")",":","WH","heatmap","for","current","level","with","shape","(","1",",","num_classes",",","H",",","W",")",".","offset_pred","(","Tensor",")",":","Offset","for","current","level","with","shape","(","1",",","corner_offset_channels",",","H",",","W",")",".","img_meta","(","dict",")",":","Meta","information","of","current","image",",","e.g.",",","image","size",",","scaling","factor",",","etc",".","rescale","(","bool",")",":","If","True",",","return","boxes","in","original","image","space",".","Defaults","to","True",".","with_nms","(","bool",")",":","If","True",",","do","nms","before","return","boxes",".","Defaults","to","False",".","Returns",":",":","obj",":","`","InstanceData","`",":","Detection","results","of","each","image","after","the","post","process",".","Each","item","usually","contains","following","keys",".","-","scores","(","Tensor",")",":","Classification","scores",",","has","a","shape","(","num_instance",",",")","-","labels","(","Tensor",")",":","Labels","of","bboxes",",","has","a","shape","(","num_instances",",",")",".","-","bboxes","(","Tensor",")",":","Has","a","shape","(","num_instances",",","4",")",",","the","last","dimension","4","arrange","as","(","x1",",","y1",",","x2",",","y2",")","."]
code: def _predict_by_feat_single(
      self,
      center_heatmap_pred: Tensor,
      wh_pred: Tensor,
      offset_pred: Tensor,
      img_meta: dict,
      rescale: bool = True,
      with_nms: bool = False,
  ) -> InstanceData:
      """Transform outputs of a single image into bbox results.
  
      Args:
          center_heatmap_pred (Tensor): Center heatmap for current level with
              shape (1, num_classes, H, W).
          wh_pred (Tensor): WH heatmap for current level with shape
              (1, num_classes, H, W).
          offset_pred (Tensor): Offset for current level with shape
              (1, corner_offset_channels, H, W).
          img_meta (dict): Meta information of current image, e.g.,
              image size, scaling factor, etc.
          rescale (bool): If True, return boxes in original image space.
              Defaults to True.
          with_nms (bool): If True, do nms before return boxes.
              Defaults to False.
  
      Returns:
          :obj:`InstanceData`: Detection results of each image
          after the post process.
          Each item usually contains following keys.
  
              - scores (Tensor): Classification scores, has a shape
                (num_instance, )
              - labels (Tensor): Labels of bboxes, has a shape
                (num_instances, ).
              - bboxes (Tensor): Has a shape (num_instances, 4),
                the last dimension 4 arrange as (x1, y1, x2, y2).
      """
      batch_det_bboxes, batch_labels = self._decode_heatmap(
          center_heatmap_pred,
          wh_pred,
          offset_pred,
          img_meta["batch_input_shape"],
          k=self.test_cfg.topk,
          kernel=self.test_cfg.local_maximum_kernel,
      )
  
      det_bboxes = batch_det_bboxes.view([-1, 5])
      det_labels = batch_labels.view(-1)
  
      batch_border = det_bboxes.new_tensor(img_meta["border"])[
          ..., [2, 0, 2, 0]
      ]
      det_bboxes[..., :4] -= batch_border
  
      if rescale and "scale_factor" in img_meta:
          det_bboxes[..., :4] /= det_bboxes.new_tensor(
              img_meta["scale_factor"]
          ).repeat((1, 2))
  
      if with_nms:
          det_bboxes, det_labels = self._bboxes_nms(
              det_bboxes, det_labels, self.test_cfg
          )
      results = InstanceData()
      results.bboxes = det_bboxes[..., :4]
      results.scores = det_bboxes[..., 4]
      results.labels = det_labels
      return results
  
imports: from typing import List, Optional, Tuple
  import torch
  import torch.nn
  from mmcv.ops import batched_nms
  from mmengine.config import ConfigDict
  from mmengine.model import bias_init_with_prob, normal_init
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.registry import MODELS
  from mmdet.utils import ConfigType, InstanceList, OptConfigType, OptInstanceList, OptMultiConfig
  from ..utils import gaussian_radius, gen_gaussian_target, get_local_maximum, get_topk_from_heatmap, multi_apply, transpose_and_gather_feat
  from .base_dense_head import BaseDenseHead
label_desc: Use image node_id 9 for calling the CenterNetHead obj's underlying member method code with example usage: obj._predict_by_feat_single(center_heatmap_pred, wh_pred, offset_pred, img_meta, rescale, with_nms) and returns: results