1 用现有模型测试
1.1 快速测试
1.1.1 下载项目
git clone https://github.com/Paper99/SRFBN_CVPR19.git
1.1.2 下载预训练模型,解压缩模型并将它们放到 ./models 中。
1.1.3 在 SRFBN_CVPR19-master 目录下,运行以下命令之一,在Set5上进行评估。
# SRFBN
python test.py -opt options/test/test_SRFBN_x2_BI.json
python test.py -opt options/test/test_SRFBN_x3_BI.json
python test.py -opt options/test/test_SRFBN_x4_BI.json
python test.py -opt options/test/test_SRFBN_x3_BD.json
python test.py -opt options/test/test_SRFBN_x3_DN.json
# SRFBN-S
python test.py -opt options/test/test_SRFBN-S_x2_BI.json
python test.py -opt options/test/test_SRFBN-S_x3_BI.json
python test.py -opt options/test/test_SRFBN-S_x4_BI.json
例如:运行 python test.py -opt options/test/test_SRFBN_x2_BI.json (红框中参数可对应修改)。结果保存在 ./results/SR/BI/SRFBN/Set5/x2 中。Set5 的 PSNR/SSIM 值显示在屏幕上。
运行结果如图所示:
1.2 测试标准的 SRbenchmark 和自己的图像
1.2.1 完成 1.1.1 和 1.1.2 ,下载 SRbenchmark 数据集。
SR benchmark (Set5, Set14, B100, Urban100 and Manga109) BaiduYun(code:z6nz)
1.2.2 在 SRFBN_CVPR19-master 目录下,解压 SRbenchmark,生成 SRbenchmark 测试数据集。
使用 matlab 打开 ./results/Prepare_TestData_HR_LR.m,生成适用不同退化模型的 HR/LR 图像,保存在 ./results 相应位置中。
1.2.3 参考./options/test/README.md ,根据需要修改 ./options/test/test_SRFBN_example.json。
将自己的图像放入 ./results/LR/MyImage 中,与 Set14数据集一同使用现有的预训练模型进行测试,结果如下:
1.2.4 在 SRFBN_CVPR19-master 目录下,运行以下命令。
python test.py -opt options/test/test_SRFBN_example.json
图像数据集的 PSNR/SSIM 值会在屏幕上显示,重建图像在 ./results/SR 中。
2 训练模型测试自己的数据集
2.1 生成训练、验证数据集训练模型
2.1.1 在 ./datasets 中新建 Ship_train_HR 文件夹存放待训练的 HR 图像。
------------期末了TAT考完再更新