(path)
return bndboxs, (size['height'], size['width'])
Read bbox for voc xml
        Return:
            bbox:[y,x,height, width], shape: (height, width)
Read bbox for voc xml
        Return:
            bbox:[y,x,height, width], shape: (height, width)
Read bbox for voc xml Return : bbox : [ y x height width ] shape : ( height width )
def read_bbox_xml(path):
        """
        Read bbox for voc xml
        Return:
            bbox:[y,x,height, width], shape: (height, width)
        """
        with open(filename, 'r') as reader:
            xml = reader.read()
        soup = BeautifulSoup(xml, 'xml')
        size = {}
        for tag in soup.size:
            if tag.string != "\n":
                size[tag.name] = int(tag.string)
        objects = soup.find_all('object')
        bndboxs = []
        for obj in objects:
            bndbox = {}
            for tag in obj.bndbox:
                if tag.string != '\n':
                    bndbox[tag.name] = int(tag.string)

            bbox = [bndbox['ymin'], bndbox['xmin'], bndbox['ymax']-bndbox['ymin'], bndbox['xmax']-bndbox['xmin']]
            bndboxs.append(bbox)
        #print(bndboxs, size)
        return bndboxs, (size['height'], size['width'])
def read_bbox_xml ( path ) : with open ( filename , 'r' ) as reader : xml = reader . read ( ) soup = BeautifulSoup ( xml , 'xml' ) size = { } for tag in soup . size : if tag . string != "\n" : size [ tag . name ] = int ( tag . string ) objects = soup . find_all ( 'object' ) bndboxs = [ ] for obj in objects : bndbox = { } for tag in obj . bndbox : if tag . string != '\n' : bndbox [ tag . name ] = int ( tag . string ) bbox = [ bndbox [ 'ymin' ] , bndbox [ 'xmin' ] , bndbox [ 'ymax' ] - bndbox [ 'ymin' ] , bndbox [ 'xmax' ] - bndbox [ 'xmin' ] ] bndboxs . append ( bbox ) #print(bndboxs, size) return bndboxs , ( size [ 'height' ] , size [ 'width' ] )