# PyTorch EDSR
Implementation of CVPR2017 workshop Paper: "Enhanced Deep Residual Networks for Single Image Super-Resolution"(https://arxiv.org/pdf/1707.02921.pdf) in PyTorch
## Usage
### Training
```
usage: main_edsr.py [-h] [--batchSize BATCHSIZE] [--nEpochs NEPOCHS] [--lr LR]
[--step STEP] [--cuda] [--resume RESUME]
[--start-epoch START_EPOCH] [--threads THREADS]
[--momentum MOMENTUM] [--weight-decay WEIGHT_DECAY]
optional arguments:
-h, --help show this help message and exit
--batchSize BATCHSIZE
training batch size
--nEpochs NEPOCHS number of epochs to train for
--lr LR Learning Rate. Default=1e-4
--step STEP Sets the learning rate to the initial LR decayed by
momentum every n epochs, Default: n=10
--cuda use cuda?
--resume RESUME path to latest checkpoint (default: none)
--start-epoch START_EPOCH
manual epoch number (useful on restarts)
--threads THREADS number of threads for data loader to use
--momentum MOMENTUM momentum
--weight-decay WEIGHT_DECAY, --wd WEIGHT_DECAY
weight decay, Default: 0
```
### Test
```
usage: test.py [-h] [--cuda] [--model MODEL] [--image IMAGE] [--scale SCALE]
PyTorch EDSR Test
optional arguments:
-h, --help show this help message and exit
--cuda use cuda?
--model MODEL model path
--image IMAGE image name
--scale SCALE scale factor, Default: 4
```
- We convert Set5 test set images to mat format using Matlab, for best PSNR performance, please use Matlab
- An example of usage is shown as follows:
```
python test.py --model model/model_edsr.pth --image butterfly_GT --scale 4 --cuda
```
### Evaluation
```
usage: eval.py [-h] [--cuda] [--model MODEL] [--dataset DATASET]
[--scale SCALE]
PyTorch ByNet Eval
optional arguments:
-h, --help Show this help message and exit
--cuda use cuda?
--model MODEL Model path. Default=model/model_epoch_40.pth
--dataset DATASET Dataset name, Default: Set5
```
- An trained model on [291](https://drive.google.com/open?id=1Rt3asDLuMgLuJvPA1YrhyjWhb97Ly742) images can be downloaded at [google_drive](https://drive.google.com/file/d/1DsvRuKMe91Rxhy7_r6t9mrZeMxARa-fT/view?usp=shar5ng), which could achieve 31.94dB PNSR on Set5 dataset.
- An example of training usage is shown as follows:
```
python eval.py --cuda --model model/model_edsr.pth --dataset Set5
```
### Prepare Training dataset
- Please refer [Code for Data Generation](https://github.com/twtygqyy/pytorch-edsr/tree/master/data) for creating training files.
- Data augmentations including flipping, rotation, downsizing are adopted.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
配套文章:https://blog.csdn.net/qq_36584673/article/details/136934003 编译器:anaconda + pycharm pytorch环境:torch1.9.1+cuda11.1 再安装好所需的包即可运行。 文件目录: data:数据集和生成h5数据集的matlab文件 Set5:测试集Set5(matlab生成的.mat格式,不用matlab生成这个格式计算的PSNR有偏差,这样最准) dataset.py:将h5数据集转成Tensor格式,作为DataLoader的输入 edsr.py:EDSR网络模型的实现 eval.py:评估测试集,得到与Bicubic对比的PSNR值 main_edsr.py:训练EDSR过程 test.py:可视化超分结果,计算单张图像的PSNR mode_edsr.pth:训练后生成的模型文件 使用方法: 1.执行main_edsr.py训练EDSR 2.执行eval.py计算Set5的平均PSNR 3.执行test.py可视化超分结果对比并计算单张图像的PSNR
资源推荐
资源详情
资源评论
收起资源包目录
pytorch-edsr-master.zip (27个子文件)
pytorch-edsr-master
eval.py 4KB
data
edsr_x4.h5 831.95MB
store2hdf5.m 3KB
generate_train.m 3KB
modcrop.m 267B
LICENSE 1KB
dataset.py 508B
edsr.py 4KB
.idea
pytorch-edsr-master.iml 477B
workspace.xml 5KB
misc.xml 372B
inspectionProfiles
Project_Default.xml 274B
profiles_settings.xml 174B
modules.xml 297B
deployment.xml 570B
.gitignore 184B
main_edsr.py 5KB
__pycache__
edsr.cpython-38.pyc 3KB
dataset.cpython-38.pyc 1KB
Set5
bird_GT.mat 3.25MB
butterfly_GT.mat 2.61MB
woman_GT.mat 3.06MB
baby_GT.mat 10.26MB
head_GT.mat 2.68MB
test.py 3KB
README.md 3KB
model_edsr.pth 164.35MB
共 27 条
- 1
资源评论
- qq_577394512024-05-06终于找到了超赞的宝藏资源,果断冲冲冲,支持!
- 2301_773078222024-04-26发现一个超赞的资源,赶紧学习起来,大家一起进步,支持!
十小大
- 粉丝: 9959
- 资源: 2555
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- BGP路由基本配置(拓扑图画好,ip配好了)
- C#的前置窗口截图工具
- 基于Flask开发后端、VUE开发前端框架,在WEB端部署YOLOv5目标检测模型
- kubekeyv3.0.13
- 基于SHT25温湿度传感器、FREERTOS、STM32F103C8T6、LCD1602温湿度采集显示系统proteus仿真设计
- C# 屏幕放大取色器 随时随地获取屏幕像素颜色
- 下载安装这个软件.apk
- 【数据集详细解释及案例分析】数据集详细解释及案例分析
- 基于SHT71温湿度传感器、STM32F103C8T6、LCD1602温湿度采集显示系统proteus仿真设计
- 基于TH02温湿度传感器、STM32F103C8T6、LCD1602、FREERTOS的温湿度采集系统proteus仿真设计
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功