# Face detection
Source: [https://docs.qualcomm.com/doc/80-70023-50/topic/gst-ai-face-detection.html](https://docs.qualcomm.com/doc/80-70023-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 following figure shows the pipeline, which receives the input, preprocesses it, 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-70023-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.json |
| Qualcomm AI Engine direct | face_det_lite_quantized.bin | face_detection.json |
| | | |
## Run the application on the target device
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. Ensure that you complete the [Prerequisites](https://docs.qualcomm.com/doc/80-70023-50/topic/download-model-and-label-files.html).
2. 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-70023-50/topic/gst-ai-face-detection.html#gst-ai-face-detection__section_txh_cm4_q2c).
3. Use the following format of the `config_face_detection.json`
file:
{
"file-path": "",
"ml-framework": "",
"model": ",
"runtime": """
}Copy to clipboard
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.json",
"threshold": 51,
"runtime": "dsp"
}Copy to clipboard
4. Run the gst-ai-face-detection
application:
gst-ai-face-detection --config-file=/etc/configs/config_face_detection.jsonCopy to clipboard
5. To display the available help options, run the following commands in the SSH
shell:
gst-ai-face-detection -hCopy to clipboard
6. To stop the use case, use CTRL + C.
## Pipeline flow
The following table lists the plugins used in the face detection
pipeline:
| Plugin | Description |
| --- | --- |
| Camera source:[qtiqmmfsrc](https://docs.qualcomm.com/doc/80-70023-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-70023-50/topic/v4l2h264dec.html) | Decodes the video. |
| [qtimlvconverter](https://docs.qualcomm.com/doc/80-70023-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. |
|
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.
|
| qtimlpostprocess |
Handles inference results from any face detection model.
Applies a threshold to the chosen number of results.
|
| [qtimetamux](https://docs.qualcomm.com/doc/80-70023-50/topic/qtimetamux.html) | Receives string-based postprocessing output text with video frame and multiplexes it. |
| [qtivoverlay](https://docs.qualcomm.com/doc/80-70023-50/topic/qtioverlay.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
The different parameters available to configure the JSON file and run the use case
are as follows:
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:
cpu
gpu
dsp
|
| **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>.
|
## Known issues
- Expect a drop in the accuracy of detection if the human face is away from the
camera.
- The application fails to work with the file‑source use case on the Ubuntu
Desktop variant.
## Related information
[Object detection](https://docs.qualcomm.com/doc/80-70023-50/topic/gst-ai-object-detection.html)
**Parent Topic:** [Run AI/ML sample applications](https://docs.qualcomm.com/doc/80-70023-50/topic/ai-ml-sample-applications.html)
Last Published: Mar 27, 2026
[Previous Topic
AI smart codec](https://docs.qualcomm.com/bundle/publicresource/80-70023-50/topics/ai-smart-codec.md) [Next Topic
Face recognition](https://docs.qualcomm.com/bundle/publicresource/80-70023-50/topics/gst-ai-face-recognition.md)