--- license: bsd-3-clause language: - en tags: - super-resolution - image-to-image - real-esrgan - esrgan - pytorch datasets: - eugenesiow/Div2k - yangtao9009/Flickr2K paper: - https://arxiv.org/abs/2107.10833 pipeline_tag: image-to-image --- # Real-ESRGAN x4plus This repository hosts the **`RealESRGAN_x4plus.pth`** pre-trained generator weights from the [xinntao/Real-ESRGAN](https://github.com/xinntao/Real-ESRGAN) project. The file is a 1:1 mirror of the asset originally released by Xintao Wang on **July 22, 2021** as part of [Real-ESRGAN v0.1.0](https://github.com/xinntao/Real-ESRGAN/releases/tag/v0.1.0). Per the v0.1.0 release notes, *"This release is mainly for storing pre-trained models and executable files."* Real-ESRGAN extends ESRGAN to a practical blind super-resolution setting by training with a high-order degradation model and pure synthetic data ([Wang et al., 2021](https://arxiv.org/abs/2107.10833)). This particular checkpoint is the **general-purpose 4ร— image super-resolution** model and is the default model selected by `inference_realesrgan.py` in the upstream repository. ## ๐Ÿ“‹ Model Details | Field | Value | | --- | --- | | Original release | [v0.1.0](https://github.com/xinntao/Real-ESRGAN/releases/tag/v0.1.0), 22 Jul 2021 | | Authors | Xintao Wang, Liangbin Xie, Chao Dong, Ying Shan โ€” Tencent ARC Lab; Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences ([paper](https://arxiv.org/abs/2107.10833)) | | Architecture | `RRDBNet(num_in_ch=3, num_out_ch=3, num_feat=64, num_block=23, num_grow_ch=32, scale=4)` ([source](https://github.com/xinntao/Real-ESRGAN/blob/master/inference_realesrgan.py)) | | Upscale factor | 4ร— | | Weight file | `RealESRGAN_x4plus.pth` (~67 MB) | | Paper | [Wang et al., 2021 โ€” *Real-ESRGAN: Training Real-World Blind Super-Resolution with Pure Synthetic Data*](https://arxiv.org/abs/2107.10833) (ICCVW 2021) | | License | [BSD 3-Clause](LICENSE), Copyright (c) 2021 Xintao Wang | | Source repository | [github.com/xinntao/Real-ESRGAN](https://github.com/xinntao/Real-ESRGAN) | | Original asset URL | [github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth) | ## โšก Intended Use `x4plus` is a **general-purpose** super-resolution model โ€” it works well across a broad range of natural images and is the default model recommended by the upstream Real-ESRGAN README for everyday use. For anime / illustration content, the smaller [`amd/realesrgan-x4plus-anime-6b`](https://huggingface.co/amd/realesrgan-x4plus-anime-6b) checkpoint (6-block variant, ~18 MB) is a better fit. ## ๐Ÿ› ๏ธ How to Use The canonical entry point is the upstream [Real-ESRGAN repository](https://github.com/xinntao/Real-ESRGAN). The workflow below mirrors the [Quick Inference](https://github.com/xinntao/Real-ESRGAN#-quick-inference) section of the upstream README: ```bash # 1. Clone Real-ESRGAN git clone https://github.com/xinntao/Real-ESRGAN.git cd Real-ESRGAN # 2. Install dependencies pip install basicsr facexlib gfpgan pip install -r requirements.txt python setup.py develop # 3. Download the weights from this Hugging Face repo huggingface-cli download amd/realesrgan-x4plus RealESRGAN_x4plus.pth --local-dir weights # 4. Run inference python inference_realesrgan.py -n RealESRGAN_x4plus -i inputs --face_enhance ``` See the upstream [README.md](https://github.com/xinntao/Real-ESRGAN/blob/master/README.md) for the full set of CLI options (`--outscale`, `--tile`, `--fp32`, etc.). A portable NCNN executable variant is also available via the `realesrgan-x4plus` model name in [Real-ESRGAN-ncnn-vulkan](https://github.com/xinntao/Real-ESRGAN/releases). ## ๐Ÿ“š Training Data Per the Real-ESRGAN paper ([Wang et al., 2021](https://arxiv.org/abs/2107.10833), ยง5), the original Real-ESRGAN models were trained on three image datasets: 1. [**DIV2K**](https://github.com/limbee/NTIRE2017) โ€” 800 2K-resolution images for image restoration tasks. 2. [**Flickr2K**](https://github.com/limbee/NTIRE2017) โ€” 2,650 2K-resolution images. 3. [**OutdoorSceneTraining (OST)**](https://mmlab.ie.cuhk.edu.hk/projects/SFTGAN/) โ€” 10,324 1K- to 2K-resolution images of outdoor scenes. Training inputs are synthetically degraded via the high-order blur / downsample / noise / JPEG pipeline described in the paper. ## โš ๏ธ Caveats and Recommendations [Wang et al. (2021)](https://arxiv.org/abs/2107.10833) note that Real-ESRGAN can introduce aliasing, unpleasant artifacts, and may fail to remove complicated degradations. Results vary by content type โ€” use `amd/realesrgan-x4plus-anime-6b` for anime/illustration imagery rather than this checkpoint. ## ๐Ÿ“Œ Citation If you use this model, please cite the original Real-ESRGAN paper: ```bibtex @InProceedings{wang2021realesrgan, author = {Xintao Wang and Liangbin Xie and Chao Dong and Ying Shan}, title = {Real-ESRGAN: Training Real-World Blind Super-Resolution with Pure Synthetic Data}, booktitle = {International Conference on Computer Vision Workshops (ICCVW)}, date = {2021} } ``` ## ๐Ÿ“œ License These weights are distributed under the **[BSD 3-Clause License](LICENSE)**, Copyright (c) 2021 Xintao Wang ([upstream LICENSE](https://github.com/xinntao/Real-ESRGAN/blob/master/LICENSE)). This repository re-hosts the original artifact unchanged; please attribute the original authors when using or redistributing the weights. ## ๐Ÿค— Acknowledgments All credit for the model architecture, training methodology, and weights goes to **[Xintao Wang](https://github.com/xinntao)** and the Real-ESRGAN authors at Tencent ARC Lab and the Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences. This Hugging Face repository exists only as a convenient mirror of the pre-trained weight file alongside its license and citation context.