CoolFace
Modelpublic

AXERA-TECH/Real-ESRGAN.axera

sourceHugging Faceupdated 1mo agoView on Hugging Face
0likes27downloads
Model Card

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: 4.2

Convert tools links:

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

Support Platform

Chipsmodelcost
AX650realesrgan-x215.6 ms
AX650realesrgan-x462.1 ms

How to use

Download all files from this repository to the device


root@ax650:~/realesrgan# tree
.
|-- model
|   `-- realesrgan-x2.axmodel
|   `-- realesrgan-x4.axmodel
|`-- run_onnx.py
|`-- run_axmodel.py
|`-- build_config.json
|`-- requirements.txt

Inference

Input Data:
|-- pics
|   `-- 00003.png  
|   `-- 00017_gray.png  
|   `-- 0014.jpg  
|   `-- 0030.jpg  
|   `-- ADE_val_00000114.jpg  
|   `-- OST_009.png  
|   `-- children-alpha.png  
|   `-- tree_alpha_16bit.png  
|   `-- wolf_gray.jpg
Inference with AX650 Host, such as M4N-Dock(爱芯派Pro)
gradio ui
$python3 gradio_demo.py
[INFO] Available providers:  ['AXCLRTExecutionProvider']
[INFO] Using provider: AXCLRTExecutionProvider
[INFO] SOC Name: AX650N
[INFO] VNPU type: VNPUType.DISABLED
[INFO] Compiler version: 4.2-dirty 5e72cf06-dirty
[INFO] Using provider: AXCLRTExecutionProvider
[INFO] SOC Name: AX650N
[INFO] VNPU type: VNPUType.DISABLED
[INFO] Compiler version: 4.2-dirty 5e72cf06-dirty

==================================================
🌐 Real-ESRGAN 超分辨率 Web UI 已启动!
🔗 本地访问: http://127.0.0.1:7860
🔗 局域网访问: http://10.126.33.124:7860
==================================================

Then open the link in the browser to use the web UI: [image]

run image

root@ax650 ~/realesrgan #python3 run_axmodel.py --input ./pics --outscale 2 --model_path ./realesrgan-x2.axmodel
[INFO] Available providers:  ['AxEngineExecutionProvider']
Testing 0 00003
[INFO] Using provider: AxEngineExecutionProvider
[INFO] Chip type: ChipType.MC50
[INFO] VNPU type: VNPUType.DISABLED
[INFO] Engine version: 2.12.0s
[INFO] Model type: 2 (triple core)
[INFO] Compiler version: 4.2-dirty 5e72cf06-dirty
Testing 1 00017_gray
[INFO] Using provider: AxEngineExecutionProvider
[INFO] Model type: 2 (triple core)
[INFO] Compiler version: 4.2-dirty 5e72cf06-dirty
Testing 2 0014
[INFO] Using provider: AxEngineExecutionProvider
[INFO] Model type: 2 (triple core)
[INFO] Compiler version: 4.2-dirty 5e72cf06-dirty
Testing 3 0030
[INFO] Using provider: AxEngineExecutionProvider
[INFO] Model type: 2 (triple core)
[INFO] Compiler version: 4.2-dirty 5e72cf06-dirty
Testing 4 ADE_val_00000114
[INFO] Using provider: AxEngineExecutionProvider
[INFO] Model type: 2 (triple core)
[INFO] Compiler version: 4.2-dirty 5e72cf06-dirty
Testing 5 OST_009
[INFO] Using provider: AxEngineExecutionProvider
[INFO] Model type: 2 (triple core)
[INFO] Compiler version: 4.2-dirty 5e72cf06-dirty
Testing 6 children-alpha
[INFO] Using provider: AxEngineExecutionProvider
[INFO] Model type: 2 (triple core)
[INFO] Compiler version: 4.2-dirty 5e72cf06-dirty
Testing 7 tree_alpha_16bit
        Input is a 16-bit image
[INFO] Using provider: AxEngineExecutionProvider
[INFO] Model type: 2 (triple core)
[INFO] Compiler version: 4.2-dirty 5e72cf06-dirty
Testing 8 wolf_gray
[INFO] Using provider: AxEngineExecutionProvider
[INFO] Model type: 2 (triple core)
[INFO] Compiler version: 4.2-dirty 5e72cf06-dirty

Output: [image]