Skip to content

Commit

Permalink
removes unnecessary casting to int
Browse files Browse the repository at this point in the history
  • Loading branch information
TCherici committed Jul 18, 2022
1 parent d13d9b3 commit e16b731
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions torchgeo/datasets/geo.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,12 +611,12 @@ def __getitem__(self, query: BoundingBox) -> Dict[str, Any]:
)
if shapes:
masks = rasterio.features.rasterize(
shapes, out_shape=(int(round(height)), int(round(width))), transform=transform
shapes, out_shape=(round(height), round(width)), transform=transform
)
else:
# If no features are found in this query, return an empty mask
# with the default fill value and dtype used by rasterize
masks = np.zeros((int(round(height)), int(round(width))), dtype=np.uint8)
masks = np.zeros((round(height), round(width)), dtype=np.uint8)

sample = {"mask": torch.tensor(masks), "crs": self.crs, "bbox": query}

Expand Down

0 comments on commit e16b731

Please sign in to comment.