def modify_label_name(input_path):
    data_paths = [os.path.join(input_path, s) for s in ['train_data']]
    print('Parsing annotation files')
    for data_path in data_paths:
        annot_path = os.path.join(data_path, 'Annotations')
        annots = [os.path.join(annot_path, s) for s in os.listdir(annot_path)]
        for annot in annots:
            try:
                et = ET.parse(annot)
                element = et.getroot()
                element_objs = element.findall('object')
                for element_obj in element_objs:
                    node = element_obj.find('name')
                    print(node.text)
                    class_name = element_obj.find('name').text
                    if (class_name == 'mn-zgl-pz-cmw-250ml'):
                        node.text = 'mn-zgl-hz-cmw-250ml'
                    print(node.text)
                write_xml(et, annot)
            except Exception as e:
                print('Exception in pascal_voc_parser: {}'.format(e))
                continue
def modify_label_name(input_path):
    data_paths = [os.path.join(input_path, s) for s in ['train_data']]
    print('Parsing annotation files')
    for data_path in data_paths:
        annot_path = os.path.join(data_path, 'Annotations')
        annots = [os.path.join(annot_path, s) for s in os.listdir(annot_path)]
        for annot in annots:
            try:
                et = ET.parse(annot)
                element = et.getroot()
                element_objs = element.findall('object')
                for element_obj in element_objs:
                    node = element_obj.find('name')
                    print(node.text)
                    class_name = element_obj.find('name').text
                    if (class_name == 'mn-zgl-pz-cmw-250ml'):
                        node.text = 'mn-zgl-hz-cmw-250ml'
                    print(node.text)
                write_xml(et, annot)
            except Exception as e:
                print('Exception in pascal_voc_parser: {}'.format(e))
                continue