Skip to content

Commit

Permalink
ruff format
Browse files Browse the repository at this point in the history
  • Loading branch information
keves1 committed Jan 8, 2025
1 parent 97f17ca commit 59ddd79
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions torchgeo/datasets/oscd.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ def __init__(
root: Path = 'data',
split: str = 'train',
bands: Sequence[str] = all_bands,
transforms: Callable[[dict[str, Tensor]],
dict[str, Tensor]] | None = None,
transforms: Callable[[dict[str, Tensor]], dict[str, Tensor]] | None = None,
download: bool = False,
checksum: bool = False,
) -> None:
Expand Down Expand Up @@ -185,8 +184,7 @@ def _load_files(self) -> list[dict[str, str | Sequence[str]]]:
def get_image_paths(ind: int) -> list[str]:
return sorted(
glob.glob(
os.path.join(images_root, region,
f'imgs_{ind}_rect', '*.tif')
os.path.join(images_root, region, f'imgs_{ind}_rect', '*.tif')
),
key=sort_sentinel2_bands,
)
Expand Down Expand Up @@ -225,8 +223,7 @@ def _load_image(self, paths: Sequence[Path]) -> Tensor:
for path in paths:
with Image.open(path) as img:
images.append(np.array(img))
array: np.typing.NDArray[np.int_] = np.stack(
images, axis=0).astype(np.int_)
array: np.typing.NDArray[np.int_] = np.stack(images, axis=0).astype(np.int_)
tensor = torch.from_numpy(array).float()
return tensor

Expand Down

0 comments on commit 59ddd79

Please sign in to comment.