mirror of
https://github.com/qurator-spk/sbb_pixelwise_segmentation.git
synced 2025-06-10 04:10:04 +02:00
modifying xml parsing
This commit is contained in:
parent
785033536a
commit
4640d9f2dc
1 changed files with 2 additions and 2 deletions
|
@ -122,7 +122,7 @@ def get_images_of_ground_truth(gt_list, dir_in, output_dir, output_type, config_
|
||||||
## to do: add footnote to text regions
|
## to do: add footnote to text regions
|
||||||
for index in tqdm(range(len(gt_list))):
|
for index in tqdm(range(len(gt_list))):
|
||||||
#try:
|
#try:
|
||||||
tree1 = ET.parse(dir_in+'/'+gt_list[index])
|
tree1 = ET.parse(dir_in+'/'+gt_list[index], parser = ET.XMLParser(encoding = 'iso-8859-5'))
|
||||||
root1=tree1.getroot()
|
root1=tree1.getroot()
|
||||||
alltags=[elem.tag for elem in root1.iter()]
|
alltags=[elem.tag for elem in root1.iter()]
|
||||||
link=alltags[0].split('}')[0]+'}'
|
link=alltags[0].split('}')[0]+'}'
|
||||||
|
@ -658,7 +658,7 @@ def find_new_features_of_contours(contours_main):
|
||||||
return cx_main, cy_main, x_min_main, x_max_main, y_min_main, y_max_main, y_corr_x_min_from_argmin
|
return cx_main, cy_main, x_min_main, x_max_main, y_min_main, y_max_main, y_corr_x_min_from_argmin
|
||||||
def read_xml(xml_file):
|
def read_xml(xml_file):
|
||||||
file_name = Path(xml_file).stem
|
file_name = Path(xml_file).stem
|
||||||
tree1 = ET.parse(xml_file)
|
tree1 = ET.parse(xml_file, parser = ET.XMLParser(encoding = 'iso-8859-5'))
|
||||||
root1=tree1.getroot()
|
root1=tree1.getroot()
|
||||||
alltags=[elem.tag for elem in root1.iter()]
|
alltags=[elem.tag for elem in root1.iter()]
|
||||||
link=alltags[0].split('}')[0]+'}'
|
link=alltags[0].split('}')[0]+'}'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue