code: def get_mean_confidence_map(
      classes: List, confidence: List, class_id_to_label: Dict
  ) -> Dict[str, float]:
      """Get Mean-confidence map from the predictions to be logged into a `wandb.Table`."""
      confidence_map = {v: [] for _, v in class_id_to_label.items()}
      for class_idx, confidence_value in zip(classes, confidence):
          confidence_map[class_id_to_label[class_idx]].append(
              confidence_value
          )
      updated_confidence_map = {}
      for label, confidence_list in confidence_map.items():
          if len(confidence_list) > 0:
              updated_confidence_map[label] = sum(
                  confidence_list
              ) / len(confidence_list)
          else:
              updated_confidence_map[label] = 0
      return updated_confidence_map
  
file_path: wandb/wandb/integration/ultralytics/bbox_utils.py
imports: from typing import Any, Dict, List, Optional, Tuple, Union
  import torch
  from ultralytics.engine.results import Results
  from ultralytics.models.yolo.detect import DetectionPredictor
  import wandb
label_desc: Use image node_id 3 for calling a global function with example usage: get_mean_confidence_map(classes, confidence, class_id_to_label) and returns: updated_confidence_map