# Face detection
Source: [https://docs.qualcomm.com/doc/80-70018-50/topic/gst-ai-face-detection.html](https://docs.qualcomm.com/doc/80-70018-50/topic/gst-ai-face-detection.html)
The **gst-ai-face-detection** application collects the live video input from a
camera, file, or an RTSP stream and uses the Qualcomm AI Engine direct and LiteRT face
detection models to produce a preview with the overlaid AI model output on the HDMI
display.
The figure shows the pipeline, which receives the input, performs preprocessing, runs
inferences on AI hardware, and displays the results on the screen.
For information about the plugins used in the pipeline flow, see [Pipeline flow](https://docs.qualcomm.com/doc/80-70018-50/topic/gst-ai-face-detection.html#gst-ai-face-detection__section_kjz_ll3_4dc).
Figure : gst-ai-face-detection pipeline

## Sample model and label files
| Runtime | Model files | Label files |
| --- | --- | --- |
| LiteRT | face_det_lite_quantized.tflite | face_detection.labels |
| Qualcomm AI Engine direct | face_det_lite_quantized.bin | face_detection.labels |
| | | |
## Prerequisites
- If not already done so, [Download and install eSDK](https://docs.qualcomm.com/bundle/publicresource/topics/80-70018-51/install-sdk.html#download-and-install-esdk-).
- [Download model and label files](https://docs.qualcomm.com/doc/80-70018-50/topic/download-model-and-label-files.html).
- To access your host computer, enable SSH. For instructions, see [Sign in using SSH](https://docs.qualcomm.com/bundle/publicresource/topics/80-70018-254/how_to.html#use-ssh).
Note: If SSH is already enabled, you can skip this
step.
- Push the model files from the Linux host
computer.
scp root@:/etc/modelsCopy to clipboard
- Note that the [downloaded
script](https://docs.qualcomm.com/doc/80-70018-50/topic/download-model-and-label-files.html) downloads the sample video.mp4 video to
the /etc/media directory. If you are using a custom video,
then ensure that you push the video to /etc/media and
update the file path in the application config.JSON file.
- Connect the display to the device using the HDMI port. For instructions, see
[Set up HDMI display](https://docs.qualcomm.com/bundle/publicresource/topics/80-70018-18/samples.html).
- Enable the
display:
export XDG_RUNTIME_DIR=/dev/socket/weston && export WAYLAND_DISPLAY=wayland-1Copy to clipboard
If you face issues while enabling camera or display, see [Camera troubleshooting](https://docs.qualcomm.com/bundle/publicresource/topics/80-70018-17/troubleshooting.html) and [Display troubleshooting](https://docs.qualcomm.com/bundle/publicresource/topics/80-70018-18/debug.html).
## Run the application
The sample application uses the
`/etc/configs/config_face_detection.json` file to read the input
parameters.
To create your own config JSON file, use [config_face_detection.json](https://git.codelinaro.org/clo/le/platform/vendor/qcom-opensource/gst-plugins-qti-oss/-/blob/imsdk.lnx.2.0.0.r2-rel/gst-sample-apps/gst-ai-face-detection/config_face_detection.json?ref_type=heads) as a
reference.
1. Use the following format of the `config_face_detection.json`
file:
{
"file-path": "",
"ml-framework": "",
"model": "",
"threshold": , "runtime": """
}
Copy to clipboard
Note: Update the config JSON file based on
the model, input stream, and other properties. For more information, see
[Config JSON field description](https://docs.qualcomm.com/doc/80-70018-50/topic/gst-ai-face-detection.html#gst-ai-face-detection__section_txh_cm4_q2c).
For
example, run the application using LiteRT, input video file, custom model,
custom label file, DSP runtime, and custom
threshold:
{
"file-path": "/etc/media/video.mp4", "ml-framework": "tflite",
"model":"/etc/models/face_det_lite_quantized.tflite",
"labels": "/etc/labels/face_detection.labels",
"constants": "qfd,q-offsets=<204.0, 12.0, 102.0>,q-scales=<0.0365355908870697,0.23025865852832794, 0.10316766798496246>;",
"threshold": 51,
"runtime": "dsp"
}Copy to clipboard
2. Run the gst-ai-face-detection
application:
gst-ai-face-detection --config-file=/etc/configs/config_face_detection.jsonCopy to clipboard
To display the available help options, run the following commands in the SSH
shell:
gst-ai-face-detection -hCopy to clipboard
To stop the use case, use CTRL + C.
## Pipeline flow
The table lists the plugins used in the face detection pipeline:
| Plugin | Description |
| --- | --- |
| Camera source:[qtiqmmfsrc](https://docs.qualcomm.com/doc/80-70018-50/topic/qtiqmmfsrc.html) |
- Captures the live stream from camera.
- Uses tee to split the stream for inferencing.
|
| RTSP source: rtspsrc |
- Captures the RTSP stream using rtspsrc, followed by
rtph264depay for video extraction.
- Uses tee to split the stream for inferencing.
|
| h264parse | Parses the H.264 video. |
| [v4l2h264dec](https://docs.qualcomm.com/doc/80-70018-50/topic/v4l2h264dec.html) | Decodes the video. |
| [qtimlvconverter](https://docs.qualcomm.com/doc/80-70018-50/topic/qtimlvconverter.html) |
- Receives the video stream on its sink pad.
- Performs the following preprocessing on the stream data.
This preprocessing is done when the model expects
floating-point values as input.
- Color conversion
- Scaling (up or down)
- Normalization
- Converts the preprocessed video stream to a tensor stream on
its source pad.
The tensor stream is used for inferencing in the later stages of
the pipeline. |
| | Acts as the inferencing plugin.
- After the inference runtime receives the tensor stream on
its sink pad, the plugin runs the inference.
- Produces a tensor stream with the inference results on its
source pad.
|
| [qtimlvdetection](https://docs.qualcomm.com/doc/80-70018-50/topic/qtimlvdetection.html) |
- Handles inference results from any face detection
model.
- Applies a threshold to the chosen number of results.
|
| [qtimetamux](https://docs.qualcomm.com/doc/80-70018-50/topic/qtimetamux.html) | Receives string-based postprocessing output text with video
frame and multiplexes it. |
| [qtivoverlay](https://docs.qualcomm.com/doc/80-70018-50/topic/qtioverlay.html) |
- Receives the multiplexed stream.
- Overlays the bounding boxes on the stream.
|
| [Waylandsink](https://docs.qualcomm.com/doc/80-70018-50/topic/waylandsink.html) |
- Waylandsink submits the video stream received on its sink
pad to Weston.
- Weston renders the video stream on a local display.
|
## Config JSON field description
Table : Field description–gst-ai-face-detection file
| Field | Values/description |
| --- | --- |
| **ml-framework** | Use one of the following models:
tflite: LiteRT
qnn: Qualcomm AI Engine direct
|
| **runtime** | Use one of the following runtimes:
|
| **Input source** | Use one of the following input sources:
camera: Primary (0) or secondary (1).
file-path: The directory path to the video
file.
rtsp-ip-port: The address of the RTSP
stream:
rtsp://<ip>:<port>/<stream>
|
**Parent Topic:** [Run AI/ML sample applications](https://docs.qualcomm.com/doc/80-70018-50/topic/ai-ml-sample-applications.html)
**Related Resources**
- [Object detection](https://docs.qualcomm.com/doc/80-70018-50/topic/gst-ai-object-detection.html)
Last Published: Jan 30, 2026
[Previous Topic
AI smart codec](https://docs.qualcomm.com/bundle/publicresource/80-70018-50/topics/ai-smart-codec.md) [Next Topic
Face recognition](https://docs.qualcomm.com/bundle/publicresource/80-70018-50/topics/gst-ai-face-recognition.md)