Saltar al contenido
ModelPublicadoExterno
Descargar

Realesrgan Onnx

ONNX export of Real-ESRGAN's general-purpose 4× upscaler (realesr-general-x4v3 variant). At only 5 MB it punches well above its weight on real photographs.

TipoOtherModelo basexinntao/Real-ESRGANVersiónRevision 488e5ddBcalidad

Fuente del modelo

Tipo
Other
Tamaño del archivo
4,65 MB
Modelo base
xinntao/Real-ESRGAN
Versión
vRevision 488e5dd
Actualizado
9 oct 2026
Descargas
0
Fuente
Hugging Face

Descripción de la fuente

Real-ESRGAN-x4v3 — 4× Image Super-Resolution (ONNX)

ONNX export of Real-ESRGAN's general-purpose 4× upscaler (realesr-general-x4v3 variant). At only ~5 MB it punches well above its weight on real photographs.

Re-hosted under Heliosoph for distribution stability — xinntao's GitHub releases are the authoritative source.

Credit: Wang Xintao et al. (Tencent ARC Lab).

What this repo contains

realesr-general-x4v3.onnx    # ~5 MB

A single ONNX file. The model upscales any input image to 4× its width and height with learned restoration of fine detail.

Input/output

Spec
Input nameinput
Input shapedynamic — [1, 3, H, W]
Input dtypefloat32, range [0, 1]
Input color orderRGB
PreprocessingDivide by 255 (no mean/std subtraction). Tile large images to avoid OOM.
Output[1, 3, H*4, W*4] in [0, 1]

How to use

import onnxruntime as ort
import numpy as np
from PIL import Image

sess = ort.InferenceSession("realesr-general-x4v3.onnx")

img = Image.open("low_res.jpg").convert("RGB")
arr = np.asarray(img, dtype=np.float32) / 255.0
arr = arr.transpose(2, 0, 1)[None, ...]  # 1x3xHxW

upscaled = sess.run(None, {"input": arr})[0][0]  # 3 x (H*4) x (W*4)
upscaled = (upscaled.transpose(1, 2, 0) * 255).clip(0, 255).astype(np.uint8)
Image.fromarray(upscaled).save("upscaled_4x.png")

For images larger than ~512×512, tile the input into overlapping patches and stitch the outputs — otherwise inference memory grows quadratically. Real-ESRGAN's reference implementation includes a tiler.

When to use which Real-ESRGAN variant

This repo ships realesr-general-x4v3 only. Other Real-ESRGAN variants exist upstream:

VariantBest for
realesr-general-x4v3 (this repo)General-purpose photos, illustrations, screenshots
RealESRGAN_x4plus_anime_6BAnime / cartoon-style images
RealESRGAN_x4plusPhotographs, more aggressive enhancement

The general-x4v3 is the safest default — it doesn't over-sharpen real photos or hallucinate on noisy input.

License

BSD-3-Clause — same as upstream. LICENSE file included.

Fuentes

1 fuente
Hugging FacePrincipalVersión 488e5dda07333179f229a6205d92135eea4c25e9
huggingface.co/Heliosoph/realesrgan-onnx/tree/488e5dda07333179f229a6205d92135eea4c25e9

Verificado 9 oct

Artefactos del modelo

1 artefacto

realesr-general-x4v3.onnx

onnx · 4,65 MB · SHA-256 09b757accd74…6fa4 · Hugging Face

Download file

Extractos de fuentes

2 extractos

--- license: bsd-3-clause library_name: onnx tags: - super-resolution - real-esrgan - image-upscaling - onnx base_model: xinntao/Real-ESRGAN pipeline_tag: image-to-image language: - en --- # Real-ESRGAN-x4v3 — 4× Image Super-Resolution (ONNX) ONNX export of [Real-ESRGAN](https://github.com/xinntao/Real-ESRGAN)'s general-purpose 4× upscaler (`realesr-general-x4v3` variant). At only ~5 MB it punches well above its weight on real photographs. Re-hosted under Heliosoph for distribution stability — xinntao's GitHub releases are the authoritative source. Credit: Wang Xintao et al. (Tencent ARC Lab). ## What this repo contains ``` realesr-general-x4v3.onnx # ~5 MB ``` A single ONNX file. The model upscales any input image to 4× its width and height with learned restoration of fine detail. ## Input/output | | Spec | |---|---| | Input name | `input` | | Input shape | dynamic — `[1, 3, H, W]` | | Input dtype | float32, range `[0, 1]` | | Input color order | **RGB** | | Preprocessing | Divide by 255 (no mean/std subtraction). Tile large images to avoid OOM. | | Output | `[1, 3, H*4, W*4]` in `[0, 1]` | ## How to use ```python import onnxruntime as ort import numpy as np from PIL import Image sess = ort.InferenceSession("realesr-general-x4v3.onnx") img = Image.open("low_res.jpg").convert("RGB") arr = np.asarray(img, dtype=np.float32) / 255.0 arr = arr.transpose(2, 0, 1)[None, ...] # 1x3xHxW upscaled = sess.run(None, {"input": arr})[0][0] # 3 x (H*4) x (W*4) upscaled = (upscaled.transpose(1, 2, 0) * 255).clip(0, 255).astype(np.uint8) Image.fromarray(upscaled).save("upscaled_4x.png") ``` For images larger than ~512×512, tile the input into overlapping patches and stitch the outputs — otherwise inference memory grows quadratically. Real-ESRGAN's reference implementation includes a tiler. ## When to use which Real-ESRGAN variant This repo ships `realesr-general-x4v3` only. Other Real-ESRGAN variants exist upstream: | Variant | Best for | |---|---| | **`realesr-general-x4v3`** (this repo) | General-purpose photos, illustrations, screenshots | | `RealESRGAN_x4plus_anime_6B` | Anime / cartoon-style images | | `RealESRGAN_x4plus` | Photographs, more aggressive enhancement | The `general-x4v3` is the safest default — it doesn't over-sharpen real photos or hallucinate on noisy input. ## License **BSD-3-Clause** — same as upstream. `LICENSE` file included.

Source context: 0 downloads · 0 likes · Pipeline image-to-image · Library onnx · Repo Heliosoph/realesrgan-onnx