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

IDTReeS - Clip boxes outside of image bounds #760

Merged
merged 16 commits into from
Sep 7, 2022
1 change: 1 addition & 0 deletions torchgeo/datasets/idtrees.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ def _load_boxes(self, path: str) -> Tensor:
boxes.append([xmin, ymin, xmax, ymax])

tensor = torch.tensor(boxes)
tensor = torch.clamp(tensor, min=0, max=self.image_size[0])
isaaccorley marked this conversation as resolved.
Show resolved Hide resolved
return tensor

def _load_target(self, path: str) -> Tensor:
Expand Down