Please download the allweather dataset provided in Histoformer.
- To train DG-Router with default settings, run
cd LoRA-IR/classification
python3 train_setting1.py --path_snow ... --path_rain ... --path_raindrop ...
- 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
- 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
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
- 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
cd LoRA-IR/Setting1
python3 compute_psnr_ssim.py --path1 ... --path2 ...