Skip to main content
QIMSDK · Qualcomm
Computer Vision

Build a four-stage real-time hand gesture recognition pipeline using Qualcomm IM SDK — covering palm detection, hand landmark estimation, gesture embedding, and gesture classification, all running on-device with hardware-accelerated inference.

QIMSDK Team·Jun 10, 2026·← All posts

Introduction

Real-time gesture recognition is redefining how humans interact with machines — enabling touchless, natural interfaces across augmented reality, gaming, accessibility, and industrial control. But accurately interpreting hand gestures demands more than simple object detection; it requires a multi-stage AI pipeline capable of progressively refining raw visual input into high-level, actionable intent. The QIM SDK brings this capability directly to the edge. By routing compute-intensive tasks through hardware-accelerated GStreamer plugins, the SDK offloads video decoding, frame preparation, multi-stage inference, and encoding entirely to dedicated hardware blocks — delivering low-latency, power-efficient execution even for complex multi-model workloads. At the core of this use case is a four-stage sequential inference pipeline:

Stage 1

Palm Detection

Stage 2

Hand Landmark Estimation

Stage 3

Gesture Embedding

Stage 4

Gesture Classification
Each stage builds directly on the output of the previous, progressively transforming raw video frames into structured, high-level gesture data. Between stages, intermediate transformations — such as rotating and cropping detected hand regions for correct spatial alignment — ensure consistent, accurate results across varying hand positions and orientations. Metadata is hierarchically structured throughout the pipeline. Each detected hand establishes a root metadata entry, with landmark detections, embeddings, and gesture classifications attached as child metadata linked to the originating detection. Visualization is fully hardware-accelerated: bounding boxes, key-points, and gesture labels are composited directly onto video frames via optimized overlay rendering. The pipeline accepts input from USB cameras, RTSP streams, ISP (on-device) cameras, and local video files, and delivers results through real-time on-screen visualization or remote streaming over RTSP and WebRTC — with structured inference metadata transmitted in parallel. The complete application source code is available here.

Use Case Overview

1

Source

The pipeline accepts continuous video input from a USB camera, RTSP stream, ISP (on-device) camera, or local video file.
2

Palm Detection

Each incoming frame is processed by the palm detection model, which identifies the presence, location, and rotation angle of any hands in the scene.
3

Hand Landmark Detection

For each detected hand, the landmark model identifies 21 key points — fingertips, joints, and wrist — capturing the full structural pose. The hand region is first rotated and cropped via affine transformation for correct spatial alignment.
4

Gesture Embedding

The detected landmarks are encoded into a compact numerical representation that summarizes the hand pose in a form optimized for classification.
5

Gesture Classification

The embedding is passed to the gesture classification model, which maps the hand pose to a predefined gesture label — such as open hand, fist, or thumbs up.
6

Metadata Synchronization

Results from all inference stages are structured hierarchically. qtimetamux synchronizes this structured metadata with the original video frames, maintaining per-frame consistency throughout the pipeline.
7

Output

Annotated frames are H.264-encoded and delivered over RTSP or WebRTC, with structured inference metadata transmitted in parallel as a JSON stream.

Pipeline diagram

Hand Gesture Recognition Pipeline

Elements used in pipeline

How It Works

1

Stage 1 — Palm Detection

The first model processes the full video frame, identifying the location, orientation, and bounding box of each detected hand. This stage also produces key points used to estimate the hand’s rotation angle. A qtimetatransform element uses this information to compute an affine transformation matrix, which is attached as metadata and carried forward to the next stage.
2

Affine Crop Generation

The hand landmark model requires a normalized, upright view of the hand — not raw bounding box coordinates. A dedicated qtimlvconverter instance consumes the affine transformation matrix and applies it to crop and rotate the detected hand region from the original frame, producing a correctly aligned input for the next stage.
3

Stage 2 — Hand Landmark Detection

The landmark model is invoked once per detected hand, processing the cropped and aligned region to produce 21 keypoints — fingertips, joints, and wrist — along with handedness and confidence scores. A post-processing step then applies a reverse transformation to remap the keypoints accurately back onto the original frame coordinate space.
4

Stage 3 — Gesture Embedding

The landmark keypoints are passed to the gesture embedder, which encodes the hand pose into a compact numerical embedding vector. This stage operates directly on tensor data — no image cropping or geometric transformation is required.
5

Stage 4 — Gesture Classification

The embedding vector is passed to the gesture classifier, which maps the hand pose representation to a predefined gesture label — such as open hand, fist, or thumbs up. Like the embedder, this stage operates purely on tensors with no additional preprocessing.
6

