LDSR-S2
LDSR-S2 provides 4× super-resolution of Sentinel-2 RGB–NIR imagery, from 10 m to a nominal 2.5 m output grid. This repository hosts the weights for OpenSR.
V1 remains the canonical, recommended checkpoint: opensr-ldsrs2_v1_0_0.ckpt. Package defaults, demos and the HPC launcher continue to select v1.
V2 is a research preview, available only by explicit selection. It has not established better or equal quality overall compared with v1. The fast 3-step sampler trades detail for speed; it is not a general quality upgrade.
Checkpoints
| File | Status and purpose |
|---|---|
| opensr-ldsrs2_v1_0_0.ckpt | Canonical v1; recommended for inference and as the default fine-tuning initializer |
| opensr-ldsrs2_v2_0_0_preview.ckpt | Research preview; 21k EMA inference weights and configuration (~676 MB) |
| opensr-ldsrs2_v2_0_0_preview_full.ckpt | Research preview; original full Lightning training state (~2.04 GB) |
V2 fine-tunes v1 on SEN2NAIP v2 cross-sensor pairs with a frozen autoencoder. The selected EMA checkpoint is from 21,000 optimizer updates. Its supplied experimental recipe uses DPM-Solver++ 2M, 3 steps and back-projection.
The preview rename changes no weights. The v2.0.0-preview revision identifies the preview filenames and documentation. Earlier v2.0.0 and v2.0.0-inference tags are retained as historical snapshots, not current stable-release recommendations. Model, dataset and software versions are separate.
Input and output
- Input: floating-point Sentinel-2 L2A reflectance, approximately
[0, 1], in R, G, B, NIR order: B04, B03, B02, B08. - Shape:
4 × H × WorB × 4 × H × W. A 128 × 128 input patch is a practical starting point. - Output: four bands at
4H × 4W, preserving the input batch convention. - Prepare calibrated reflectance and handle cloud/nodata masks before inference. Do not pass raw digital numbers without their appropriate scaling and offsets.
The model handles tensors; georeferencing, raster tiling and stitching belong in the surrounding processing pipeline, such as opensr-utils.
Quick start — canonical v1
Install a PyTorch build appropriate for your hardware, then:
pip install opensr-model huggingface_hub
from pathlib import Path
import torch
import opensr_model
from omegaconf import OmegaConf
from huggingface_hub import hf_hub_download
config = OmegaConf.load(Path(opensr_model.__file__).parent / "configs/config_10m.yaml")
checkpoint = hf_hub_download(
"simon-donike/RS-SR-LTDF", filename="opensr-ldsrs2_v1_0_0.ckpt"
)
model = opensr_model.SRLatentDiffusion(
config, device="cuda" if torch.cuda.is_available() else "cpu"
)
model.load_pretrained(checkpoint)
model.eval()
# rgbn is your floating-point [4,H,W] or [B,4,H,W] reflectance tensor.
with torch.inference_mode():
sr = model(rgbn.to(model.device))
Sampling settings come from your installed package/config; checkpoint choice is separate. See the inference guide for sampler options.
Try the v2 research preview explicitly
Use the pinned public implementation for the preview sampler and checkpoint metadata support:
pip install "opensr-model @ git+https://github.com/ESAOpenSR/opensr-model.git@8e0422df71be686504570ff91a656c2698d7c2bd" huggingface_hub
from huggingface_hub import snapshot_download
folder = snapshot_download(
repo_id="simon-donike/RS-SR-LTDF",
revision="v2.0.0-preview",
allow_patterns=["opensr-ldsrs2_v2_0_0_preview.ckpt", "v2.0.0/*", "LICENSE.md", "README.md"],
local_dir="ldsr-s2-v2-preview",
)
python ldsr-s2-v2-preview/v2.0.0/example.py --input input.pt --output sr.pt
# Optional slower sampler:
python ldsr-s2-v2-preview/v2.0.0/example.py --input input.pt --output sr.pt --sampler ddim --steps 100
The files under v2.0.0/ are preview-only: config, example, provenance and checksums. The example explicitly selects v2 and back-projection. Existing example_rural.pt and example_urban.pt inputs remain available.
Fine-tuning
Use v1 as the recommended starting point: set model.pretrained_checkpoint to opensr-ldsrs2_v1_0_0.ckpt and resume_checkpoint: null, with your own data and a fresh optimizer.
For experiments starting from v2, the smaller opensr-ldsrs2_v2_0_0_preview.ckpt can also initialize training. The full preview file preserves raw weights, EMA, optimizer, scaler, loops and callbacks for advanced recovery of the original training state with a compatible run setup. It is not accepted by the public inference loader and is not a portable resume bundle. See the checkpoint and training guidance and full training guide.
Intended use and limitations
Use for Earth-observation visualization, super-resolution research and downstream studies that independently validate the reconstructed imagery. Generated detail can be incorrect, omitted or hallucinated. A 2.5 m output grid is not an independent 2.5 m sensor measurement, and back-projection consistency does not establish that fine structures are real. Performance can change across geography, land cover, season and acquisition conditions. Repeated sampling measures model variability, not calibrated certainty about the scene.
License and citation
The model weights are released under the MIT License, as are the existing weights in this repository. Training datasets retain their own terms. The implementation retains the applicable OpenSR and CompVis notices.
The paper describes the original LDSR-S2 method; the v2 fine-tuning and sampling recipe are subsequent development. Please cite the method and record the checkpoint version used:
@article{donike2025trustworthy,
author = {Donike, Simon and Aybar, Cesar and G{\'o}mez-Chova, Luis and Kalaitzis, Freddie},
title = {Trustworthy Super-Resolution of Multispectral Sentinel-2 Imagery With Latent Diffusion},
journal = {IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing},
volume = {18},
pages = {6940--6952},
year = {2025},
doi = {10.1109/JSTARS.2025.3542220}
}
Developed within ESA OpenSR, with contributions from the Image Processing Laboratory at the Universitat de València and project collaborators. See the source code, paper, and OpenSR evaluation tools.