py-real-esrgan


Namepy-real-esrgan JSON
Version 2.0.0 PyPI version JSON
download
home_pageNone
SummaryNone
upload_time2024-04-15 18:18:22
maintainerSberbank AI, Xintao Wang, nbdy
docs_urlNone
authorSberbank AI, Xintao Wang
requires_python>=3.10
licenseBSD 3-Clause License Copyright (c) 2021, Sberbank AI All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Real-ESRGAN
PyTorch implementation of a Real-ESRGAN model trained on custom dataset. This model shows better results on faces compared to the original version. It is also easier to integrate this model into your projects.

> This is not an official implementation. We partially use code from the [original repository](https://github.com/xinntao/Real-ESRGAN)

Real-ESRGAN is an upgraded [ESRGAN](https://arxiv.org/abs/1809.00219) trained with pure synthetic data is capable of enhancing details while removing annoying artifacts for common real-world images. 

You can try it in [google colab](https://colab.research.google.com/drive/1YlWt--P9w25JUs8bHBOuf8GcMkx-hocP?usp=sharing) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1YlWt--P9w25JUs8bHBOuf8GcMkx-hocP?usp=sharing)

- [Paper (Real-ESRGAN: Training Real-World Blind Super-Resolution with Pure Synthetic Data)](https://arxiv.org/abs/2107.10833)
- [Original implementation](https://github.com/xinntao/Real-ESRGAN)
- [Huggingface 🤗](https://huggingface.co/sberbank-ai/Real-ESRGAN)

### Installation

```bash
pip install git+https://github.com/sberbank-ai/Real-ESRGAN.git
```

### Usage

---

Basic usage:

```python
import torch
from PIL import Image
from py_real_esrgan.model import RealESRGAN

device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')

model = RealESRGAN(device, scale=4)
model.load_weights('weights/RealESRGAN_x4.pth', download=True)

path_to_image = 'inputs/lr_image.png'
image = Image.open(path_to_image).convert('RGB')

sr_image = model.predict(image)

sr_image.save('results/sr_image.png')
```

### Examples

---

Low quality image:

![](inputs/lr_image.png)

Real-ESRGAN result:

![](results/sr_image.png)

---

Low quality image:

![](inputs/lr_face.png)

Real-ESRGAN result:

![](results/sr_face.png)

---

Low quality image:

![](inputs/lr_lion.png)

Real-ESRGAN result:

![](results/sr_lion.png)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "py-real-esrgan",
    "maintainer": "Sberbank AI, Xintao Wang, nbdy",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": "Sberbank AI, Xintao Wang",
    "author_email": null,
    "download_url": null,
    "platform": null,
    "description": "# Real-ESRGAN\nPyTorch implementation of a Real-ESRGAN model trained on custom dataset. This model shows better results on faces compared to the original version. It is also easier to integrate this model into your projects.\n\n> This is not an official implementation. We partially use code from the [original repository](https://github.com/xinntao/Real-ESRGAN)\n\nReal-ESRGAN is an upgraded [ESRGAN](https://arxiv.org/abs/1809.00219) trained with pure synthetic data is capable of enhancing details while removing annoying artifacts for common real-world images. \n\nYou can try it in [google colab](https://colab.research.google.com/drive/1YlWt--P9w25JUs8bHBOuf8GcMkx-hocP?usp=sharing) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1YlWt--P9w25JUs8bHBOuf8GcMkx-hocP?usp=sharing)\n\n- [Paper (Real-ESRGAN: Training Real-World Blind Super-Resolution with Pure Synthetic Data)](https://arxiv.org/abs/2107.10833)\n- [Original implementation](https://github.com/xinntao/Real-ESRGAN)\n- [Huggingface \ud83e\udd17](https://huggingface.co/sberbank-ai/Real-ESRGAN)\n\n### Installation\n\n```bash\npip install git+https://github.com/sberbank-ai/Real-ESRGAN.git\n```\n\n### Usage\n\n---\n\nBasic usage:\n\n```python\nimport torch\nfrom PIL import Image\nfrom py_real_esrgan.model import RealESRGAN\n\ndevice = torch.device('cuda' if torch.cuda.is_available() else 'cpu')\n\nmodel = RealESRGAN(device, scale=4)\nmodel.load_weights('weights/RealESRGAN_x4.pth', download=True)\n\npath_to_image = 'inputs/lr_image.png'\nimage = Image.open(path_to_image).convert('RGB')\n\nsr_image = model.predict(image)\n\nsr_image.save('results/sr_image.png')\n```\n\n### Examples\n\n---\n\nLow quality image:\n\n![](inputs/lr_image.png)\n\nReal-ESRGAN result:\n\n![](results/sr_image.png)\n\n---\n\nLow quality image:\n\n![](inputs/lr_face.png)\n\nReal-ESRGAN result:\n\n![](results/sr_face.png)\n\n---\n\nLow quality image:\n\n![](inputs/lr_lion.png)\n\nReal-ESRGAN result:\n\n![](results/sr_lion.png)\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause License  Copyright (c) 2021, Sberbank AI All rights reserved.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
    "summary": null,
    "version": "2.0.0",
    "project_urls": {
        "Changelog": "https://github.com/ai-forever/Real-ESRGAN/blob/main/CHANGELOG.md",
        "Documentation": "https://github.com/ai-forever/Real-ESRGAN/wiki",
        "Homepage": "https://github.com/ai-forever/Real-ESRGAN",
        "Issues": "https://github.com/ai-forever/Real-ESRGAN/issues",
        "Repository": "https://github.com/ai-forever/Real-ESRGAN.git"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "36cd928f22d14f87e03061785e0929184ba433b1ac6aae958ed67c5d9ab034fd",
                "md5": "466e8ac7bf33658ca0819315618b61cf",
                "sha256": "5667e58c416761a1f0fa3fc09c2ec2605379d732ef0fe465bf986d2ccc218a78"
            },
            "downloads": -1,
            "filename": "py_real_esrgan-2.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "466e8ac7bf33658ca0819315618b61cf",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 11860,
            "upload_time": "2024-04-15T18:18:22",
            "upload_time_iso_8601": "2024-04-15T18:18:22.547861Z",
            "url": "https://files.pythonhosted.org/packages/36/cd/928f22d14f87e03061785e0929184ba433b1ac6aae958ed67c5d9ab034fd/py_real_esrgan-2.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-15 18:18:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ai-forever",
    "github_project": "Real-ESRGAN",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "py-real-esrgan"
}
        
Elapsed time: 0.23529s