Datasets:

License:
The dataset viewer is not available for this subset.
Job manager crashed while running this job (missing heartbeats).

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

SEN2NAIP

The increasing demand for high spatial resolution in remote sensing imagery has led to the necessity of super-resolution (SR) algorithms that convert low-resolution (LR) images into high-resolution (HR) ones. To address this need, we introduce SEN2NAIP, a large remote sensing dataset designed to support conventional and reference-based SR model training. SEN2NAIP is structured into two components to provide a broad spectrum of research and application needs. The first component comprises a cross-sensor dataset of 2,851 pairs of LR images from Sentinel-2 L2A and HR images from the National Agriculture Imagery Program (NAIP). Leveraging this dataset, we developed a degradation model capable of converting NAIP images to match the characteristics of Sentinel-2 imagery (S2like). Subsequently, this degradation model was utilized to create the second component, a synthetic dataset comprising 17,657 NAIP and S2like image pairs. With the SEN2NAIP dataset, we aim to provide a valuable resource that facilitates the exploration of new techniques for enhancing the spatial resolution of Sentinel-2 satellite imagery.

DOWNLOAD DATASET

from huggingface_hub import hf_hub_download

# Donwload cross-sensor dataset
hf_hub_download(
    repo_id="isp-uv-es/SEN2NAIP",
    repo_type="dataset",
    filename="cross-sensor/cross-sensor.zip"
)

# Donwload synthetic dataset
for i in range(1, 19):
    hf_hub_download(
        repo_id="isp-uv-es/SEN2NAIP",
        repo_type="dataset",
        filename="synthetic/synthetic_%02d.zip" % i
    )

REPRODUCIBLE EXAMPLES

Load cross-sensor dataset

import rioxarray
import torch

DEMO_PATH = "https://huggingface.co/datasets/isp-uv-es/SEN2NAIP/resolve/main/demo/"

cross_sensor_path = DEMO_PATH + "cross-sensor/ROI_0000/"
hr_data = rioxarray.open_rasterio(cross_sensor_path + "hr.tif")
lr_data = rioxarray.open_rasterio(cross_sensor_path + "lr.tif")
hr_torch = torch.from_numpy(hr_data.to_numpy()) / 255
lr_torch = torch.from_numpy(lr_data.to_numpy()) / 10000

Load Synthetic dataset

Available methods: vae_histogram_matching, vae_histogram_matching, gamma_multivariate_normal_90, gamma_multivariate_normal_75, gamma_multivariate_normal_50, gamma_multivariate_normal_25, gamma_multivariate_normal_10.

import opensr_degradation
import rioxarray
import datasets
import requests
import tempfile
import torch
import json


def load_metadata(metadata_path: str) -> dict:
    tmpfile = tempfile.NamedTemporaryFile(suffix=".json")
    with requests.get(metadata_path) as response:
        with open(tmpfile.name, "wb") as file:
            file.write(response.content)
        metadata_json = json.load(open(tmpfile.name, "r"))
    return metadata_json

DEMO_PATH = "https://huggingface.co/datasets/isp-uv-es/SEN2NAIP/resolve/main/demo/"

# Synthetic LR and HR data ------------------------------
synthetic_path = DEMO_PATH + "synthetic/ROI_0001/"

hr_early_data = rioxarray.open_rasterio(synthetic_path + "early/01__m_4506807_nw_19_1_20110818.tif")
hr_early_torch = torch.from_numpy(hr_early_data.to_numpy()) / 255
hr_early_metadata = load_metadata(synthetic_path + "late/metadata.json")
lr_hat, hr_hat = opensr_degradation.main.get_s2like(
    image=hr_early_torch,
    table=hr_early_metadata["sim_histograms"],
    model="gamma_multivariate_normal_50"
)


import matplotlib.pyplot as plt
fig, ax = plt.subplots(1, 3, figsize=(10, 5))
ax[0].imshow(hr_early_torch[[3, 1, 2]].permute(1, 2, 0))
ax[0].set_title("NAIP")
ax[1].imshow(hr_hat[[3, 1, 2]].permute(1, 2, 0)*3)
ax[1].set_title("NAIPhat")
ax[2].imshow(lr_hat[[3, 1, 2]].permute(1, 2, 0)*3)
ax[2].set_title("S2like")
plt.show()

CITATION

TODO!

Downloads last month
104