Real-ESRGAN-x4plus Example
This document describes using the QAI AppBuilder Python API to run inference with the Real-ESRGAN-x4plus super-resolution model on the Qualcomm® Hexagon™ Processor (NPU).
Supported devices
| Device | SoC |
|---|---|
| Dragon Q6A | QCS6490 |
| Dragon Q8B | SC8280XP |
| Fogwise® AIRbox Q900 | QCS9075 |
Install QAI AppBuilder
-
Install QAI AppBuilder by following the QAI AppBuilder installation guide.
-
Configure ADSP environment variables as described in Create ADSP environment variables.
Run the sample
Install dependencies
Install sample dependencies in the activated virtual environment:
pip3 install requests tqdm qai-hub py3-wget Pillow torch torchvision opencv-python-headless
Run the script
-
Enter the upstream samples directory
Devicecd qai-appbuilder/samples -
Prepare input data (the sample provides a default image)

input image
Run inference
On QCS6490 / SC8280XP, do not use the default float DLC. The default .dlc path fails with The SocModel doesn't support FP16. Use --bin to download the precompiled HTP context binary.
- QCS6490
- SC8280XP
- QCS9075
python3 ComputerVision/Super_Resolution/real_esrgan_x4plus/real_esrgan_x4plus.py --chipset 6490 --bin --no_show
SC8280XP and QCS6490 both use Hexagon V68. Use --chipset 6490 with --bin.
python3 ComputerVision/Super_Resolution/real_esrgan_x4plus/real_esrgan_x4plus.py --chipset 6490 --bin --no_show
python3 ComputerVision/Super_Resolution/real_esrgan_x4plus/real_esrgan_x4plus.py --chipset 9075 --no_show
On QCS9075 the Hub default is a .bin HTP context that runs as-is. Use --no_show on headless sessions.
--no_show avoids opening an image viewer on headless SSH sessions.
Expected result
A successful run writes:
ComputerVision/Super_Resolution/real_esrgan_x4plus/output.png
Launcher alternative:
python3 run_inference.py --model real_esrgan_x4plus --args "--chipset 6490 --bin --no_show"