Files
琉璃月光 67883f1a50 最新推送
2026-03-10 14:14:14 +08:00

12 lines
345 B
Python

import xml.etree.ElementTree as ET
# 读取 XML 文件
tree = ET.parse('annotations.xml')
root = tree.getroot()
# 清空所有 polygon 的 points 属性
for polygon in root.iter('polygon'):
polygon.set('points', '')
# 保存回文件(或另存为新文件)
tree.write('annotations_cleared.xml', encoding='utf-8', xml_declaration=True)