|
@@ -128,7 +128,10 @@ class VOCDetection(Dataset):
|
|
|
gt_class[i][0] = cname2cid[cname]
|
|
gt_class[i][0] = cname2cid[cname]
|
|
|
pattern = re.compile('<difficult>', re.IGNORECASE)
|
|
pattern = re.compile('<difficult>', re.IGNORECASE)
|
|
|
diff_tag = pattern.findall(str(ET.tostringlist(obj)))[0][1:-1]
|
|
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)
|
|
pattern = re.compile('<bndbox>', re.IGNORECASE)
|
|
|
box_tag = pattern.findall(str(ET.tostringlist(obj)))[0][1:-1]
|
|
box_tag = pattern.findall(str(ET.tostringlist(obj)))[0][1:-1]
|
|
|
box_element = obj.find(box_tag)
|
|
box_element = obj.find(box_tag)
|