Skip to content

xintangjin/MLP-AMDC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MLP-AMDC

ARAD_1K

1. Create Envirement:

  • Python 3 (Recommend to use Anaconda)

  • NVIDIA GPU + CUDA

  • Python packages:

    cd AMDC
    pip install -r requirements.txt

2. Data Preparation:

  • Download training spectral images (Google Drive / Baidu Disk, code: mst1), training RGB images (Google Drive / Baidu Disk), validation spectral images (Google Drive / Baidu Disk), validation RGB images (Google Drive / Baidu Disk), and testing RGB images (Google Drive / Baidu Disk) from the competition website of NTIRE 2022 Spectral Reconstruction Challenge.

  • Place the training spectral images and validation spectral images to /AMDC/dataset/Train_Spec/.

  • Place the training RGB images and validation RGB images to /AMDC/dataset/Train_RGB/.

  • Place the testing RGB images to /AMDC/dataset/Test_RGB/.

  • Then this repo is collected as the following form:

    |--AMDC
        |--ARAD_1K 
        |--dataset 
            |--Train_Spec
                |--ARAD_1K_0001.mat
                |--ARAD_1K_0002.mat
                : 
                |--ARAD_1K_0950.mat
      	  |--Train_RGB
                |--ARAD_1K_0001.jpg
                |--ARAD_1K_0002.jpg
                : 
                |--ARAD_1K_0950.jpg
            |--Valid_Spec
                |--ARAD_1K_0901.mat
                |--ARAD_1K_0902.mat
                : 
                |--ARAD_1K_0950.mat
      	  |--Valid_RGB
                |--ARAD_1K_0901.jpg
                |--ARAD_1K_0902.jpg
                : 
                |--ARAD_1K_0950.jpg
            |--Test_RGB
                |--ARAD_1K_0951.jpg
                |--ARAD_1K_0952.jpg
                : 
                |--ARAD_1K_1000.jpg
            |--split_txt
                |--train_list.txt
                |--valid_list.txt
            |--mask.mat

3. Training

cd /AMDC/ARAD_1K/train_code/
python train.py --method AMDC_3stg  --batch_size 4  --outf ./exp/AMDC_3stg/ --data_root ../dataset/  --gpu_id 0
python train.py --method AMDC_5stg  --batch_size 2  --outf ./exp/AMDC_3stg/ --data_root ../dataset/  --gpu_id 0
python train.py --method AMDC_7stg  --batch_size 2  --outf ./exp/AMDC_3stg/ --data_root ../dataset/  --gpu_id 0
python train.py --method AMDC_9stg  --batch_size 2  --outf ./exp/AMDC_3stg/ --data_root ../dataset/  --gpu_id 0

4. Testing

(1) Download the pretrained model zoo from (will coming soon).

(2) Run the following command to test the model on the testing RGB images.

cd /AMDC/ARAD_1K/test_code/
python test.py --method AMDC_3stg  --batch_size 4  --outf ./exp/AMDC_3stg/ --data_root ../dataset/  --gpu_id 0
python test.py --method AMDC_5stg  --batch_size 2  --outf ./exp/AMDC_3stg/ --data_root ../dataset/  --gpu_id 0
python test.py --method AMDC_7stg  --batch_size 2  --outf ./exp/AMDC_3stg/ --data_root ../dataset/  --gpu_id 0
python test.py --method AMDC_9stg  --batch_size 2  --outf ./exp/AMDC_3stg/ --data_root ../dataset/  --gpu_id 0

KAIST and CAVE adhering to the TSA-Net

1. Data Preparation:

  • The repo is collected as the following form:

    |--AMDC
        |--simulation 
        |--datasets 
            |--cave_1024_28
              |--scene1.mat
              |--scene2.mat
              :  
              |--scene205.mat
      	  |--cave_1024_28_RGB
              |--scene1.mat
              |--scene2.mat
              :  
              |--scene205.mat
            |--cave_512_28
              |--scene1.mat
              |--scene2.mat
              :  
              |--scene30.mat
            |--cave_512_28_RGB
              |--scene1.mat
              |--scene2.mat
              :  
              |--scene30.mat
      	  |--TSA_simu_data
                |--Truth
                  |--scene01.mat
                  |--scene02.mat
                  : 
                  |--scene10.mat
                |--Truth_RGB
                  |--scene01.mat
                  |--scene02.mat
                  : 
                  |--scene10.mat
                |--mask.mat

1)Download cave_1024_28 (One Drive), CAVE_512_28 (Baidu Disk, code: ixoe | One Drive), KAIST_CVPR2021 (Baidu Disk, code: 5mmn | One Drive), TSA_simu_data (One Drive), TSA_real_data (One Drive), and then put them into the corresponding folders of datasets/ and recollect them as the following form: #f03c15 2) Download cave_1024_28_RGB,Truth_RGB (Baidu Disk, code: y183))

##2.Prepare Pretrained ckpt:

Download pretrained (will comming soon) .

3. Training

cd /AMDC/simulation/train_code/
python train.py --method AMDC_3stg  --batch_size 4  --outf ./exp/AMDC_3stg/ --data_root ../dataset/  --gpu_id 0
python train.py --method AMDC_5stg  --batch_size 2  --outf ./exp/AMDC_3stg/ --data_root ../dataset/  --gpu_id 0
python train.py --method AMDC_7stg  --batch_size 2  --outf ./exp/AMDC_3stg/ --data_root ../dataset/  --gpu_id 0
python train.py --method AMDC_9stg  --batch_size 2  --outf ./exp/AMDC_3stg/ --data_root ../dataset/  --gpu_id 0

4. Testing

cd /AMDC/simulation/test_code/
python test.py --method AMDC_3stg  --batch_size 4  --outf ./exp/AMDC_3stg/ --data_root ../dataset/  --gpu_id 0
python test.py --method AMDC_5stg  --batch_size 2  --outf ./exp/AMDC_3stg/ --data_root ../dataset/  --gpu_id 0
python test.py --method AMDC_7stg  --batch_size 2  --outf ./exp/AMDC_3stg/ --data_root ../dataset/  --gpu_id 0
python test.py --method AMDC_9stg  --batch_size 2  --outf ./exp/AMDC_3stg/ --data_root ../dataset/  --gpu_id 0

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages