Skip to content

Commit

Permalink
Fix dtype, remove unnecessary conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjstewart committed Jul 9, 2022
1 parent 025001e commit eb1f061
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torchgeo/datasets/reforestree.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def _load_image(self, path: str) -> Tensor:
the image
"""
with Image.open(path) as img:
array: "np.typing.NDArray[np.int_]" = np.array(img.convert("RGB"))
array: "np.typing.NDArray[np.uint8]" = np.array(img)
tensor = torch.from_numpy(array)
# Convert from HxWxC to CxHxW
tensor = tensor.permute((2, 0, 1))
Expand Down

0 comments on commit eb1f061

Please sign in to comment.