Single-model vision tasks like object detection are a staple of edge AI, but real-world interactive applications—such as touchless UI control, sign language interpretation, and robotics—frequently require chained multi-model pipelines.
In a multi-model pipeline, the output of one neural network dynamically crops, scales, or conditions the input for the next. While flexible, chaining multiple models sequentially can cause a severe CPU bottleneck if executed entirely on host ARM cores.
In this project, we tackle the complete 3-stage MediaPipe Hand Gesture Recognition pipeline on the Qualcomm Dragonwing IQ-9075 EVK running Ubuntu 24.04 LTS. By leveraging Qualcomm's QNN (Qualcomm Neural Network) Hexagon HTP Delegate through ai-edge-litert, we offload all three models directly into the NPU's VTCM (Vector Tightly-Coupled Memory) cache. We then compare this setup against a 4-thread CPU baseline.
You'll need:
- A Dragonwing IQ-9075 EVK, already flashed with Ubuntu 24.04 LTS and reachable over SSH. If you haven't done this yet, follow Qualcomm's official guides first: Flash Ubuntu using QDL, then et up the device.
- A USB webcam (e.g., Logitech C922 Pro Stream).
- A host computer to work from (Mac or Linux; the steps below are identical on Windows via WSL).
- A free account at aihub.qualcomm.com.
Check that your board is reachable over SSH before doing anything else. <user> is ubuntu unless you changed it during setup:
ssh <user>@<board-ip> 'echo board is up'Tip: Don't know your board's IP? Try ssh [email protected] first (the board announces itself on the local network under its hostname, ubuntu by default). Otherwise, check your Wi-Fi router's list of connected devices.
Tip: Don't know your board's IP? Try2. Prepare Python & AI Hub Environment on Host PCssh [email protected]first (the board announces itself on the local network under its hostname,ubuntuby default). Otherwise, check your Wi-Fi router's list of connected devices.
Install Python on your computer. AI Hub's tools require Python 3.10, 3.11, 3.12, or 3.13. Check what version you have:
python3.12 --versionIf that command isn't found, install it on your host machine:
- Mac:
brew install [email protected] - Linux (Ubuntu 24.04):
sudo apt install python3.12 python3.12-venv - Windows: Use WSL, then follow the Linux instructions inside it.
Next, create a virtual environment and install the AI Hub models package on your host computer:
python3.12 -m venv ~/qai-hub-env
source ~/qai-hub-env/bin/activate
pip install "qai-hub-models[mediapipe_hand_gesture]"3. Connect Host to Qualcomm AI HubGet your API token from aihub.qualcomm.com → Account / Settings → API Token, then configure your client:
qai-hub configure --api_token YOUR_TOKENVerify that the Dragonwing IQ-9075 EVK is recognized by AI Hub:
qai-hub list-devices | grep -i 9075If Dragonwing IQ-9075 EVK (or QCS9075) shows up in the output, you're ready!
Unlike a single-shot detector, MediaPipe breaks gesture recognition into three distinct stages to maximize precision while keeping compute costs low:
- Stage 1 — Palm Detection: Detects palm centers and rotation angles across a full 256x256 image frame.
- Stage 2 — Hand Landmarks: Warps and rescales the cropped hand region to 224x224, extracting 21 3D hand coordinates and identifying left vs. right hand orientation.
- Stage 3 — Gesture Classification: Preprocesses the 21 landmarks into a centered, scale-invariant 64-element feature vector (including handedness), running it through both regular and mirrored passes to classify gestures (Open Palm, Closed Fist, Pointing Up, Victory, Thumb Up, Thumb Down, ILoveYou, or None).
We will download both model variants (Float32 for CPU benchmarking and 8-bit Quantized INT8 W8A8 for NPU acceleration) using the Qualcomm AI Hub CLI on your host computer, then push them directly to the IQ9 EVK over SSH/SCP.
A. Download Assets on Host PCOn your host Mac/Linux machine (make sure your ~/qai-hub-env virtual environment is active):
# Create a local workspace on your Host
mkdir -p ~/mediapipe_workspace
cd ~/mediapipe_workspace
# Fetch NPU (W8A8) and CPU (Float32) models via AI Hub CLI
qai-hub-models fetch mediapipe_hand_gesture --runtime tflite --precision w8a8
qai-hub-models fetch mediapipe_hand_gesture --runtime tflite --precision float(Note: The CLI extracts the models directly into mediapipe_hand_gesture-tflite-w8a8 and mediapipe_hand_gesture-tflite-float in your current directory.)
Now create target directories on the board and transfer the extracted .tflite model files using scp:
# Create destination directories on the board via SSH
ssh <user>@<board-ip> "mkdir -p ~/models/mediapipe_hand_gesture-tflite-w8a8 ~/models/mediapipe_hand_gesture-tflite-float"
# Transfer W8A8 (NPU) models from Host to IQ9 EVK
scp -r ~/mediapipe_workspace/mediapipe_hand_gesture-tflite-w8a8/* <user>@<board-ip>:~/models/mediapipe_hand_gesture-tflite-w8a8/
# Transfer Float32 (CPU) models from Host to IQ9 EVK
scp -r ~/mediapipe_workspace/mediapipe_hand_gesture-tflite-float/* <user>@<board-ip>:~/models/mediapipe_hand_gesture-tflite-float/Verify that the models are present on your board:
ssh <user>@<board-ip> "ls -la ~/models/mediapipe_hand_gesture-tflite-w8a8/"Each directory on the EVK should contain:
palm_detector.tflitehand_landmark_detector.tflitecanned_gesture_classifier.tflite
The rest of this guide takes place directly on the board. SSH into your IQ-9075 EVK:
ssh <user>@<board-ip>Update system packages and install OpenCV/GStreamer multimedia libraries:
sudo apt update && sudo apt upgrade -y
sudo apt install -y \
python3-pip \
python3-venv \
python3-dev \
git \
build-essential \
cmake \
libgl1-mesa-glx \
libglib2.0-0 \
libgstreamer1.0-0 \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
v4l-utilsStep 3: Configure On-Device Python Virtual EnvironmentCreate an isolated virtual environment on the board to manage Python packages safely:
# Navigate to home and create environment
cd ~
python3 -m venv mediapipe_env
# Activate virtual environment
source ~/mediapipe_env/bin/activate
# Upgrade pip and install execution libraries
pip install --upgrade pip
pip install ai-edge-litert opencv-python numpyNote: Always run source ~/mediapipe_env/bin/activate whenever opening a new terminal session on the EVK to run your scripts.
Note: Always run source ~/mediapipe_env/bin/activate whenever opening a new terminal session on the EVK to run your scripts.Step 4: Verify Qualcomm QNN Delegate DriversThe Qualcomm Neural Network (QNN) delegate connects ai-edge-litert directly to the Hexagon Tensor Processor (HTP/NPU). Check that the shared driver library is available on the board:
ls -l /usr/lib/libQnnTFLiteDelegate.soIf this path resolves, the board is fully ready for hardware NPU acceleration.
Step 5: Code Architecture HighlightsIn Python, binding multi-model stages to the Hexagon NPU requires instantiating the QNN delegate with LiteRT:
import ai_edge_litert.interpreter as litert
# Path to the Qualcomm QNN hardware delegate
QNN_DELEGATE_PATH = "/usr/lib/libQnnTFLiteDelegate.so"
# Load delegate for Hexagon Tensor Processor (HTP)
qnn_delegate = litert.load_delegate(QNN_DELEGATE_PATH, options={"backend_type": "htp"})
# Bind each pipeline stage to the NPU
palm_interp = litert.Interpreter(model_path=PALM_DETECTOR_PATH, experimental_delegates=[qnn_delegate])
palm_interp.allocate_tensors()
land_interp = litert.Interpreter(model_path=LANDMARK_DETECTOR_PATH, experimental_delegates=[qnn_delegate])
land_interp.allocate_tensors()
class_interp = litert.Interpreter(model_path=CLASSIFIER_PATH, experimental_delegates=[qnn_delegate])
class_interp.allocate_tensors()Step 6: Setup Python Scripts and Execute BenchmarksOn the IQ-9075 EVK (with your ~/mediapipe_env virtual environment active), create a dedicated folder for the project code:
mkdir -p ~/mediapipe_gesture
cd ~/mediapipe_gesturemain_npu.py(Copy the code from the Code / Attachments section)
You can create these directly on the board using nano:
nano main_cpu.py
# Paste the CPU code and save (Ctrl+O, Enter, Ctrl+X)
nano main_npu.py
# Paste the NPU code and save (Ctrl+O, Enter, Ctrl+X)Running the NPU BenchmarkBefore running the NPU script, we must export the ADSP_LIBRARY_PATH. This environment variable tells the host OS (Ubuntu) exactly where to find the low-level FastRPC skeletal and stub files required to establish a communication bridge with the Hexagon NPU processor. Without it, the application will fail to initialize the NPU and likely crash or silently fall back to the CPU.
Plug in your USB webcam and run the NPU accelerated script:
export ADSP_LIBRARY_PATH=/usr/lib/rfsa/adsp:/dsp
python3 main_npu.py- Visual Output: A real-time window displaying green hand bounding box, yellow skeletal connections, red joint landmarks, dark blue gesture labels, and real-time NPU latency metrics in green.
Run the CPU baseline script to compare performance against host ARM cores:
python3 main_cpu.py- Visual Output: Identical pipeline visualization displaying yellow latency metrics representing 4-thread CPU execution.
Below are the end-to-end performance metrics collected on the Qualcomm IQ-9075 EVK running Ubuntu 24.04 LTS:
- Multi-Model Chaining on NPU: Offloading sequential models to the Qualcomm Hexagon NPU significantly reduces end-to-end latency while keeping host CPU cycles free for downstream robotics or control logic.
- VTCM Cache Advantage: 8-bit quantization (
w8a8) allows all three model graphs to fit inside Hexagon's high-speed VTCM cache, avoiding memory bandwidth bottlenecks. - Edge Readiness: Shifting vision processing to the NPU delivers a power-efficient, ultra-responsive foundation for real-time edge AI systems.




Comments