# PyTorch LapSRN
Implementation of CVPR2017 Paper: "Deep Laplacian Pyramid Networks for Fast and Accurate Super-Resolution"(http://vllab.ucmerced.edu/wlai24/LapSRN/) in PyTorch
## Usage
### Training
```
usage: main.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]
[--pretrained PRETRAINED]
PyTorch LapSRN
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 checkpoint (default: none)
--start-epoch START_EPOCH
Manual epoch number (useful on restarts)
--threads THREADS Number of threads for data loader to use, Default: 1
--momentum MOMENTUM Momentum, Default: 0.9
--weight-decay WEIGHT_DECAY, --wd WEIGHT_DECAY
weight decay, Default: 1e-4
--pretrained PRETRAINED
path to pretrained model (default: none)
```
An example of training usage is shown as follows:
```
python main_lapsrn.py --cuda
```
### Evaluation
```
usage: eval.py [-h] [--cuda] [--model MODEL] [--dataset DATASET]
[--scale SCALE]
PyTorch LapSRN Eval
optional arguments:
-h, --help show this help message and exit
--cuda use cuda?
--model MODEL model path
--dataset DATASET dataset name, Default: Set5
--scale SCALE scale factor, Default: 4
```
### Demo
```
usage: demo.py [-h] [--cuda] [--model MODEL] [--image IMAGE] [--scale SCALE]
PyTorch LapSRN Demo
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
### Prepare Training dataset
- We provide a simple hdf5 format training sample in data folder with 'data', 'label_x2', and 'label_x4' keys, the training data is generated with Matlab Bicubic Interplotation, please refer [Code for Data Generation](https://github.com/twtygqyy/pytorch-LapSRN/tree/master/data) for creating training files.
### Performance
- We provide a pretrained LapSRN x4 model trained on T91 and BSDS200 images from [SR_training_datasets](http://vllab.ucmerced.edu/wlai24/LapSRN/results/SR_testing_datasets.zip) with data augmentation as mentioned in the paper
- No bias is used in this implementation, and another difference from paper is that Adam optimizer with 1e-4 learning is applied instead of SGD
- Performance in PSNR on Set5, Set14, and BSD100
| DataSet/Method | LapSRN Paper | LapSRN PyTorch|
| ------------- |:-------------:| -----:|
| Set5 | 31.54 | **31.65** |
| Set14 | 28.19 | **28.27** |
| BSD100 | 27.32 | **27.36** |
### ToDos
- LapSRN x8
- LapGAN Evaluation
### Citation
If you find the code and datasets useful in your research, please cite:
@inproceedings{LapSRN,
author = {Lai, Wei-Sheng and Huang, Jia-Bin and Ahuja, Narendra and Yang, Ming-Hsuan},
title = {Deep Laplacian Pyramid Networks for Fast and Accurate Super-Resolution},
booktitle = {IEEE Conferene on Computer Vision and Pattern Recognition},
year = {2017}
}
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
配套文章:https://blog.csdn.net/qq_36584673/article/details/137588091 编译器:anaconda + pycharm pytorch环境:torch1.9.1+cuda11.1 再安装好所需的包即可运行。 文件目录: checkpoint:存放训练过程中的模型文件 data:h5格式训练集位置,生成h5格式训练集的matlab代码 model:作者给出的模型文件位置 testsets:测试集,有Set5 Test:生成测试集.mat格式的matlab代码 dataset.py:将h5数据集转成DataLoader的输入格式 demo.py:可视化测试图像的超分结果,和Bicubic对比 eval.py:评估测试集,计算平均PSNR main_lapsrn.py:训练LapSRN lapsrn.py:LapSRN模型定义 使用方法: 1.执行main_lapsrn.py训练LapSRN 2.执行eval.py计算Set5的平均PSNR 3.执行demo.py可视化超分结果对比并计算单张图像的PSNR
资源推荐
资源详情
资源评论
收起资源包目录
pytorch-LapSRN-master.zip (31个子文件)
pytorch-LapSRN-master
pytorch-LapSRN-master
lapsrn_wgan.py 8KB
checkpoint
lapsrn_model_epoch_100.pth 3.34MB
eval.py 3KB
main_lapsrn.py 5KB
main_lapwgan.py 9KB
data
lap_pry_x4_small.h5 47.26MB
generate_train_lap_pry.m 3KB
store2hdf5.m 4KB
modcrop.m 267B
LICENSE 1KB
dataset.py 633B
lapsrn.py 5KB
Test
generate_test_mat.m 801B
model
model_epoch_100.pth 3.35MB
__pycache__
lapsrn.cpython-38.pyc 4KB
demo.py 3KB
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
results
butterfly_GT_LapSRN_plt.png 416KB
README.md 4KB
.idea
pytorch-LapSRN-master.iml 477B
other.xml 200B
workspace.xml 4KB
misc.xml 371B
inspectionProfiles
profiles_settings.xml 174B
modules.xml 301B
deployment.xml 1KB
.gitignore 184B
共 31 条
- 1
资源评论
- kssslkf2024-05-02资源值得借鉴的内容很多,那就浅学一下吧,值得下载!
- 2401_845738262024-04-29这个资源值得下载,资源内容详细全面,与描述一致,受益匪浅。
十小大
- 粉丝: 9963
- 资源: 2555
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功