def modify2_label_name(input_path):
    print('Parsing annotation files')
    annot_path = input_path
    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')
                class_name = element_obj.find('name').text
                if (class_name == 'yd-ydmtcqscm-pz-cmw-56g'):
                    print(node.text)
                    print(annot)
                    node.text = 'yd-ydwtkxt-pz-qscmw-56g'
                elif (class_name == 'htk-tls-dz-hd-288g'):
                    print(node.text)
                    print(annot)
                    node.text = 'htk-tls-dz-hdw-288g'
                    print(node.text)
                elif (class_name == 'hwd-hwdfbm-tz-hxw-75g'):
                    print(node.text)
                    print(annot)
                    node.text = 'hwd-hwdfbm-tz-hxw-84g'
                    print(node.text)
                elif (class_name == 'df-dfqkl-dz-zrqkl--43g'):
                    print(node.text)
                    print(annot)
                    node.text = 'df-dfqkl-dz-zrqkl-43g'
                    print(node.text)
            write_xml(et, annot)
        except Exception as e:
            print('Exception in pascal_voc_parser: {}'.format(e))
            continue
def modify2_label_name(input_path):
    print('Parsing annotation files')
    annot_path = input_path
    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')
                class_name = element_obj.find('name').text
                if (class_name == 'yd-ydmtcqscm-pz-cmw-56g'):
                    print(node.text)
                    print(annot)
                    node.text = 'yd-ydwtkxt-pz-qscmw-56g'
                elif (class_name == 'htk-tls-dz-hd-288g'):
                    print(node.text)
                    print(annot)
                    node.text = 'htk-tls-dz-hdw-288g'
                    print(node.text)
                elif (class_name == 'hwd-hwdfbm-tz-hxw-75g'):
                    print(node.text)
                    print(annot)
                    node.text = 'hwd-hwdfbm-tz-hxw-84g'
                    print(node.text)
                elif (class_name == 'df-dfqkl-dz-zrqkl--43g'):
                    print(node.text)
                    print(annot)
                    node.text = 'df-dfqkl-dz-zrqkl-43g'
                    print(node.text)
            write_xml(et, annot)
        except Exception as e:
            print('Exception in pascal_voc_parser: {}'.format(e))
            continue