# Face detection

Source: [https://docs.qualcomm.com/doc/80-70022-50/topic/gst-ai-face-detection.html](https://docs.qualcomm.com/doc/80-70022-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-70022-50/topic/gst-ai-face-detection.html#gst-ai-face-detection__section_kjz_ll3_4dc).

Figure : gst-ai-face-detection pipeline
            
            <!--?xml version="1.0" encoding="UTF-8"?-->
<svg xmlns="http://www.w3.org/2000/svg" width="1297.997314453125909" height="396" viewbox="0 0 1297.997314453125909 396">
  <g id="Layer_2" data-name="Layer 2">
    <g>
      <rect x=".500122070313409" y=".500091552734375" width="1296.99755859375" height="394.99951171875" rx="7.499999999999999" ry="7.499999999999999" style="fill: #fafafa;"></rect>
      <path d="M1289.997314453125909,1c3.85986328125,0,7,3.140167236328125,7,7v380c0,3.859832763671875-3.14013671875,7-7,7H8c-3.859832763670966,0-7-3.140167236328125-7-7V8c0-3.859832763671875,3.140167236329034-7,7-7h1281.997314453125909M1289.997314453125909,0H8C3.581817626954034,0,0,3.581666946411133,0,8v380c0,4.4183349609375,3.581817626954034,8,8,8h1281.997314453125909c4.41815185546875,0,8-3.5816650390625,8-8V8c0-4.418333053588867-3.58184814453125-8-8-8h0Z" style="fill: #d2d7e1;"></path>
    </g>
    <g>
      <g>
        <text transform="translate(1099.969085693360284 372.09149169921875)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Qualcomm </tspan></text>
        <rect x="1079.718099495071328" y="360" width="16" height="16" rx="2" ry="2" style="fill: #2a2aea;"></rect>
      </g>
      <g>
        <text transform="translate(1198.550903320313409 372.09149169921875)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Open source</tspan></text>
        <rect x="1178.299880907924489" y="360" width="16" height="16" rx="2" ry="2" style="fill: #007884;"></rect>
      </g>
    </g>
  </g>
  <g id="Layer_3" data-name="Layer 3">
    <rect x="515.425395376812048" y="20.184578868753306" width="60.000000000001819" height="319.630863243328349" rx="3.999999999999996" ry="3.999999999999996" style="fill: #007884;"></rect>
    <rect x="1009.975547522936722" y="20.184578868753306" width="104.000000000003638" height="319.630863243328349" rx="8" ry="8" style="fill: #2a2aea;"></rect>
    <g>
      <line x1="1113.975524902344659" y1="180.000015258789062" x2="1126.618713378907159" y2="180.000015258789062" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
      <polygon points="1125.451538085938409 183.98907470703125 1132.359741210938409 180.000015258789062 1125.451538085938409 176.010940551757812 1125.451538085938409 183.98907470703125"></polygon>
    </g>
    <g>
      <line x1="1178.596801757813409" y1="207.835418701171875" x2="1178.596801757813409" y2="220.478607177734375" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
      <polygon points="1174.607727050782159 219.311416625976562 1178.596801757813409 226.219589233398438 1182.585876464844659 219.311416625976562 1174.607727050782159 219.311416625976562"></polygon>
    </g>
    <line x1="1224.833886009054368" y1="254.054977702013275" x2="1238.732058707369106" y2="254.055013361685269" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
    <rect x="1132.359725383631485" y="226.667924517310894" width="92.474160625422883" height="54.774142029076756" rx="4" ry="4" style="fill: #007884;"></rect>
    <text transform="translate(535.721755981446222 184.091278076171875)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">tee</tspan></text>
    <text transform="translate(1024.610107421875909 184.090972900390625)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">qtimetamux</tspan></text>
    <text transform="translate(1139.232421875000909 258.146331787109375)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Waylandsink</tspan></text>
    <rect x="1132.359725383631485" y="152.612939475879102" width="92.474160625422883" height="54.774142029076756" rx="4" ry="4" style="fill: #2a2aea;"></rect>
    <text transform="translate(1144.963806152344659 184.091339111328125)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">qtivoverlay</tspan></text>
    <g>
      <g>
        <rect x="1241.040995020396622" y="240.84580204579288" width="36" height="25.200000000000728" rx="4" ry="4" style="fill: none; stroke: #000; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2px;"></rect>
        <line x1="1251.840995020392256" y1="273.245802045790697" x2="1266.240995020390073" y2="273.245802045790697" style="fill: none; stroke: #000; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2px;"></line>
      </g>
      <line x1="1259.040995020396622" y1="266.045802045793607" x2="1259.040995020396622" y2="273.245802045790697" style="fill: none; stroke: #000; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2px;"></line>
    </g>
    <g>
      <g>
        <line x1="575.425399780274347" y1="74.265731811523438" x2="588.068588256836847" y2="74.265731811523438" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="586.901397705079034 78.254798889160156 593.809570312501819 74.265731811523438 586.901397705079034 70.27667236328125 586.901397705079034 78.254798889160156"></polygon>
      </g>
      <g>
        <line x1="575.425399780274347" y1="40.430534362792969" x2="1004.165283203125909" y2="40.430534362792969" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="1002.998046875000909 44.419593811035156 1009.906250000000909 40.430534362792969 1002.998046875000909 36.44146728515625 1002.998046875000909 44.419593811035156"></polygon>
      </g>
      <rect x="593.878871866668305" y="49.265734709197204" width="120.000000000007276" height="50" rx="4" ry="4" style="fill: #2a2aea;"></rect>
      <g>
        <line x1="713.878875732422784" y1="74.265731811523438" x2="726.522064208985284" y2="74.265731811523438" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="725.354888916016534 78.254798889160156 732.263061523438409 74.265731811523438 725.354888916016534 70.27667236328125 725.354888916016534 78.254798889160156"></polygon>
      </g>
      <rect x="732.3323483565282" y="49.265734709197204" width="89.465350685417434" height="50" rx="4" ry="4" style="fill: #2a2aea;"></rect>
      <g>
        <line x1="821.797698974610284" y1="74.265731811523438" x2="834.440887451172784" y2="74.265731811523438" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="833.273712158204034 78.254798889160156 840.181884765625909 74.265731811523438 833.273712158204034 70.27667236328125 833.273712158204034 78.254798889160156"></polygon>
      </g>
      <rect x="840.251175531798253" y="49.265734709197204" width="121.27089550128585" height="50" rx="3.999999999999995" ry="3.999999999999995" style="fill: #2a2aea;"></rect>
      <g>
        <line x1="961.522094726563409" y1="74.265731811523438" x2="1004.165283203125909" y2="74.265731811523438" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="1002.998046875000909 78.254798889160156 1009.906250000000909 74.265731811523438 1002.998046875000909 70.27667236328125 1002.998046875000909 78.254798889160156"></polygon>
      </g>
      <text transform="translate(605.340301513672784 78.3568115234375)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">qtimlvconverter</tspan></text>
      <text transform="translate(749.563751220704034 78.35723876953125)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">qtimlqnn</tspan></text>
      <text transform="translate(846.393493652344659 78.3568115234375)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">qtimlpostprocess</tspan></text>
      <text transform="translate(966.285400390625909 68.688873291015625)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">sink_1</tspan></text>
      <text transform="translate(966.285583496094659 32.739105224609375)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">sink_0</tspan></text>
    </g>
    <g>
      <g>
        <line x1="575.425399780274347" y1="192.027496337890625" x2="588.068588256836847" y2="192.027496337890625" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="586.901397705079034 196.016571044921875 593.809570312501819 192.027496337890625 586.901397705079034 188.038436889648438 586.901397705079034 196.016571044921875"></polygon>
      </g>
      <g>
        <line x1="575.425399780274347" y1="158.192306518554688" x2="1004.165283203125909" y2="158.192306518554688" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="1002.998046875000909 162.181365966796875 1009.906250000000909 158.192306518554688 1002.998046875000909 154.203231811523438 1002.998046875000909 162.181365966796875"></polygon>
      </g>
      <rect x="593.878871866668305" y="167.027503011133376" width="120.000000000007276" height="50" rx="4" ry="4" style="fill: #2a2aea;"></rect>
      <g>
        <line x1="713.878875732422784" y1="192.027496337890625" x2="726.522064208985284" y2="192.027496337890625" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="725.354888916016534 196.016571044921875 732.263061523438409 192.027496337890625 725.354888916016534 188.038436889648438 725.354888916016534 196.016571044921875"></polygon>
      </g>
      <rect x="732.3323483565282" y="167.027503011133376" width="89.465350685417434" height="50" rx="4" ry="4" style="fill: #2a2aea;"></rect>
      <g>
        <line x1="821.797698974610284" y1="192.027496337890625" x2="834.440887451172784" y2="192.027496337890625" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="833.273712158204034 196.016571044921875 840.181884765625909 192.027496337890625 833.273712158204034 188.038436889648438 833.273712158204034 196.016571044921875"></polygon>
      </g>
      <rect x="840.251175531798253" y="167.027503011133376" width="121.27089550128585" height="50" rx="3.999999999999995" ry="3.999999999999995" style="fill: #2a2aea;"></rect>
      <g>
        <line x1="961.522094726563409" y1="192.027496337890625" x2="1004.165283203125909" y2="192.027496337890625" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="1002.998046875000909 196.016571044921875 1009.906250000000909 192.027496337890625 1002.998046875000909 188.038436889648438 1002.998046875000909 196.016571044921875"></polygon>
      </g>
      <text transform="translate(605.340301513672784 196.118499755859375)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">qtimlvconverter</tspan></text>
      <text transform="translate(749.563751220704034 196.118927001953125)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">qtimlqnn</tspan></text>
      <text transform="translate(846.393493652344659 196.118499755859375)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">qtimlpostprocess</tspan></text>
      <text transform="translate(966.285400390625909 186.450592041015625)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">sink_1</tspan></text>
      <text transform="translate(966.285583496094659 150.500885009765625)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">sink_0</tspan></text>
    </g>
    <g>
      <g>
        <line x1="575.425399780274347" y1="309.34893798828125" x2="588.068588256836847" y2="309.34893798828125" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="586.901397705079034 313.337982177734375 593.809570312501819 309.34893798828125 586.901397705079034 305.35986328125 586.901397705079034 313.337982177734375"></polygon>
      </g>
      <g>
        <line x1="575.425399780274347" y1="275.51373291015625" x2="1004.165283203125909" y2="275.51373291015625" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="1002.998046875000909 279.5028076171875 1009.906250000000909 275.51373291015625 1002.998046875000909 271.524658203125 1002.998046875000909 279.5028076171875"></polygon>
      </g>
      <rect x="593.878871866668305" y="284.348933366854908" width="120.000000000007276" height="50" rx="4" ry="4" style="fill: #2a2aea;"></rect>
      <g>
        <line x1="713.878875732422784" y1="309.34893798828125" x2="726.522064208985284" y2="309.34893798828125" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="725.354888916016534 313.337982177734375 732.263061523438409 309.34893798828125 725.354888916016534 305.35986328125 725.354888916016534 313.337982177734375"></polygon>
      </g>
      <rect x="732.3323483565282" y="284.348933366854908" width="89.465350685417434" height="50" rx="4" ry="4" style="fill: #2a2aea;"></rect>
      <g>
        <line x1="821.797698974610284" y1="309.34893798828125" x2="834.440887451172784" y2="309.34893798828125" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="833.273712158204034 313.337982177734375 840.181884765625909 309.34893798828125 833.273712158204034 305.35986328125 833.273712158204034 313.337982177734375"></polygon>
      </g>
      <rect x="840.251175531798253" y="284.348933366854908" width="121.27089550128585" height="50" rx="3.999999999999995" ry="3.999999999999995" style="fill: #2a2aea;"></rect>
      <g>
        <line x1="961.522094726563409" y1="309.34893798828125" x2="1004.165283203125909" y2="309.34893798828125" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="1002.998046875000909 313.337982177734375 1009.906250000000909 309.34893798828125 1002.998046875000909 305.35986328125 1002.998046875000909 313.337982177734375"></polygon>
      </g>
      <text transform="translate(605.340301513672784 313.439971923828125)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">qtimlvconverter</tspan></text>
      <text transform="translate(749.563751220704034 313.440399169921875)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">qtimlqnn</tspan></text>
      <text transform="translate(846.393493652344659 313.439971923828125)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">qtimlpostprocess</tspan></text>
      <text transform="translate(964.476989746094659 301.800262451171875)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">sink_1</tspan></text>
      <text transform="translate(963.349304199219659 268.666473388671875)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">sink_0</tspan></text>
    </g>
    <g>
      <g>
        <rect x="70.541867788610034" y="280.522223068370295" width="86" height="60" rx="4" ry="4" style="fill: #007884;"></rect>
        <g>
          <line x1="156.54185327016603" y1="310.522236539940423" x2="169.185072264306655" y2="310.522236539940423" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
          <polygon points="168.01786645375978 314.511280729393548 174.926039061181655 310.522236539940423 168.01786645375978 306.533161832909173 168.01786645375978 314.511280729393548"></polygon>
        </g>
        <line x1="57.872905089507185" y1="310.522223068370295" x2="70.541867788610034" y2="310.522223068370295" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <rect x="174.995344278465382" y="280.522223068370295" width="95" height="60" rx="4" ry="4" style="fill: #007884;"></rect>
        <g>
          <line x1="269.99534448110353" y1="310.522236539940423" x2="282.63853295766603" y2="310.522236539940423" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
          <polygon points="281.471342405908217 314.511280729393548 288.379515013330092 310.522236539940423 281.471342405908217 306.533161832909173 281.471342405908217 314.511280729393548"></polygon>
        </g>
        <rect x="288.448820768320729" y="280.522223068370295" width="95" height="60" rx="3.999999999999997" ry="3.999999999999997" style="fill: #007884;"></rect>
        <g>
          <line x1="383.448820433251967" y1="310.522236539940423" x2="396.092014631860366" y2="310.522236539940423" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
          <polygon points="394.92482217275392 314.511280729393548 401.832998594873061 310.522236539940423 394.92482217275392 306.533161832909173 394.92482217275392 314.511280729393548"></polygon>
        </g>
        <rect x="401.902297258176986" y="280.522223068370295" width="94.999999999999091" height="60" rx="3.999999999999999" ry="3.999999999999999" style="fill: #007884;"></rect>
        <g>
          <line x1="496.902296385399495" y1="310.522236539940423" x2="509.545492491356526" y2="310.522236539940423" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
          <polygon points="508.378301939598714 314.511280729393548 515.286474547020589 310.522236539940423 508.378301939598714 306.533161832909173 508.378301939598714 314.511280729393548"></polygon>
        </g>
        <text transform="translate(89.975006103516534 314.044403076171875)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">rtspsrc </tspan></text>
        <text transform="translate(196.532241821289972 307.213958740234375)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">rtph264 </tspan><tspan x="5.52685546875" y="16.7998046875">depay </tspan></text>
        <text transform="translate(302.880142211914972 314.613861083984375)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">h264parse</tspan></text>
        <text transform="translate(408.420673370362238 314.613677978515625)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">V4l2h264dec</tspan></text>
        <g>
          <path d="M35.37654155394921,306.872223068365201c.001393890381223-.745582866664336.606937980652219-1.348867893218994,1.352521705628533-1.347474002832314.248203468321663.000463485717773.491475105285645.069345188137959.703078651427859.199073982235859l6.595199203491575,4.048200130462646c.635238075255984.390344238279795.833762741087412,1.221743202208017.443418502807617,1.85698127746582-.110953330993652.180562019348145-.262856483459473.332465171813965-.443418502807617.443418502807617l-6.595199203491575,4.05000000000291c-.635638046266649.389691925047373-1.46683273315557.190314102168486-1.856524658203853-.445323944091797-.130368232727051-.212645530700684-.199274826049077-.457250976563955-.199075698852539-.706676673893526v-8.098199272157217Z" style="fill: none; stroke: #000; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2px;"></path>
          <path d="M29.976541553949573,330.722223068371022h18" style="fill: none; stroke: #000; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2px;"></path>
          <rect x="20.976541553949573" y="298.322223068369567" width="36" height="25.19999999999709" rx="2" ry="2" style="fill: none; stroke: #000; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2px;"></rect>
        </g>
      </g>
      <g>
        <g>
          <path d="M45.726541553949573,52.472515665486753h-20.25c-2.485281229017346,0-4.5,2.014718770980835-4.5,4.500000000000909v36c0,2.485283374786377,2.014718770982654,4.5,4.5,4.5h27c2.485283374787286,0,4.5-2.014716625213623,4.5-4.5v-29.25l-11.25-11.250000000000909Z" style="fill: none; stroke: #000; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2px;"></path>
          <path d="M43.476541553949573,52.472515665486753v9.000000000000909c0,2.485281229019165,2.014718770980835,4.5,4.5,4.5h9" style="fill: none; stroke: #000; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2px;"></path>
          <path d="M34.476541553949573,72.722515665487663l11.25,6.75-11.25,6.75v-13.5Z" style="fill: none; stroke: #000; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2px;"></path>
        </g>
        <rect x="70.541867788610034" y="44.972515665486753" width="86" height="60.000000000000909" rx="4" ry="4" style="fill: #007884;"></rect>
        <g>
          <line x1="156.54185327016603" y1="74.972515775780266" x2="169.185072264306655" y2="74.972515775780266" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
          <polygon points="168.01786645375978 78.961582853416985 174.926039061181655 74.972515775780266 168.01786645375978 70.983448698143548 168.01786645375978 78.961582853416985"></polygon>
        </g>
        <line x1="57.872905089507185" y1="74.972515665487663" x2="70.541867788610034" y2="74.972515665487663" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <rect x="174.995344278465382" y="44.972515665486753" width="95" height="60.000000000000909" rx="4" ry="4" style="fill: #007884;"></rect>
        <g>
          <line x1="269.99534448110353" y1="74.972515775780266" x2="282.63853295766603" y2="74.972515775780266" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
          <polygon points="281.471342405908217 78.961582853416985 288.379515013330092 74.972515775780266 281.471342405908217 70.983448698143548 281.471342405908217 78.961582853416985"></polygon>
        </g>
        <rect x="288.448820768320729" y="44.972515665486753" width="95" height="60.000000000000909" rx="3.999999999999998" ry="3.999999999999998" style="fill: #007884;"></rect>
        <g>
          <line x1="383.448820433251967" y1="74.972515775780266" x2="396.092014631860366" y2="74.972515775780266" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
          <polygon points="394.92482217275392 78.961582853416985 401.832998594873061 74.972515775780266 394.92482217275392 70.983448698143548 394.92482217275392 78.961582853416985"></polygon>
        </g>
        <rect x="401.902297258176986" y="44.972515665486753" width="94.999999999999091" height="60.000000000000909" rx="4" ry="4" style="fill: #007884;"></rect>
        <g>
          <line x1="496.902296385399495" y1="74.972515775780266" x2="509.545492491356526" y2="74.972515775780266" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
          <polygon points="508.378301939598714 78.961582853416985 515.286474547020589 74.972515775780266 508.378301939598714 70.983448698143548 508.378301939598714 78.961582853416985"></polygon>
        </g>
        <text transform="translate(94.363677978516534 78.49468994140625)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">filesrc</tspan></text>
        <text transform="translate(195.110366821289972 79.06427001953125)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">qtdemux</tspan></text>
        <text transform="translate(302.880142211914972 79.06414794921875)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">h264parse</tspan></text>
        <text transform="translate(408.420673370362238 79.06396484375)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">V4l2h264dec</tspan></text>
      </g>
      <text transform="translate(20.976287841797784 32.285888671875)" style="font-family: Roboto-Bold, Roboto; font-size: 14px; font-weight: 700;"><tspan x="0" y="0">File (default)</tspan></text>
      <g>
        <g>
          <g>
            <path d="M43.476541553949573,175.525029674439793h-9l-4.5,5.400000000001455h-5.400000000001455c-1.988224983215332,0-3.599999999998545,1.611775016783213-3.599999999998545,3.599999999998545v16.200000000000728c0,1.988226699828374,1.611775016783213,3.600000000002183,3.599999999998545,3.600000000002183h28.80000000000291c1.988226699828374,0,3.599999999998545-1.611773300173809,3.599999999998545-3.600000000002183v-16.200000000000728c0-1.988224983215332-1.611773300170171-3.599999999998545-3.599999999998545-3.599999999998545h-5.400000000001455l-4.5-5.400000000001455Z" style="fill: none; stroke: #000; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2px;"></path>
            <circle cx="38.976541553949573" cy="189.925029674441248" r="5.400000000001455" style="fill: none; stroke: #000; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2px;"></circle>
          </g>
          <rect x="70.541867788610034" y="161.925029674441248" width="86" height="60" rx="4" ry="4" style="fill: #2a2aea;"></rect>
          <g>
            <line x1="156.54185327016603" y1="191.925022794823235" x2="509.545164427391683" y2="191.925022794823235" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
            <polygon points="508.37797387563387 195.914097501854485 515.286154112450276 191.925022794823235 508.37797387563387 187.935963346581048 508.37797387563387 195.914097501854485"></polygon>
          </g>
          <line x1="57.872905089507185" y1="191.925029674441248" x2="70.541867788610034" y2="191.925029674441248" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
          <text transform="translate(77.256744384766534 195.447113037109375)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">qtiqmmfsrc</tspan></text>
        </g>
        <text transform="translate(17.784088134766534 148.876953125)" style="font-family: Roboto-Bold, Roboto; font-size: 14px; font-weight: 700;"><tspan x="0" y="0">Camera (optional)</tspan></text>
      </g>
      <text transform="translate(17.784210205079034 267.521697998046875)" style="font-family: Roboto-Bold, Roboto; font-size: 14px; font-weight: 700;"><tspan x="0" y="0">RTSP (optional)</tspan></text>
      <g>
        <line x1="17.78410180532137" y1="120.88019247255761" x2="21.78410180532137" y2="120.88019247255761" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <line x1="25.830152830711995" y1="120.88019247255761" x2="509.33274682485262" y2="120.88019247255761" style="fill: none; stroke: #000; stroke-dasharray: 8.092093467712402 4.046046733856201; stroke-miterlimit: 10;"></line>
        <line x1="511.355772337547933" y1="120.88019247255761" x2="515.355772337547933" y2="120.88019247255761" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
      </g>
      <g>
        <line x1="17.78410180532137" y1="237.945240522802123" x2="21.78410180532137" y2="237.945240522802123" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <line x1="25.830152830711995" y1="237.945240522802123" x2="509.33274682485262" y2="237.945240522802123" style="fill: none; stroke: #000; stroke-dasharray: 8.092093467712402 4.046046733856201; stroke-miterlimit: 10;"></line>
        <line x1="511.355772337547933" y1="237.945240522802123" x2="515.355772337547933" y2="237.945240522802123" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
      </g>
    </g>
  </g>
</svg>

## Sample model and label files

| Runtime | Model files | Label files |
| --- | --- | --- |
| LiteRT | <var class="keyword varname">face_det_lite_quantized.tflite</var> | <var class="keyword varname">face_detection.json</var> |
| Qualcomm AI Engine direct | <var class="keyword varname">face_det_lite_quantized.bin</var> | <var class="keyword varname">face_detection.json</var> |
|  |  |  |

## 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-70022-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-70022-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": "<input-video-path>",
        "ml-framework": "<tflite or qnn framework>", 
        "model": "<path-to-model-file",
        "labels": "<path-to-label-file",
        "threshold": <post-processing threshold, integer value from 1-100>, 
        "runtime": ""<cpu, gpu or dsp 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-70022-50/topic/qtiqmmfsrc.html) | <ul class="ul" id="gst-ai-face-detection__ul_zyl_gj1_mcc"><br>                                    <li class="li">Captures the live stream from camera.</li><br><br>                                    <li class="li">Uses tee to split the stream for inferencing.</li><br><br>                                </ul> |
