Skip to content

Commit

Permalink
mypy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsleh committed Apr 7, 2022
1 parent 318e753 commit f03026d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions torchgeo/datasets/forestdamage.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ def parse_pascal_voc(path: str) -> Dict[str, Any]:
int(bndbox.find("xmax").text), # type: ignore[union-attr, arg-type]
int(bndbox.find("ymax").text), # type: ignore[union-attr, arg-type]
]
if obj.find("damage") is not None:
label = obj.find("damage").text # type: ignore[union-attr]

label_var = obj.find("damage")
if label_var is not None:
label = label_var.text
else:
label = "other"
bboxes.append(bbox)
Expand Down

0 comments on commit f03026d

Please sign in to comment.