Skip to content

zhu-xlab/RevFus

Repository files navigation

RevFus: Reverse degradation for remote sensing pan-sharpening

This repository contains the implementation of RevFus, a self-supervised approach for image fusion.


📊 Data Preparation

Using Sample Data

This repository includes sample data to help you get started immediately.

See chkpt/WV_Unsup_s1024/RevFus_D701_lr0.001_S311_lr0.001/Readme.md to download sample data and model weights.

Simply run the script to see the results.

Using Your Own Data

To replace the sample data with your own dataset, you need to modify the data loading logic in the main script:

  1. Open RevFus_run.py.
  2. Locate lines 46–56.
  3. Replace the existing loading code with your own data pipeline.
  4. Requirement: Ensure that the input images are pre-processed into a 4D Tensor format: (Batch size, Channels, Height, Width).

Note: Failure to provide the shape may result in dimension mismatch errors during the fusion process.


🚀 Running the Code

1. Self-Supervised Training

To run the self-supervised fusion process from scratch, use RevFus_run.py. You can configure the hyperparameters via command-line arguments:

python RevFus_run.py --gpus 0 --C_lr 1e-3 --D_lr 1e-3 --C_ite 311 --D_ite 701

Arguments Overview:

  • --C_lr: Learning rate for Structural Detail Compensation (Default: 1e-3).
  • --D_lr: Learning rate for Degradation-to-Fusion (Default: 1e-3).
  • --C_ite: Iterations for Structural Detail Compensation (Default: 311).
  • --D_ite: Iterations for Degradation-to-Fusion (Default: 701).
  • --gpus: Specify GPU device IDs (Default: "0").

2. Testing / Inference

If you only want to test the model and obtain results using a specific checkpoint, follow these steps:

  1. Modify the Script: Open RevFus_test.py and update the following:
  • Checkpoint Path: Change the pthname variable to your specific model path:
pthname = 'chkpt/WV_Unsup_s1024/RevFus_D701_lr0.001_S311_lr0.001/'
  • Input Data: Update the data loading section to point to your test images.
  1. Run the Script:
python RevFus_test.py --gpus 0

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages