code: def bbox_wandb(
      bbox: BBox, label_id: int, label_name: str, score=None
  ) -> dict:
      """Return a wandb compatible dictionary with bbox, label and score"""
      xmin, ymin, xmax, ymax = map(int, bbox.xyxy)
  
      box_data = {
          "position": {
              "minX": xmin,
              "maxX": xmax,
              "minY": ymin,
              "maxY": ymax,
          },
          "class_id": int(label_id),
          "domain": "pixel",
      }
  
      if score:
          score = int(score * 100)
          box_caption = f"{label_name} ({score}%)"
          box_data["score"] = score
      else:
          box_caption = label_name
  
      box_data["box_caption"] = box_caption
  
      return box_data
  
file_path: icevision/icevision/visualize/wandb_img.py
imports: from typing import List
  import wandb
  from icevision import BaseRecord, BBox
  from icevision.data.prediction import Prediction
label_desc: Use image node_id 2 for calling a global function with example usage: bbox_wandb(bbox, label_id, label_name, score) and returns: box_data