ONNX Model Zoo

AXERA-TECH/Real-ESRGAN

By AXERA-TECH · ↓ 13 · ♥ 1 · Updated 2025-05-04

What's in this repo

This page lists the files in AXERA-TECH/Real-ESRGAN, including realesrgan-x4-256.onnx, realesrgan-x4.onnx.

  • 2 ONNX models (.onnx files)
  • 12 files, including 4 .axmodel, 2 .onnx, 1 .md, 1 .json, 1 .py, 1 .jpg
  • Last updated 2025-05-04

ONNX files

File Size Download
onnx/realesrgan-x4-256.onnx — Download
onnx/realesrgan-x4.onnx — Download

How to use

These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.

README

Real-ESRGAN

This version of Real-ESRGAN has been converted to run on the Axera NPU using w8a8 quantization.

This model has been optimized with the following LoRA:

Compatible with Pulsar2 version: 3.4

Convert tools links:

For those who are interested in model conversion, you can try to export axmodel through

Support Platform

Chips 64x64 -> 256x256 256x256 -> 1024x1024
AX650 15 ms 440 ms
AX630C 76 ms 2030 ms

How to use

Download all files from this repository to the device

(axcl) axera@raspberrypi:~/samples/realesrgan.axera $ tree -L 2
.
├── ax630c
│   ├── realesrgan-x4-256.axmodel
│   └── realesrgan-x4.axmodel
├── ax650
│   ├── realesrgan-x4-256.axmodel
│   └── realesrgan-x4.axmodel
├── config.json
├── main.py
├── onnx
│   ├── realesrgan-x4-256.onnx
│   └── realesrgan-x4.onnx
├── output_test_256.jpg
├── out_test-256.jpg
└── test_256.jpeg

3 directories, 11 file

python env requirement

pyaxengine

https://github.com/AXERA-TECH/pyaxengine

wget https://github.com/AXERA-TECH/pyaxengine/releases/download/0.1.3rc0/axengine-0.1.3-py3-none-any.whl
pip install axengine-0.1.3-py3-none-any.whl
others
pip install argparse numpy opencv-python

Inference with AX630C Host, such as Module-LLM, LLM630 Compute Kit

root@ax630c:/mnt/qtang/realesrgan.axera# python3 main.py --input test_256.jpeg --output test_256_20e.jpeg --model ax630/realesrgan-x4-256.axmodel
[INFO] Available providers:  ['AxEngineExecutionProvider']
[INFO] Using provider: AxEngineExecutionProvider
[INFO] Chip type: ChipType.MC20E
[INFO] VNPU type: VNPUType.DISABLED
[INFO] Engine version: 2.7.2a
[INFO] Model type: 1 (full core)
[INFO] Compiler version: 3.4 3dfd5692
input.1 [1, 256, 256, 3] uint8
1895 [1, 1024, 1024, 3] float32
Original Image Shape: (243, 243, 3)
Preprocessed Image Shape: (1, 256, 256, 3)
Inference Time: 2066.72 ms
Output Shape: (1, 1024, 1024, 3)
Final Output Image Shape: (1024, 1024, 3)
root@ax630c:/mnt/qtang/realesrgan.axera# 

Inference with M.2 Accelerator card

What is M.2 Accelerator card?, Show this DEMO based on Raspberry PI 5.

(axcl) axera@raspberrypi:~/samples/realesrgan.axera $ python main.py --input test_256.jpeg --output output_test_256.jpg --model realesrgan-x4-256.axmodel
[INFO] Available providers:  ['AXCLRTExecutionProvider']
[INFO] Using provider: AXCLRTExecutionProvider
[INFO] SOC Name: AX650N
[INFO] VNPU type: VNPUType.DISABLED
[INFO] Compiler version: 3.4 3dfd5692
input.1 [1, 256, 256, 3] uint8
<cdata 'char *' 0x262e54e0> [1, 1024, 1024, 3] float32
Original Image Shape: (243, 243, 3)
Preprocessed Image Shape: (1, 256, 256, 3)
Inference Time: 455.81 ms
Output Shape: (1, 1024, 1024, 3)
Final Output Image Shape: (1024, 1024, 3)
(axcl) axera@raspberrypi:~/samples/realesrgan.axera $

Input

Output

Model info

onnx Real-ESRGAN SR Int8 image-to-image en license:bsd-3-clause-clear region:us
↓ 13 ♥ 1

Created: 2025-05-04

Updated: 2025-05-04

View on Hugging Face

Files (12)

.gitattributes
README.md
ax630c/realesrgan-x4-256.axmodel
ax630c/realesrgan-x4.axmodel
ax650/realesrgan-x4-256.axmodel
ax650/realesrgan-x4.axmodel
config.json
main.py
onnx/realesrgan-x4-256.onnx ONNX
onnx/realesrgan-x4.onnx ONNX
output_test_256.jpg
test_256.jpeg

Related models