# ESRGAN-PyTorch
## Overview
This repository contains an op-for-op PyTorch reimplementation of [ESRGAN: Enhanced Super-Resolution Generative Adversarial Networks](https://arxiv.org/abs/1809.00219v2).
## Table of contents
- [ESRGAN-PyTorch](#esrgan-pytorch)
- [Overview](#overview)
- [Table of contents](#table-of-contents)
- [Download weights](#download-weights)
- [Download datasets](#download-datasets)
- [How Test and Train](#how-test-and-train)
- [Test](#test)
- [Train RRDBNet model](#train-rrdbnet-model)
- [Resume train RRDBNet model](#resume-train-rrdbnet-model)
- [Train ESRGAN model](#train-esrgan-model)
- [Resume train ESRGAN model](#resume-train-esrgan-model)
- [Result](#result)
- [Contributing](#contributing)
- [Credit](#credit)
- [ESRGAN: Enhanced Super-Resolution Generative Adversarial Networks](#esrgan-enhanced-super-resolution-generative-adversarial-networks)
## Download weights
- [Google Driver](https://drive.google.com/drive/folders/17ju2HN7Y6pyPK2CC_AqnAfTOe9_3hCQ8?usp=sharing)
- [Baidu Driver](https://pan.baidu.com/s/1yNs4rqIb004-NKEdKBJtYg?pwd=llot)
## Download datasets
Contains DIV2K, DIV8K, Flickr2K, OST, T91, Set5, Set14, BSDS100 and BSDS200, etc.
- [Google Driver](https://drive.google.com/drive/folders/1A6lzGeQrFMxPqJehK9s37ce-tPDj20mD?usp=sharing)
- [Baidu Driver](https://pan.baidu.com/s/1o-8Ty_7q6DiS3ykLU09IVg?pwd=llot)
## How Test and Train
Both training and testing only need to modify the `config.py` file.
### Test
- line 31: `upscale_factor` change to `4`.
- line 33: `mode` change to `test`.
- line 111: `model_path` change to `results/pretrained_models/RRDBNet_x4-DFO2K-2e2a91f4.pth.tar`.
### Train RRDBNet model
- line 31: `upscale_factor` change to `4`.
- line 33: `mode` change to `train_rrdbnet`.
- line 35: `exp_name` change to `RRDBNet_baseline`.
### Resume train RRDBNet model
- line 31: `upscale_factor` change to `4`.
- line 33: `mode` change to `train_rrdbnet`.
- line 35: `exp_name` change to `RRDBNet_baseline`.
- line 49: `resume` change to `samples/RRDBNet_baseline/g_epoch_xxx.pth.tar`.
### Train ESRGAN model
- line 31: `upscale_factor` change to `4`.
- line 33: `mode` change to `train_esrgan`.
- line 35: `exp_name` change to `ESRGAN_baseline`.
- line 77: `resume` change to `results/RRDBNet_baseline/g_last.pth.tar`.
### Resume train ESRGAN model
- line 31: `upscale_factor` change to `4`.
- line 33: `mode` change to `train_esrgan`.
- line 35: `exp_name` change to `ESRGAN_baseline`.
- line 77: `resume` change to `results/RRDBNet_baseline/g_last.pth.tar`.
- line 78: `resume_d` change to `samples/ESRGAN_baseline/g_epoch_xxx.pth.tar`.
- line 79: `resume_g` change to `samples/ESRGAN_baseline/g_epoch_xxx.pth.tar`.
### Result
Source of original paper results: [https://arxiv.org/pdf/1809.00219v2.pdf](https://arxiv.org/pdf/1809.00219v2.pdf)
In the following table, the value in `()` indicates the result of the project, and `-` indicates no test.
| Method | Scale | Set5 (PSNR/SSIM) | Set14 (PSNR/SSIM) | BSD100 (PSNR/SSIM) | Urban100 (PSNR/SSIM) | Manga109 (PSNR/SSIM) |
|:------:|:-----:|:-----------------------------------:|:-----------------------------------:|:-----------------------------------:|:-----------------------------------:|:-----------------------------------:|
| RRDB | 4 | 32.73(**32.71**)/0.9011(**0.9018**) | 28.99(**28.96**)/0.7917(**0.7917**) | 27.85(**27.85**)/0.7455(**0.7473**) | 28.03(**28.03**)/0.8153(**0.8156**) | 31.66(**31.60**)/0.9196(**0.9195**) |
| ESRGAN | 4 | -(**30.44**)/-(**0.8525**) | -(**26.28**)/-(**0.6994**) | -(**25.33**)/-(**0.6534**) | -(**24.36**)/-(**0.7341**) | -(**29.42**)/-(**0.8597**) |
```bash
# Download `ESRGAN_x4-DFO2K-25393df7.pth.tar` weights to `./results/pretrained_models`
# More detail see `README.md<Download weights>`
python ./inference.py --inputs_path ./figure/baboon_lr.png --output_path ./figure/baboon_sr.png --weights_path ./results/pretrained_models/ESRGAN_x4-DFO2K-25393df7.pth.tar
```
Input:
<span align="center"><img width="492" height="480" src="figure/baboon_lr.png"/></span>
Output:
<span align="center"><img width="492" height="480" src="figure/baboon_sr.png"/></span>
```text
Build ESRGAN model successfully.
Load ESRGAN model weights `./results/pretrained_models/ESRGAN_x4-DFO2K-25393df7.pth.tar` successfully.
SR image save to `./figure/baboon_sr.png`
```
### Contributing
If you find a bug, create a GitHub issue, or even better, submit a pull request. Similarly, if you have questions, simply post them as GitHub issues.
I look forward to seeing what the community does with these models!
### Credit
#### ESRGAN: Enhanced Super-Resolution Generative Adversarial Networks
_Xintao Wang, Ke Yu, Shixiang Wu, Jinjin Gu, Yihao Liu, Chao Dong, Chen Change Loy, Yu Qiao, Xiaoou Tang_ <br>
**Abstract** <br>
The Super-Resolution Generative Adversarial Network (SRGAN) is a seminal work that is capable of generating realistic textures during single image
super-resolution. However, the hallucinated details are often accompanied with unpleasant artifacts. To further enhance the visual quality, we
thoroughly study three key components of SRGAN - network architecture, adversarial loss and perceptual loss, and improve each of them to derive an
Enhanced SRGAN (ESRGAN). In particular, we introduce the Residual-in-Residual Dense Block (RRDB) without batch normalization as the basic network
building unit. Moreover, we borrow the idea from relativistic GAN to let the discriminator predict relative realness instead of the absolute value.
Finally, we improve the perceptual loss by using the features before activation, which could provide stronger supervision for brightness consistency
and texture recovery. Benefiting from these improvements, the proposed ESRGAN achieves consistently better visual quality with more realistic and
natural textures than SRGAN and won the first place in the PIRM2018-SR Challenge. The code is available
at [this https URL](https://github.com/xinntao/ESRGAN).
[[Paper]](https://arxiv.org/pdf/1809.00219v2.pdf) [[Author's implements(PyTorch)]](https://github.com/xinntao/ESRGAN)
```bibtex
@misc{wang2018esrgan,
title={ESRGAN: Enhanced Super-Resolution Generative Adversarial Networks},
author={Xintao Wang and Ke Yu and Shixiang Wu and Jinjin Gu and Yihao Liu and Chao Dong and Chen Change Loy and Yu Qiao and Xiaoou Tang},
year={2018},
eprint={1809.00219},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
```
没有合适的资源?快使用搜索试试~ 我知道了~
ESRGAN_MRI-main.zip
共2000个文件
png:1981个
py:11个
xml:4个
需积分: 0 0 下载量 133 浏览量
更新于2024-12-17
收藏 40.78MB ZIP 举报
ESRGAN_MRI-main.zip
收起资源包目录
ESRGAN_MRI-main.zip (2000个子文件)
README.md 7KB
README.md 1KB
lr_f5_153_z_43_0002.png 7KB
lr_f1_160_z_49_0002.png 7KB
lr_f1_160_z_50_0002.png 7KB
lr_f5_153_z_44_0002.png 7KB
lr_f1_160_z_47_0002.png 7KB
lr_f1_160_z_51_0002.png 7KB
lr_f5_153_z_52_0002.png 7KB
lr_f5_153_z_48_0002.png 7KB
lr_f5_153_z_50_0002.png 7KB
lr_f5_153_z_54_0002.png 7KB
lr_f5_153_z_51_0002.png 7KB
lr_f5_153_z_55_0002.png 7KB
lr_f5_153_z_57_0002.png 7KB
lr_f5_153_z_56_0002.png 7KB
lr_f5_153_z_61_0003.png 7KB
lr_f5_153_z_55_0003.png 7KB
lr_f5_153_z_57_0003.png 7KB
lr_f5_153_z_58_0003.png 7KB
lr_f5_153_z_60_0003.png 7KB
lr_f5_153_z_45_0002.png 7KB
lr_f5_153_z_62_0003.png 7KB
lr_f5_153_z_52_0003.png 7KB
lr_f5_153_z_49_0003.png 7KB
lr_f5_153_z_62_0002.png 7KB
lr_f5_153_z_43_0003.png 7KB
lr_f5_153_z_65_0002.png 7KB
lr_f1_160_z_48_0003.png 7KB
lr_f5_153_z_65_0003.png 7KB
lr_f5_153_z_50_0003.png 7KB
lr_f5_153_z_63_0003.png 7KB
lr_f1_160_z_49_0003.png 7KB
lr_f5_153_z_46_0003.png 7KB
lr_f5_153_z_44_0003.png 7KB
lr_f1_160_z_47_0003.png 7KB
lr_f1_160_z_42_0003.png 7KB
lr_f5_153_z_43_0006.png 7KB
lr_f1_160_z_51_0003.png 7KB
lr_f2_145_z_47_0002.png 7KB
lr_f1_160_z_55_0002.png 7KB
lr_f5_153_z_48_0003.png 7KB
lr_f5_153_z_66_0002.png 7KB
lr_f1_160_z_58_0002.png 7KB
lr_f5_153_z_68_0002.png 7KB
lr_f5_153_z_49_0006.png 7KB
lr_f2_145_z_44_0002.png 7KB
lr_f5_153_z_55_0006.png 7KB
lr_f2_145_z_43_0002.png 7KB
lr_f1_160_z_60_0002.png 7KB
lr_f5_153_z_69_0002.png 7KB
lr_f5_153_z_65_0001.png 7KB
lr_f5_153_z_66_0003.png 7KB
lr_f5_153_z_52_0006.png 7KB
lr_f1_160_z_56_0002.png 7KB
lr_f5_153_z_78_0003.png 7KB
lr_f2_145_z_52_0002.png 7KB
lr_f5_153_z_87_0003.png 7KB
lr_f5_153_z_43_0009.png 7KB
lr_f1_160_z_59_0002.png 7KB
lr_f5_153_z_70_0003.png 7KB
lr_f5_153_z_53_0006.png 7KB
lr_f5_153_z_44_0006.png 7KB
lr_f5_153_z_79_0003.png 7KB
lr_f5_153_z_70_0002.png 7KB
lr_f5_153_z_83_0003.png 7KB
lr_f5_153_z_90_0003.png 7KB
lr_f5_153_z_85_0003.png 7KB
lr_f5_153_z_59_0001.png 7KB
lr_f5_153_z_49_0012.png 7KB
lr_f5_153_z_73_0003.png 7KB
lr_f2_145_z_48_0002.png 7KB
lr_f5_153_z_88_0003.png 7KB
lr_f5_153_z_42_0006.png 7KB
lr_f1_160_z_62_0002.png 7KB
lr_f5_153_z_57_0006.png 7KB
lr_f1_160_z_46_0003.png 7KB
lr_f2_145_z_50_0002.png 7KB
lr_f5_153_z_49_0010.png 7KB
lr_f5_153_z_71_0003.png 7KB
lr_f1_160_z_61_0002.png 7KB
lr_f5_153_z_69_0001.png 7KB
lr_f5_153_z_50_0006.png 7KB
lr_f5_153_z_46_0012.png 7KB
lr_f5_153_z_44_0012.png 7KB
lr_f5_153_z_74_0003.png 7KB
lr_f1_160_z_65_0002.png 7KB
lr_f5_153_z_49_0009.png 7KB
lr_f5_153_z_89_0006.png 7KB
lr_f5_153_z_92_0006.png 7KB
lr_f5_153_z_46_0006.png 7KB
lr_f5_153_z_91_0003.png 7KB
lr_f2_145_z_54_0002.png 7KB
lr_f1_160_z_77_0002.png 7KB
lr_f5_153_z_44_0009.png 7KB
lr_f1_160_z_76_0002.png 7KB
lr_f2_145_z_53_0002.png 7KB
lr_f5_153_z_91_0006.png 7KB
lr_f5_153_z_71_0002.png 7KB
lr_f5_153_z_54_0010.png 7KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源推荐
资源预览
资源评论
5星 · 资源好评率100%
2024-09-05 上传
5星 · 资源好评率100%
106 浏览量
157 浏览量
2022-07-14 上传
5星 · 资源好评率100%
2021-09-25 上传
142 浏览量
143 浏览量
2024-02-20 上传
2019-08-07 上传
2024-02-20 上传
125 浏览量
2023-08-09 上传
2017-12-08 上传
129 浏览量
180 浏览量
2021-10-10 上传
2022-01-29 上传
2022-03-18 上传
2020-08-17 上传
2022-02-17 上传
5星 · 资源好评率100%
2022-02-16 上传
2022-03-21 上传
2022-02-16 上传
198 浏览量
资源评论
weixin_40025586
- 粉丝: 11
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功