Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix coordinate swap bug in IDTReeS #683

Merged
merged 2 commits into from
Jul 21, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix coordinate swap
  • Loading branch information
ashnair1 authored Jul 21, 2022
commit e83d90362937bd2500322fbe4e359b8a23f6ce7c
8 changes: 4 additions & 4 deletions torchgeo/datasets/idtrees.py
Original file line number Diff line number Diff line change
@@ -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)