code: def get_infer_results(outs, catid, bias=0):
      """
      Get result at the stage of inference.
      The output format is dictionary containing bbox or mask result.
  
      For example, bbox result is a list and each element contains
      image_id, category_id, bbox and score.
      """
      if outs is None or len(outs) == 0:
          raise ValueError(
              "The number of valid detection result if zero. Please use reasonable model and check input data."
          )
  
      im_id = outs["im_id"]
  
      infer_res = {}
      if "bbox" in outs:
          if len(outs["bbox"]) > 0 and len(outs["bbox"][0]) > 6:
              infer_res["bbox"] = get_det_poly_res(
                  outs["bbox"],
                  outs["bbox_num"],
                  im_id,
                  catid,
                  bias=bias,
              )
          else:
              infer_res["bbox"] = get_det_res(
                  outs["bbox"],
                  outs["bbox_num"],
                  im_id,
                  catid,
                  bias=bias,
              )
  
      if "mask" in outs:
          # mask post process
          infer_res["mask"] = get_seg_res(
              outs["mask"], outs["bbox"], outs["bbox_num"], im_id, catid
          )
  
      if "segm" in outs:
          infer_res["segm"] = get_solov2_segm_res(outs, im_id, catid)
  
      if "keypoint" in outs:
          infer_res["keypoint"] = get_keypoint_res(outs, im_id)
          outs["bbox_num"] = [len(infer_res["keypoint"])]
  
      if "pose3d" in outs:
          infer_res["pose3d"] = get_pose3d_res(outs, im_id)
          outs["bbox_num"] = [len(infer_res["pose3d"])]
  
      return infer_res
  
file_path: PaddleDetection/ppdet/metrics/coco_utils.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import sys
  import numpy
  import itertools
  from ppdet.metrics.json_results import get_det_res, get_det_poly_res, get_seg_res, get_solov2_segm_res, get_keypoint_res, get_pose3d_res
  from ppdet.metrics.map_utils import draw_pr_curve
  from ppdet.utils.logger import setup_logger
label_desc: Use image node_id 1 for calling a global function with example usage: get_infer_results(outs, catid, bias) and returns: infer_res