blob: 6791e472ea19509554accf7a4ab600220c1e8d56 [file] [log] [blame]
Nikhil Raj9aed8fb2021-11-17 13:16:45 +00001<!-- Copyright (c) 2020 ARM Limited. -->
2<!-- -->
3<!-- SPDX-License-Identifier: MIT -->
4<!-- -->
5<!-- HTML header for doxygen 1.8.13-->
6<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
7<html xmlns="http://www.w3.org/1999/xhtml">
8<head>
9<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
10<meta http-equiv="X-UA-Compatible" content="IE=9"/>
11<meta name="generator" content="Doxygen 1.8.13"/>
12<meta name="robots" content="NOINDEX, NOFOLLOW" />
13<meta name="viewport" content="width=device-width, initial-scale=1"/>
14<title>ArmNN: YoloDatabase Class Reference</title>
15<link href="tabs.css" rel="stylesheet" type="text/css"/>
16<script type="text/javascript" src="jquery.js"></script>
17<script type="text/javascript" src="dynsections.js"></script>
18<link href="navtree.css" rel="stylesheet" type="text/css"/>
19<script type="text/javascript" src="resize.js"></script>
20<script type="text/javascript" src="navtreedata.js"></script>
21<script type="text/javascript" src="navtree.js"></script>
22<script type="text/javascript">
23 $(document).ready(initResizable);
24</script>
25<link href="search/search.css" rel="stylesheet" type="text/css"/>
26<script type="text/javascript" src="search/searchdata.js"></script>
27<script type="text/javascript" src="search/search.js"></script>
28<script type="text/x-mathjax-config">
29 MathJax.Hub.Config({
30 extensions: ["tex2jax.js"],
31 jax: ["input/TeX","output/HTML-CSS"],
32});
33</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
34<link href="doxygen.css" rel="stylesheet" type="text/css" />
35<link href="stylesheet.css" rel="stylesheet" type="text/css"/>
36</head>
37<body>
38<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
39<div id="titlearea">
40<table cellspacing="0" cellpadding="0">
41 <tbody>
42 <tr style="height: 56px;">
43 <img alt="ArmNN" src="Arm_NN_horizontal_blue.png" style="max-width: 10rem; margin-top: .5rem; margin-left 10px"/>
44 <td style="padding-left: 0.5em;">
45 <div id="projectname">
46 &#160;<span id="projectnumber">21.11</span>
47 </div>
48 </td>
49 </tr>
50 </tbody>
51</table>
52</div>
53<!-- end header part -->
54<!-- Generated by Doxygen 1.8.13 -->
55<script type="text/javascript">
56var searchBox = new SearchBox("searchBox", "search",false,'Search');
57</script>
58<script type="text/javascript" src="menudata.js"></script>
59<script type="text/javascript" src="menu.js"></script>
60<script type="text/javascript">
61$(function() {
62 initMenu('',true,false,'search.php','Search');
63 $(document).ready(function() { init_search(); });
64});
65</script>
66<div id="main-nav"></div>
67</div><!-- top -->
68<div id="side-nav" class="ui-resizable side-nav-resizable">
69 <div id="nav-tree">
70 <div id="nav-tree-contents">
71 <div id="nav-sync" class="sync"></div>
72 </div>
73 </div>
74 <div id="splitbar" style="-moz-user-select:none;"
75 class="ui-resizable-handle">
76 </div>
77</div>
78<script type="text/javascript">
79$(document).ready(function(){initNavTree('class_yolo_database.xhtml','');});
80</script>
81<div id="doc-content">
82<!-- window showing the filter options -->
83<div id="MSearchSelectWindow"
84 onmouseover="return searchBox.OnSearchSelectShow()"
85 onmouseout="return searchBox.OnSearchSelectHide()"
86 onkeydown="return searchBox.OnSearchSelectKey(event)">
87</div>
88
89<!-- iframe showing the search results (closed by default) -->
90<div id="MSearchResultsWindow">
91<iframe src="javascript:void(0)" frameborder="0"
92 name="MSearchResults" id="MSearchResults">
93</iframe>
94</div>
95
96<div class="header">
97 <div class="summary">
98<a href="#pub-types">Public Types</a> &#124;
99<a href="#pub-methods">Public Member Functions</a> &#124;
100<a href="class_yolo_database-members.xhtml">List of all members</a> </div>
101 <div class="headertitle">
102<div class="title">YoloDatabase Class Reference</div> </div>
103</div><!--header-->
104<div class="contents">
105
106<p><code>#include &lt;<a class="el" href="_yolo_database_8hpp_source.xhtml">YoloDatabase.hpp</a>&gt;</code></p>
107<table class="memberdecls">
108<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
109Public Types</h2></td></tr>
110<tr class="memitem:a626407dd7c0a5e7d9299ac3deba502d7"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_yolo_database.xhtml#a626407dd7c0a5e7d9299ac3deba502d7">TTestCaseData</a> = <a class="el" href="class_yolo_test_case_data.xhtml">YoloTestCaseData</a></td></tr>
111<tr class="separator:a626407dd7c0a5e7d9299ac3deba502d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
112</table><table class="memberdecls">
113<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
114Public Member Functions</h2></td></tr>
115<tr class="memitem:ae29cd81371801a0d70ac3dbd5adc01e5"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_yolo_database.xhtml#ae29cd81371801a0d70ac3dbd5adc01e5">YoloDatabase</a> (const std::string &amp;imageDir)</td></tr>
116<tr class="separator:ae29cd81371801a0d70ac3dbd5adc01e5"><td class="memSeparator" colspan="2">&#160;</td></tr>
117<tr class="memitem:a4b1e13e320d157200130d2161a8d2070"><td class="memItemLeft" align="right" valign="top">std::unique_ptr&lt; <a class="el" href="class_yolo_database.xhtml#a626407dd7c0a5e7d9299ac3deba502d7">TTestCaseData</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_yolo_database.xhtml#a4b1e13e320d157200130d2161a8d2070">GetTestCaseData</a> (unsigned int testCaseId)</td></tr>
118<tr class="separator:a4b1e13e320d157200130d2161a8d2070"><td class="memSeparator" colspan="2">&#160;</td></tr>
119</table>
120<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
121<div class="textblock">
122<p class="definition">Definition at line <a class="el" href="_yolo_database_8hpp_source.xhtml#l00053">53</a> of file <a class="el" href="_yolo_database_8hpp_source.xhtml">YoloDatabase.hpp</a>.</p>
123</div><h2 class="groupheader">Member Typedef Documentation</h2>
124<a id="a626407dd7c0a5e7d9299ac3deba502d7"></a>
125<h2 class="memtitle"><span class="permalink"><a href="#a626407dd7c0a5e7d9299ac3deba502d7">&#9670;&nbsp;</a></span>TTestCaseData</h2>
126
127<div class="memitem">
128<div class="memproto">
129 <table class="memname">
130 <tr>
131 <td class="memname">using <a class="el" href="class_yolo_database.xhtml#a626407dd7c0a5e7d9299ac3deba502d7">TTestCaseData</a> = <a class="el" href="class_yolo_test_case_data.xhtml">YoloTestCaseData</a></td>
132 </tr>
133 </table>
134</div><div class="memdoc">
135
136<p class="definition">Definition at line <a class="el" href="_yolo_database_8hpp_source.xhtml#l00056">56</a> of file <a class="el" href="_yolo_database_8hpp_source.xhtml">YoloDatabase.hpp</a>.</p>
137
138</div>
139</div>
140<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
141<a id="ae29cd81371801a0d70ac3dbd5adc01e5"></a>
142<h2 class="memtitle"><span class="permalink"><a href="#ae29cd81371801a0d70ac3dbd5adc01e5">&#9670;&nbsp;</a></span>YoloDatabase()</h2>
143
144<div class="memitem">
145<div class="memproto">
146<table class="mlabels">
147 <tr>
148 <td class="mlabels-left">
149 <table class="memname">
150 <tr>
151 <td class="memname"><a class="el" href="class_yolo_database.xhtml">YoloDatabase</a> </td>
152 <td>(</td>
153 <td class="paramtype">const std::string &amp;&#160;</td>
154 <td class="paramname"><em>imageDir</em></td><td>)</td>
155 <td></td>
156 </tr>
157 </table>
158 </td>
159 <td class="mlabels-right">
160<span class="mlabels"><span class="mlabel">explicit</span></span> </td>
161 </tr>
162</table>
163</div><div class="memdoc">
164
165<p class="definition">Definition at line <a class="el" href="_yolo_database_8cpp_source.xhtml#l00068">68</a> of file <a class="el" href="_yolo_database_8cpp_source.xhtml">YoloDatabase.cpp</a>.</p>
166<div class="fragment"><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; : m_ImageDir(imageDir)</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;{</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;}</div></div><!-- fragment -->
167</div>
168</div>
169<h2 class="groupheader">Member Function Documentation</h2>
170<a id="a4b1e13e320d157200130d2161a8d2070"></a>
171<h2 class="memtitle"><span class="permalink"><a href="#a4b1e13e320d157200130d2161a8d2070">&#9670;&nbsp;</a></span>GetTestCaseData()</h2>
172
173<div class="memitem">
174<div class="memproto">
175 <table class="memname">
176 <tr>
177 <td class="memname">std::unique_ptr&lt; <a class="el" href="class_yolo_database.xhtml#a626407dd7c0a5e7d9299ac3deba502d7">YoloDatabase::TTestCaseData</a> &gt; GetTestCaseData </td>
178 <td>(</td>
179 <td class="paramtype">unsigned int&#160;</td>
180 <td class="paramname"><em>testCaseId</em></td><td>)</td>
181 <td></td>
182 </tr>
183 </table>
184</div><div class="memdoc">
185
186<p class="definition">Definition at line <a class="el" href="_yolo_database_8cpp_source.xhtml#l00073">73</a> of file <a class="el" href="_yolo_database_8cpp_source.xhtml">YoloDatabase.cpp</a>.</p>
187
188<p class="reference">References <a class="el" href="_logging_8hpp_source.xhtml#l00202">ARMNN_LOG</a>, <a class="el" href="_exceptions_8hpp_source.xhtml#l00209">CHECK_LOCATION</a>, <a class="el" href="_inference_test_image_8cpp_source.xhtml#l00310">GetImageDataInArmNnLayoutAsNormalizedFloats()</a>, <a class="el" href="_numeric_cast_8hpp_source.xhtml#l00035">armnn::numeric_cast()</a>, <a class="el" href="_inference_test_image_8cpp_source.xhtml#l00209">InferenceTestImage::Resize()</a>, <a class="el" href="_inference_test_image_8hpp.xhtml#a5f7592b0a8fa09208cd32721cf207110aabe0e112dd5f40f1de00eccbf99798a3">Rgb</a>, <a class="el" href="_exceptions_8cpp_source.xhtml#l00032">Exception::what()</a>, <a class="el" href="_yolo_database_8hpp_source.xhtml#l00051">YoloImageHeight</a>, and <a class="el" href="_yolo_database_8hpp_source.xhtml#l00050">YoloImageWidth</a>.</p>
189<div class="fragment"><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;{</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; testCaseId = testCaseId % <a class="code" href="namespacearmnn.xhtml#a375ca3cff9f1b005d1412dc5f3cf5b6e">armnn::numeric_cast</a>&lt;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>&gt;(g_PerTestCaseInputOutput.size());</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; <span class="keyword">const</span> <span class="keyword">auto</span>&amp; testCaseInputOutput = g_PerTestCaseInputOutput[testCaseId];</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; <span class="keyword">const</span> std::string imagePath = m_ImageDir + testCaseInputOutput.first;</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="comment">// Loads test case input image.</span></div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; std::vector&lt;float&gt; imageData;</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; <span class="keywordflow">try</span></div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; {</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <a class="code" href="class_inference_test_image.xhtml">InferenceTestImage</a> image(imagePath.c_str());</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="_yolo_database_8hpp.xhtml#a88c3339d57718f167a374ab572610ba8">YoloImageWidth</a> != image.GetWidth() || <a class="code" href="_yolo_database_8hpp.xhtml#af74f4ad1b33fe68237cb97c9345e9e87">YoloImageHeight</a> != image.GetHeight())</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; {</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; image.<a class="code" href="class_inference_test_image.xhtml#a4a6637c2a2952a14cb3a426133b67a73">Resize</a>(<a class="code" href="_yolo_database_8hpp.xhtml#a88c3339d57718f167a374ab572610ba8">YoloImageWidth</a>, <a class="code" href="_yolo_database_8hpp.xhtml#af74f4ad1b33fe68237cb97c9345e9e87">YoloImageHeight</a>, <a class="code" href="_exceptions_8hpp.xhtml#aa3be76aec4ce713822a5ea1ecbb7bc61">CHECK_LOCATION</a>());</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; }</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; imageData = <a class="code" href="_inference_test_image_8cpp.xhtml#a3f8ac82c346c723f775a383d22239182">GetImageDataInArmNnLayoutAsNormalizedFloats</a>(<a class="code" href="_inference_test_image_8hpp.xhtml#a5f7592b0a8fa09208cd32721cf207110aabe0e112dd5f40f1de00eccbf99798a3">ImageChannelLayout::Rgb</a>, image);</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; }</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <span class="keywordflow">catch</span> (<span class="keyword">const</span> <a class="code" href="class_inference_test_image_exception.xhtml">InferenceTestImageException</a>&amp; e)</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; {</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <a class="code" href="_logging_8hpp.xhtml#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a>(fatal) &lt;&lt; <span class="stringliteral">&quot;Failed to load test case &quot;</span> &lt;&lt; testCaseId &lt;&lt; <span class="stringliteral">&quot; with error: &quot;</span> &lt;&lt; e.<a class="code" href="classarmnn_1_1_exception.xhtml#abf843cbb29dec939d0731e491bab6f70">what</a>();</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; }</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160;</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; <span class="comment">// Prepares test case output.</span></div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; std::vector&lt;YoloDetectedObject&gt; topObjectDetections;</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; topObjectDetections.reserve(1);</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; topObjectDetections.push_back(testCaseInputOutput.second);</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; <span class="keywordflow">return</span> std::make_unique&lt;YoloTestCaseData&gt;(std::move(imageData), std::move(topObjectDetections));</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160;}</div><div class="ttc" id="_yolo_database_8hpp_xhtml_af74f4ad1b33fe68237cb97c9345e9e87"><div class="ttname"><a href="_yolo_database_8hpp.xhtml#af74f4ad1b33fe68237cb97c9345e9e87">YoloImageHeight</a></div><div class="ttdeci">constexpr unsigned int YoloImageHeight</div><div class="ttdef"><b>Definition:</b> <a href="_yolo_database_8hpp_source.xhtml#l00051">YoloDatabase.hpp:51</a></div></div>
190<div class="ttc" id="classarmnn_1_1_exception_xhtml_abf843cbb29dec939d0731e491bab6f70"><div class="ttname"><a href="classarmnn_1_1_exception.xhtml#abf843cbb29dec939d0731e491bab6f70">armnn::Exception::what</a></div><div class="ttdeci">virtual const char * what() const noexcept override</div><div class="ttdef"><b>Definition:</b> <a href="_exceptions_8cpp_source.xhtml#l00032">Exceptions.cpp:32</a></div></div>
191<div class="ttc" id="_logging_8hpp_xhtml_a7b6ad073975f437ec38ca7d20154727f"><div class="ttname"><a href="_logging_8hpp.xhtml#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a></div><div class="ttdeci">#define ARMNN_LOG(severity)</div><div class="ttdef"><b>Definition:</b> <a href="_logging_8hpp_source.xhtml#l00202">Logging.hpp:202</a></div></div>
192<div class="ttc" id="class_inference_test_image_exception_xhtml"><div class="ttname"><a href="class_inference_test_image_exception.xhtml">InferenceTestImageException</a></div><div class="ttdef"><b>Definition:</b> <a href="_inference_test_image_8hpp_source.xhtml#l00015">InferenceTestImage.hpp:15</a></div></div>
193<div class="ttc" id="_inference_test_image_8cpp_xhtml_a3f8ac82c346c723f775a383d22239182"><div class="ttname"><a href="_inference_test_image_8cpp.xhtml#a3f8ac82c346c723f775a383d22239182">GetImageDataInArmNnLayoutAsNormalizedFloats</a></div><div class="ttdeci">std::vector&lt; float &gt; GetImageDataInArmNnLayoutAsNormalizedFloats(ImageChannelLayout layout, const InferenceTestImage &amp;image)</div><div class="ttdef"><b>Definition:</b> <a href="_inference_test_image_8cpp_source.xhtml#l00310">InferenceTestImage.cpp:310</a></div></div>
194<div class="ttc" id="_exceptions_8hpp_xhtml_aa3be76aec4ce713822a5ea1ecbb7bc61"><div class="ttname"><a href="_exceptions_8hpp.xhtml#aa3be76aec4ce713822a5ea1ecbb7bc61">CHECK_LOCATION</a></div><div class="ttdeci">#define CHECK_LOCATION()</div><div class="ttdef"><b>Definition:</b> <a href="_exceptions_8hpp_source.xhtml#l00209">Exceptions.hpp:209</a></div></div>
195<div class="ttc" id="class_inference_test_image_xhtml"><div class="ttname"><a href="class_inference_test_image.xhtml">InferenceTestImage</a></div><div class="ttdef"><b>Definition:</b> <a href="_inference_test_image_8hpp_source.xhtml#l00051">InferenceTestImage.hpp:51</a></div></div>
196<div class="ttc" id="_yolo_database_8hpp_xhtml_a88c3339d57718f167a374ab572610ba8"><div class="ttname"><a href="_yolo_database_8hpp.xhtml#a88c3339d57718f167a374ab572610ba8">YoloImageWidth</a></div><div class="ttdeci">constexpr unsigned int YoloImageWidth</div><div class="ttdef"><b>Definition:</b> <a href="_yolo_database_8hpp_source.xhtml#l00050">YoloDatabase.hpp:50</a></div></div>
197<div class="ttc" id="_inference_test_image_8hpp_xhtml_a5f7592b0a8fa09208cd32721cf207110aabe0e112dd5f40f1de00eccbf99798a3"><div class="ttname"><a href="_inference_test_image_8hpp.xhtml#a5f7592b0a8fa09208cd32721cf207110aabe0e112dd5f40f1de00eccbf99798a3">ImageChannelLayout::Rgb</a></div></div>
198<div class="ttc" id="namespacearmnn_xhtml_a375ca3cff9f1b005d1412dc5f3cf5b6e"><div class="ttname"><a href="namespacearmnn.xhtml#a375ca3cff9f1b005d1412dc5f3cf5b6e">armnn::numeric_cast</a></div><div class="ttdeci">std::enable_if_t&lt; std::is_unsigned&lt; Source &gt;::value &amp;&amp;std::is_unsigned&lt; Dest &gt;::value, Dest &gt; numeric_cast(Source source)</div><div class="ttdef"><b>Definition:</b> <a href="_numeric_cast_8hpp_source.xhtml#l00035">NumericCast.hpp:35</a></div></div>
199<div class="ttc" id="class_inference_test_image_xhtml_a4a6637c2a2952a14cb3a426133b67a73"><div class="ttname"><a href="class_inference_test_image.xhtml#a4a6637c2a2952a14cb3a426133b67a73">InferenceTestImage::Resize</a></div><div class="ttdeci">std::vector&lt; float &gt; Resize(unsigned int newWidth, unsigned int newHeight, const armnn::CheckLocation &amp;location, const ResizingMethods meth=ResizingMethods::STB, const std::array&lt; float, 3 &gt; &amp;mean={{0.0, 0.0, 0.0}}, const std::array&lt; float, 3 &gt; &amp;stddev={{1.0, 1.0, 1.0}}, const float scale=255.0f)</div><div class="ttdef"><b>Definition:</b> <a href="_inference_test_image_8cpp_source.xhtml#l00209">InferenceTestImage.cpp:209</a></div></div>
200</div><!-- fragment -->
201</div>
202</div>
203<hr/>The documentation for this class was generated from the following files:<ul>
204<li>tests/<a class="el" href="_yolo_database_8hpp_source.xhtml">YoloDatabase.hpp</a></li>
205<li>tests/<a class="el" href="_yolo_database_8cpp_source.xhtml">YoloDatabase.cpp</a></li>
206</ul>
207</div><!-- contents -->
208</div><!-- doc-content -->
209<!-- start footer part -->
210<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
211 <ul>
212 <li class="navelem"><a class="el" href="class_yolo_database.xhtml">YoloDatabase</a></li>
213 <li class="footer">Generated on Wed Nov 17 2021 12:59:41 for ArmNN by
214 <a href="http://www.doxygen.org/index.html">
215 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
216 </ul>
217</div>
218</body>
219</html>