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

models: Switch to kornia AugmentationSequential #1979

Merged
merged 5 commits into from
Apr 5, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
mypy-fix
ashnair1 committed Apr 5, 2024
commit e480cce3c5719322ebcdbab19051073b750a4aa0
4 changes: 2 additions & 2 deletions torchgeo/models/swin.py
Original file line number Diff line number Diff line change
@@ -31,14 +31,14 @@
_mean = torch.zeros_like(_std)
_sentinel2_ms_satlas_transforms = K.AugmentationSequential(
K.Normalize(mean=_mean, std=_std),
Lambda(lambda x: torch.clamp(x, min=0.0, max=1.0)),
Lambda(lambda x: torch.clamp(x, min=0.0, max=1.0)), # type: ignore[arg-type]
adamjstewart marked this conversation as resolved.
Show resolved Hide resolved
data_keys=None,
)

# Satlas Landsat imagery is 16-bit, normalized by clipping some pixel N with (N-4000)/16320 to (0, 1). # noqa: E501
_landsat_satlas_transforms = K.AugmentationSequential(
K.Normalize(mean=torch.tensor(4000), std=torch.tensor(16320)),
Lambda(lambda x: torch.clamp(x, min=0.0, max=1.0)),
Lambda(lambda x: torch.clamp(x, min=0.0, max=1.0)), # type: ignore[arg-type]
data_keys=None,
)