Skip to content

stywmy/SMFuse

Repository files navigation

SMFuse

This is the code of the paper titled as "SMFuse: Two-Stage Structural Map Aware Network for Multi-focus Image Fusion".

The article is accepted by International Conference on Pattern Recognition.

Framework

Image Image Image

Environment

  • Python 3.8.16
  • torch 2.0.1
  • torchvision 0.15.2
  • tqdm 4.65.0

To Train

You can run the following prompt:

python train.py

Note: SMGNet and DMGNet need to be trained separately in the code. You need to comment out the parts of the train.exe, train_utils/train_and_ eval.py, src/model.py, and my_dataset.py code that are not relevant to the current training phase.

To Test

In the first stage: Please create a new test image data file, modify the corresponding path in predict.py, and then run the following prompt:

python predict.py 

Note: Before running, it is necessary to comment out the code of the second stage. Similarly, you need to comment out irrelevant parts of the src/model.py code.model_30_structure.pth is for first stage.

In the second stage: Please put the structure diagram obtained in the first stage into a folder, modify the corresponding path in predict.exe, and then run the following prompt:

python predict.py # Obtain a preliminary decision map
python predict_final.py # Obtain the final decision map and fused image

Note: Before running, it is necessary to comment out the code of the first stage. Similarly, you need to comment out irrelevant parts of the src/model.py code.model_30.pth is for second stage.

Contact Informaiton

If you have any questions, please contact me at tianyu_shen_jnu@163.com.

About

This is the code of SMFuse

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages