code: def mask_to_bounding(np_image):
      if isinstance(np_image, wandb.Image):
          np_image = np.array(np_image.image)
  
      data = []
      for id_num in BDD_IDS:
          matches = np_image == id_num
          col_count = np.where(matches.sum(axis=0))[0]
          row_count = np.where(matches.sum(axis=1))[0]
  
          if len(col_count) > 1 and len(row_count) > 1:
              min_x = col_count[0] / np_image.shape[1]
              max_x = col_count[-1] / np_image.shape[1]
              min_y = row_count[0] / np_image.shape[0]
              max_y = row_count[-1] / np_image.shape[0]
  
              data.append(
                  {
                      "position": {
                          "minX": min_x,
                          "maxX": max_x,
                          "minY": min_y,
                          "maxY": max_y,
                      },
                      "class_id": id_num,
                  }
              )
      return data
  
imports: import os
  import pickle
  import shutil
  import time
  import numpy
  import wandb
  from PIL import Image
label_desc: Use image node_id 9 for calling a global function with example usage: mask_to_bounding(np_image) and returns: data