blob: 0df906d145eaff8e040bfd6351090423822d2590 [file] [log] [blame]
<!-- HTML header for doxygen 1.8.15-->
<!-- Remember to use version doxygen 1.8.15 +-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="robots" content="NOINDEX, NOFOLLOW" /> <!-- Prevent indexing by search engines -->
<title>Compute Library: CaffePreproccessor Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" async="async" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<img alt="Compute Library" src="https://raw.githubusercontent.com/ARM-software/ComputeLibrary/gh-pages/ACL_logo.png" style="max-width: 100%;margin-top: 15px;margin-left: 10px"/>
<td style="padding-left: 0.5em;">
<div id="projectname">
&#160;<span id="projectnumber">19.08</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classarm__compute_1_1graph__utils_1_1_caffe_preproccessor.xhtml','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> </div>
<div class="headertitle">
<div class="title">CaffePreproccessor Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Caffe preproccessor.
<a href="classarm__compute_1_1graph__utils_1_1_caffe_preproccessor.xhtml#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="_graph_utils_8h_source.xhtml">GraphUtils.h</a>&gt;</code></p>
<div class="dynheader">
Collaboration diagram for CaffePreproccessor:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="classarm__compute_1_1graph__utils_1_1_caffe_preproccessor__coll__graph.svg" width="158" height="112"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<center><span class="legend">[<a target="top" href="graph_legend.xhtml">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a17f1b10d24fd28928777ee5c62c9cbfb"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1graph__utils_1_1_caffe_preproccessor.xhtml#a17f1b10d24fd28928777ee5c62c9cbfb">CaffePreproccessor</a> (std::array&lt; float, 3 &gt; mean=std::array&lt; float, 3 &gt; { { 0, 0, 0 } }, bool bgr=true, float scale=1.f)</td></tr>
<tr class="memdesc:a17f1b10d24fd28928777ee5c62c9cbfb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default Constructor. <a href="#a17f1b10d24fd28928777ee5c62c9cbfb">More...</a><br /></td></tr>
<tr class="separator:a17f1b10d24fd28928777ee5c62c9cbfb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1545d087d050b8e9733e7e212df73666"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1graph__utils_1_1_caffe_preproccessor.xhtml#a1545d087d050b8e9733e7e212df73666">preprocess</a> (<a class="el" href="classarm__compute_1_1_i_tensor.xhtml">ITensor</a> &amp;tensor) override</td></tr>
<tr class="memdesc:a1545d087d050b8e9733e7e212df73666"><td class="mdescLeft">&#160;</td><td class="mdescRight">Preprocess the given tensor. <a href="#a1545d087d050b8e9733e7e212df73666">More...</a><br /></td></tr>
<tr class="separator:a1545d087d050b8e9733e7e212df73666"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classarm__compute_1_1graph__utils_1_1_i_preprocessor"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classarm__compute_1_1graph__utils_1_1_i_preprocessor')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classarm__compute_1_1graph__utils_1_1_i_preprocessor.xhtml">IPreprocessor</a></td></tr>
<tr class="memitem:a145ae89877c556306c3b0a8d869b33f3 inherit pub_methods_classarm__compute_1_1graph__utils_1_1_i_preprocessor"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1graph__utils_1_1_i_preprocessor.xhtml#a145ae89877c556306c3b0a8d869b33f3">~IPreprocessor</a> ()=default</td></tr>
<tr class="memdesc:a145ae89877c556306c3b0a8d869b33f3 inherit pub_methods_classarm__compute_1_1graph__utils_1_1_i_preprocessor"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default destructor. <a href="classarm__compute_1_1graph__utils_1_1_i_preprocessor.xhtml#a145ae89877c556306c3b0a8d869b33f3">More...</a><br /></td></tr>
<tr class="separator:a145ae89877c556306c3b0a8d869b33f3 inherit pub_methods_classarm__compute_1_1graph__utils_1_1_i_preprocessor"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Caffe preproccessor. </p>
<p class="definition">Definition at line <a class="el" href="_graph_utils_8h_source.xhtml#l00060">60</a> of file <a class="el" href="_graph_utils_8h_source.xhtml">GraphUtils.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a17f1b10d24fd28928777ee5c62c9cbfb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a17f1b10d24fd28928777ee5c62c9cbfb">&#9670;&nbsp;</a></span>CaffePreproccessor()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classarm__compute_1_1graph__utils_1_1_caffe_preproccessor.xhtml">CaffePreproccessor</a> </td>
<td>(</td>
<td class="paramtype">std::array&lt; float, 3 &gt;&#160;</td>
<td class="paramname"><em>mean</em> = <code>std::array&lt;float,&#160;3&gt;&#160;{&#160;{&#160;0,&#160;0,&#160;0&#160;}&#160;}</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>bgr</em> = <code>true</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>scale</em> = <code>1.f</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Default Constructor. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">mean</td><td>Mean array in RGB ordering </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">bgr</td><td>Boolean specifying if the preprocessing should assume BGR format </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">scale</td><td>Scale value </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="_graph_utils_8cpp_source.xhtml#l00080">80</a> of file <a class="el" href="_graph_utils_8cpp_source.xhtml">GraphUtils.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; : _mean(mean), _bgr(bgr), _scale(<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#acec6d8ad52a28972fa74e071c1a63b6a">scale</a>)</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; <span class="keywordflow">if</span>(_bgr)</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; {</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; <a class="code" href="namespacearm__compute.xhtml#ae70b8de3a0b147a476cabb07b8707d7f">std::swap</a>(_mean[0], _mean[2]);</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; }</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160;}</div><div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_acec6d8ad52a28972fa74e071c1a63b6a"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#acec6d8ad52a28972fa74e071c1a63b6a">arm_compute::test::validation::scale</a></div><div class="ttdeci">scale</div><div class="ttdef"><b>Definition:</b> <a href="_n_e_o_n_2_pixel_wise_multiplication_8cpp_source.xhtml#l00317">PixelWiseMultiplication.cpp:317</a></div></div>
<div class="ttc" id="namespacearm__compute_xhtml_ae70b8de3a0b147a476cabb07b8707d7f"><div class="ttname"><a href="namespacearm__compute.xhtml#ae70b8de3a0b147a476cabb07b8707d7f">arm_compute::swap</a></div><div class="ttdeci">void swap(Window &amp;lhs, Window &amp;rhs)</div><div class="ttdef"><b>Definition:</b> <a href="_window_8inl_source.xhtml#l00278">Window.inl:278</a></div></div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="_window_8inl_source.xhtml#l00278">arm_compute::swap()</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a1545d087d050b8e9733e7e212df73666"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1545d087d050b8e9733e7e212df73666">&#9670;&nbsp;</a></span>preprocess()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void preprocess </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classarm__compute_1_1_i_tensor.xhtml">ITensor</a> &amp;&#160;</td>
<td class="paramname"><em>tensor</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Preprocess the given tensor. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">tensor</td><td><a class="el" href="classarm__compute_1_1_tensor.xhtml" title="Basic implementation of the tensor interface.">Tensor</a> to preprocess. </td></tr>
</table>
</dd>
</dl>
<p>Implements <a class="el" href="classarm__compute_1_1graph__utils_1_1_i_preprocessor.xhtml#ae699b63165de5182fda5a2337009641f">IPreprocessor</a>.</p>
<p class="definition">Definition at line <a class="el" href="_graph_utils_8cpp_source.xhtml#l00089">89</a> of file <a class="el" href="_graph_utils_8cpp_source.xhtml">GraphUtils.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;{</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; Window window;</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; window.use_tensor_dimensions(tensor.info()-&gt;tensor_shape());</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160;</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; <span class="keyword">const</span> <span class="keywordtype">int</span> channel_idx = <a class="code" href="namespacearm__compute.xhtml#a46e938020a3ac8c926d0590b7fe957db">get_data_layout_dimension_index</a>(tensor.info()-&gt;data_layout(), <a class="code" href="namespacearm__compute.xhtml#a74ce3f7420453d3446218ff3b7453e02af52e9c50a060add65a035429b2a22229">DataLayoutDimension::CHANNEL</a>);</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; <a class="code" href="namespacearm__compute.xhtml#a5002bf7ec46d52971f9526e94172cfee">execute_window_loop</a>(window, [&amp;](<span class="keyword">const</span> Coordinates &amp; <span class="keywordtype">id</span>)</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; {</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; <span class="keyword">const</span> <span class="keywordtype">float</span> value = *reinterpret_cast&lt;float *&gt;(tensor.ptr_to_element(<span class="keywordtype">id</span>)) - _mean[<span class="keywordtype">id</span>[channel_idx]];</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; *reinterpret_cast&lt;float *&gt;(tensor.ptr_to_element(<span class="keywordtype">id</span>)) = value * _scale;</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;}</div><div class="ttc" id="namespacearm__compute_xhtml_a74ce3f7420453d3446218ff3b7453e02af52e9c50a060add65a035429b2a22229"><div class="ttname"><a href="namespacearm__compute.xhtml#a74ce3f7420453d3446218ff3b7453e02af52e9c50a060add65a035429b2a22229">arm_compute::DataLayoutDimension::CHANNEL</a></div><div class="ttdoc">channel</div></div>
<div class="ttc" id="namespacearm__compute_xhtml_a5002bf7ec46d52971f9526e94172cfee"><div class="ttname"><a href="namespacearm__compute.xhtml#a5002bf7ec46d52971f9526e94172cfee">arm_compute::execute_window_loop</a></div><div class="ttdeci">void execute_window_loop(const Window &amp;w, L &amp;&amp;lambda_function, Ts &amp;&amp;... iterators)</div><div class="ttdoc">Iterate through the passed window, automatically adjusting the iterators and calling the lambda_funct...</div><div class="ttdef"><b>Definition:</b> <a href="_helpers_8inl_source.xhtml#l00122">Helpers.inl:122</a></div></div>
<div class="ttc" id="namespacearm__compute_xhtml_a46e938020a3ac8c926d0590b7fe957db"><div class="ttname"><a href="namespacearm__compute.xhtml#a46e938020a3ac8c926d0590b7fe957db">arm_compute::get_data_layout_dimension_index</a></div><div class="ttdeci">size_t get_data_layout_dimension_index(const DataLayout data_layout, const DataLayoutDimension data_layout_dimension)</div><div class="ttdoc">Get the index of the given dimension.</div><div class="ttdef"><b>Definition:</b> <a href="_helpers_8inl_source.xhtml#l00326">Helpers.inl:326</a></div></div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="namespacearm__compute.xhtml#a74ce3f7420453d3446218ff3b7453e02af52e9c50a060add65a035429b2a22229">arm_compute::CHANNEL</a>, <a class="el" href="classarm__compute_1_1_i_tensor_info.xhtml#a367b5090ab432bc7de2c32369e087ab1">ITensorInfo::data_layout()</a>, <a class="el" href="_helpers_8inl_source.xhtml#l00122">arm_compute::execute_window_loop()</a>, <a class="el" href="_helpers_8inl_source.xhtml#l00326">arm_compute::get_data_layout_dimension_index()</a>, <a class="el" href="classarm__compute_1_1_i_tensor.xhtml#a0e95dc1e53c361348314873b168ae237">ITensor::info()</a>, <a class="el" href="classarm__compute_1_1_i_tensor_info.xhtml#a7c66505457d00ece3aa4b34cab80757d">ITensorInfo::tensor_shape()</a>, and <a class="el" href="_window_8inl_source.xhtml#l00250">Window::use_tensor_dimensions()</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>utils/<a class="el" href="_graph_utils_8h_source.xhtml">GraphUtils.h</a></li>
<li>utils/<a class="el" href="_graph_utils_8cpp_source.xhtml">GraphUtils.cpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="namespacearm__compute.xhtml">arm_compute</a></li><li class="navelem"><a class="el" href="namespacearm__compute_1_1graph__utils.xhtml">graph_utils</a></li><li class="navelem"><a class="el" href="classarm__compute_1_1graph__utils_1_1_caffe_preproccessor.xhtml">CaffePreproccessor</a></li>
<li class="footer">Generated on Mon Sep 2 2019 11:47:39 for Compute Library by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.15 </li>
</ul>
</div>
</body>
</html>