From 800b6b2e39fad2fb99bbf1af407c8f103ce3bf45 Mon Sep 17 00:00:00 2001 From: Ashwin Nair Date: Fri, 5 Apr 2024 17:00:40 +0400 Subject: [PATCH] Wrap Lambda in ImageSequential --- torchgeo/models/swin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/torchgeo/models/swin.py b/torchgeo/models/swin.py index db7751922ba..a44e70ab2c6 100644 --- a/torchgeo/models/swin.py +++ b/torchgeo/models/swin.py @@ -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)), # type: ignore[arg-type] + K.ImageSequential(Lambda(lambda x: torch.clamp(x, min=0.0, max=1.0))), 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)), # type: ignore[arg-type] + K.ImageSequential(Lambda(lambda x: torch.clamp(x, min=0.0, max=1.0))), data_keys=None, )