# IDN
This repository is implementation of the "Fast and Accurate Single Image Super-Resolution via Information Distillation Network".
<center><img src="./figs/fig2.png"></center>
<center><img src="./figs/fig3.png"></center>
## Requirements
- PyTorch
- Tensorflow
- tqdm
- Numpy
- Pillow
**Tensorflow** is required for quickly fetching image in training phase.
## Results
<table>
<tr>
<td><center>Original</center></td>
<td><center>BICUBIC x2</center></td>
<td><center>IDN x2</center></td>
</tr>
<tr>
<td>
<center><img src="./data/comic.bmp""></center>
</td>
<td>
<center><img src="./data/comic_x2_bicubic.png"></center>
</td>
<td>
<center><img src="./data/comic_x2_IDN.png"></center>
</td>
</tr>
</table>
## Usages
### Train
When training begins, the model weights will be saved every epoch. <br />
If you want to train quickly, you should use **--use_fast_loader** option.
```bash
python main.py --scale 2 \
--num_features 64 \
--d 16 \
--s 4 \
--images_dir "" \
--outputs_dir "" \
--patch_size 29 \
--batch_size 16 \
--num_epochs 20 \
--lr 1e-4 \
--loss "l1" \
--threads 8 \
--seed 123 \
--use_fast_loader
```
### Fine-tuning
The fine-tuning artifacts are generated as "IDN_ft_epoch_{}.pth".
```bash
python main.py --scale 2 \
--num_features 64 \
--d 16 \
--s 4 \
--images_dir "" \
--outputs_dir "" \
--weights_path "" \
--patch_size 39 \
--batch_size 16 \
--num_epochs 20 \
--lr 1e-5 \
--loss "l2" \
--threads 8 \
--seed 123 \
--use_fast_loader
```
### Test
Output results consist of restored images by the BICUBIC and the IDN.
```bash
python example --scale 2 \
--num_features 64 \
--d 16 \
--s 4 \
--weights_path "" \
--image_path "" \
--outputs_dir ""
```
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
保姆级使用教程:https://blog.csdn.net/qq_36584673/article/details/138493007 data:测试单张图像以及超分结果文件夹 datasets:数据集存放文件夹,包含训练集和测试集 Plt:Loss、PSNR、SSIM与Epoch关系曲线图存放位置 weights:模型权重文件存放位置 data_aug.py:离线数据增强 dataset.py:制作数据集 draw_evaluation.py:绘制Loss、PSNR、SSIM与Epoch的关系曲线图 example.py:测试单张图像超分结果 imresize.py:python实现matlab中的imresize main.py:训练IDN model.py:IDN模型实现 test_benchmark.py:测试4个benchmark,控制台输出平均PSNR和SSIM utils.py:图像处理,计算指标工具集 详细使用见教程文章
资源推荐
资源详情
资源评论
收起资源包目录
IDN-pytorch-master.zip (85个子文件)
IDN-pytorch-master
utils.py 7KB
weights
best_no_ft_x4.pth 2.28MB
best_ft_x4.pth 2.28MB
best_ft_x3.pth 2.28MB
best_no_ft_x3.pth 2.28MB
best_ft_x2.pth 2.28MB
best_no_ft_x2.pth 2.28MB
main.py 8KB
imresize.py 5KB
data
comic_x3_IDN.png 162KB
butterfly_GT_x2_bicubic.png 109KB
butterfly_GT_x3_IDN.png 112KB
butterfly_GT_x3_bicubic.png 101KB
butterfly_GT_plt_x2_IDN.png 636KB
butterfly_GT_plt_x4_IDN.png 611KB
comic_x2_bicubic.png 157KB
comic.bmp 265KB
comic_plt_x4_IDN.png 842KB
butterfly_GT_x4_IDN.png 112KB
comic_x4_IDN.png 149KB
comic_x3_bicubic.png 139KB
butterfly_GT_x2_IDN.png 118KB
comic_x4_bicubic.png 125KB
butterfly_GT_plt_x2_IDN_before.png 646KB
comic_x2_IDN.png 178KB
butterfly_GT_plt_x3_IDN.png 621KB
comic_plt_x2_IDN.png 911KB
butterfly_GT.bmp 192KB
butterfly_GT_x2_IDN_nofine-tuning.png 126KB
comic_plt_x3_IDN.png 871KB
butterfly_GT_x4_bicubic.png 95KB
data_aug.py 1KB
dataset.py 4KB
model.py 3KB
.idea
IDN-pytorch-master.iml 316B
workspace.xml 3KB
misc.xml 266B
inspectionProfiles
profiles_settings.xml 174B
modules.xml 295B
.gitignore 50B
datasets
Plt
evalution_plt_best_ft_x4.png 306KB
evalution_plt_2.png 317KB
evalution_plt_best_ft_2002.png 312KB
evalution_plt_best_ft_x3.png 323KB
Loss_plt_2.png 114KB
draw_evaluation.py 3KB
figs
fig2.png 200KB
fig3.png 45KB
test_benchmark.py 5KB
IDN结果记录
comic_x3_IDN.png 162KB
butterfly_GT_x2_bicubic.png 109KB
butterfly_GT_x3_IDN.png 112KB
butterfly_GT_x3_bicubic.png 101KB
butterfly_GT_plt_x2_IDN.png 636KB
butterfly_GT_plt_x4_IDN.png 611KB
comic_x2_bicubic.png 157KB
weights_srf_2_train_results.csv 2KB
comic.bmp 265KB
comic_plt_x4_IDN.png 842KB
butterfly_GT_x4_IDN.png 112KB
comic_x4_IDN.png 149KB
weights_ft_srf_3_train_results.csv 18KB
comic_x3_bicubic.png 139KB
butterfly_GT_x2_IDN.png 118KB
comic_x4_bicubic.png 125KB
weights_no_ft_srf_4_train_results.csv 2KB
butterfly_GT_plt_x2_IDN_before.png 646KB
comic_x2_IDN.png 178KB
butterfly_GT_plt_x3_IDN.png 621KB
weights_no_ft_srf_2_train_results.csv 146B
comic_plt_x2_IDN.png 911KB
weights_ft_srf_4_train_results.csv 24KB
weights_ft_srf_2_train_results.csv 12KB
weights_no_ft_srf_3_train_results.csv 2KB
butterfly_GT.bmp 192KB
butterfly_GT_x2_IDN_nofine-tuning.png 126KB
comic_plt_x3_IDN.png 871KB
butterfly_GT_x4_bicubic.png 95KB
example.py 3KB
.gitignore 16B
__pycache__
model.cpython-38.pyc 3KB
utils.cpython-38.pyc 7KB
dataset.cpython-38.pyc 2KB
imresize.cpython-38.pyc 5KB
README.md 2KB
共 85 条
- 1
资源评论
十小大
- 粉丝: 1w+
- 资源: 2556
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功