Skip to content

Commit

Permalink
Fix parse error in XMLDataset (open-mmlab#4729)
Browse files Browse the repository at this point in the history
  • Loading branch information
yeliudev authored Mar 15, 2021
1 parent f3bc86b commit f2aa584
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mmdet/datasets/xml_style.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def get_ann_info(self, idx):
if name not in self.CLASSES:
continue
label = self.cat2label[name]
difficult = int(obj.find('difficult').text)
difficult = obj.find('difficult')
difficult = 0 if difficult is None else int(difficult.text)
bnd_box = obj.find('bndbox')
# TODO: check whether it is necessary to use int
# Coordinates may be float type
Expand Down

0 comments on commit f2aa584

Please sign in to comment.