|
1 |
| -# L1BSR-GUI |
2 |
| -Graphical interface for Self-Supervised SISR for Sentinel-2 L1B Imagery |
| 1 | +# Sentinel-2 Super-Resolution GUI |
| 2 | + |
| 3 | +A simple, user-friendly desktop application to increase the resolution of Sentinel-2 satellite images. |
| 4 | + |
| 5 | +This tool takes the standard 10-meter Blue, Green, Red, and Near-Infrared (NIR) bands and uses a pre-trained AI model to create a higher-resolution, 2x upscaled image. It's designed for users who want to easily enhance their satellite imagery without complex command-line tools. |
| 6 | + |
| 7 | + |
| 8 | +*(Your screenshot here. Just replace the link!)* |
| 9 | + |
| 10 | +*** |
| 11 | + |
| 12 | +## TL;DR (For the Impatient) |
| 13 | + |
| 14 | +1. **Install stuff**: `pip install pyqt5 torch safetensors rasterio pillow numpy` |
| 15 | +2. **Get the Model**: Download the `REC_Real_L1B.safetensors` file (you'll need to find this from the original project or a trusted source). |
| 16 | +3. **Run the App**: `python l1bsr_sr_gui_updated.py` |
| 17 | +4. **Load Data**: Select the model file and your four Sentinel-2 band files (B02, B03, B04, B08). |
| 18 | +5. **Process**: Click the "Process" button. |
| 19 | +6. **Save**: Save your beautiful new high-resolution image as a GeoTIFF or a JPG. |
| 20 | + |
| 21 | +*** |
| 22 | + |
| 23 | +## Features |
| 24 | + |
| 25 | +* **2x Super-Resolution**: Upscales 10m Sentinel-2 bands (B02, B03, B04, B08) to a higher resolution. |
| 26 | +* **Graphical User Interface**: No command line needed! A simple point-and-click interface. |
| 27 | +* **Interactive Preview**: |
| 28 | + * See a large preview of your final, upscaled image. |
| 29 | + * **Click and hold** on the preview to instantly see the "before" image for a quick comparison. |
| 30 | + * Use the scrollbars to pan across the entire image if it's large. |
| 31 | +* **Visual Sharpening**: Optionally apply an Unsharp Mask filter to the preview and JPG output to make details pop. |
| 32 | +* **Flexible Output Formats**: |
| 33 | + * **GeoTIFF**: Save the full 4-band (B,G,R,NIR) output with all geographic data preserved. This is the best option for scientific use. |
| 34 | + * **JPG + JGW**: Save a visually-appealing 3-band (RGB) image with an accompanying world file (`.jgw`) for use in GIS software. |
| 35 | + |
| 36 | +## Requirements |
| 37 | + |
| 38 | +You will need Python 3 and the following libraries, which can be installed easily using `pip`: |
| 39 | + |
| 40 | +``` |
| 41 | +pip install pyqt5 torch safetensors rasterio pillow numpy |
| 42 | +``` |
| 43 | +**For GPU Acceleration (Optional but Recommended)**: If you have an NVIDIA graphics card, make sure you install a version of PyTorch that supports CUDA. This will make the processing significantly faster. |
| 44 | + |
| 45 | +## How to Use |
| 46 | + |
| 47 | +1. **Place the Model File**: For convenience, create a folder named `trained_models` in the same directory as the script and place the `REC_Real_L1B.safetensors` file inside it. The app will find it automatically on startup. |
| 48 | + ``` |
| 49 | + - your_project_folder/ |
| 50 | + |- l1bsr_sr_gui_updated.py (this script) |
| 51 | + |- trained_models/ |
| 52 | + |- REC_Real_L1B.safetensors |
| 53 | + ``` |
| 54 | + If you place the model elsewhere, you can select it manually using the "Browse..." button. |
| 55 | +
|
| 56 | +2. **Launch the Application**: Run the script from your terminal: |
| 57 | + ```bash |
| 58 | + python l1bsr_sr_gui_updated.py |
| 59 | + ``` |
| 60 | +
|
| 61 | +3. **Select Input Bands**: Click the "Select B02...", "Select B03...", etc., buttons to load your four input GeoTIFF files. A small preview of each band will appear. The files must have the same dimensions and geographic projection. |
| 62 | +
|
| 63 | +4. **Process the Image**: Click the big **"Process (2x Super-Resolution)"** button. Wait a few moments (it will be much faster with a GPU). When it's done, the upscaled RGB preview will appear in the output window. |
| 64 | +
|
| 65 | +5. **Preview and Sharpen**: |
| 66 | + * Click and hold the mouse on the output image to compare it with the original. |
| 67 | + * To make the image look sharper, check the "Sharpen" box and adjust the slider. This only affects the preview and the final JPG, not the scientific GeoTIFF data. |
| 68 | +
|
| 69 | +6. **Save Your Output**: |
| 70 | + * Click **"Save as GeoTIFF..."** to save the pure, 4-band scientific data. |
| 71 | + * Click **"Save as JPG + JGW..."** to save a visually-ready 3-band image for reports or simple GIS viewing. |
| 72 | +
|
| 73 | +## Attribution and License |
| 74 | +
|
| 75 | +This application's user interface and workflow are built upon the core model and concepts from the **L1BSR project**. The AI model architecture (`RCAN`) and processing logic are derived from their original work. |
| 76 | +
|
| 77 | +* **Original Repository**: [https://github.com/centreborelli/L1BSR](https://github.com/centreborelli/L1BSR) |
| 78 | +
|
| 79 | +This work, like the original it is based on, is licensed under the **GNU General Public License v3.0**. |
0 commit comments