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 into detections raw bbox prediction.
  
  Args:
      center_heatmap_pred (Tensor): center predict heatmap,
         shape (B, num_classes, H, W).
      wh_pred (Tensor): wh predict, shape (B, 2, H, W).
      offset_pred (Tensor): offset predict, shape (B, 2, H, W).
      img_shape (tuple): image shape in hw format.
      k (int): Get top k center keypoints from heatmap. Defaults to 100.
      kernel (int): Max pooling kernel for extract local maximum pixels.
         Defaults to 3.
  
  Returns:
      tuple[Tensor]: Decoded output of CenterNetHead, containing
         the following Tensors:
  
        - batch_bboxes (Tensor): Coords of each box with shape (B, k, 5)
        - batch_topk_labels (Tensor): Categories of each box with                   shape (B, k)
docstr_tok: ["Transform","outputs","into","detections","raw","bbox","prediction",".","Args",":","center_heatmap_pred","(","Tensor",")",":","center","predict","heatmap",",","shape","(","B",",","num_classes",",","H",",","W",")",".","wh_pred","(","Tensor",")",":","wh","predict",",","shape","(","B",",","2",",","H",",","W",")",".","offset_pred","(","Tensor",")",":","offset","predict",",","shape","(","B",",","2",",","H",",","W",")",".","img_shape","(","tuple",")",":","image","shape","in","hw","format",".","k","(","int",")",":","Get","top","k","center","keypoints","from","heatmap",".","Defaults","to","100.","kernel","(","int",")",":","Max","pooling","kernel","for","extract","local","maximum","pixels",".","Defaults","to","3",".","Returns",":","tuple","[","Tensor","]",":","Decoded","output","of","CenterNetHead",",","containing","the","following","Tensors",":","-","batch_bboxes","(","Tensor",")",":","Coords","of","each","box","with","shape","(","B",",","k",",","5",")","-","batch_topk_labels","(","Tensor",")",":","Categories","of","each","box","with","shape","(","B",",","k",")"]
code: def _decode_heatmap(
      self,
      center_heatmap_pred: Tensor,
      wh_pred: Tensor,
      offset_pred: Tensor,
      img_shape: tuple,
      k: int = 100,
      kernel: int = 3,
  ) -> Tuple[Tensor, Tensor]:
      """Transform outputs into detections raw bbox prediction.
  
          Args:
              center_heatmap_pred (Tensor): center predict heatmap,
                 shape (B, num_classes, H, W).
              wh_pred (Tensor): wh predict, shape (B, 2, H, W).
              offset_pred (Tensor): offset predict, shape (B, 2, H, W).
              img_shape (tuple): image shape in hw format.
              k (int): Get top k center keypoints from heatmap. Defaults to 100.
              kernel (int): Max pooling kernel for extract local maximum pixels.
                 Defaults to 3.
  
          Returns:
              tuple[Tensor]: Decoded output of CenterNetHead, containing
                 the following Tensors:
  
                - batch_bboxes (Tensor): Coords of each box with shape (B, k, 5)
                - batch_topk_labels (Tensor): Categories of each box with \
                    shape (B, k)
          """
      height, width = center_heatmap_pred.shape[2:]
      inp_h, inp_w = img_shape
  
      center_heatmap_pred = get_local_maximum(
          center_heatmap_pred, kernel=kernel
      )
  
      *batch_dets, topk_ys, topk_xs = get_topk_from_heatmap(
          center_heatmap_pred, k=k
      )
      batch_scores, batch_index, batch_topk_labels = batch_dets
  
      wh = transpose_and_gather_feat(wh_pred, batch_index)
      offset = transpose_and_gather_feat(offset_pred, batch_index)
      topk_xs = topk_xs + offset[..., 0]
      topk_ys = topk_ys + offset[..., 1]
      tl_x = (topk_xs - wh[..., 0] / 2) * (inp_w / width)
      tl_y = (topk_ys - wh[..., 1] / 2) * (inp_h / height)
      br_x = (topk_xs + wh[..., 0] / 2) * (inp_w / width)
      br_y = (topk_ys + wh[..., 1] / 2) * (inp_h / height)
  
      batch_bboxes = torch.stack([tl_x, tl_y, br_x, br_y], dim=2)
      batch_bboxes = torch.cat(
          (batch_bboxes, batch_scores[..., None]), dim=-1
      )
      return batch_bboxes, batch_topk_labels
  
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 10 for calling the CenterNetHead obj's underlying member method code with example usage: obj._decode_heatmap(center_heatmap_pred, wh_pred, offset_pred, img_shape, k, kernel) and returns: batch_bboxes,  batch_topk_labels