diff --git a/README.md b/README.md index ea31033..21e625a 100644 --- a/README.md +++ b/README.md @@ -36,14 +36,51 @@ Multi-modality (MM) image fusion aims to render fused images that maintain the m Our CDDFuse is implemented in ``net.py``. +### Training +**1. Virtual Environment** +``` +# create virtual environment +conda create -n cddfuse python=3.8.10 +conda activate cddfuse +# select pytorch version yourself +# install cddfuse requirements +pip install -r requirements.txt +``` + +**2. Data Preparation** + +Download the MSRS dataset from [this link](https://github.com/Linfeng-Tang/MSRS) and place it in the folder ``'./MSRS_train/'``. + +**3. Pre-Processing** + +Run +``` +python dataprocessing.py +``` +and the processed training dataset is in ``'./data/MSRS_train_imgsize_128_stride_200.h5'``. + +**4. CDDFuse Training** + +Run +``` +python train.py +``` +and the trained model is available in ``'./models/'``. + ### Testing +**1. Pretrained models** + Pretrained models are available in ``'./models/CDDFuse_IVF.pth'`` and ``'./models/CDDFuse_MIF.pth'``, which are responsible for the Infrared-Visible Fusion (IVF) and Medical Image Fusion (MIF) tasks, respectively. +**2. Test datasets** + The test datasets used in the paper have been stored in ``'./test_img/RoadScene'``, ``'./test_img/TNO'`` for IVF, ``'./test_img/MRI_CT'``, ``'./test_img/MRI_PET'`` and ``'./test_img/MRI_SPECT'`` for MIF. Unfortunately, since the size of **MSRS dataset** for IVF is 500+MB, we can not upload it for exhibition. It can be downloaded via [this link](https://github.com/Linfeng-Tang/MSRS). The other datasets contain all the test images. +**3. Results in Our Paper** + If you want to infer with our CDDFuse and obtain the fusion results in our paper, please run ``'test_IVF.py'`` for IVF and ``'test_MIF.py'`` for MIF. The testing results will be printed in the terminal. @@ -91,38 +128,6 @@ CDDFuse_MIF 3.9 58.31 20.87 2.49 1.35 0.97 0.78 1.48 ``` which can match the results in Table 5 in our original paper. -### Training -**1. Virtual Environment** -``` -# create virtual environment -conda create -n cddfuse python=3.8.10 -conda activate cddfuse -# select pytorch version yourself -# install cddfuse requirements -pip install -r requirements.txt -``` - -**2. Data Preparation** - -Download the MSRS dataset from [this link](https://github.com/Linfeng-Tang/MSRS) and place it in the folder ``'./MSRS_train/'``. - -**3. Pre-Processing** - -Run -``` -python dataprocessing.py -``` -and the processed training dataset is in ``'./data/MSRS_train_imgsize_128_stride_200.h5'``. - -**4. CDDFuse Training** - -Run -``` -python train.py -``` -and the trained model is available in ``'./models/'``. - - ## CDDFuse ### Illustration of our CDDFuse model.