parameters: (filename)
return_statement: return objects
docstring: parse pascal voc record into a dictionary
      :param filename: xml file path
      :return: list of dict
docstring_summary: parse pascal voc record into a dictionary
      :param filename: xml file path
      :return: list of dict
docstring_tokens: parse pascal voc record into a dictionary : param filename : xml file path : return : list of dict
function: def parse_voc_rec(filename):
      """
      parse pascal voc record into a dictionary
      :param filename: xml file path
      :return: list of dict
      """
      import xml.etree.ElementTree as ET
      tree = ET.parse(filename)
      objects = []
      for obj in tree.findall('object'):
          obj_dict = dict()
          obj_dict['name'] = obj.find('name').text
          obj_dict['difficult'] = int(obj.find('difficult').text)
          bbox = obj.find('bndbox')
          obj_dict['bbox'] = [int(float(bbox.find('xmin').text)),
                              int(float(bbox.find('ymin').text)),
                              int(float(bbox.find('xmax').text)),
                              int(float(bbox.find('ymax').text))]
          objects.append(obj_dict)
      return objects
function_tokens: def parse_voc_rec ( filename ) : import xml . etree . ElementTree as ET tree = ET . parse ( filename ) objects = [ ] for obj in tree . findall ( 'object' ) : obj_dict = dict ( ) obj_dict [ 'name' ] = obj . find ( 'name' ) . text obj_dict [ 'difficult' ] = int ( obj . find ( 'difficult' ) . text ) bbox = obj . find ( 'bndbox' ) obj_dict [ 'bbox' ] = [ int ( float ( bbox . find ( 'xmin' ) . text ) ) , int ( float ( bbox . find ( 'ymin' ) . text ) ) , int ( float ( bbox . find ( 'xmax' ) . text ) ) , int ( float ( bbox . find ( 'ymax' ) . text ) ) ] objects . append ( obj_dict ) return objects