code: def get_final_preds(
      batch_heatmaps: torch.Tensor,
      trans: list = None,
      post_processing: bool = False,
  ):
      assert trans is not None
      coords, maxvals = get_max_preds(batch_heatmaps)
  
      heatmap_height = batch_heatmaps.shape[2]
      heatmap_width = batch_heatmaps.shape[3]
  
      # post-processing
      if post_processing:
          for n in range(coords.shape[0]):
              for p in range(coords.shape[1]):
                  hm = batch_heatmaps[n][p]
                  px = int(math.floor(coords[n][p][0] + 0.5))
                  py = int(math.floor(coords[n][p][1] + 0.5))
                  if (
                      1 < px < heatmap_width - 1
                      and 1 < py < heatmap_height - 1
                  ):
                      diff = torch.tensor(
                          [
                              hm[py][px + 1] - hm[py][px - 1],
                              hm[py + 1][px] - hm[py - 1][px],
                          ]
                      ).to(batch_heatmaps.device)
                      coords[n][p] += torch.sign(diff) * 0.25
  
      preds = coords.clone().cpu().numpy()
  
      # Transform back
      for i in range(coords.shape[0]):
          preds[i] = affine_points(preds[i], trans[i])
  
      return preds, maxvals.cpu().numpy()
  
imports: import math
  import random
  from typing import Tuple
  import cv2
  import numpy
  import torch
  from torchvision.transforms import functional
  import matplotlib.pyplot
label_desc: Use image node_id 5 for calling a global function with example usage: get_final_preds(batch_heatmaps, trans, post_processing) and returns: preds,  maxvals