# 目标检测和分类 

Source: [https://docs.qualcomm.com/doc/80-70022-50SC/topic/camera-ai-detection-overlay-composer-display.html](https://docs.qualcomm.com/doc/80-70022-50SC/topic/camera-ai-detection-overlay-composer-display.html)

**gst-camera-two-stream-detection-and-classification-side-by-side.py** 应用程序使用 YOLOv8 LiteRT 模型来检测，并使用 `inception_v3` 来分类 AI 叠加编辑器显示的场景中的目标。

Figure : 目标检测和分类的 pipeline
            
            <!--?xml version="1.0" encoding="UTF-8" standalone="no"?-->

<!-- Generated by Microsoft Visio, SVG Export pipeline_object_detection_and_classification.svg pipeline_object_detection_and_c -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="13.4702in" height="3.0656in" viewbox="0 0 969.857 220.723" xml:space="preserve" color-interpolation-filters="sRGB" class="st13"><v:documentproperties v:langid="1033" v:viewmarkup="false"></v:documentproperties>
<style>.svg-1 .st1 { fill: #fafafa; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st2 { fill: #d2d7e1; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st3 { fill: #2a2aea; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st4 { fill: #ffffff; font-family: Roboto; font-size: 0.874992em }
.svg-1 .st5 { fill: none; stroke: #000000; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5 }
.svg-1 .st6 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st7 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st8 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st9 { stroke: #000000; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5 }
.svg-1 .st10 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st11 { fill: #000000; font-family: Roboto; font-size: 0.874992em }
.svg-1 .st12 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-1 .st13 { fill: none; fill-rule: evenodd; font-size: 12px; overflow: visible; stroke-linecap: square; stroke-miterlimit: 3 }</style>
<g v:mid="0" v:index="1" v:groupcontext="foregroundPage">	<title>pipeline_object_detection_and_c</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="19" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<g id="shape3-1" v:mid="3" v:groupcontext="shape" transform="translate(0.374794,-0.37532)">		<title>Sheet.3</title>		<path d="M0 215.1 A5.62513 5.62513 -180 0 0 5.62 220.72 L963.48 220.72 A5.62513 5.62513 -180 0 0 969.11 215.1 L969.11					 6.38 A5.62513 5.62513 -180 0 0 963.48 0.75 L5.62 0.75 A5.62513 5.62513 -180 0 0 0 6.38 L0 215.1 Z" class="st1"></path>	</g>	<g id="shape4-3" v:mid="4" v:groupcontext="shape">		<title>Sheet.4</title>		<path d="M963.86 0.75 C966.75 0.75 969.11 3.11 969.11 6 L969.11 214.72 C969.11 217.62 966.75 219.97 963.86 219.97 L6					 219.97 C3.11 219.97 0.75 217.62 0.75 214.72 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L963.86 0.75 ZM963.86 0					 L6 0 C2.69 0 0 2.69 0 6 L0 214.72 C0 218.04 2.69 220.72 6 220.72 L963.86 220.72 C967.17 220.72 969.86 218.04					 969.86 214.72 L969.86 6 C969.86 2.69 967.17 0 963.86 0 Z" class="st2"></path>	</g>	<g id="shape14-5" v:mid="14" v:groupcontext="shape" transform="translate(627.385,-148.389)">		<title>Sheet.14</title>		<desc>qtioverlay</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="40.9531" cy="192.056" width="81.91" height="57.3343"></v:textrect>		<path d="M-0 217.72 A3.00007 3.00007 -180 0 0 3 220.72 L78.91 220.72 A3.00007 3.00007 -180 0 0 81.91 217.72 L81.91 166.39					 A3.00007 3.00007 -180 0 0 78.91 163.39 L3 163.39 A3.00007 3.00007 -180 0 0 -0 166.39 L0 217.72 Z" class="st3"></path>		<text x="18.27" y="195.66" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtioverlay</text>		</g>	<g id="shape17-8" v:mid="17" v:groupcontext="shape" transform="translate(747.729,-42)">		<title>Sheet.17</title>		<desc>qtivcomposer</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="37.871" cy="138.862" width="75.75" height="163.723"></v:textrect>		<path d="M0 217.72 A3.00007 3.00007 -180 0 0 3 220.72 L72.74 220.72 A3.00007 3.00007 -180 0 0 75.74 217.72 L75.74 60					 A3.00007 3.00007 -180 0 0 72.74 57 L3 57 A3.00007 3.00007 -180 0 0 0 60 L0 217.72 Z" class="st3"></path>		<text x="5.81" y="142.46" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtivcomposer</text>		</g>	<g id="shape20-11" v:mid="20" v:groupcontext="shape" transform="translate(15.8926,-166.9)">		<title>Sheet.20</title>		<path d="M18.43 197.13 L11.06 197.13 L7.37 201.56 L2.95 201.56 C1.32 201.56 0 202.88 0 204.51 L0 217.77 C0 219.4 1.32					 220.72 2.95 220.72 L26.54 220.72 C28.17 220.72 29.49 219.4 29.49 217.77 L29.49 204.51 C29.49 202.88 28.17					 201.56 26.54 201.56 L22.11 201.56 L18.43 197.13 Z" class="st5"></path>	</g>	<g id="shape21-13" v:mid="21" v:groupcontext="shape" transform="translate(26.2127,-174.271)">		<title>Sheet.21</title>		<ellipse cx="4.42293" cy="216.3" rx="4.42293" ry="4.42293" class="st5"></ellipse>	</g>	<g id="shape22-15" v:mid="22" v:groupcontext="shape" transform="translate(56.4896,-148.389)">		<title>Sheet.22</title>		<desc>qtiqmmfsrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="35.2196" cy="192.056" width="70.44" height="57.3343"></v:textrect>		<path d="M0 217.72 A3.00007 3.00007 -180 0 0 3 220.72 L67.44 220.72 A3.00007 3.00007 -180 0 0 70.44 217.72 L70.44 166.39					 A3.00007 3.00007 -180 0 0 67.44 163.39 L3 163.39 A3.00007 3.00007 -180 0 0 0 166.39 L0 217.72 Z" class="st3"></path>		<text x="8.01" y="195.66" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtiqmmfsrc</text>		</g>	<g id="shape24-18" v:mid="24" v:groupcontext="shape" transform="translate(126.929,-177.056)">		<title>Sheet.24</title>		<path d="M0 220.72 L10.69 220.72" class="st6"></path>	</g>	<g id="shape25-21" v:mid="25" v:groupcontext="shape" transform="translate(136.748,-174.064)">		<title>Sheet.25</title>		<path d="M0 220.72 L5.18 217.73 L0 214.74 L0 220.72 Z" class="st7"></path>	</g>	<g id="shape26-23" v:mid="26" v:groupcontext="shape" transform="translate(46.1129,-177.056)">		<title>Sheet.26</title>		<path d="M0 220.72 L10.38 220.72" class="st6"></path>	</g>	<g id="shape29-26" v:mid="29" v:groupcontext="shape" transform="translate(141.929,-148.389)">		<title>Sheet.29</title>		<desc>tee</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="28.6672" cy="192.056" width="57.34" height="57.3343"></v:textrect>		<path d="M-0 217.72 A3.00007 3.00007 -180 0 0 3 220.72 L54.33 220.72 A3.00007 3.00007 -180 0 0 57.33 217.72 L57.33 166.39					 A3.00007 3.00007 -180 0 0 54.33 163.39 L3 163.39 A3.00007 3.00007 -180 0 0 0 166.39 L0 217.72 Z" class="st8"></path>		<text x="21.39" y="195.66" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>tee</text>		</g>	<g id="shape32-29" v:mid="32" v:groupcontext="shape" transform="translate(530.504,-148.389)">		<title>Sheet.32</title>		<desc>qtimetamux</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="40.9531" cy="192.056" width="81.91" height="57.3343"></v:textrect>		<path d="M0 217.72 A3.00007 3.00007 -180 0 0 3 220.72 L78.91 220.72 A3.00007 3.00007 -180 0 0 81.91 217.72 L81.91 166.39					 A3.00007 3.00007 -180 0 0 78.91 163.39 L3 163.39 A3.00007 3.00007 -180 0 0 0 166.39 L0 217.72 Z" class="st3"></path>		<text x="12.93" y="195.66" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtimetamux</text>		</g>	<g id="shape36-32" v:mid="36" v:groupcontext="shape" transform="translate(199.175,-168.865)">		<title>Sheet.36</title>		<path d="M0 220.72 L10.75 220.72" class="st6"></path>	</g>	<g id="shape37-35" v:mid="37" v:groupcontext="shape" transform="translate(209.051,-165.874)">		<title>Sheet.37</title>		<path d="M0 220.72 L5.18 217.73 L0 214.74 L0 220.72 Z" class="st7"></path>	</g>	<g id="shape39-37" v:mid="39" v:groupcontext="shape" transform="translate(199.175,-196.579)">		<title>Sheet.39</title>		<path d="M0 220.72 L325.33 220.72" class="st6"></path>	</g>	<g id="shape40-40" v:mid="40" v:groupcontext="shape" transform="translate(523.628,-193.587)">		<title>Sheet.40</title>		<path d="M0 220.72 L5.18 217.73 L0 214.74 L0 220.72 Z" class="st7"></path>	</g>	<g id="shape41-42" v:mid="41" v:groupcontext="shape" transform="translate(214.289,-148.389)">		<title>Sheet.41</title>		<desc>qtimlvconverter</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45.3937" cy="200.247" width="90.79" height="40.9531"></v:textrect>		<path d="M0 217.72 A3.00007 3.00007 -180 0 0 3 220.72 L87.79 220.72 A3.00007 3.00007 -180 0 0 90.79 217.72 L90.79 182.77					 A3.00007 3.00007 -180 0 0 87.79 179.77 L3 179.77 A3.00007 3.00007 -180 0 0 -0 182.77 L0 217.72 Z" class="st3"></path>		<text x="8.99" y="203.85" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtimlvconverter</text>		</g>	<g id="shape43-45" v:mid="43" v:groupcontext="shape" transform="translate(305.076,-168.865)">		<title>Sheet.43</title>		<path d="M0 220.72 L10.75 220.72" class="st6"></path>	</g>	<g id="shape44-48" v:mid="44" v:groupcontext="shape" transform="translate(314.953,-165.874)">		<title>Sheet.44</title>		<path d="M0 220.72 L5.18 217.73 L0 214.74 L0 220.72 Z" class="st7"></path>	</g>	<g id="shape45-50" v:mid="45" v:groupcontext="shape" transform="translate(320.191,-148.389)">		<title>Sheet.45</title>		<desc>qtimltflite</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="36.6388" cy="200.247" width="73.28" height="40.9531"></v:textrect>		<path d="M0 217.72 A3.00007 3.00007 -180 0 0 3 220.72 L70.28 220.72 A3.00007 3.00007 -180 0 0 73.28 217.72 L73.28 182.77					 A3.00007 3.00007 -180 0 0 70.28 179.77 L3 179.77 A3.00007 3.00007 -180 0 0 0 182.77 L0 217.72 Z" class="st3"></path>		<text x="14.21" y="203.85" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtimltflite</text>		</g>	<g id="shape47-53" v:mid="47" v:groupcontext="shape" transform="translate(393.469,-168.865)">		<title>Sheet.47</title>		<path d="M0 220.72 L10.75 220.72" class="st6"></path>	</g>	<g id="shape48-56" v:mid="48" v:groupcontext="shape" transform="translate(403.345,-165.874)">		<title>Sheet.48</title>		<path d="M0 220.72 L5.18 217.73 L0 214.74 L0 220.72 Z" class="st7"></path>	</g>	<g id="shape50-58" v:mid="50" v:groupcontext="shape" transform="translate(515.171,-168.865)">		<title>Sheet.50</title>		<path d="M0 220.72 L10.75 220.72" class="st6"></path>	</g>	<g id="shape51-61" v:mid="51" v:groupcontext="shape" transform="translate(525.048,-165.874)">		<title>Sheet.51</title>		<path d="M0 220.72 L5.18 217.73 L0 214.74 L0 220.72 Z" class="st7"></path>	</g>	<g id="shape52-63" v:mid="52" v:groupcontext="shape" transform="translate(408.583,-148.389)">		<title>Sheet.52</title>		<desc>qtimlpostprocess</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="53.2941" cy="200.247" width="106.59" height="40.9531"></v:textrect>		<path d="M-0 217.72 A3.00007 3.00007 -180 0 0 3 220.72 L103.59 220.72 A3.00007 3.00007 -180 0 0 106.59 217.72 L106.59					 182.77 A3.00007 3.00007 -180 0 0 103.59 179.77 L3 179.77 A3.00007 3.00007 -180 0 0 -0 182.77 L0 217.72 Z" class="st3"></path>		<text x="12.42" y="203.85" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtimlpostprocess</text>		</g>	<g id="shape57-66" v:mid="57" v:groupcontext="shape" transform="translate(612.327,-177.056)">		<title>Sheet.57</title>		<path d="M0 220.72 L10.75 220.72" class="st6"></path>	</g>	<g id="shape58-69" v:mid="58" v:groupcontext="shape" transform="translate(622.203,-174.064)">		<title>Sheet.58</title>		<path d="M0 220.72 L5.18 217.73 L0 214.74 L0 220.72 Z" class="st7"></path>	</g>	<g id="shape60-71" v:mid="60" v:groupcontext="shape" transform="translate(709.291,-177.056)">		<title>Sheet.60</title>		<path d="M0 220.72 L34.13 220.72" class="st6"></path>	</g>	<g id="shape61-74" v:mid="61" v:groupcontext="shape" transform="translate(742.548,-174.064)">		<title>Sheet.61</title>		<path d="M0 220.72 L5.18 217.73 L0 214.74 L0 220.72 Z" class="st7"></path>	</g>	<g id="shape63-76" v:mid="63" v:groupcontext="shape" transform="translate(823.245,-123.862)">		<title>Sheet.63</title>		<path d="M0 220.72 L10.75 220.72" class="st6"></path>	</g>	<g id="shape64-79" v:mid="64" v:groupcontext="shape" transform="translate(833.121,-120.87)">		<title>Sheet.64</title>		<path d="M0 220.72 L5.18 217.73 L0 214.74 L0 220.72 Z" class="st7"></path>	</g>	<g id="shape66-81" v:mid="66" v:groupcontext="shape" transform="translate(838.303,-95.1945)">		<title>Sheet.66</title>		<desc>Waylandsink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="37.871" cy="192.056" width="75.75" height="57.3343"></v:textrect>		<path d="M0 217.72 A3.00007 3.00007 -180 0 0 3 220.72 L72.74 220.72 A3.00007 3.00007 -180 0 0 75.74 217.72 L75.74 166.39					 A3.00007 3.00007 -180 0 0 72.74 163.39 L3 163.39 A3.00007 3.00007 -180 0 0 -0 166.39 L0 217.72 Z" class="st8"></path>		<text x="8.35" y="195.66" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Waylandsink  </text>		</g>	<g id="shape70-84" v:mid="70" v:groupcontext="shape" transform="translate(925.371,-113.422)">		<title>Sheet.70</title>		<path d="M0 217.72 A3.00007 3.00007 -180 0 0 3 220.72 L26.49 220.72 A3.00007 3.00007 -180 0 0 29.49 217.72 L29.49 203.08					 A3.00007 3.00007 -180 0 0 26.49 200.08 L3 200.08 A3.00007 3.00007 -180 0 0 0 203.08 L0 217.72 Z" class="st5"></path>	</g>	<g id="shape71-86" v:mid="71" v:groupcontext="shape" transform="translate(934.216,-107.525)">		<title>Sheet.71</title>		<path d="M0 220.72 L11.79 220.72" class="st9"></path>	</g>	<g id="shape72-89" v:mid="72" v:groupcontext="shape" transform="translate(1160.84,107.301) rotate(90)">		<title>Sheet.72</title>		<path d="M0 220.72 L5.9 220.72" class="st9"></path>	</g>	<g id="shape73-92" v:mid="73" v:groupcontext="shape" transform="translate(712.534,-178.826)">		<title>Sheet.73</title>		<desc>sink_0</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="31.5" cy="214.423" width="63.01" height="12.6"></v:textrect>		<rect x="0" y="208.123" width="63" height="12.6" class="st10"></rect>		<text x="0" y="217.57" class="st11" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>sink_0</text>		</g>	<g id="shape75-95" v:mid="75" v:groupcontext="shape" transform="translate(627.385,-43.5)">		<title>Sheet.75</title>		<desc>qtioverlay</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="40.9531" cy="192.056" width="81.91" height="57.3343"></v:textrect>		<path d="M-0 217.72 A3.00007 3.00007 -180 0 0 3 220.72 L78.91 220.72 A3.00007 3.00007 -180 0 0 81.91 217.72 L81.91 166.39					 A3.00007 3.00007 -180 0 0 78.91 163.39 L3 163.39 A3.00007 3.00007 -180 0 0 -0 166.39 L0 217.72 Z" class="st3"></path>		<text x="18.27" y="195.66" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtioverlay</text>		</g>	<g id="shape78-98" v:mid="78" v:groupcontext="shape" transform="translate(15.8926,-62.0108)">		<title>Sheet.78</title>		<path d="M18.43 197.13 L11.06 197.13 L7.37 201.56 L2.95 201.56 C1.32 201.56 0 202.88 0 204.51 L0 217.77 C0 219.4 1.32					 220.72 2.95 220.72 L26.54 220.72 C28.17 220.72 29.49 219.4 29.49 217.77 L29.49 204.51 C29.49 202.88 28.17					 201.56 26.54 201.56 L22.11 201.56 L18.43 197.13 Z" class="st5"></path>	</g>	<g id="shape79-100" v:mid="79" v:groupcontext="shape" transform="translate(26.2127,-69.3823)">		<title>Sheet.79</title>		<ellipse cx="4.42293" cy="216.3" rx="4.42293" ry="4.42293" class="st5"></ellipse>	</g>	<g id="shape80-102" v:mid="80" v:groupcontext="shape" transform="translate(56.4896,-43.5)">		<title>Sheet.80</title>		<desc>qtiqmmfsrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="35.2196" cy="192.056" width="70.44" height="57.3343"></v:textrect>		<path d="M0 217.72 A3.00007 3.00007 -180 0 0 3 220.72 L67.44 220.72 A3.00007 3.00007 -180 0 0 70.44 217.72 L70.44 166.39					 A3.00007 3.00007 -180 0 0 67.44 163.39 L3 163.39 A3.00007 3.00007 -180 0 0 0 166.39 L0 217.72 Z" class="st3"></path>		<text x="8.01" y="195.66" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtiqmmfsrc</text>		</g>	<g id="shape82-105" v:mid="82" v:groupcontext="shape" transform="translate(126.929,-72.1672)">		<title>Sheet.82</title>		<path d="M0 220.72 L10.69 220.72" class="st6"></path>	</g>	<g id="shape83-108" v:mid="83" v:groupcontext="shape" transform="translate(136.748,-69.1753)">		<title>Sheet.83</title>		<path d="M0 220.72 L5.18 217.73 L0 214.74 L0 220.72 Z" class="st7"></path>	</g>	<g id="shape84-110" v:mid="84" v:groupcontext="shape" transform="translate(46.1129,-72.1671)">		<title>Sheet.84</title>		<path d="M0 220.72 L10.38 220.72" class="st6"></path>	</g>	<g id="shape87-113" v:mid="87" v:groupcontext="shape" transform="translate(141.929,-43.5)">		<title>Sheet.87</title>		<desc>tee</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="28.6672" cy="192.056" width="57.34" height="57.3343"></v:textrect>		<path d="M0 217.72 A3.00007 3.00007 -180 0 0 3 220.72 L54.33 220.72 A3.00007 3.00007 -180 0 0 57.33 217.72 L57.33 166.39					 A3.00007 3.00007 -180 0 0 54.33 163.39 L3 163.39 A3.00007 3.00007 -180 0 0 -0 166.39 L0 217.72 Z" class="st8"></path>		<text x="21.39" y="195.66" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>tee</text>		</g>	<g id="shape90-116" v:mid="90" v:groupcontext="shape" transform="translate(530.504,-43.5)">		<title>Sheet.90</title>		<desc>qtimetamux</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="40.9531" cy="192.056" width="81.91" height="57.3343"></v:textrect>		<path d="M0 217.72 A3.00007 3.00007 -180 0 0 3 220.72 L78.91 220.72 A3.00007 3.00007 -180 0 0 81.91 217.72 L81.91 166.39					 A3.00007 3.00007 -180 0 0 78.91 163.39 L3 163.39 A3.00007 3.00007 -180 0 0 0 166.39 L0 217.72 Z" class="st3"></path>		<text x="12.93" y="195.66" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtimetamux</text>		</g>	<g id="shape94-119" v:mid="94" v:groupcontext="shape" transform="translate(199.175,-63.9765)">		<title>Sheet.94</title>		<path d="M0 220.72 L10.75 220.72" class="st6"></path>	</g>	<g id="shape95-122" v:mid="95" v:groupcontext="shape" transform="translate(209.051,-60.9847)">		<title>Sheet.95</title>		<path d="M0 220.72 L5.18 217.73 L0 214.74 L0 220.72 Z" class="st7"></path>	</g>	<g id="shape97-124" v:mid="97" v:groupcontext="shape" transform="translate(199.175,-91.6896)">		<title>Sheet.97</title>		<path d="M0 220.72 L325.33 220.72" class="st6"></path>	</g>	<g id="shape98-127" v:mid="98" v:groupcontext="shape" transform="translate(523.628,-88.6978)">		<title>Sheet.98</title>		<path d="M0 220.72 L5.18 217.73 L0 214.74 L0 220.72 Z" class="st7"></path>	</g>	<g id="shape99-129" v:mid="99" v:groupcontext="shape" transform="translate(214.289,-43.5)">		<title>Sheet.99</title>		<desc>qtimlvconverter</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45.3937" cy="200.247" width="90.79" height="40.9531"></v:textrect>		<path d="M0 217.72 A3.00007 3.00007 -180 0 0 3 220.72 L87.79 220.72 A3.00007 3.00007 -180 0 0 90.79 217.72 L90.79 182.77					 A3.00007 3.00007 -180 0 0 87.79 179.77 L3 179.77 A3.00007 3.00007 -180 0 0 -0 182.77 L0 217.72 Z" class="st3"></path>		<text x="8.99" y="203.85" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtimlvconverter</text>		</g>	<g id="shape101-132" v:mid="101" v:groupcontext="shape" transform="translate(305.076,-63.9765)">		<title>Sheet.101</title>		<path d="M0 220.72 L10.75 220.72" class="st6"></path>	</g>	<g id="shape102-135" v:mid="102" v:groupcontext="shape" transform="translate(314.953,-60.9847)">		<title>Sheet.102</title>		<path d="M0 220.72 L5.18 217.73 L0 214.74 L0 220.72 Z" class="st7"></path>	</g>	<g id="shape103-137" v:mid="103" v:groupcontext="shape" transform="translate(320.191,-43.5)">		<title>Sheet.103</title>		<desc>qtimltflite</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="36.6388" cy="200.247" width="73.28" height="40.9531"></v:textrect>		<path d="M-0 217.72 A3.00007 3.00007 -180 0 0 3 220.72 L70.28 220.72 A3.00007 3.00007 -180 0 0 73.28 217.72 L73.28 182.77					 A3.00007 3.00007 -180 0 0 70.28 179.77 L3 179.77 A3.00007 3.00007 -180 0 0 0 182.77 L0 217.72 Z" class="st3"></path>		<text x="14.21" y="203.85" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtimltflite</text>		</g>	<g id="shape105-140" v:mid="105" v:groupcontext="shape" transform="translate(393.469,-63.9765)">		<title>Sheet.105</title>		<path d="M0 220.72 L10.75 220.72" class="st6"></path>	</g>	<g id="shape106-143" v:mid="106" v:groupcontext="shape" transform="translate(403.345,-60.9847)">		<title>Sheet.106</title>		<path d="M0 220.72 L5.18 217.73 L0 214.74 L0 220.72 Z" class="st7"></path>	</g>	<g id="shape108-145" v:mid="108" v:groupcontext="shape" transform="translate(515.171,-63.9765)">		<title>Sheet.108</title>		<path d="M0 220.72 L10.75 220.72" class="st6"></path>	</g>	<g id="shape109-148" v:mid="109" v:groupcontext="shape" transform="translate(525.048,-60.9847)">		<title>Sheet.109</title>		<path d="M0 220.72 L5.18 217.73 L0 214.74 L0 220.72 Z" class="st7"></path>	</g>	<g id="shape110-150" v:mid="110" v:groupcontext="shape" transform="translate(408.583,-43.5)">		<title>Sheet.110</title>		<desc>qtimlpostprocess</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="53.2941" cy="200.247" width="106.59" height="40.9531"></v:textrect>		<path d="M0 217.72 A3.00007 3.00007 -180 0 0 3 220.72 L103.59 220.72 A3.00007 3.00007 -180 0 0 106.59 217.72 L106.59					 182.77 A3.00007 3.00007 -180 0 0 103.59 179.77 L3 179.77 A3.00007 3.00007 -180 0 0 0 182.77 L0 217.72 Z" class="st3"></path>		<text x="12.42" y="203.85" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtimlpostprocess</text>		</g>	<g id="shape115-153" v:mid="115" v:groupcontext="shape" transform="translate(612.327,-72.1672)">		<title>Sheet.115</title>		<path d="M0 220.72 L10.75 220.72" class="st6"></path>	</g>	<g id="shape116-156" v:mid="116" v:groupcontext="shape" transform="translate(622.203,-69.1753)">		<title>Sheet.116</title>		<path d="M0 220.72 L5.18 217.73 L0 214.74 L0 220.72 Z" class="st7"></path>	</g>	<g id="shape118-158" v:mid="118" v:groupcontext="shape" transform="translate(709.291,-72.1672)">		<title>Sheet.118</title>		<path d="M0 220.72 L34.13 220.72" class="st6"></path>	</g>	<g id="shape119-161" v:mid="119" v:groupcontext="shape" transform="translate(742.548,-69.1753)">		<title>Sheet.119</title>		<path d="M0 220.72 L5.18 217.73 L0 214.74 L0 220.72 Z" class="st7"></path>	</g>	<g id="shape120-163" v:mid="120" v:groupcontext="shape" transform="translate(712.534,-73.9369)">		<title>Sheet.120</title>		<desc>sink_1</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="31.5" cy="214.423" width="63.01" height="12.6"></v:textrect>		<rect x="0" y="208.123" width="63" height="12.6" class="st10"></rect>		<text x="0" y="217.57" class="st11" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>sink_1</text>		</g>	<g id="shape121-166" v:mid="121" v:groupcontext="shape" transform="translate(914.045,-123.862)">		<title>Sheet.121</title>		<path d="M0 220.72 L10.38 220.72" class="st6"></path>	</g>	<g id="group138-169" transform="translate(844.732,-14.7814)" v:mid="138" v:groupcontext="group">		<title>Sheet.138</title>		<g id="shape7-170" v:mid="7" v:groupcontext="shape" transform="translate(15.1882,0)">			<title>Sheet.7</title>			<desc>Qualcomm</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="27.1367" cy="214.423" width="54.28" height="12.6"></v:textrect>			<rect x="0" y="208.123" width="54.2734" height="12.6" class="st10"></rect>			<text x="0" y="217.57" class="st11" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>Qualcomm  </text>			</g>		<g id="shape8-173" v:mid="8" v:groupcontext="shape" transform="translate(-9.99201E-16,-0.218619)">			<title>Sheet.8</title>			<path d="M0 219.22 A1.50003 1.50003 -180 0 0 1.5 220.72 L10.5 220.72 A1.50003 1.50003 -180 0 0 12 219.22 L12 210.22						 A1.50003 1.50003 -180 0 0 10.5 208.72 L1.5 208.72 A1.50003 1.50003 -180 0 0 0 210.22 L0 219.22 Z" class="st3"></path>		</g>		<g id="shape10-175" v:mid="10" v:groupcontext="shape" transform="translate(89.1246,0)">			<title>Sheet.10</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="214.423" width="21.01" height="12.6"></v:textrect>			<rect x="0" y="208.123" width="21" height="12.6" class="st10"></rect>			<text x="0" y="217.92" class="st12" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape11-178" v:mid="11" v:groupcontext="shape" transform="translate(73.9363,-0.218619)">			<title>Sheet.11</title>			<path d="M0 219.22 A1.50003 1.50003 -180 0 0 1.5 220.72 L10.5 220.72 A1.50003 1.50003 -180 0 0 12 219.22 L12 210.22						 A1.50003 1.50003 -180 0 0 10.5 208.72 L1.5 208.72 A1.50003 1.50003 -180 0 0 0 210.22 L0 219.22 Z" class="st8"></path>		</g>	</g></g>
</svg>

有关该 pipeline 中使用的插件的信息，请参见 [Pipeline 流](https://docs.qualcomm.com/doc/80-70022-50SC/topic/camera-ai-detection-overlay-composer-display.html#camera-ai-detection-overlay-composer-display__section_l1h_cpk_bdc)。

## 模型文件

Table : 用于检测和分类的模型

| 目的 | LiteRT模型 | 说明 |
| :--- | :--- | :--- |
| 目标检测 | YOLOX | <ol class="ol" id="camera-ai-detection-overlay-composer-display__ul_cfw_r4k_bdc"><br>                                    <li class="li">从摄像头流中识别场景中的目标。</li><br><br>                                    <li class="li">将边界框覆盖在检测到的目标上。</li><br><br>                                </ol> |
| 图像分类 | InceptionV3 | <ol class="ol" id="camera-ai-detection-overlay-composer-display__ol_jll_v4k_bdc"><br>                                    <li class="li">对摄像头流中的场景进行分类。</li><br><br>                                    <li class="li">在屏幕上叠加分类标签。</li><br><br>                                </ol> |

## 在目标设备上运行应用程序

1. 确保您已完成[前提条件](https://docs.qualcomm.com/doc/80-70022-50SC/topic/prerequisites-for-python-sample-applications.html)。
2. 在目标设备上运行检测和分类脚本：

        gst-camera-two-stream-detection-and-classification-side-by-side.pyCopy to clipboard
3. 如需显示可用的帮助选项，可运行以下命令：

        gst-camera-two-stream-detection-and-classification-side-by-side.py -hCopy to clipboard

Table : 用于目标检测和分类 python 应用程序的模型和标签文件的默认目录

| 模型和标签文件 | 目录 |
| :--- | :--- |
| 检测模型 | /etc/models/yolox\_quantized.tflite |
| 检测标签 | /etc/labels/yolox.json |
| 分类模型 | /etc/models/inception\_v3\_quantized.tflite |
| 分类标签 | /etc/labels/classification.json |

## 预期输出

图像并排显示在显示器上。

## Pipeline 流

| 处理过程 | 说明 |
| --- | --- |
| [qtiqmmfsrc](https://docs.qualcomm.com/doc/80-70022-50SC/topic/qtiqmmfsrc.html) | 从摄像头采集两个视频流：<ul class="ul"><br>                                    <li class="li">用于检测的流使用 tee 分割并发送到以下位置：<ul class="ul" id="camera-ai-detection-overlay-composer-display__ul_elf_dtk_bdc"><br>                                            <li class="li">qtimetamux 保留视频流。</li><br><br>                                            <li class="li">qtimlvconverter 将视频流转换为输入张量以进行检测推理。</li><br><br>                                        </ul><br></li><br><br>                                    <li class="li">用于分类的流使用 tee 进行分割并发送到以下位置：<ul class="ul" id="camera-ai-detection-overlay-composer-display__ul_nsj_htk_bdc"><br>                                            <li class="li">qtimetamux 保留视频流。</li><br><br>                                            <li class="li">qtimlvconverter 将视频流转换为输入张量，用于分类推理。</li><br><br>                                        </ul><br><br>                                    </li><br><br>                                </ul> |
| **预处理** | **预处理** |
| [qtimlvconverter](https://docs.qualcomm.com/doc/80-70022-50SC/topic/qtimlvconverter.html) | <ol class="ol" id="camera-ai-detection-overlay-composer-display__ol_i5w_4wl_vbc"><br>                                    <li class="li">在其接收端口上接收视频流。</li><br><br>                                    <li class="li">执行预处理：<ul class="ul" id="camera-ai-detection-overlay-composer-display__ol_zdw_qwl_vbc"><br>                                            <li class="li">颜色转换</li><br><br>                                            <li class="li">缩小/放大</li><br><br>                                            <li class="li">当模型期望浮点值作为输入时对流数据进行标准化</li><br><br>                                        </ul><br></li><br><br>                                    <li class="li">在其发送端口上将视频流转换为张量数据。<p class="p">分类模型使用此张量数据进行推理。</p><br></li><br><br>                                </ol> |
| **推理** | **推理** |
| [qtimltflite](https://docs.qualcomm.com/doc/80-70022-50SC/topic/qtimltflite.html) | <ol class="ol" id="camera-ai-detection-overlay-composer-display__ol_u1l_cxl_vbc"><br>                                    <li class="li">加载模型。</li><br><br>                                    <li class="li">为选择的 delegate 修改图。</li><br><br>                                    <li class="li">在其接收端口上接收张量数据。</li><br><br>                                    <li class="li">执行推理并在其发送端口上生成包含推理结果的张量数据。</li><br><br>                                </ol> |
| **后处理** | **后处理** |
| qtimlpostprocess | <ol class="ol" id="camera-ai-detection-overlay-composer-display__ol_ky5_grn_vbc"><br>                                    <li class="li"> 接收来自目标检测模型的推理张量。 </li><br><br>                                    <li class="li">将其接收端口上的推理张量转换为多媒体插件稍后可以处理的视频或文本等格式。</li><br><br>                                    <li class="li">将阈值应用于所选的结果数。 </li><br><br>                                    <li class="li">加载检测模型的相应模块。 <p class="p">在此用例中，qtimlpostprocess 执行以下操作：<br>                                            </p><ol class="ol" type="a" id="camera-ai-detection-overlay-composer-display__ol_jcd_wnk_5bc"><br>                                            <li class="li">加载 YOLOv8 子模块。 </li><br><br>                                            <li class="li">将结果生成为文本结构。</li><br><br>                                            <li class="li">接着发送到 qtimetamux 的接收端口。</li><br><br>                                        </ol><br></li><br><br>                                </ol> |
| qtimlpostprocess | <ol class="ol" id="camera-ai-detection-overlay-composer-display__ol_o3v_2xl_vbc"><br>                                    <li class="li">从其接收端口上的分类模型接收推理结果。 </li><br><br>                                    <li class="li">将推理张量转换为多媒体插件稍后可以处理的视频或文本等格式。 </li><br><br>                                    <li class="li">将阈值应用于所选的结果数。 </li><br><br>                                    <li class="li">加载分类模型的相应模块。 <p class="p">在此用例中，qtimlpostprocess 执行以下操作： </p><ol class="ol" type="a" id="camera-ai-detection-overlay-composer-display__ol_p3v_2xl_vbc"><br>                                            <li class="li">加载模型的子模块。</li><br><br>                                            <li class="li">将结果生成为带有分类标签的视频帧。</li><br><br>                                            <li class="li">将它们发送至 qtivcomposer 的接收端口。</li><br><br>                                        </ol><br></li><br><br>                                </ol> |
| [qtimetamux](https://docs.qualcomm.com/doc/80-70022-50SC/topic/qtimetamux.html) | <ol class="ol" id="camera-ai-detection-overlay-composer-display__ol_ll3_x5l_vbc"><br>                                    <li class="li">在接收端口上接收视频流和文本流，以及与视频流相对应的边框结果。</li><br><br>                                    <li class="li">使用接收端口中的视频流内容生成 GST 缓存。</li><br><br>                                    <li class="li">将边框作为 GstVideoRegionOfInterest 从数据接收端添加到其发送端口上的 GST 缓存元数据（元复用）。</li><br><br>                                </ol> |
| [qtivoverlay](https://docs.qualcomm.com/doc/80-70022-50SC/topic/qtioverlay.html) | <ol class="ol" id="camera-ai-detection-overlay-composer-display__ol_wst_y5l_vbc"><br>                                    <li class="li">接收多路复用流。</li><br><br>                                    <li class="li">使用 CL 将边框叠加在 VideoFrame 上。</li><br><br>                                    <li class="li">在其发送端口上生成带有叠加层的 GST 缓存。</li><br><br>                                </ol> |
| [qtivcomposer](https://docs.qualcomm.com/doc/80-70022-50SC/topic/qtivcomposer.html) | <ol class="ol" id="camera-ai-detection-overlay-composer-display__ol_nmc_lxl_vbc"><br>                                    <li class="li">在接收端口上接收原始视频流和分类结果。 </li><br><br>                                    <li class="li">在其发送端口上生成 GST 缓存，其内容由来自其接收端的视频流组成。</li><br><br>                                </ol> |
| **输出** | **输出** |
| [Waylandsink](https://docs.qualcomm.com/doc/80-70022-50SC/topic/waylandsink.html) | <ol class="ol" id="camera-ai-detection-overlay-composer-display__ol_cgt_mwl_vbc"><br>                                    <li class="li">在其接收端口上接收视频</li><br><br>                                    <li class="li">将视频流提交到 Weston。 </li><br><br>                                    <li class="li">Weston 在本地显示器设备上呈现视频流。</li><br><br>                                </ol> |
|  |  |

## 已知问题

- 输出标签模糊。
- 对于摄像头用例，请使用支持 640 × 360 分辨率的摄像头。

## 相关信息

- [目标检测](https://docs.qualcomm.com/doc/80-70022-50SC/topic/gst-ai-object-detection.html)
- [图像分类](https://docs.qualcomm.com/doc/80-70022-50SC/topic/gst-ai-classification.html)

**Parent Topic:** [运行基于 Python 的应用程序](https://docs.qualcomm.com/doc/80-70022-50SC/topic/python-sample-applications.html)

Last Published: Nov 05, 2025

[Previous Topic
使用 Python 解码 JPEG 图像](https://docs.qualcomm.com/bundle/publicresource/80-70022-50SC/topics/decode-jpeg-images-using-python.md) [Next Topic
转换和编码摄像头流](https://docs.qualcomm.com/bundle/publicresource/80-70022-50SC/topics/camera-transform-downscale-and-rotate-encode.md)