This repository contains the implementation of RevFus, a self-supervised approach for image fusion.
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.
To replace the sample data with your own dataset, you need to modify the data loading logic in the main script:
- Open
RevFus_run.py. - Locate lines 46–56.
- Replace the existing loading code with your own data pipeline.
- 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.
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").
If you only want to test the model and obtain results using a specific checkpoint, follow these steps:
- Modify the Script: Open
RevFus_test.pyand update the following:
- Checkpoint Path: Change the
pthnamevariable 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.
- Run the Script:
python RevFus_test.py --gpus 0