class_docstr: Postprocess the model outputs to get final prediction:
      1. Do NMS for heatmap to get top `max_per_img` bboxes.
      2. Decode bboxes using center offset and box size.
      3. Rescale decoded bboxes reference to the origin image shape.
  Args:
      max_per_img(int): the maximum number of predicted objects in a image,
          500 by default.
      down_ratio(int): the down ratio from images to heatmap, 4 by default.
      regress_ltrb (bool): whether to regress left/top/right/bottom or
          width/height for a box, true by default.
class_docstr_tok: ["Postprocess","the","model","outputs","to","get","final","prediction",":","1",".","Do","NMS","for","heatmap","to","get","top","`","max_per_img","`","bboxes",".","2",".","Decode","bboxes","using","center","offset","and","box","size",".","3",".","Rescale","decoded","bboxes","reference","to","the","origin","image","shape",".","Args",":","max_per_img","(","int",")",":","the","maximum","number","of","predicted","objects","in","a","image",",","500","by","default",".","down_ratio","(","int",")",":","the","down","ratio","from","images","to","heatmap",",","4","by","default",".","regress_ltrb","(","bool",")",":","whether","to","regress","left\/top\/right\/bottom","or","width\/height","for","a","box",",","true","by","default","."]
docstr: Select top k scores and decode to get xy coordinates. 
code: def _topk(self, scores):
      """Select top k scores and decode to get xy coordinates."""
      k = self.max_per_img
      shape_fm = paddle.shape(scores)
      shape_fm.stop_gradient = True
      cat, height, width = shape_fm[1], shape_fm[2], shape_fm[3]
      # batch size is 1
      scores_r = paddle.reshape(scores, [cat, -1])
      topk_scores, topk_inds = paddle.topk(scores_r, k)
      topk_ys = topk_inds // width
      topk_xs = topk_inds % width
  
      topk_score_r = paddle.reshape(topk_scores, [-1])
      topk_score, topk_ind = paddle.topk(topk_score_r, k)
      k_t = paddle.full(paddle.shape(topk_ind), k, dtype="int64")
      topk_clses = paddle.cast(
          paddle.floor_divide(topk_ind, k_t), "float32"
      )
  
      topk_inds = paddle.reshape(topk_inds, [-1])
      topk_ys = paddle.reshape(topk_ys, [-1, 1])
      topk_xs = paddle.reshape(topk_xs, [-1, 1])
      topk_inds = paddle.gather(topk_inds, topk_ind)
      topk_ys = paddle.gather(topk_ys, topk_ind)
      topk_xs = paddle.gather(topk_xs, topk_ind)
      return topk_score, topk_inds, topk_clses, topk_ys, topk_xs
  
imports: import numpy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from ppdet.core.workspace import register
  from ppdet.modeling.bbox_utils import nonempty_bbox
  from .transformers import bbox_cxcywh_to_xyxy
label_desc: Use image node_id 3 for calling the CenterNetPostProcess obj's underlying member method code with example usage: obj._topk(scores) and returns: topk_score,  topk_inds,  topk_clses,  topk_ys,  topk_xs