跳到主要内容

Real-ESRGAN-x4plus 示例

此文档讲述使用 QAI AppBuilder Python API 利用 Qualcomm® Hexagon™ Processor (NPU) 推理 Real-ESRGAN-x4plus 图像超分模型。

示例支持设备

设备SoC
Dragon Q6AQCS6490
Dragon Q8BSC8280XP
Fogwise® AIRbox Q900QCS9075

安装 QAI AppBuilder

提示
  1. 请根据 QAI AppBuilder 安装方法 安装 QAI AppBuilder。

  2. 请根据 创建 ADSP 环境变量 配置 ADSP 环境变量。

运行示例

安装依赖

在已激活的虚拟环境中安装示例依赖:

Device
pip3 install requests tqdm qai-hub py3-wget Pillow torch torchvision opencv-python-headless

运行脚本

  • 进入上游示例目录

    Device
    cd qai-appbuilder/samples
  • 准备输入数据(示例自带输入文件时可直接运行;也可按脚本参数指定)

input image

执行推理

注意

在 QCS6490 / SC8280XP 上,不要使用默认 float DLC。默认 .dlc 会报 The SocModel doesn't support FP16 并导致加载失败。请使用 --bin 下载预编译 HTP context binary。

提示

SC8280XP 与 QCS6490 同为 Hexagon V68,下载模型时使用 --chipset 6490,并加 --bin

Device
python3 ComputerVision/Super_Resolution/real_esrgan_x4plus/real_esrgan_x4plus.py --chipset 6490 --bin --no_show

--no_show 用于无图形界面的 SSH/无头环境,避免弹出看图窗口。

预期结果

推理成功后会生成:

ComputerVision/Super_Resolution/real_esrgan_x4plus/output.png

日志中可见类似 Inference completed 与输出路径信息。

提示

也可使用启动器:

python3 run_inference.py --model real_esrgan_x4plus --args "--chipset 6490 --bin --no_show"

    您需要登录 GitHub 才能发表评论。如果您已登录,请忽略此消息。

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