You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OSCD is a change detection dataset. OSCDDataset.__getitem__ returns an "image" of shape [2 x C x H x W]. Most of our other datasets return images of shape [C x H x W], and SemanticSegmentationTask is designed to work with these kind of images. It looks like there are some hacks in OSCDDataModule to work around this, but these hacks are very unreliable. For example, in:
mask=repeat(sample["mask"], "h w -> t h w", t=2).float()
image, mask=self.rcrop(sample["image"], mask)
mask=mask.squeeze()[0]
images.append(image.squeeze())
masks.append(mask.long())
we use squeeze() without specifying which dimension to remove. This has different behavior when batch size is 1 vs >1, so we should avoid using this.
To fix this, I think we could either change __getitem__ to return an "image" of shape [2C x H x W] or create a new ChangeDetectionTask for these kinds of datasets.
See the following comments for additional discussion/issues:
OSCD is a change detection dataset.
OSCDDataset.__getitem__
returns an "image" of shape [2 x C x H x W]. Most of our other datasets return images of shape [C x H x W], andSemanticSegmentationTask
is designed to work with these kind of images. It looks like there are some hacks inOSCDDataModule
to work around this, but these hacks are very unreliable. For example, in:we use
squeeze()
without specifying which dimension to remove. This has different behavior when batch size is 1 vs >1, so we should avoid using this.To fix this, I think we could either change
__getitem__
to return an "image" of shape [2C x H x W] or create a newChangeDetectionTask
for these kinds of datasets.See the following comments for additional discussion/issues:
The text was updated successfully, but these errors were encountered: