Toward High-Fidelity End-to-End Multi-Focus Image Fusion via Swin Transformer-Based Network
Official implementation of SwinMFF for multi-focus image fusion
Step 1: Download the DUTS dataset
Step 2: Extract the dataset to your project directory
Step 3: Generate training and testing datasets
# Generate training dataset
python ./make_dataset.py --mode='TR'
# Generate testing dataset
python ./make_dataset.py --mode='TE'Start training with the following command:
python ./train.py💡 Tip: Make sure you have sufficient GPU memory for training. The model requires at least 8GB VRAM.
Download the pre-trained weights and place them in your project directory
| Dataset | Command | Description |
|---|---|---|
| Lytro | python ./predict.py --dataset_path='./assets/Lytro' --model_path='./checkpoint.ckpt' --is_gray=False |
Light field camera dataset |
| MFFW | python ./predict.py --dataset_path='./assets/MFFW' --model_path='./checkpoint.ckpt' --is_gray=False |
Multi-focus fusion dataset |
| MFI-WHU | python ./predict.py --dataset_path='./assets/MFI-WHU' --model_path='./checkpoint.ckpt' --is_gray=False |
Wuhan University dataset |
| Custom | python ./predict.py --dataset_path='your_path' --model_path='your_path' --is_gray=False/True |
Your own dataset |
📊 Comparison Results: Download comprehensive comparison results with various learning-based methods
🔗 Traditional Methods: For traditional method comparisons, visit the MFIF repository
If you find our work helpful in your research, please consider citing our paper:
📋 BibTeX Citation
@article{xie2024swinmff,
title={SwinMFF: toward high-fidelity end-to-end multi-focus image fusion via swin transformer-based network},
author={Xie, Xinzhe and Guo, Buyu and Li, Peiliang and He, Shuangyan and Zhou, Sangjun},
journal={The Visual Computer},
pages={1--24},
year={2024},
publisher={Springer}
}⭐ If you find this project helpful, please consider giving it a star! ⭐
Made with ❤️ by the SwinMFF Team