Giter VIP home page Giter VIP logo

satlas-super-resolution's Introduction

Satlas Super Resolution

Satlas aims to provide open AI-generated geospatial data that is highly accurate, available globally, and updated on a frequent (monthly) basis. One of the data applications in Satlas is globally generated Super-Resolution imagery for 2023.

animated animated

We describe the many findings that led to the global super-resolution outputs in the paper, Zooming Out on Zooming In: Advancing Super-Resolution for Remote Sensing. Supplementary material is available here.

This repository contains the training and inference code for the AI-generated Super-Resolution data found at https://satlas.allen.ai/, as well as code, data, and model weights corresponding to the paper.

The experiments branch contains config files for experiments from the paper, while the main branch is limited to showcasing the main features.

Installation

Initialize conda:

conda create --name ssr python==3.9
conda activate ssr
pip install -r requirements.txt
conda install gdal

Download

Data

There are two training sets:

  • The urban set (train_urban_set), with ~1.1 million pairs from locations within a 5km radius of cities in the USA with a population >= 50k. There are 12 Sentinel-2 bands included in this set. Download links: part1 part2 part3 part4
  • The full set (train_full_set), consisting of ~44million pairs from all locations where NAIP imagery was available between 2019-2020. The full set, in the data format established prior to 2023-12-08, can be downloaded at this link.

The urban set (termed S2-NAIP) was used for all experiments in the paper, because we found the full set to be overwhelmed with monotonous landscapes.

There are three val/test sets:

  • The validation set (val_set) consists of 8192 image pairs. There are 12 Sentinel-2 bands included in this set. (download)
  • A small subset of this validation set (small_val_set) with 256 image pairs that are specifically from urban areas, which is useful for qualititive analysis and faster validation. (download)
  • A test set (test_set) containing eight 16x16 grids of Sentinel-2 tiles from interesting locations including Dry Tortugas National Park, Bolivia, France, South Africa, and Japan. (download)

Additional data includes:

  • A set of NAIP images from 2016-2018 corresponding to the train_urban_set and small_val_set NAIP images (old-naip). These are used as input to the discriminator for the model variant described in supplementary Section A.5.2. (download)
  • JSON files containing tile weights for the train_urban_set and train_full_set (train_tile_weights). Using OpenStreetMap categories, we count the number of tiles where each category appears at least once and then weight tiles by the inverse frequency of the rarest category appearing in that tile. (download)
  • For train_urban_set, there is a JSON file with mappings between each NAIP chip and polygons of OpenStreetMap categories in that chip (osm_chips_to_masks.json). This is used for the object-discriminator variation described in supplementary Section A.5.1. (download)
  • RRDBNet weights from a model pretrained on SatlasPretrain. Used in experiment described in supplementary Section A.5.3. (download)

All of the above data (except for the full training set due to size) can be downloaded at this link, or individual links are provided above for ease of downloading.

HuggingFace

The train_urban_set, split into many partitions, val_set, and test_set are available for download on HuggingFace as well.

Model Weights

Weights from models trained on the S2-NAIP dataset are listed below.

ESRGAN

Varying number of input Sentinel-2 images (just RGB bands):

Number Input Images Weights Config
1 1-S2-images esrgan_baseline_1S2.yml
2 2-S2-images esrgan_baseline_2S2.yml
4 4-S2-images esrgan_baseline_4S2.yml
8 8-S2-images esrgan_baseline.yml
16 16-S2-images esrgan_baseline_16S2.yml

Different Sentinel-2 bands used as input (8 input images):

Bands Weights Config
10m 10m-S2-bands esrgan_baseline_10m.yml
20m 20m-S2-bands esrgan_baseline_20m.yml
60m 60m-S2-bands esrgan_baseline_60m.yml

SRCNN & HighResNet

S2-NAIP Dataset Structure

The dataset consists of image pairs from Sentinel-2 and NAIP satellites, where a pair is a time series of Sentinel-2 images that overlap spatially and temporally [within 3 months] with a NAIP image. The imagery is from 2019-2020 and is limited to the USA.

The images adhere to the same Web-Mercator tile system as in SatlasPretrain.

