Skip to content

Commit

Permalink
mypy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ashnair1 committed Jan 10, 2024
1 parent ac5f80e commit 14acc85
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion torchgeo/datasets/vhr10.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ def _load_image(self, id_: int) -> Tensor:
)
with Image.open(filename) as img:
array: "np.typing.NDArray[np.int_]" = np.array(img)
tensor = torch.from_numpy(array).float()
tensor = torch.from_numpy(array)
tensor = tensor.float()
# Convert from HxWxC to CxHxW
tensor = tensor.permute((2, 0, 1))
return tensor
Expand Down

0 comments on commit 14acc85

Please sign in to comment.