code: def update(self, inputs, outputs):
      bboxes = outputs["bbox"][:, 2:].numpy()
      scores = outputs["bbox"][:, 1].numpy()
      labels = outputs["bbox"][:, 0].numpy()
      bbox_lengths = outputs["bbox_num"].numpy()
      if bboxes.shape[0] == 1 and bboxes.sum() == 0.0:
          return
  
      gt_boxes = inputs["gt_bbox"].numpy()[0]
      gt_labels = inputs["gt_class"].numpy()[0]
      if gt_labels.shape[0] == 0:
          return
  
      correct = []
      detected = []
      for i in range(bboxes.shape[0]):
          obj_pred = 0
          pred_bbox = bboxes[i].reshape(1, 4)
          # Compute iou with target boxes
          iou = bbox_iou_np_expand(pred_bbox, gt_boxes, x1y1x2y2=True)[
              0
          ]
          # Extract index of largest overlap
          best_i = np.argmax(iou)
          # If overlap exceeds threshold and classification is correct mark as correct
          if (
              iou[best_i] > self.overlap_thresh
              and obj_pred == gt_labels[best_i]
              and best_i not in detected
          ):
              correct.append(1)
              detected.append(best_i)
          else:
              correct.append(0)
  
      # Compute Average Precision (AP) per class
      target_cls = list(gt_labels.T[0])
      AP, AP_class, R, P = ap_per_class(
          tp=correct,
          conf=scores,
          pred_cls=np.zeros_like(scores),
          target_cls=target_cls,
      )
      self.AP_accum_count += np.bincount(AP_class, minlength=1)
      self.AP_accum += np.bincount(AP_class, minlength=1, weights=AP)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import copy
  import sys
  import math
  from collections import defaultdict
  import numpy
  from ppdet.modeling.bbox_utils import bbox_iou_np_expand
  from .map_utils import ap_per_class
  from .metrics import Metric
  from .munkres import Munkres
  from ppdet.utils.logger import setup_logger
label_desc: Use image node_id 3 for calling the JDEDetMetric obj's underlying member method code with example usage: obj.update(inputs, outputs) without return types