code: def get_bounding_boxes(img_file, annot_file):
      srcRaster = gdal.Open(img_file)
      targetSR = osr.SpatialReference()
      targetSR.ImportFromWkt(srcRaster.GetProjectionRef())
      geomTransform = srcRaster.GetGeoTransform()
  
      dataSource = ogr.Open(annot_file, 0)
      layer = dataSource.GetLayer()
  
      building_id = 0
      buildinglist = []
  
      for feature in layer:
          geom = feature.GetGeometryRef()
          geom_wkt_list = geoPolygonToPixelPolygonWKT(
              geom, img_file, targetSR, geomTransform
          )
  
          for geom_wkt in geom_wkt_list:
              building_id += 1
              buildinglist.append(
                  ogr.CreateGeometryFromWkt(geom_wkt[0]).GetEnvelope()
              )
  
      return buildinglist
  
imports: from osgeo import gdal, osr, ogr
  import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: get_bounding_boxes(img_file, annot_file) and returns: buildinglist