NBUDataset#

class deepinv.datasets.NBUDataset(root_dir: str | Path, satellite: str = 'gaofen-1', return_pan: bool = False, transform_ms: Callable | None = None, transform_pan: Callable | None = None, download: bool = False)[source]#

Bases: Dataset

NBU remote sensing multispectral satellite imagery dataset.

Returns Cx256x256 multispectral (MS) satellite images of urban scenes from 6 different satellites. with C=4 for "gaofen-1" and C=8 for the rest.

For pan-sharpening problems, you can return pan-sharpening measurements by using return_pan=True, outputting a deepinv.utils.TensorList of (MS, PAN) where PAN are 1024x1024 panchromatic images.

This dataset was compiled in A Large-Scale Benchmark Data Set for Evaluating Pansharpening Performance and downloaded from this drive. We perform no other processing other than to take the “Urban” subset and provide each satellite’s data separately, which you can choose using the satellite argument:

  • "gaofen-1": 5 images

  • "ikonos": 60 images

  • "quickbird": 150 images

  • "worldview-2": 150 images

  • "worldview-3": 55 images

  • "worldview-4": 90 images

Note

Returns images as torch.Tensor normalised to 0-1 over the whole dataset.


Examples:

Instantiate dataset and download raw data from the Internet

from deepinv.datasets import NBUDataset
dataset = NBUDataset(
    root_dir=".",            # root directory
    satellite="worldview-2", # choose satellite
    download=True,           # download dataset
    return_pan=True          # return panchromatic image too as pair (MS, PAN)
)
print(dataset.check_dataset_exists())
print(len(dataset))
Parameters:
  • root_dir (str, Path) – NBU dataset root directory

  • satellite (str) – satellite name, choose from the options above, defaults to “gaofen-1”.

  • return_pan (bool) – if True, return panchromatic images as TensorList of (MS, PAN), if False, just return multispectral images.

  • transform_ms (Callable) – optional transform for multispectral images

  • transform_pan (Callable) – optional transform for panchromatic images

  • download (bool) – whether to download dataset

check_dataset_exists()[source]#

Verify that the image folders exist and contain all the images.

root_dir should have the following structure:

root_dir --- nbu --- <satellite> --- 1.mat
          |       |               |
          |       |               -- x.mat
          |       -- <satellite>
          -- xxx

Examples using NBUDataset:#

Remote sensing with satellite images

Remote sensing with satellite images