We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d789f03 commit 292865bCopy full SHA for 292865b
docs/source/scripts/generate_tfrecord.py
@@ -80,15 +80,19 @@ def xml_to_csv(path):
80
for xml_file in glob.glob(path + '/*.xml'):
81
tree = ET.parse(xml_file)
82
root = tree.getroot()
83
+ filename = root.find('filename').text
84
+ width = int(root.find('size').find('width').text)
85
+ height = int(root.find('size').find('height').text)
86
for member in root.findall('object'):
- value = (root.find('filename').text,
- int(root.find('size')[0].text),
- int(root.find('size')[1].text),
87
- member[0].text,
88
- int(member[4][0].text),
89
- int(member[4][1].text),
90
- int(member[4][2].text),
91
- int(member[4][3].text)
+ bndbox = member.find('bndbox')
+ value = (filename,
+ width,
+ height,
+ member.find('name').text,
92
+ int(bndbox.find('xmin').text),
93
+ int(bndbox.find('ymin').text),
94
+ int(bndbox.find('xmax').text),
95
+ int(bndbox.find('ymax').text),
96
)
97
xml_list.append(value)
98
column_name = ['filename', 'width', 'height',
0 commit comments