class_docstr: refer to
  https://github.com/leoxiaobin/deep-high-resolution-net.pytorch
  Copyright (c) Microsoft, under the MIT License.
class_docstr_tok: ["refer","to","https",":","\/\/github.com\/leoxiaobin\/deep-high-resolution-net.pytorch","Copyright","(","c",")","Microsoft",",","under","the","MIT","License","."]
code: def get_final_results(self, preds, all_boxes, img_path):
      _kpts = []
      for idx, kpt in enumerate(preds):
          _kpts.append(
              {
                  "keypoints": kpt,
                  "center": all_boxes[idx][0:2],
                  "scale": all_boxes[idx][2:4],
                  "area": all_boxes[idx][4],
                  "score": all_boxes[idx][5],
                  "image": int(img_path[idx]),
              }
          )
      # image x person x (keypoints)
      kpts = defaultdict(list)
      for kpt in _kpts:
          kpts[kpt["image"]].append(kpt)
  
      # rescoring and oks nms
      num_joints = preds.shape[1]
      in_vis_thre = self.in_vis_thre
      oks_thre = self.oks_thre
      oks_nmsed_kpts = []
      for img in kpts.keys():
          img_kpts = kpts[img]
          for n_p in img_kpts:
              box_score = n_p["score"]
              kpt_score = 0
              valid_num = 0
              for n_jt in range(0, num_joints):
                  t_s = n_p["keypoints"][n_jt][2]
                  if t_s > in_vis_thre:
                      kpt_score = kpt_score + t_s
                      valid_num = valid_num + 1
              if valid_num != 0:
                  kpt_score = kpt_score / valid_num
              # rescoring
              n_p["score"] = kpt_score * box_score
  
          keep = oks_nms(
              [img_kpts[i] for i in range(len(img_kpts))], oks_thre
          )
  
          if len(keep) == 0:
              oks_nmsed_kpts.append(img_kpts)
          else:
              oks_nmsed_kpts.append([img_kpts[_keep] for _keep in keep])
  
      self._write_coco_keypoint_results(oks_nmsed_kpts)
  
imports: import os
  import json
  from collections import defaultdict, OrderedDict
  import numpy
  import paddle
  from pycocotools.coco import COCO
  from pycocotools.cocoeval import COCOeval
  from ..modeling.keypoint_utils import oks_nms, keypoint_pck_accuracy, keypoint_auc, keypoint_epe
  from scipy.io import loadmat, savemat
  from ppdet.utils.logger import setup_logger
label_desc: Use image node_id 6 for calling the KeyPointTopDownCOCOEval obj's underlying member method code with example usage: obj.get_final_results(preds, all_boxes, img_path) without return types