NAIP

The NAIP images included in this dataset are 25% of the original NAIP resolution. Each image is 128x128px with RGB channels.

In each set, there is a naip folder containing images in this format: naip/{image_uuid}/{tile}/rgb.png, where image_uuid is the image's unique identifier with the capture timestamp, and tile refers to its location in a 2^17 x 2^17 Web-Mercator grid (ex. 12345_67890).

Sentinel-2

We use the Sentinel-2 L1C imagery. Models that input 3 bands use the TCI file provided by ESA. This contains an 8-bit image that has been normalized by ESA to the 0-255 range. The image is normalized for input to the model by dividing the 0-255 RGB values by 255, and retaining the RGB order. Most experiments utilize just TCI, but for non-TCI bands, the 16-bit source data is divided by 8160 and clipped to 0-1.

For each NAIP image, there is a time series of corresponding 32x32px Sentinel-2 images. These time series are saved as pngs in the shape, [number_sentinel2_images * 32, 32, 3]. Note that the input images do not need to be in chronological order.

In each set, there is a sentinel2 folder containing these time series in the format: sentinel2/{tile}/{band}.png, where tile refers to its location in a 2^17 x 2^17 Web-Mercator grid (ex. 12345_67890) and band refers to the Sentinel-2 bands (tci, b01, b05, b06, b07, b08, b09, b10, b11, b12).

How to Process Raw Sentinel-2 Data

For each image, use the TCI.jp2 file and use the following code to process it in the same way as the S2-NAIP dataset:

import rasterio

tci_jp2_path = 'path/to/TCI.jp2'
with rasterio.open(tci_jp2_path) as src:
    img_rep, meta_rep = reproject_image(
        img, meta, rasterio.crs.CRS.from_epsg(3857), resolution=(9.555, 9.555), resampling=rasterio.warp.Resampling.bilinear)

