FaceDetectorYN.html 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <!-- NewPage -->
  3. <html lang="en">
  4. <head>
  5. <!-- Generated by javadoc (1.8.0_312) on Wed Jun 28 12:47:23 UTC 2023 -->
  6. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  7. <title>FaceDetectorYN (OpenCV 4.8.0 Java documentation)</title>
  8. <meta name="date" content="2023-06-28">
  9. <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
  10. <script type="text/javascript" src="../../../script.js"></script>
  11. </head>
  12. <body>
  13. <script type="text/javascript"><!--
  14. try {
  15. if (location.href.indexOf('is-external=true') == -1) {
  16. parent.document.title="FaceDetectorYN (OpenCV 4.8.0 Java documentation)";
  17. }
  18. }
  19. catch(err) {
  20. }
  21. //-->
  22. var methods = {"i0":9,"i1":9,"i2":9,"i3":9,"i4":9,"i5":9,"i6":9,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10};
  23. var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
  24. var altColor = "altColor";
  25. var rowColor = "rowColor";
  26. var tableTab = "tableTab";
  27. var activeTableTab = "activeTableTab";
  28. </script>
  29. <noscript>
  30. <div>JavaScript is disabled on your browser.</div>
  31. </noscript>
  32. <!-- ========= START OF TOP NAVBAR ======= -->
  33. <div class="topNav"><a name="navbar.top">
  34. <!-- -->
  35. </a>
  36. <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
  37. <a name="navbar.top.firstrow">
  38. <!-- -->
  39. </a>
  40. <ul class="navList" title="Navigation">
  41. <li><a href="../../../overview-summary.html">Overview</a></li>
  42. <li><a href="package-summary.html">Package</a></li>
  43. <li class="navBarCell1Rev">Class</li>
  44. <li><a href="package-tree.html">Tree</a></li>
  45. <li><a href="../../../index-all.html">Index</a></li>
  46. <li><a href="../../../help-doc.html">Help</a></li>
  47. </ul>
  48. <div class="aboutLanguage">
  49. <script>
  50. var url = window.location.href;
  51. var pos = url.lastIndexOf('/javadoc/');
  52. url = pos >= 0 ? (url.substring(0, pos) + '/javadoc/mymath.js') : (window.location.origin + '/mymath.js');
  53. var script = document.createElement('script');
  54. script.src = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML,' + url;
  55. document.getElementsByTagName('head')[0].appendChild(script);
  56. </script>
  57. </div>
  58. </div>
  59. <div class="subNav">
  60. <ul class="navList">
  61. <li><a href="../../../org/opencv/objdetect/Dictionary.html" title="class in org.opencv.objdetect"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  62. <li><a href="../../../org/opencv/objdetect/FaceRecognizerSF.html" title="class in org.opencv.objdetect"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
  63. </ul>
  64. <ul class="navList">
  65. <li><a href="../../../index.html?org/opencv/objdetect/FaceDetectorYN.html" target="_top">Frames</a></li>
  66. <li><a href="FaceDetectorYN.html" target="_top">No&nbsp;Frames</a></li>
  67. </ul>
  68. <ul class="navList" id="allclasses_navbar_top">
  69. <li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
  70. </ul>
  71. <div>
  72. <script type="text/javascript"><!--
  73. allClassesLink = document.getElementById("allclasses_navbar_top");
  74. if(window==top) {
  75. allClassesLink.style.display = "block";
  76. }
  77. else {
  78. allClassesLink.style.display = "none";
  79. }
  80. //-->
  81. </script>
  82. </div>
  83. <div>
  84. <ul class="subNavList">
  85. <li>Summary:&nbsp;</li>
  86. <li>Nested&nbsp;|&nbsp;</li>
  87. <li>Field&nbsp;|&nbsp;</li>
  88. <li>Constr&nbsp;|&nbsp;</li>
  89. <li><a href="#method.summary">Method</a></li>
  90. </ul>
  91. <ul class="subNavList">
  92. <li>Detail:&nbsp;</li>
  93. <li>Field&nbsp;|&nbsp;</li>
  94. <li>Constr&nbsp;|&nbsp;</li>
  95. <li><a href="#method.detail">Method</a></li>
  96. </ul>
  97. </div>
  98. <a name="skip.navbar.top">
  99. <!-- -->
  100. </a></div>
  101. <!-- ========= END OF TOP NAVBAR ========= -->
  102. <!-- ======== START OF CLASS DATA ======== -->
  103. <div class="header">
  104. <div class="subTitle">org.opencv.objdetect</div>
  105. <h2 title="Class FaceDetectorYN" class="title">Class FaceDetectorYN</h2>
  106. </div>
  107. <div class="contentContainer">
  108. <ul class="inheritance">
  109. <li>java.lang.Object</li>
  110. <li>
  111. <ul class="inheritance">
  112. <li>org.opencv.objdetect.FaceDetectorYN</li>
  113. </ul>
  114. </li>
  115. </ul>
  116. <div class="description">
  117. <ul class="blockList">
  118. <li class="blockList">
  119. <hr>
  120. <br>
  121. <pre>public class <span class="typeNameLabel">FaceDetectorYN</span>
  122. extends java.lang.Object</pre>
  123. <div class="block">DNN-based face detector
  124. model download link: https://github.com/opencv/opencv_zoo/tree/master/models/face_detection_yunet</div>
  125. </li>
  126. </ul>
  127. </div>
  128. <div class="summary">
  129. <ul class="blockList">
  130. <li class="blockList">
  131. <!-- ========== METHOD SUMMARY =========== -->
  132. <ul class="blockList">
  133. <li class="blockList"><a name="method.summary">
  134. <!-- -->
  135. </a>
  136. <h3>Method Summary</h3>
  137. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
  138. <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
  139. <tr>
  140. <th class="colFirst" scope="col">Modifier and Type</th>
  141. <th class="colLast" scope="col">Method and Description</th>
  142. </tr>
  143. <tr id="i0" class="altColor">
  144. <td class="colFirst"><code>static <a href="../../../org/opencv/objdetect/FaceDetectorYN.html" title="class in org.opencv.objdetect">FaceDetectorYN</a></code></td>
  145. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/FaceDetectorYN.html#Z:Z__fromPtr__-long-">__fromPtr__</a></span>(long&nbsp;addr)</code>&nbsp;</td>
  146. </tr>
  147. <tr id="i1" class="rowColor">
  148. <td class="colFirst"><code>static <a href="../../../org/opencv/objdetect/FaceDetectorYN.html" title="class in org.opencv.objdetect">FaceDetectorYN</a></code></td>
  149. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/FaceDetectorYN.html#create-java.lang.String-java.lang.String-org.opencv.core.Size-">create</a></span>(java.lang.String&nbsp;model,
  150. java.lang.String&nbsp;config,
  151. <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;input_size)</code>
  152. <div class="block">Creates an instance of this class with given parameters</div>
  153. </td>
  154. </tr>
  155. <tr id="i2" class="altColor">
  156. <td class="colFirst"><code>static <a href="../../../org/opencv/objdetect/FaceDetectorYN.html" title="class in org.opencv.objdetect">FaceDetectorYN</a></code></td>
  157. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/FaceDetectorYN.html#create-java.lang.String-java.lang.String-org.opencv.core.Size-float-">create</a></span>(java.lang.String&nbsp;model,
  158. java.lang.String&nbsp;config,
  159. <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;input_size,
  160. float&nbsp;score_threshold)</code>
  161. <div class="block">Creates an instance of this class with given parameters</div>
  162. </td>
  163. </tr>
  164. <tr id="i3" class="rowColor">
  165. <td class="colFirst"><code>static <a href="../../../org/opencv/objdetect/FaceDetectorYN.html" title="class in org.opencv.objdetect">FaceDetectorYN</a></code></td>
  166. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/FaceDetectorYN.html#create-java.lang.String-java.lang.String-org.opencv.core.Size-float-float-">create</a></span>(java.lang.String&nbsp;model,
  167. java.lang.String&nbsp;config,
  168. <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;input_size,
  169. float&nbsp;score_threshold,
  170. float&nbsp;nms_threshold)</code>
  171. <div class="block">Creates an instance of this class with given parameters</div>
  172. </td>
  173. </tr>
  174. <tr id="i4" class="altColor">
  175. <td class="colFirst"><code>static <a href="../../../org/opencv/objdetect/FaceDetectorYN.html" title="class in org.opencv.objdetect">FaceDetectorYN</a></code></td>
  176. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/FaceDetectorYN.html#create-java.lang.String-java.lang.String-org.opencv.core.Size-float-float-int-">create</a></span>(java.lang.String&nbsp;model,
  177. java.lang.String&nbsp;config,
  178. <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;input_size,
  179. float&nbsp;score_threshold,
  180. float&nbsp;nms_threshold,
  181. int&nbsp;top_k)</code>
  182. <div class="block">Creates an instance of this class with given parameters</div>
  183. </td>
  184. </tr>
  185. <tr id="i5" class="rowColor">
  186. <td class="colFirst"><code>static <a href="../../../org/opencv/objdetect/FaceDetectorYN.html" title="class in org.opencv.objdetect">FaceDetectorYN</a></code></td>
  187. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/FaceDetectorYN.html#create-java.lang.String-java.lang.String-org.opencv.core.Size-float-float-int-int-">create</a></span>(java.lang.String&nbsp;model,
  188. java.lang.String&nbsp;config,
  189. <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;input_size,
  190. float&nbsp;score_threshold,
  191. float&nbsp;nms_threshold,
  192. int&nbsp;top_k,
  193. int&nbsp;backend_id)</code>
  194. <div class="block">Creates an instance of this class with given parameters</div>
  195. </td>
  196. </tr>
  197. <tr id="i6" class="altColor">
  198. <td class="colFirst"><code>static <a href="../../../org/opencv/objdetect/FaceDetectorYN.html" title="class in org.opencv.objdetect">FaceDetectorYN</a></code></td>
  199. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/FaceDetectorYN.html#create-java.lang.String-java.lang.String-org.opencv.core.Size-float-float-int-int-int-">create</a></span>(java.lang.String&nbsp;model,
  200. java.lang.String&nbsp;config,
  201. <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;input_size,
  202. float&nbsp;score_threshold,
  203. float&nbsp;nms_threshold,
  204. int&nbsp;top_k,
  205. int&nbsp;backend_id,
  206. int&nbsp;target_id)</code>
  207. <div class="block">Creates an instance of this class with given parameters</div>
  208. </td>
  209. </tr>
  210. <tr id="i7" class="rowColor">
  211. <td class="colFirst"><code>int</code></td>
  212. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/FaceDetectorYN.html#detect-org.opencv.core.Mat-org.opencv.core.Mat-">detect</a></span>(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image,
  213. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;faces)</code>
  214. <div class="block">Detects faces in the input image.</div>
  215. </td>
  216. </tr>
  217. <tr id="i8" class="altColor">
  218. <td class="colFirst"><code><a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a></code></td>
  219. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/FaceDetectorYN.html#getInputSize--">getInputSize</a></span>()</code>&nbsp;</td>
  220. </tr>
  221. <tr id="i9" class="rowColor">
  222. <td class="colFirst"><code>long</code></td>
  223. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/FaceDetectorYN.html#getNativeObjAddr--">getNativeObjAddr</a></span>()</code>&nbsp;</td>
  224. </tr>
  225. <tr id="i10" class="altColor">
  226. <td class="colFirst"><code>float</code></td>
  227. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/FaceDetectorYN.html#getNMSThreshold--">getNMSThreshold</a></span>()</code>&nbsp;</td>
  228. </tr>
  229. <tr id="i11" class="rowColor">
  230. <td class="colFirst"><code>float</code></td>
  231. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/FaceDetectorYN.html#getScoreThreshold--">getScoreThreshold</a></span>()</code>&nbsp;</td>
  232. </tr>
  233. <tr id="i12" class="altColor">
  234. <td class="colFirst"><code>int</code></td>
  235. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/FaceDetectorYN.html#getTopK--">getTopK</a></span>()</code>&nbsp;</td>
  236. </tr>
  237. <tr id="i13" class="rowColor">
  238. <td class="colFirst"><code>void</code></td>
  239. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/FaceDetectorYN.html#setInputSize-org.opencv.core.Size-">setInputSize</a></span>(<a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;input_size)</code>
  240. <div class="block">Set the size for the network input, which overwrites the input size of creating model.</div>
  241. </td>
  242. </tr>
  243. <tr id="i14" class="altColor">
  244. <td class="colFirst"><code>void</code></td>
  245. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/FaceDetectorYN.html#setNMSThreshold-float-">setNMSThreshold</a></span>(float&nbsp;nms_threshold)</code>
  246. <div class="block">Set the Non-maximum-suppression threshold to suppress bounding boxes that have IoU greater than the given value</div>
  247. </td>
  248. </tr>
  249. <tr id="i15" class="rowColor">
  250. <td class="colFirst"><code>void</code></td>
  251. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/FaceDetectorYN.html#setScoreThreshold-float-">setScoreThreshold</a></span>(float&nbsp;score_threshold)</code>
  252. <div class="block">Set the score threshold to filter out bounding boxes of score less than the given value</div>
  253. </td>
  254. </tr>
  255. <tr id="i16" class="altColor">
  256. <td class="colFirst"><code>void</code></td>
  257. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/FaceDetectorYN.html#setTopK-int-">setTopK</a></span>(int&nbsp;top_k)</code>
  258. <div class="block">Set the number of bounding boxes preserved before NMS</div>
  259. </td>
  260. </tr>
  261. </table>
  262. <ul class="blockList">
  263. <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
  264. <!-- -->
  265. </a>
  266. <h3>Methods inherited from class&nbsp;java.lang.Object</h3>
  267. <code>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
  268. </ul>
  269. </li>
  270. </ul>
  271. </li>
  272. </ul>
  273. </div>
  274. <div class="details">
  275. <ul class="blockList">
  276. <li class="blockList">
  277. <!-- ============ METHOD DETAIL ========== -->
  278. <ul class="blockList">
  279. <li class="blockList"><a name="method.detail">
  280. <!-- -->
  281. </a>
  282. <h3>Method Detail</h3>
  283. <a name="Z:Z__fromPtr__-long-">
  284. <!-- -->
  285. </a>
  286. <ul class="blockList">
  287. <li class="blockList">
  288. <h4>__fromPtr__</h4>
  289. <pre>public static&nbsp;<a href="../../../org/opencv/objdetect/FaceDetectorYN.html" title="class in org.opencv.objdetect">FaceDetectorYN</a>&nbsp;__fromPtr__(long&nbsp;addr)</pre>
  290. </li>
  291. </ul>
  292. <a name="create-java.lang.String-java.lang.String-org.opencv.core.Size-">
  293. <!-- -->
  294. </a>
  295. <ul class="blockList">
  296. <li class="blockList">
  297. <h4>create</h4>
  298. <pre>public static&nbsp;<a href="../../../org/opencv/objdetect/FaceDetectorYN.html" title="class in org.opencv.objdetect">FaceDetectorYN</a>&nbsp;create(java.lang.String&nbsp;model,
  299. java.lang.String&nbsp;config,
  300. <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;input_size)</pre>
  301. <div class="block">Creates an instance of this class with given parameters</div>
  302. <dl>
  303. <dt><span class="paramLabel">Parameters:</span></dt>
  304. <dd><code>model</code> - the path to the requested model</dd>
  305. <dd><code>config</code> - the path to the config file for compability, which is not requested for ONNX models</dd>
  306. <dd><code>input_size</code> - the size of the input image</dd>
  307. <dt><span class="returnLabel">Returns:</span></dt>
  308. <dd>automatically generated</dd>
  309. </dl>
  310. </li>
  311. </ul>
  312. <a name="create-java.lang.String-java.lang.String-org.opencv.core.Size-float-">
  313. <!-- -->
  314. </a>
  315. <ul class="blockList">
  316. <li class="blockList">
  317. <h4>create</h4>
  318. <pre>public static&nbsp;<a href="../../../org/opencv/objdetect/FaceDetectorYN.html" title="class in org.opencv.objdetect">FaceDetectorYN</a>&nbsp;create(java.lang.String&nbsp;model,
  319. java.lang.String&nbsp;config,
  320. <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;input_size,
  321. float&nbsp;score_threshold)</pre>
  322. <div class="block">Creates an instance of this class with given parameters</div>
  323. <dl>
  324. <dt><span class="paramLabel">Parameters:</span></dt>
  325. <dd><code>model</code> - the path to the requested model</dd>
  326. <dd><code>config</code> - the path to the config file for compability, which is not requested for ONNX models</dd>
  327. <dd><code>input_size</code> - the size of the input image</dd>
  328. <dd><code>score_threshold</code> - the threshold to filter out bounding boxes of score smaller than the given value</dd>
  329. <dt><span class="returnLabel">Returns:</span></dt>
  330. <dd>automatically generated</dd>
  331. </dl>
  332. </li>
  333. </ul>
  334. <a name="create-java.lang.String-java.lang.String-org.opencv.core.Size-float-float-">
  335. <!-- -->
  336. </a>
  337. <ul class="blockList">
  338. <li class="blockList">
  339. <h4>create</h4>
  340. <pre>public static&nbsp;<a href="../../../org/opencv/objdetect/FaceDetectorYN.html" title="class in org.opencv.objdetect">FaceDetectorYN</a>&nbsp;create(java.lang.String&nbsp;model,
  341. java.lang.String&nbsp;config,
  342. <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;input_size,
  343. float&nbsp;score_threshold,
  344. float&nbsp;nms_threshold)</pre>
  345. <div class="block">Creates an instance of this class with given parameters</div>
  346. <dl>
  347. <dt><span class="paramLabel">Parameters:</span></dt>
  348. <dd><code>model</code> - the path to the requested model</dd>
  349. <dd><code>config</code> - the path to the config file for compability, which is not requested for ONNX models</dd>
  350. <dd><code>input_size</code> - the size of the input image</dd>
  351. <dd><code>score_threshold</code> - the threshold to filter out bounding boxes of score smaller than the given value</dd>
  352. <dd><code>nms_threshold</code> - the threshold to suppress bounding boxes of IoU bigger than the given value</dd>
  353. <dt><span class="returnLabel">Returns:</span></dt>
  354. <dd>automatically generated</dd>
  355. </dl>
  356. </li>
  357. </ul>
  358. <a name="create-java.lang.String-java.lang.String-org.opencv.core.Size-float-float-int-">
  359. <!-- -->
  360. </a>
  361. <ul class="blockList">
  362. <li class="blockList">
  363. <h4>create</h4>
  364. <pre>public static&nbsp;<a href="../../../org/opencv/objdetect/FaceDetectorYN.html" title="class in org.opencv.objdetect">FaceDetectorYN</a>&nbsp;create(java.lang.String&nbsp;model,
  365. java.lang.String&nbsp;config,
  366. <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;input_size,
  367. float&nbsp;score_threshold,
  368. float&nbsp;nms_threshold,
  369. int&nbsp;top_k)</pre>
  370. <div class="block">Creates an instance of this class with given parameters</div>
  371. <dl>
  372. <dt><span class="paramLabel">Parameters:</span></dt>
  373. <dd><code>model</code> - the path to the requested model</dd>
  374. <dd><code>config</code> - the path to the config file for compability, which is not requested for ONNX models</dd>
  375. <dd><code>input_size</code> - the size of the input image</dd>
  376. <dd><code>score_threshold</code> - the threshold to filter out bounding boxes of score smaller than the given value</dd>
  377. <dd><code>nms_threshold</code> - the threshold to suppress bounding boxes of IoU bigger than the given value</dd>
  378. <dd><code>top_k</code> - keep top K bboxes before NMS</dd>
  379. <dt><span class="returnLabel">Returns:</span></dt>
  380. <dd>automatically generated</dd>
  381. </dl>
  382. </li>
  383. </ul>
  384. <a name="create-java.lang.String-java.lang.String-org.opencv.core.Size-float-float-int-int-">
  385. <!-- -->
  386. </a>
  387. <ul class="blockList">
  388. <li class="blockList">
  389. <h4>create</h4>
  390. <pre>public static&nbsp;<a href="../../../org/opencv/objdetect/FaceDetectorYN.html" title="class in org.opencv.objdetect">FaceDetectorYN</a>&nbsp;create(java.lang.String&nbsp;model,
  391. java.lang.String&nbsp;config,
  392. <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;input_size,
  393. float&nbsp;score_threshold,
  394. float&nbsp;nms_threshold,
  395. int&nbsp;top_k,
  396. int&nbsp;backend_id)</pre>
  397. <div class="block">Creates an instance of this class with given parameters</div>
  398. <dl>
  399. <dt><span class="paramLabel">Parameters:</span></dt>
  400. <dd><code>model</code> - the path to the requested model</dd>
  401. <dd><code>config</code> - the path to the config file for compability, which is not requested for ONNX models</dd>
  402. <dd><code>input_size</code> - the size of the input image</dd>
  403. <dd><code>score_threshold</code> - the threshold to filter out bounding boxes of score smaller than the given value</dd>
  404. <dd><code>nms_threshold</code> - the threshold to suppress bounding boxes of IoU bigger than the given value</dd>
  405. <dd><code>top_k</code> - keep top K bboxes before NMS</dd>
  406. <dd><code>backend_id</code> - the id of backend</dd>
  407. <dt><span class="returnLabel">Returns:</span></dt>
  408. <dd>automatically generated</dd>
  409. </dl>
  410. </li>
  411. </ul>
  412. <a name="create-java.lang.String-java.lang.String-org.opencv.core.Size-float-float-int-int-int-">
  413. <!-- -->
  414. </a>
  415. <ul class="blockList">
  416. <li class="blockList">
  417. <h4>create</h4>
  418. <pre>public static&nbsp;<a href="../../../org/opencv/objdetect/FaceDetectorYN.html" title="class in org.opencv.objdetect">FaceDetectorYN</a>&nbsp;create(java.lang.String&nbsp;model,
  419. java.lang.String&nbsp;config,
  420. <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;input_size,
  421. float&nbsp;score_threshold,
  422. float&nbsp;nms_threshold,
  423. int&nbsp;top_k,
  424. int&nbsp;backend_id,
  425. int&nbsp;target_id)</pre>
  426. <div class="block">Creates an instance of this class with given parameters</div>
  427. <dl>
  428. <dt><span class="paramLabel">Parameters:</span></dt>
  429. <dd><code>model</code> - the path to the requested model</dd>
  430. <dd><code>config</code> - the path to the config file for compability, which is not requested for ONNX models</dd>
  431. <dd><code>input_size</code> - the size of the input image</dd>
  432. <dd><code>score_threshold</code> - the threshold to filter out bounding boxes of score smaller than the given value</dd>
  433. <dd><code>nms_threshold</code> - the threshold to suppress bounding boxes of IoU bigger than the given value</dd>
  434. <dd><code>top_k</code> - keep top K bboxes before NMS</dd>
  435. <dd><code>backend_id</code> - the id of backend</dd>
  436. <dd><code>target_id</code> - the id of target device</dd>
  437. <dt><span class="returnLabel">Returns:</span></dt>
  438. <dd>automatically generated</dd>
  439. </dl>
  440. </li>
  441. </ul>
  442. <a name="detect-org.opencv.core.Mat-org.opencv.core.Mat-">
  443. <!-- -->
  444. </a>
  445. <ul class="blockList">
  446. <li class="blockList">
  447. <h4>detect</h4>
  448. <pre>public&nbsp;int&nbsp;detect(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image,
  449. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;faces)</pre>
  450. <div class="block">Detects faces in the input image. Following is an example output.
  451. ![image](pics/lena-face-detection.jpg)</div>
  452. <dl>
  453. <dt><span class="paramLabel">Parameters:</span></dt>
  454. <dd><code>image</code> - an image to detect</dd>
  455. <dd><code>faces</code> - detection results stored in a 2D cv::Mat of shape [num_faces, 15]
  456. - 0-1: x, y of bbox top left corner
  457. - 2-3: width, height of bbox
  458. - 4-5: x, y of right eye (blue point in the example image)
  459. - 6-7: x, y of left eye (red point in the example image)
  460. - 8-9: x, y of nose tip (green point in the example image)
  461. - 10-11: x, y of right corner of mouth (pink point in the example image)
  462. - 12-13: x, y of left corner of mouth (yellow point in the example image)
  463. - 14: face score</dd>
  464. <dt><span class="returnLabel">Returns:</span></dt>
  465. <dd>automatically generated</dd>
  466. </dl>
  467. </li>
  468. </ul>
  469. <a name="getInputSize--">
  470. <!-- -->
  471. </a>
  472. <ul class="blockList">
  473. <li class="blockList">
  474. <h4>getInputSize</h4>
  475. <pre>public&nbsp;<a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;getInputSize()</pre>
  476. </li>
  477. </ul>
  478. <a name="getNativeObjAddr--">
  479. <!-- -->
  480. </a>
  481. <ul class="blockList">
  482. <li class="blockList">
  483. <h4>getNativeObjAddr</h4>
  484. <pre>public&nbsp;long&nbsp;getNativeObjAddr()</pre>
  485. </li>
  486. </ul>
  487. <a name="getNMSThreshold--">
  488. <!-- -->
  489. </a>
  490. <ul class="blockList">
  491. <li class="blockList">
  492. <h4>getNMSThreshold</h4>
  493. <pre>public&nbsp;float&nbsp;getNMSThreshold()</pre>
  494. </li>
  495. </ul>
  496. <a name="getScoreThreshold--">
  497. <!-- -->
  498. </a>
  499. <ul class="blockList">
  500. <li class="blockList">
  501. <h4>getScoreThreshold</h4>
  502. <pre>public&nbsp;float&nbsp;getScoreThreshold()</pre>
  503. </li>
  504. </ul>
  505. <a name="getTopK--">
  506. <!-- -->
  507. </a>
  508. <ul class="blockList">
  509. <li class="blockList">
  510. <h4>getTopK</h4>
  511. <pre>public&nbsp;int&nbsp;getTopK()</pre>
  512. </li>
  513. </ul>
  514. <a name="setInputSize-org.opencv.core.Size-">
  515. <!-- -->
  516. </a>
  517. <ul class="blockList">
  518. <li class="blockList">
  519. <h4>setInputSize</h4>
  520. <pre>public&nbsp;void&nbsp;setInputSize(<a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;input_size)</pre>
  521. <div class="block">Set the size for the network input, which overwrites the input size of creating model. Call this method when the size of input image does not match the input size when creating model</div>
  522. <dl>
  523. <dt><span class="paramLabel">Parameters:</span></dt>
  524. <dd><code>input_size</code> - the size of the input image</dd>
  525. </dl>
  526. </li>
  527. </ul>
  528. <a name="setNMSThreshold-float-">
  529. <!-- -->
  530. </a>
  531. <ul class="blockList">
  532. <li class="blockList">
  533. <h4>setNMSThreshold</h4>
  534. <pre>public&nbsp;void&nbsp;setNMSThreshold(float&nbsp;nms_threshold)</pre>
  535. <div class="block">Set the Non-maximum-suppression threshold to suppress bounding boxes that have IoU greater than the given value</div>
  536. <dl>
  537. <dt><span class="paramLabel">Parameters:</span></dt>
  538. <dd><code>nms_threshold</code> - threshold for NMS operation</dd>
  539. </dl>
  540. </li>
  541. </ul>
  542. <a name="setScoreThreshold-float-">
  543. <!-- -->
  544. </a>
  545. <ul class="blockList">
  546. <li class="blockList">
  547. <h4>setScoreThreshold</h4>
  548. <pre>public&nbsp;void&nbsp;setScoreThreshold(float&nbsp;score_threshold)</pre>
  549. <div class="block">Set the score threshold to filter out bounding boxes of score less than the given value</div>
  550. <dl>
  551. <dt><span class="paramLabel">Parameters:</span></dt>
  552. <dd><code>score_threshold</code> - threshold for filtering out bounding boxes</dd>
  553. </dl>
  554. </li>
  555. </ul>
  556. <a name="setTopK-int-">
  557. <!-- -->
  558. </a>
  559. <ul class="blockListLast">
  560. <li class="blockList">
  561. <h4>setTopK</h4>
  562. <pre>public&nbsp;void&nbsp;setTopK(int&nbsp;top_k)</pre>
  563. <div class="block">Set the number of bounding boxes preserved before NMS</div>
  564. <dl>
  565. <dt><span class="paramLabel">Parameters:</span></dt>
  566. <dd><code>top_k</code> - the number of bounding boxes to preserve from top rank based on score</dd>
  567. </dl>
  568. </li>
  569. </ul>
  570. </li>
  571. </ul>
  572. </li>
  573. </ul>
  574. </div>
  575. </div>
  576. <!-- ========= END OF CLASS DATA ========= -->
  577. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  578. <div class="bottomNav"><a name="navbar.bottom">
  579. <!-- -->
  580. </a>
  581. <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
  582. <a name="navbar.bottom.firstrow">
  583. <!-- -->
  584. </a>
  585. <ul class="navList" title="Navigation">
  586. <li><a href="../../../overview-summary.html">Overview</a></li>
  587. <li><a href="package-summary.html">Package</a></li>
  588. <li class="navBarCell1Rev">Class</li>
  589. <li><a href="package-tree.html">Tree</a></li>
  590. <li><a href="../../../index-all.html">Index</a></li>
  591. <li><a href="../../../help-doc.html">Help</a></li>
  592. </ul>
  593. <div class="aboutLanguage">
  594. <script>
  595. var url = window.location.href;
  596. var pos = url.lastIndexOf('/javadoc/');
  597. url = pos >= 0 ? (url.substring(0, pos) + '/javadoc/mymath.js') : (window.location.origin + '/mymath.js');
  598. var script = document.createElement('script');
  599. script.src = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML,' + url;
  600. document.getElementsByTagName('head')[0].appendChild(script);
  601. </script>
  602. </div>
  603. </div>
  604. <div class="subNav">
  605. <ul class="navList">
  606. <li><a href="../../../org/opencv/objdetect/Dictionary.html" title="class in org.opencv.objdetect"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  607. <li><a href="../../../org/opencv/objdetect/FaceRecognizerSF.html" title="class in org.opencv.objdetect"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
  608. </ul>
  609. <ul class="navList">
  610. <li><a href="../../../index.html?org/opencv/objdetect/FaceDetectorYN.html" target="_top">Frames</a></li>
  611. <li><a href="FaceDetectorYN.html" target="_top">No&nbsp;Frames</a></li>
  612. </ul>
  613. <ul class="navList" id="allclasses_navbar_bottom">
  614. <li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
  615. </ul>
  616. <div>
  617. <script type="text/javascript"><!--
  618. allClassesLink = document.getElementById("allclasses_navbar_bottom");
  619. if(window==top) {
  620. allClassesLink.style.display = "block";
  621. }
  622. else {
  623. allClassesLink.style.display = "none";
  624. }
  625. //-->
  626. </script>
  627. </div>
  628. <div>
  629. <ul class="subNavList">
  630. <li>Summary:&nbsp;</li>
  631. <li>Nested&nbsp;|&nbsp;</li>
  632. <li>Field&nbsp;|&nbsp;</li>
  633. <li>Constr&nbsp;|&nbsp;</li>
  634. <li><a href="#method.summary">Method</a></li>
  635. </ul>
  636. <ul class="subNavList">
  637. <li>Detail:&nbsp;</li>
  638. <li>Field&nbsp;|&nbsp;</li>
  639. <li>Constr&nbsp;|&nbsp;</li>
  640. <li><a href="#method.detail">Method</a></li>
  641. </ul>
  642. </div>
  643. <a name="skip.navbar.bottom">
  644. <!-- -->
  645. </a></div>
  646. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  647. <p class="legalCopy"><small>Generated on 2023-06-28 12:47:21 / OpenCV 4.8.0</small></p>
  648. </body>
  649. </html>