Skip to main content

MediaPipe-Hand-Detection Example

This document describes how to use the QAI AppBuilder Python API to run inference with the MediaPipe-Hand-Detection hand pose recognition model on Qualcomm® Hexagon™ Processor (NPU).

Supported devices

DeviceSoC
Fogwise® AIRbox Q900QCS9075

Install QAI AppBuilder​

tip
  1. Install QAI AppBuilder by following the QAI AppBuilder installation guide.

  2. Configure ADSP environment variables as described in Create ADSP environment variables.

Run the sample​

Install dependencies​

Install sample dependencies in the activated virtual environment:

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

The script also looks under ~/.qaihm for MediaPipePyTorch (provides blazepalm and related modules). If missing:

Device
mkdir -p ~/.qaihm
git clone --depth 1 https://github.com/zmurez/MediaPipePyTorch.git ~/.qaihm/MediaPipePyTorch

Run the script​

  • Enter the upstream samples directory

    Device
    cd qai-appbuilder/samples
  • Prepare input data (camera UI needs a GUI; use a static image in headless environments)

input image

  • Run inference

    Device
    python3 ComputerVision/Pose_Estimation/mediapipe_hand/mediapipe_hand.py \
    --chipset 9075 \
    --imagefile /path/to/hand_image.png \
    --displayPredict False \
    --DemoMode False
  • Example result: output.jpg is written in the sample directory

output image

tip

The first run downloads handdetector and landmarkdetector via Qualcomm® AI Hub. Prefer --imagefile when no display is available, and use opencv-python-headless to avoid Qt plugin initialization failures.

python3 run_inference.py --list
python3 run_inference.py --model mediapipe_hand --args "--chipset 9075 --imagefile /path/to/hand_image.png --displayPredict False --DemoMode False"

    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