提交 691e1851 编写于 作者: S sunyanfang01

for difficult voc xml

上级 5d59995c
......@@ -128,7 +128,10 @@ class VOCDetection(Dataset):
gt_class[i][0] = cname2cid[cname]
pattern = re.compile('<difficult>', re.IGNORECASE)
diff_tag = pattern.findall(str(ET.tostringlist(obj)))[0][1:-1]
_difficult = int(obj.find(diff_tag).text)
try:
_difficult = int(obj.find(diff_tag).text)
except Exception:
_difficult = 0
pattern = re.compile('<bndbox>', re.IGNORECASE)
box_tag = pattern.findall(str(ET.tostringlist(obj)))[0][1:-1]
box_element = obj.find(box_tag)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册