Skip to content

Latest commit

 

History

History
53 lines (45 loc) · 1.72 KB

README.md

File metadata and controls

53 lines (45 loc) · 1.72 KB

Dataset Preparation

Please download the allweather dataset provided in Histoformer.

Train

  1. To train DG-Router with default settings, run
cd LoRA-IR/classification
python3 train_setting1.py --path_snow ... --path_rain ... --path_raindrop ...
  1. To pretrain LoRA-IR with default settings, run
cd LoRA-IR
# Don't forget to modify the specific data&ckpt path in the yaml file
python3 -m torch.distributed.launch --nproc_per_node 8 --master_port 1234 \
basicsr/train.py -opt Setting1/options/Setting1_Pre.yml --launcher pytorch
  1. To fine-tune LoRA-IR with default settings, run
cd LoRA-IR
# Don't forget to modify the specific data&ckpt path in the yaml file
python3 -m torch.distributed.launch --nproc_per_node 8 --master_port 1234 \
basicsr/train.py -opt Setting1/options/Setting1_Ft.yml --launcher pytorch

Evaluation

  1. Download the pre-trained DG-Router and IR models.

  2. For testing DR-Router, run

cd LoRA-IR/classification
# for cls label, snow=0, rain=1, raindrop=2
python3 test_setting1.py --ckpt /path/to/setting1_router.pth \
--path /path/to/lq/image/ --label 0/1/2
  1. For testing IR model, run
cd LoRA-IR
python3 test_3input.py --input_dir /path/to/lq/image/ \
--result_dir /path/to/save/dir \
--weights /path/to/setting1_ir.pth \
--weights_clip /path/to/setting1_router.pth \
--yaml_file Setting1/options/Setting1_Ft.yml

To reproduce PSNR/SSIM results of Tab. 1, run

cd LoRA-IR/Setting1
python3 compute_psnr_ssim.py --path1 ... --path2 ...