code: def get_weighted_box(boxes, conf_type="avg"):
      box = np.zeros(8, dtype=np.float32)
      conf = 0
      conf_list = []
      w = 0
      for b in boxes:
          box[4:] += b[1] * b[4:]
          conf += b[1]
          conf_list.append(b[1])
          w += b[2]
      box[0] = boxes[0][0]
      if conf_type in (
          "avg",
          "box_and_model_avg",
          "absent_model_aware_avg",
      ):
          box[1] = conf / len(boxes)
      elif conf_type == "max":
          box[1] = np.array(conf_list).max()
      box[2] = w
      box[3] = -1
      box[4:] /= conf
  
      return box
  
file_path: mmdetection/mmdet/models/utils/wbf.py
imports: import warnings
  from typing import Tuple
  import numpy
  import torch
  from torch import Tensor
label_desc: Use image node_id 3 for calling a global function with example usage: get_weighted_box(boxes, conf_type) and returns: box