Restormer 代码复现

1、环境配置

conda create -n restormer python=3.9
conda activate restormer
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
pip install matplotlib scikit-learn scikit-image opencv-python yacs joblib natsort h5py tqdm
pip install einops gdown addict future lmdb numpy pyyaml requests scipy tb-nightly yapf lpips
python setup.py develop --no_cuda_ext

2、train

cd Restormer

修改 Deraining/Options/Deraining_Restormer.yml 里面的数据集路径

运行

python basicsr/train.py -opt /root/autodl-tmp/Restormer-main/Deraining/Options/Deraining_Restormer.yml

开始训练:

3、test

3.1 演示

python demo.py --task Task_Name --input_dir path_to_images --result_dir save_images_here

在图像目录上执行虚化去模糊的示例用法:

python demo.py --task Single_Image_Defocus_Deblurring --input_dir './demo/degraded/' --result_dir './demo/restored/'

直接在图像上执行 Defocus Debulling 的示例用法:

python demo.py --task Single_Image_Defocus_Deblurring --input_dir './demo/degraded/portrait.jpg' --result_dir './demo/restored/'

3.2 测试

python test.py

 运行

evaluate_PSNR_SSIM.m 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值