Skip to content

Commit

Permalink
Fix coordinate swap bug in IDTReeS (#683)
Browse files Browse the repository at this point in the history
* Fix coordinate swap

* Test coverage
  • Loading branch information
ashnair1 authored and adamjstewart committed Sep 3, 2022
1 parent 1044078 commit ec72bfe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions torchgeo/datasets/idtrees.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,10 @@ def _load_boxes(self, path: str) -> Tensor:
with rasterio.open(path) as f:
for geom in geoms:
coords = [f.index(x, y) for x, y in geom]
xmin = min(coord[0] for coord in coords)
xmax = max(coord[0] for coord in coords)
ymin = min(coord[1] for coord in coords)
ymax = max(coord[1] for coord in coords)
xmin = min(coord[1] for coord in coords)
xmax = max(coord[1] for coord in coords)
ymin = min(coord[0] for coord in coords)
ymax = max(coord[0] for coord in coords)
boxes.append([xmin, ymin, xmax, ymax])

tensor = torch.tensor(boxes)
Expand Down

0 comments on commit ec72bfe

Please sign in to comment.