code: def get_bbox_from_bool_mask(bool_mask):
      """
      Generate voc bbox ([xmin, ymin, xmax, ymax]) from given bool_mask (2D np.ndarray)
      """
      rows = np.any(bool_mask, axis=1)
      cols = np.any(bool_mask, axis=0)
  
      if not np.any(rows) or not np.any(cols):
          return None
  
      ymin, ymax = np.where(rows)[0][[0, -1]]
      xmin, xmax = np.where(cols)[0][[0, -1]]
      width = xmax - xmin
      height = ymax - ymin
  
      if width == 0 or height == 0:
          return None
  
      return [xmin, ymin, xmax, ymax]
  
imports: import copy
  import os
  import random
  import time
  from typing import List, Optional, Union
  import cv2
  import numpy
  import requests
  from PIL import Image
  from sahi.utils.file import Path
label_desc: Use image node_id 13 for calling a global function with example usage: get_bbox_from_bool_mask(bool_mask) and returns: list, None, None