Code Monkey home page Code Monkey logo

sr4rs's Introduction

SR4RS

An open source tool for super resolution. You can add your own models, cost functions, feel free to open a PR!

Super Resolution for Remote Sensing

This work has been supported by the Programme National de Télédétection Spatiale (PNTS), grant n° PNTS-2020-07

Cite

@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}
}

Representative images

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!).

Read more

Blog post on MDL4EO

How to use?

SR4RS needs OTBTF>=2.3 to work.

Quick HR image generation using pre-trained model

  1. 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
  1. 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
  1. Clone SR4RS
git clone https://github.com/remicres/sr4rs.git
  1. 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

Train a model

Here is a summary of the steps to follow.

  1. Generate patches images using the PatchesExtraction application from OTBTF, from one low-res image (LR) and one high-res image (HR)
  2. Run train.py on your patches images, and generate a SavedModel
  3. Use sr.py on LR image using the previously generated SavedModel

For more details, see the documentation and check the pre-trained models.

sr4rs's People

Contributors

remicres avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.