Skip to content

Super-resolution of 10 Sentinel-2 bands to 5-meter resolution, starting from L1C or L2A (Theia format) products.

License

Notifications You must be signed in to change notification settings

Evoland-Land-Monitoring-Evolution/sentinel2_superresolution

Repository files navigation

sentinel2_superresolution

Generate 5m super-resolved images from Sentinel-2 L2A (Theia) products (bands B02, B03, B04, B05, B06, B07, B08, B8A, B11 and B12) using Single Image Super-Resolution model trained in the frame of the EVOLAND Horizon Europe.

The network has been trained in the course of the project using the Sen2Venµs dataset, complimented with B11 and B12 patches.

Michel, J.; Vinasco-Salinas, J.; Inglada, J.; Hagolle, O. SEN2VENµS, a Dataset for the Training of Sentinel-2 Super-Resolution Algorithms. Data 2022, 7, 96. https://doi.org/10.3390/data7070096

Installation

CPU inference

Installing the tool should then be straightforward with pip :

$ pip install git+https://framagit.org/jmichel-otb/sentinel2_superresolution.git

Additional steps for GPU inference

In order to perform GPU inference (using the --gpu command-line switch), first make sure that the following package are installed:

  • cuda-python

You can then install gpu support with:

$ pip install "sentinel2_superresolution[gpu] @ git+https://github.com/Evoland-Land-Monitoring-Evolution/sentinel2_superresolution.git"

Usage

Pixel rows / columns region of interest

Example of use with a pixel (rows / columns of the 10m input image) ROI :

$ sentinel2_superesolution -v -i SENTINEL2A_20200808-105933-164_L2A_T31TCG_C_V2-2/ -o results/  --bicubic -roip 2000 2000 2500 2500

Note the --bicubic flag, that allows to also generate a bicubic-upsampled image to 5 meters in order to compare with the SISR result.

UTM coordinates region of interest

Example of use with a UTM (coordinates of the product) ROI:

$ sentinel2_superesolution -v -i SENTINEL2A_20200808-105933-164_L2A_T31TCG_C_V2-2/ -o results/  --bicubic -roi 300160.000 4590400.000 304000.000 4594240.000

Note the --bicubic flag, that allows to also generate a bicubic-upsampled image to 5 meters in order to compare with the SISR result.

Using L1C product as input

$ sentinel2_superesolution -i S2B_MSIL1C_20231126T105309_N0509_R051_T31TCJ_20231126T113937.SAFE/ -roip 0 0 512 512 --l1c -o results/

Note: Do not forget the --l1c flag, as the tool will not detect the product format automatically.

Inference on GPU

sentinel2_superesolution -i SENTINEL2B_20230219-105857-687_L2A_T31TCJ_C_V3-1 -o resumts/ --gpu

Add the --gpu switch. If there are no GPUs available or correctly configured, the tool will fallback to CPU inference.

Frequently asked Questions

Here is a list of questions that have been frequently asked.

Bands order

Bands in output image follow the following order: B2, B3, B4, B8, B5, B6, B7, B8A, B11, B12

L2A only

Processed bands are the FRE variants (Flat Reflectence).

L1C only

Upon reading of the product, sensorsio applies the -1000 radiometric offset depending on the product version.

FileNotFoundError : Could not find root XML file

If you encounter the following:

raise FileNotFoundError(
FileNotFoundError: Could not find root XML file in product directory data/S2B_MSIL2A_20240424T054639_N0510_R048_T43SCS_20240424T080948.SAFE****

It is likely that you are trying to process Sen2corr L2A. Currently sentinel2_superresolution only supports Theia L2A products from https://theia.cnes.fr.

Inference time for full products

Here are orders of magnitude for full products inference time:

CPU (1 core)CPU (8 cores)GPU (A100)
L1C6 hours1 hour6 minutes
L2A5 hours50 minutes5 minutes

Credits

  • This work was partly performed using HPC resources from GENCI-IDRIS (Grant 2023-AD010114835)
  • This work was partly performed using HPC resources from CNES.

About

Super-resolution of 10 Sentinel-2 bands to 5-meter resolution, starting from L1C or L2A (Theia format) products.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages