docstr: get predictions from score maps
  
  Args:
      heatmaps: numpy.ndarray([batch_size, num_joints, height, width])
  
  Returns:
      preds: numpy.ndarray([batch_size, num_joints, 2]), keypoints coords
      maxvals: numpy.ndarray([batch_size, num_joints, 2]), the maximum confidence of the keypoints
docstr_tok: ["get","predictions","from","score","maps","Args",":","heatmaps",":","numpy.ndarray","(","[","batch_size",",","num_joints",",","height",",","width","]",")","Returns",":","preds",":","numpy.ndarray","(","[","batch_size",",","num_joints",",","2","]",")",",","keypoints","coords","maxvals",":","numpy.ndarray","(","[","batch_size",",","num_joints",",","2","]",")",",","the","maximum","confidence","of","the","keypoints"]
code: def get_max_preds(self, heatmaps):
      """get predictions from score maps
  
      Args:
          heatmaps: numpy.ndarray([batch_size, num_joints, height, width])
  
      Returns:
          preds: numpy.ndarray([batch_size, num_joints, 2]), keypoints coords
          maxvals: numpy.ndarray([batch_size, num_joints, 2]), the maximum confidence of the keypoints
      """
      assert isinstance(
          heatmaps, np.ndarray
      ), "heatmaps should be numpy.ndarray"
      assert heatmaps.ndim == 4, "batch_images should be 4-ndim"
  
      batch_size = heatmaps.shape[0]
      num_joints = heatmaps.shape[1]
      width = heatmaps.shape[3]
      heatmaps_reshaped = heatmaps.reshape((batch_size, num_joints, -1))
      idx = np.argmax(heatmaps_reshaped, 2)
      maxvals = np.amax(heatmaps_reshaped, 2)
  
      maxvals = maxvals.reshape((batch_size, num_joints, 1))
      idx = idx.reshape((batch_size, num_joints, 1))
  
      preds = np.tile(idx, (1, 1, 2)).astype(np.float32)
  
      preds[:, :, 0] = (preds[:, :, 0]) % width
      preds[:, :, 1] = np.floor((preds[:, :, 1]) / width)
  
      pred_mask = np.tile(np.greater(maxvals, 0.0), (1, 1, 2))
      pred_mask = pred_mask.astype(np.float32)
  
      preds *= pred_mask
  
      return preds, maxvals
  
imports: from scipy.optimize import linear_sum_assignment
  from collections import abc, defaultdict
  import cv2
  import numpy
  import math
  import paddle
  import paddle.nn
  from keypoint_preprocess import get_affine_mat_kernel, get_affine_transform
label_desc: Use image node_id 3 for calling the HRNetPostProcess obj's underlying member method code with example usage: obj.get_max_preds(heatmaps) and returns: preds,  maxvals