code: def update(self, inputs, outputs):
      outs = {}
      # outputs Tensor -> numpy.ndarray
      for k, v in outputs.items():
          outs[k] = v.numpy() if isinstance(v, paddle.Tensor) else v
  
      # multi-scale inputs: all inputs have same im_id
      if isinstance(inputs, typing.Sequence):
          im_id = inputs[0]["im_id"]
      else:
          im_id = inputs["im_id"]
      outs["im_id"] = (
          im_id.numpy() if isinstance(im_id, paddle.Tensor) else im_id
      )
  
      infer_results = get_infer_results(
          outs, self.clsid2catid, bias=self.bias
      )
      self.results["bbox"] += (
          infer_results["bbox"] if "bbox" in infer_results else []
      )
      self.results["mask"] += (
          infer_results["mask"] if "mask" in infer_results else []
      )
      self.results["segm"] += (
          infer_results["segm"] if "segm" in infer_results else []
      )
      self.results["keypoint"] += (
          infer_results["keypoint"]
          if "keypoint" in infer_results
          else []
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import sys
  import json
  import paddle
  import numpy
  import typing
  from collections import defaultdict
  from pathlib import Path
  from .map_utils import prune_zero_padding, DetectionMAP
  from .coco_utils import get_infer_results, cocoapi_eval
  from .widerface_utils import face_eval_run
  from ppdet.data.source.category import get_categories
  from ppdet.modeling.rbox_utils import poly2rbox_np
  from ppdet.utils.logger import setup_logger
label_desc: Use image node_id 3 for calling the COCOMetric obj's underlying member method code with example usage: obj.update(inputs, outputs) without return types