The unified package to use all functionalities
This package provides the entry-point for SR product generation. It can take any SR model and perform patched SR on Sen2 inputs, both for the RGB-NIR bands to create the high frequencies, as well as for the 20m bands in order to profit from the created frequencies.
pip install sen2sr
The model and weigths from. the paper “Trustworthy Super-Resolution of Multispectral Sentinel-2 Imagery with Latent Diffusion” are packaged up in this repository, making it possible to use the latent-diffusion model in your applications.
pip install opensr-model
This repository allows the user to ingest Sentinel-2 “.SAFE”-format images or large geotiffs, superresolve them with any given model. The prediction is multi-GPU optimized using Pytorch Lightning. The package creates a product which is (a) histogram- matched to the LR image, (b) patched to discard border pixels with possible artifacts (c) overlapped on the edges of image patches, weighted on the distance from the edge of each pixel to avoid patching artifacts
pip install opensr-utils
A package to build LR-HR image dataset for super-resolution, using dedicated downgrading kernels to approximate the degradation funcitons between Sentinel-2 and HR sensors.
pip install opensr-degradation
A collection of SISR and MISR datasets, built using S2 and NAIP iamge pairs. The images are carefully degraded to approximate the actual downgrading function.
from huggingface_hub import hf_hub_download
hf_hub_download(
repo_id="isp-uv-es/SEN2NAIP",
repo_type="dataset",
filename="cross-sensor/cross-sensor.zip")
A collection of validation utils, meant to accept segmentation and object detection models trained on LR/HR/SR imagery in order to compute accuracy metrics for different tasks.
!pip install opensr-usecases
from opensr_usecases import Validator
val_obj = Validator(output_folder="data_folder")
val_obj.run_predictions(dataloader_lr, lr_model)
val_obj.calculate_segmentation_metrics(pred_type="LR", threshold=0.75)
val_obj.calculate_object_detection_metrics(pred_type="LR", threshold=0.75)
val_obj.print_segmentation_metrics(save_csv=True)