未验证 提交 8dd34643 编写于 作者: E Edward Yang 提交者: GitHub

Update voc.py (#5407)

Updated voc.py in case error occurs when xml file contains self closing node <difficult/>.
上级 188b0559
...@@ -143,7 +143,7 @@ class VOCDataSet(DetDataset): ...@@ -143,7 +143,7 @@ class VOCDataSet(DetDataset):
# user dataset may not contain difficult field # user dataset may not contain difficult field
_difficult = obj.find('difficult') _difficult = obj.find('difficult')
_difficult = int( _difficult = int(
_difficult.text) if _difficult is not None else 0 _difficult.text) if _difficult is not None and _difficult.text is not None else 0
x1 = float(obj.find('bndbox').find('xmin').text) x1 = float(obj.find('bndbox').find('xmin').text)
y1 = float(obj.find('bndbox').find('ymin').text) y1 = float(obj.find('bndbox').find('ymin').text)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册