with rasterio.open(tci_jp2_path.replace('.jp2', '_rep.jp2', 'w', **meta_rep) as dst:
    dst.write(img_rep)

Model

In the paper, we experiment with SRCNN, HighResNet, SR3, and ESRGAN. For a good balance of output quality and inference speed, we use the ESRGAN model for generating global super-resolution outputs.

Our ESRGAN model is an adaptation of the original ESRGAN, with changes that allow the input to be a time series of Sentinel-2 images. All models are trained to upsample by a factor of 4.

The SR3 diffusion model code has lived in a separate repository. We are working to release that as well.

Training

To train a model on this dataset, run the following command, with the desired configuration file:

python -m ssr.train -opt ssr/options/esrgan_s2naip_urban.yml

There are several sample configuration files in ssr/options/. Make sure the configuration file specifies correct paths to your downloaded data, the desired number of low-resolution input images, model parameters, and pretrained weights (if applicable).

Add the --debug flag to the above command if wandb logging, model saving, and visualization creation is not wanted.


To train with multiple GPUs, use the following command:

PYTHONPATH=. python -m torch.distributed.launch --nproc_per_node=8 --master_port=1234 ssr/train.py -opt ssr/options/esrgan_s2naip_urban.yml --launcher pytorch

Testing

To evaluate the model on a validation or test set, when ground truth high-res images are available, run the following command, with the desired configuration file:

python -m ssr.test -opt ssr/options/esrgan_s2naip_urban.yml

This will test the model using data and parameters specified in ['datasets']['test'], and will save the model outputs as pngs in the results/ directory. Specified metrics will be displayed to the screen at the end.

Inference

To run inference on data, when ground truth high-res images are not available, run the following command:

python -m ssr.infer -opt ssr/options/infer_example.yml

Inference settings are specified in the configuration file. The data_dir can be of any directory structure, but must contain pngs. Both the original low-res images and the super-res images will be saved to the save_path.


When running inference on an entire Sentinel-2 tile (consisting of a 16x16 grid of chunks), there is the infer_grid.py script that will stitch the individual chunks together into one large image.

Try this out on the S2NAIP test set with this command:

python -m ssr.infer_grid -opt ssr/options/infer_grid_example.yml

Accuracy

There are instances where the generated super resolution outputs are incorrect.

Specifically:

  1. Sometimes the model generates vessels in the water or cars on a highway, but because the input is a time series of Sentinel-2 imagery (which can span a few months), it is unlikely that those things persist in one location.

  1. Sometimes the model generates natural objects like trees or bushes where there should be a building, or vice versa. This is more common in places that look vastly different from the USA, such as the example below in Kota, India.

Acknowledgements

Thanks to these codebases for foundational Super-Resolution code and inspiration:

BasicSR

Real-ESRGAN

Image Super-Resolution via Iterative Refinement (SR3)

WorldStrat

Contact

If you have any questions, please email [email protected] or open an issue.

satlas-super-resolution's People

Contributors

piperwolters avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

satlas-super-resolution's Issues

Multi-gpu training

Hi, is the command for running script on multi-gpu correct?
I am getting some problems in the beggining of the training phase. I want to train it on 2 gpus.

After this command "PYTHONPATH=. python -m torch.distributed.launch --nproc_per_node=2 --master_port=1234 ssr/train.py -opt ssr/options/esrgan_s2naip_urban.yml --launcher pytorch" I get:

/trinity/home/park.yunseok/.local/lib/python3.8/site-packages/torch/distributed/launch.py:181: FutureWarning: The module torch.distributed.launch is deprecated
and will be removed in future. Use torchrun.
Note that --use-env is set by default in torchrun.
If your script expects --local-rank argument to be set, please
change it to read from os.environ['LOCAL_RANK'] instead. See
https://pytorch.org/docs/stable/distributed.html#launch-utility for
further instructions

warnings.warn(
[2024-03-22 21:56:50,850] torch.distributed.run: [WARNING]
[2024-03-22 21:56:50,850] torch.distributed.run: [WARNING] *****************************************
[2024-03-22 21:56:50,850] torch.distributed.run: [WARNING] Setting OMP_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable for optimal performance in your application as needed.
[2024-03-22 21:56:50,850] torch.distributed.run: [WARNING] *****************************************
[W socket.cpp:436] [c10d] The server socket cannot be initialized on [::]:4321 (errno: 97 - Address family not supported by protocol).
[W socket.cpp:663] [c10d] The client socket cannot be initialized to connect to [localhost]:4321 (errno: 97 - Address family not supported by protocol).
/trinity/home/park.yunseok/.local/lib/python3.8/site-packages/torchvision/transforms/functional_tensor.py:5: UserWarning: The torchvision.transforms.functional_tensor module is deprecated in 0.15 and will be removed in 0.17. Please don't rely on it. You probably just need to use APIs in torchvision.transforms.functional or in torchvision.transforms.v2.functional.
warnings.warn(
/trinity/home/park.yunseok/.local/lib/python3.8/site-packages/torchvision/transforms/functional_tensor.py:5: UserWarning: The torchvision.transforms.functional_tensor module is deprecated in 0.15 and will be removed in 0.17. Please don't rely on it. You probably just need to use APIs in torchvision.transforms.functional or in torchvision.transforms.v2.functional.
warnings.warn(
usage: train.py [-h] -opt OPT [--launcher {none,pytorch,slurm}]
[--auto_resume] [--debug] [--local_rank LOCAL_RANK]
[--force_yml FORCE_YML [FORCE_YML ...]]
usage: train.py [-h] -opt OPT [--launcher {none,pytorch,slurm}]
[--auto_resume] [--debug] [--local_rank LOCAL_RANK]
[--force_yml FORCE_YML [FORCE_YML ...]]
train.py: error: unrecognized arguments: --local-rank=1
train.py: error: unrecognized arguments: --local-rank=0
[2024-03-22 21:57:00,889] torch.distributed.elastic.multiprocessing.api: [ERROR] failed (exitcode: 2) local_rank: 0 (pid: 4154405) of binary: /trinity/home/park.yunseok/.conda/envs/ssr/bin/python
Traceback (most recent call last):
File "/trinity/home/park.yunseok/.conda/envs/ssr/lib/python3.8/runpy.py", line 192, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/trinity/home/park.yunseok/.conda/envs/ssr/lib/python3.8/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/trinity/home/park.yunseok/.local/lib/python3.8/site-packages/torch/distributed/launch.py", line 196, in
main()
File "/trinity/home/park.yunseok/.local/lib/python3.8/site-packages/torch/distributed/launch.py", line 192, in main
launch(args)
File "/trinity/home/park.yunseok/.local/lib/python3.8/site-packages/torch/distributed/launch.py", line 177, in launch
run(args)
File "/trinity/home/park.yunseok/.local/lib/python3.8/site-packages/torch/distributed/run.py", line 797, in run
elastic_launch(
File "/trinity/home/park.yunseok/.local/lib/python3.8/site-packages/torch/distributed/launcher/api.py", line 134, in call
return launch_agent(self._config, self._entrypoint, list(args))
File "/trinity/home/park.yunseok/.local/lib/python3.8/site-packages/torch/distributed/launcher/api.py", line 264, in launch_agent
raise ChildFailedError(
torch.distributed.elastic.multiprocessing.errors.ChildFailedError:

ssr/train.py FAILED

Failures:
[1]:
time : 2024-03-22_21:57:00
host : gn16.zhores
rank : 1 (local_rank: 1)
exitcode : 2 (pid: 4154406)
error_file: <N/A>
traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html

Root Cause (first observed failure):
[0]:
time : 2024-03-22_21:57:00
host : gn16.zhores
rank : 0 (local_rank: 0)
exitcode : 2 (pid: 4154405)
error_file: <N/A>
traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html

About the dataset

Hello! Your work is excellent and has inspired and helped me a lot. However, this dataset seems to be too large, can you block it up and provide download links separately?

Dear Professor, I hope this email finds you well. My name is HATIM OUDAHA and I am a final year student at IAV MOROCCO working on my end-of-studies project. The objective of my project has been remote sensing image super-resolution. In this regard, I am writing to kindly request your assistance. Given your expertise, I believe your guidance would be invaluable in helping me if you have a pretrained model, analyze the results, and draw appropriate conclusions their performance in wich area (agriculter, urban…). if you could share with me a collab to test your model in a sentinel2 moroccan dataset. I wanna use transfert learning on it if you could explain me the Steps to have a super resolution result I understand you must have many demands on your time. However, any support you could provide would be a tremendous help for the completion of my studies. Please let me know if you could help me in this study. Regards,

Inference result

Hello, I use the esrgan_orig_2S2 pretrained model to infer grid, and I copy one low resolution image
Anhui_Chaohu_2020_Spring_S2_RGB
I got the high resolution image:
QQ截图20240113172531
I have two questions: 1 Can color differences between different image grids be eliminated?
2 Why are there so many mosaics?
I hope to receive your answer! Thank you!

How to Process Raw Sentinel-2 Data

Hi Piper,
Thanks for arranging all the data descriptions and working pipelines. When I am going to infer new pics of Sentinel-2 Data, I am confused with the part of How to Process Raw Sentinel-2 Data since I did not find the reproject_image function in your repo. Are the following codes just pseudocode?
Appreciate your help,
Fang

Training ESRGAN on PROBA-V

Hello!

I'm trying to train the esrgan on proba-v dataset and I came across some questions I coudln't find in the paper.

  1. You took the dataset from the competitions, am I correct?
  2. Did you pre-train a PSNR-oriented model with the L1 loss with proba-v dataset (just like in esrgan and real-esrgan did)?
  3. In the probav_esrgan.yml I don't understand the number of input channels. in RRDBNet shouldn't the input channel be 9 since proba-v (from the competition) has only 1 channel? Why is the output channel 3? I also do not understand why the input channel for discriminator is 30.
    image

Thank you in advance.

MuS2 result

Hi,Wolters.
Did you try to run code in MuS2 dataset? I found when I use RGB bands,the results will be very bad.

PROBA-V dataset question

Hi,

My Proba-V dataset looks like the following:

  • probav
    • train
      • RED
      • NIR
    • val
      • RED
      • NIR

And the yml file:
image

When I run the script I get such problem:
image

1m high-res and NIR band

Thanks very much to the authors for making this work in the public domain. I have few questions.

1.) NAIP imagery is available in 1m but why the super resolution result is only 2.5m? Are there any technical challenges in training the model to generate 1m image?

2.) NAIP imagery also includes the NIR band. I am curious why the NIR band was not included in the super resolution process. For example, using the Sentinel-2 10m (R, G, B, NIR) as model input to get the high resolution 2.5m (R, G, B, NIR) instead of just using the RGB bands.

3.) I looked at the val_set (as it was easier to download and check) and only could see the rgb as png file inside the NAIP folder. Is there any chance to make the NIR band from NAIP available for the training data?

Thanks again!

Meaning behind the Training data's folder structure

Thanks very much to the authors for making this work in the public domain. I have few questions regarding the folder structure.

Currently the folder structure for an image looks something like this:

├───naip
│   └───m_2608053_sw_17_060_20191203
│       └───36226_55652
│               rgb.png
│
└───sentinel2
    └───36226_55652
            b01.png
            b05.png
            b06.png
            b07.png
            b08.png
            b09.png
            b10.png
            b11.png
            b12.png
            tci.png

I would like to know the meaning behind the naip folder name. I think it's safe to assume sw stands for south-west and 20191203 is the date of NAIP image (Dec 03, 2019). What about m_2608053, 17_060 and 36226_55652?

I am trying to locate the original NAIP image geographically for further analysis.

Data Normalization in Sentinel-2

Hi!,

First off, thank you so much for your effort in sharing the weights and code for SR (not many people in the field tend to do that)! Unfortunately, I am having some issues reproducing the results.

If I intend to apply the model in a fresh Sentinel-2 scene:

a) Should I use L1C or L2A data? If it's L2A, are you using Sen2Cor processing? In the https://satlas.allen.ai/map also seems like you applied a blur kernel to the Sentinel-2.

b) Did you apply any form of data normalization when converting the S2 data to .png?

Thank you very much!

https://satlas.allen.ai/map?state={%22view%22:{%22longitude%22:-113.30307090140528,%22latitude%22:44.503575173782934,%22zoom%22:14.606271409299431,%22pitch%22:0,%22bearing%22:0},%22showHeatmap%22:true,%22showAnimation%22:false,%22showSatellite%22:false,%22selectedDateOption%22:%222022-12%22,%22selectedDateOptionSecondary%22:%222016-01%22,%22selectedStartDateOption%22:%222016-01%22,%22selectedEndDateOption%22:%222022-12%22,%22selectedTreeCoverFill%22:[{%22label%22:%22None%22,%22isChecked%22:false},{%22label%22:%22Low%22,%22isChecked%22:false},{%22label%22:%22Medium%22,%22isChecked%22:true},{%22label%22:%22High%22,%22isChecked%22:true},{%22label%22:%22Full%22,%22isChecked%22:true}],%22selectedMarineInfra%22:[{%22label%22:%22Offshore%20Wind%20Turbines%22,%22isChecked%22:true},{%22label%22:%22Offshore%20Platforms%22,%22isChecked%22:false}],%22selectedRenewableEnergy%22:[{%22label%22:%22Solar%20Farms%22,%22isChecked%22:true},{%22label%22:%22Onshore%20Wind%20Turbines%22,%22isChecked%22:true}],%22selectedApplication%22:%22Super%20Resolution%22,%22selectedLayout%22:%22Single%20Map%22}

image

About logging

Hi,

Sorry for making issues with stupid questions.
I just don't know where I should ask. If I want to log the process then what should I write in "project" and "resume id"? I already have made an account in wandb, but don't know what to do with them.
image

Thank you in advance.

Adversarial loss for ESRGAN

Hi!

I see that in the paper you mentioned using ESGRAN with clip loss for optimal model for upscaling.
In the original ESRGAN paper RaGAN (Relativistic average GAN) loss is used, however your code uses a standard GAN loss. Is there a special reason why you decided to use standard GAN loss?

SSRDataset is not found!

Hi, I'm planning to run esrgan_s2naip_urban.yml, but I encountered one problem:

Name SSRDataset is not found, use name: SSRDataset_basicsr!
Traceback (most recent call last):
File "/trinity/shared/opt/python/3.8.5/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/trinity/shared/opt/python/3.8.5/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/beegfs/home/park.yunseok/satlas-super-resolution/ssr/train.py", line 182, in
train_pipeline(root_path)
File "/beegfs/home/park.yunseok/satlas-super-resolution/ssr/train.py", line 80, in train_pipeline
result = create_train_val_dataloader(opt, logger)
File "/trinity/home/park.yunseok/.local/lib/python3.8/site-packages/basicsr/train.py", line 35, in create_train_val_dataloader
train_set = build_dataset(dataset_opt)
File "/trinity/home/park.yunseok/.local/lib/python3.8/site-packages/basicsr/data/init.py", line 34, in build_dataset
dataset = DATASET_REGISTRY.get(dataset_opt['type'])(dataset_opt)
File "/trinity/home/park.yunseok/.local/lib/python3.8/site-packages/basicsr/utils/registry.py", line 71, in get
raise KeyError(f"No object named '{name}' found in '{self._name}' registry!")
KeyError: "No object named 'SSRDataset' found in 'dataset' registry!"

How can I solve such problem?
Thank you in advance

Using 4 bands (10m)

Hi!

Have you tried using 4 10m bands as input? Did you somehow preprocess the nir band cause I opened b08 band to visualise, however all values are 0.

Training time

image

Hi, can you tell me how long it took for you to train S2-NAIP on esrgan?
I'm started training with OSM discriminator & clip loss, however I'm still in 200th iteration for 2.5.

Inference

Hi! I'm trying to perform inference on Sentinel-2 imagery. I am using the esrgan_8S2.pth weights and the basic infer_example.yml for my config file. I'm obtaining my imagery from the sentinel hub, and i've combined the images to get a [number_sentinel2_images * 32, 32, 3] dimension. number_sentinel2_images in my case would be 8. I'm getting some super weird results.
Input:
output_lr

lr:

lr

Results/Hr:
sr

This is my first github issue. Let me know if you need any additional information from me!

use multi gpus to train highresnet using Probav dataset

Hi! Dear authors,when I use multi gpus to train highresnet using Probav dataset, I found a bug "RuntimeError: Function BroadcastBackward returned an invalid gradient at index 6 - got [0] but expected shape compatible with [1, 0, 3, 3]", I'm find the method to fix it. If you have solution, please tell me,thanks~

Sentinel collections and Black Images in Timeseries

Hello,

I only have access to Sentinel-l2A data for my project and am interested in applying your model. So, can I use Sentinel-2A data as input for the model?

Some of the images in my timeseries image are black:
0TCI
Will they impact the overall performance or require any special preprocessing?

Your insights on these issues would be greatly appreciated.
Thank you for your time and assistance.

Question regarding logging in wandb

Hello again,

Can you tell me in which part of the code losses are logged in wandb? And how it's logged. I understood almost the whole code, but not the part where all losses are logged.
I'm trying to change the code so that it also plots super-resolved images in wandb, so that it does not have to save the images in my computer every certain iteration. For some reason it takes a long time to save the validation results for whole small validation dataset, that's why I want to log the validation result in wandb to keep the track of the GAN (as you know it's hard to track the performance and result just based on losses).

Thank you in advance!

Extracting the train_urban_set

Hi, this might be obvious but I am struggling to extract these files. The train_urban_set contains three file

  1. train_urban_set.z01
  2. train_urban_set.z02
  3. train_urban_set.z03

How to extract these? I have tried unzip / tar.

Thanks.

Problem running probav_esrgan.yml

I'm trying to run the model and I encounter some problem:

(base) [park.yunseok@gn20 satlas-super-resolution]$ python -m ssr.train -opt ssr/options/probav_esrgan.yml
/trinity/home/park.yunseok/.local/lib/python3.8/site-packages/torchvision/transforms/functional_tensor.py:5: UserWarning: The torchvision.transforms.functional_tensor module is deprecated in 0.15 and will be removed in 0.17. Please don't rely on it. You probably just need to use APIs in torchvision.transforms.functional or in torchvision.transforms.v2.functional.
warnings.warn(
Traceback (most recent call last):
File "/trinity/shared/opt/python/3.8.5/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/trinity/shared/opt/python/3.8.5/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/beegfs/home/park.yunseok/satlas-super-resolution/ssr/train.py", line 182, in
train_pipeline(root_path)
File "/beegfs/home/park.yunseok/satlas-super-resolution/ssr/train.py", line 53, in train_pipeline
opt, args = parse_options(root_path, is_train=True)
File "/beegfs/home/park.yunseok/satlas-super-resolution/ssr/utils/options.py", line 66, in parse_options
opt['dist'] = False
TypeError: 'str' object does not support item assignment

Cannot unzip the train_dataset

Hi,

I've successfully downloaded validation and test data.
I've also download first 5 sets of train dataset from huggingface, however I cannot open the file, even with 7zip.
Can someone tell me in detail how I should access the dataset?

Thank you in advance,

Possible Inappropriate Implementation in s2-naip_dataset.py (Reshape Issue)

Hi Authors,

Thanks for make it public! I am following up on your work and have found an inappropriate code implementation that may invalidate some conclusions and findings about the number of Sentinel-2 images in your research paper. Specifically, at lines 190-191 in s2-naip_dataset.py, when it reads and reshapes the data, the result of s2_img (in line 191) blends the channels and time series together, which makes the s2_tensor unusable for time-series split with indices. Thus, the model always uses all the time-series data but only a few channels.

Here is an example: Say you have an RGB image with dimensions 3x128x32, which becomes 4x3x32x32 (TxCxHxW) after reshaping (T: Time, C: Channel, H: Height, W: Width). The desired output after reshaping should be like this:
-- For each T_i in the first dimension (each 3-channel image 3x32x32), the value is from (T_i^R, T_i^G, T_i^B) as a Sentinel-2 image;

However, the current implementation will result in the following outcomes:
-- For the 1st T_i (i=0), its 3x32x32 is from (T_0^R, T_1^G, T_2^B);
-- For the 2nd T_i (i=1), its 3x32x32 is from (T_0^G, T_1^B, T_3^R);
-- For the 3rd T_i (i=2), its 3x32x32 is from (T_0^B, T_2^R, T_3^G);
-- For the 4th T_i (i=3), its 3x32x32 is from (T_1^R, T_2^G, T_3^B);

In this case, a 3x32x32 array is not a Sentinel-2 image for a specific time, but a non-meaningful channel combination.

The correct way to address this could be - first reshape it to CxTxHxW, then move axis using permute to TxCxHxW:

Replace
s2_img = torch.reshape(s2_img, (-1, s2_img.shape[0], 32, 32))
with
s2_img = torch.reshape(s2_img, (s2_img.shape[0], -1, 32, 32)).permute(1,0,2,3)

Continuing the training where it stopped

What do I have to change in the .yml file to continue where it left off?
Just give the path to the saved checkpoint file?
Do I also have to change something so that it continued logging in wandb?

Inference Results - Strong Hallucinations in Urban Areas

Hi Piper,
first of all thanks for providing this repository and the weights - the structure and codebase made re-implementation very intuitive. The transparency and reproducability that you provide is what the field of remote sensing SR desperately needs.

The Question:
I am running SISR on S2 images and get good results in rural and suburban areas. As soon as more densly built-up areas are present in a patch though, the model strongly hallucinates and deviates very far from both the ground truth and the input imagery. I'm using the esrgan_1S2.pth checkpoint. Cross-checking my results with the same area on the Satlas SR map shows a very large difference in quality.
Do you have any idea what might cause this, or have you seen similar results before?

Thanks in advance
Simon

Images

This example is in Buenos Aires, Argentina

1. Satlas Screenshot

Bildschirmfoto 2024-04-23 um 11 49 40

2. My Results

Bildschirmfoto 2024-04-23 um 11 37 48

3. Input S2 Image

Bildschirmfoto 2024-04-23 um 11 37 41

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.