An open source tool for super resolution. You can add your own models, cost functions, feel free to open a PR!
This work has been supported by the Programme National de Télédétection Spatiale (PNTS), grant n° PNTS-2020-07
@misc{sr4rs2021,
author = {Cresson, R.},
title = {Super Resolution for Remote Sensing},
year = {2021},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/remicres/sr4rs}},
commit = {28792f2ed0b45c6f66abf9cb9cfa4a5d8e58d511}
}
The following are Sentinel-2 images processed with a model trained from pansharpened Spot-6/7 images.
Look at the entire Sentinel-2 image processed over the Montpellier area (Image is resampled in another cartographic projection, which might distord a bit the nice result!).
Blog post on MDL4EO
SR4RS needs OTBTF>=2.3 to work.
- Get the latest OTBTF docker image and enter the docker image. Use the nice and lightweight builds done by Vincent@LaTelescop (see here to see all flavours). Here is an example with the otbtf gpu:2.3-dev image, using NVIDIA runtime:
docker run -ti --runtime=nvidia registry.gitlab.com/latelescop/docker/otbtf/gpu:2.3-dev bash
- Download and unzip a pre-trained SavedModel (see this section to see available pre-trained models)
wget https://nextcloud.inrae.fr/s/JLsak68H2KYzPyG/download
unzip download
- Clone SR4RS
git clone https://github.com/remicres/sr4rs.git
- Use SR4RS to create an HR image (the considered pre-trained model runs on a Sentinel-2 image, 4-channels ordered as Red, Green, Blue, Near infrared). Just download a Sentinel-2 image from ESA hub or elsewhere, then concatenate the bands in this order (for that you can use the OTB application named
otbcli_ConcatenateImages
).
python sr4rs/code/sr.py \
--savedmodel sr4rs_mini-mtp-2.5_savedmodel \
--input /path/to/some/S2_image/stacked_channels_4328_10m.tif \
--output test.tif
Here is a summary of the steps to follow.
- Generate patches images using the
PatchesExtraction
application from OTBTF, from one low-res image (LR) and one high-res image (HR) - Run
train.py
on your patches images, and generate a SavedModel - Use
sr.py
on LR image using the previously generated SavedModel
For more details, see the documentation and check the pre-trained models.