Skip to main content

Real-ESRGAN

This document explains how to run the Real-ESRGAN sample application on a host device equipped with the Radxa AICore AX-M1.

Precompiled model quantization format: w8a8.

Create a virtual environment

Host
python3 -m venv .venv && source .venv/bin/activate

Download the demo repository

Host
pip3 install -U "huggingface_hub"
hf download AXERA-TECH/Real-ESRGAN --local-dir ./Real-ESRGAN
cd Real-ESRGAN

Example usage

Install Python dependencies

Host
pip3 install argparse numpy opencv-python
pip3 install https://github.com/AXERA-TECH/pyaxengine/releases/download/0.1.3.rc1/axengine-0.1.3-py3-none-any.whl

Model inference

Host
python3 main.py --input test_256.jpeg  --output test_256_20e.jpeg --model ax650/realesrgan-x4-256.axmodel
(.venv) rock@rock-5b-plus:~/ssd/axera/Real-ESRGAN$ python3 main.py --input test_256.jpeg  --output test_256_x4.jpeg --model ax650/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
1895 [1, 1024, 1024, 3] float32
Original Image Shape: (243, 243, 3)
Preprocessed Image Shape: (1, 256, 256, 3)
Inference Time: 465.12 ms
Output Shape: (1, 1024, 1024, 3)
Final Output Image Shape: (1024, 1024, 3)

real-esrgan demo input

real-esrgan demo output

    You need to be logged into GitHub to post a comment. If you are already logged in, please ignore this message.

    Radxa-docs © 2026 by Radxa Computer (Shenzhen) Co.,Ltd. is licensed under CC BY 4.0