Hierarchical Metadata

To preserve logical relationships across all four stages, the pipeline employs a hierarchical metadata model based on unique IDs and parent IDs. The palm detection stage creates a root metadata entry for each detected hand; each subsequent stage — landmark detection, embedding, and classification — attaches its results as child metadata referencing the parent. This ensures every classified gesture is explicitly traceable to its originating hand detection.
7

Output

Annotated frames with bounding boxes, keypoints, and gesture labels are rendered via hardware-accelerated overlay. The H.264-encoded stream is delivered over RTSP or WebRTC, with structured inference metadata transmitted in parallel as a JSON stream.

Run application on device

Setup Requirements

Hardware

HW Setup

Software

Flash your Qualcomm Edge device by following the device setup and flashing instructions here Once your device is ready, follow the instructions below to set up the Gesture Recognition AI Pipeline:
AI Model and config files
Download the gesture recognizer models from Google MediaPipe:
These are FLOAT precision models.
Copy files to device
Connect to device
Run the Gesture Recognition Application
Note: A display must be connected to the device. If no display is available, use the --no-display flag to run in headless mode.
Use the following base path for model and label files based on your OS:
Note: This example uses an offline video file as input. To use an IP/RTSP camera or USB camera instead, update the --input-type argument accordingly — refer to the Command-Line Options section below for details.
It produces two key output results: an AI-annotated video stream and a JSON metadata stream. To visualize these results, refer to the Host-Side Visualization section below.

Visualize the Results - Host-Side Visualization (Windows + WSL)

This section describes how to run the visualization client on a Windows host machine using WSL (Windows Subsystem for Linux). The client renders the live video stream alongside a real-time AI metadata panel. 📥 The visualization client script can be downloaded here: rtsp_webrtc_client.py It displays:
  • Left panel — Live video stream with AI overlays (bounding boxes, keypoints, gesture labels)
  • Right panel — Real-time AI metadata (JSON): object detections, bounding boxes, and confidence scores.
Step 1 — Install WSL and Ubuntu If WSL is not already installed, run the following from a Windows terminal:
Once installed, open the Ubuntu terminal and update the system:
Step 2 — Install System Dependencies The visualization script requires GStreamer and Python GObject Introspection (GI) bindings. Install all required packages with:
Step 3 — Run the Visualization Client Script Navigate to the directory containing the script and run:
Step 4 — Expected Output Once the client connects, the UI will display: After following the steps, the video and metadata streams should be up and running. Gesture Recognition AI Pipeline is configured for single-hand gesture recognition — the most common interaction scenario, where one dominant gesture is performed at a time. This keeps computational overhead low while maintaining reliable detection and classification. When multiple hands are present, the model prioritizes the detection with the highest confidence score, ensuring stable and accurate gesture recognition even in dynamic conditions. Expected Output The pipeline generates structured JSON metadata in the following format:
Beyond the default setup, the application offers flexible input and output configurations that can be tailored via command-line options, as described below:

Command-Line Options

Selects the video input source for the pipeline.
Specifies the input source configuration corresponding to the selected --input-type.
Defines how the processed output stream is delivered.
Specifies the output destination configuration corresponding to the selected --output-type.
Root directory for model, label, and config files. The application resolves assets automatically:
Disables local on-screen rendering. Recommended for headless deployments, remote streaming setups (RTSP/WebRTC), or performance optimization.
Sets the raw input video resolution and frame rate. Applicable only to ISP and USB inputs.
Specifies the local WebRTC signaling client ID used for peer connection setup with the signaling server.

JSON Metadata Output

The pipeline generates structured per-frame metadata. Each detected hand produces a root entry with child landmark, embedding, and classification results:

Implementation Deep-Dive

The application separates user configuration from runtime state using two structs:
The pipeline is composed of three independent branches: input, processing, and output. Construction order is deliberate — input first, output second, processing branch last.
Each stage is configured with a GPU-delegated qtimltflite instance and a task-specific qtimlpostprocess module:
WebRTC communication uses explicit SDP offer/answer exchange and ICE candidate negotiation via WebSocket using libsoup:

Build the Application

Conclusion

The QIM SDK’s modular architecture enables developers to compose intelligent video analytics pipelines with speed and flexibility. Models run in parallel or sequentially, with each stage’s output automatically attached to the corresponding video frame as structured metadata. Decoupled video and inference processing allows multiple models to execute concurrently — maximizing throughput without sacrificing accuracy — with all results unified through a single GStreamer element for clean, scalable integration. Whether building touchless interfaces or gesture-driven applications, the QIM SDK provides a solid, production-ready foundation for advanced edge AI.