| RTSP source: rtspsrc | <ul class="ul" id="gst-ai-face-detection__ul_vsj_2r4_tbc"><br>                                    <li class="li">Captures the RTSP stream using rtspsrc, followed by<br>                                        rtph264depay for video extraction.</li><br><br>                                    <li class="li">Uses tee to split the stream for inferencing.</li><br><br>                                </ul> |
| h264parse | Parses the H.264 video. |
| [v4l2h264dec](https://docs.qualcomm.com/doc/80-70022-50/topic/v4l2h264dec.html) | Decodes the video. |
| [qtimlvconverter](https://docs.qualcomm.com/doc/80-70022-50/topic/qtimlvconverter.html) | <ol class="ol" id="gst-ai-face-detection__ol_j34_ddg_q1c"><br>                                    <li class="li">Receives the video stream on its sink pad.</li><br><br>                                    <li class="li">Performs the following preprocessing on the stream data.<br>                                        This preprocessing is done when the model expects<br>                                        floating-point values as input.<ol class="ol" type="a" id="gst-ai-face-detection__ol_m5z_cpr_lbc"><br>                                            <li class="li">Color conversion</li><br><br>                                            <li class="li">Scaling (up or down)</li><br><br>                                            <li class="li">Normalization</li><br><br>                                        </ol><br></li><br><br>                                    <li class="li">Converts the preprocessed video stream to a tensor stream on<br>                                        its source pad. </li><br><br>                                </ol><br><br>                                <br>The tensor stream is used for inferencing in the later stages of<br>                                    the pipeline. |
| <ul class="ul"><br>                                    <li class="li"><a href="https://docs.qualcomm.com/doc/80-70022-50/topic/qtimltflite.html">qtimltflite</a></li><br><br>                                    <li class="li"><a href="https://docs.qualcomm.com/doc/80-70022-50/topic/qtimlqnn.html">qtimlqnn</a></li><br><br>                                </ul> | Acts as the inferencing plugin.<ol class="ol" id="gst-ai-face-detection__ol_mbk_pl3_4dc"><br>                                    <li class="li">After the inference runtime receives the tensor stream on<br>                                        its sink pad, the plugin runs the inference.</li><br><br>                                    <li class="li">Produces a tensor stream with the inference results on its<br>                                        source pad.</li><br><br>                                </ol> |
| qtimlpostprocess | <ul class="ul" id="gst-ai-face-detection__ul_lwr_xl3_4dc"><br>                                    <li class="li">Handles inference results from any face detection<br>                                        model.</li><br><br>                                    <li class="li">Applies a threshold to the chosen number of results.</li><br><br>                                </ul> |
| [qtimetamux](https://docs.qualcomm.com/doc/80-70022-50/topic/qtimetamux.html) | Receives string-based postprocessing output text with video<br>                                frame and multiplexes it. |
| [qtivoverlay](https://docs.qualcomm.com/doc/80-70022-50/topic/qtioverlay.html) | <ol class="ol" id="gst-ai-face-detection__ol_wst_y5l_vbc"><br>                                    <li class="li">Receives the multiplexed stream.</li><br><br>                                    <li class="li">Overlays the bounding boxes on the stream.</li><br><br>                                </ol> |
| [Waylandsink](https://docs.qualcomm.com/doc/80-70022-50/topic/waylandsink.html) | <ol class="ol" id="gst-ai-face-detection__ol_kjr_fvr_lbc"><br>                                    <li class="li">Waylandsink submits the video stream received on its sink<br>                                        pad to Weston.</li><br><br>                                    <li class="li">Weston renders the video stream on a local display.</li><br><br>                                </ol> |

## 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:<br><ul class="ul" id="gst-ai-face-detection__ul_ucy_cm4_q2c"><br>                                    <li class="li"><code class="ph codeph">tflite</code>: LiteRT</li><br><br>                                    <li class="li"><code class="ph codeph">qnn</code>: Qualcomm AI Engine direct</li><br><br>                                </ul> |
| **runtime** | Use one of the following runtimes:<br><ul class="ul" id="gst-ai-face-detection__ul_vcy_cm4_q2c"><br>                                    <li class="li"><code class="ph codeph">cpu</code></li><br><br>                                    <li class="li"><code class="ph codeph">gpu</code></li><br><br>                                    <li class="li"><code class="ph codeph">dsp</code></li><br><br>                                </ul> |
| **Input source** | Use one of the following input sources:<br><ul class="ul" id="gst-ai-face-detection__ul_wcy_cm4_q2c"><br>                                    <li class="li"><code class="ph codeph">camera</code>: Primary (0) or secondary (1).</li><br><br>                                    <li class="li"><code class="ph codeph">file-path</code>: The directory path to the video<br>                                        file.</li><br><br>                                    <li class="li"><code class="ph codeph">rtsp-ip-port</code>: The address of the RTSP<br>                                        stream:<br>                                                  <em class="ph i"><u class="ph u"><code class="ph codeph">rtsp://&lt;ip&gt;:&lt;port&gt;/&lt;stream&gt;</code></u></em>.</li><br><br>                                </ul> |

## Known issue

Expect a drop in the accuracy of  detection if the human face is away from the
                camera.

## Related information

[Object detection](https://docs.qualcomm.com/doc/80-70022-50/topic/gst-ai-object-detection.html)

**Parent Topic:** [Run AI/ML sample applications](https://docs.qualcomm.com/doc/80-70022-50/topic/ai-ml-sample-applications.html)

Last Published: Feb 20, 2026

[Previous Topic
AI smart codec](https://docs.qualcomm.com/bundle/publicresource/80-70022-50/topics/ai-smart-codec.md) [Next Topic
Face recognition](https://docs.qualcomm.com/bundle/publicresource/80-70022-50/topics/gst-ai-face-recognition.md)