<!DOCTYPE html><htmlclass="default no-js"><head><metacharSet="utf-8"/><metahttp-equiv="X-UA-Compatible"content="IE=edge"/><title>@vladmandic/face-api - v1.5.3</title><metaname="description"content="Documentation for @vladmandic/face-api - v1.5.3"/><metaname="viewport"content="width=device-width, initial-scale=1"/><linkrel="stylesheet"href="assets/style.css"/><linkrel="stylesheet"href="assets/highlight.css"/><scriptasyncsrc="assets/search.js"id="search-script"></script></head><body><header><divclass="tsd-page-toolbar"><divclass="container"><divclass="table-wrap"><divclass="table-cell"id="tsd-search"data-base="."><divclass="field"><labelfor="tsd-search-field"class="tsd-widget search no-caption">Search</label><inputtype="text"id="tsd-search-field"/></div><ulclass="results"><liclass="state loading">Preparing search index...</li><liclass="state failure">The search index is not available</li></ul><ahref="index.html"class="title">@vladmandic/face-api - v1.5.3</a></div><divclass="table-cell"id="tsd-widgets"><divid="tsd-filter"><ahref="#"class="tsd-widget options no-caption"data-toggle="options">Options</a><divclass="tsd-filter-group"><divclass="tsd-select"id="tsd-filter-visibility"><spanclass="tsd-select-label">All</span><ulclass="tsd-select-list"><lidata-value="public">Public</li><lidata-value="protected">Public/Protected</li><lidata-value="private"class="selected">All</li></ul></div><inputtype="checkbox"id="tsd-filter-inherited"checked/><labelclass="tsd-widget"for="tsd-filter-inherited">Inherited</label></div></div><ahref="#"class="tsd-widget menu no-caption"data-toggle="menu">Menu</a></div></div></div></div><divclass="tsd-page-title"><divclass="container"><h1>@vladmandic/face-api - v1.5.3</h1></div></div></header><divclass="container container-main"><divclass="row"><divclass="col-8 col-content"><sectionclass="tsd-panel-group tsd-index-group"><h2>Index</h2><sectionclass="tsd-panel tsd-index-panel"><divclass="tsd-index-content"><sectionclass="tsd-index-section "><h3>Namespaces</h3><ulclass="tsd-index-list"><liclass="tsd-kind-namespace"><ahref="modules/draw.html"class="tsd-kind-icon">draw</a></li><liclass="tsd-kind-namespace"><ahref="modules/utils.html"class="tsd-kind-icon">utils</a></li></ul></section><sectionclass="tsd-index-section "><h3>Enumerations</h3><ulclass="tsd-index-list"><liclass="tsd-kind-enum"><ahref="enums/Gender.html"class="tsd-kind-icon">Gender</a></li></ul></section><sectionclass="tsd-index-section "><h3>Classes</h3><ulclass="tsd-index-list"><liclass="tsd-kind-class"><ahref="classes/AgeGenderNet.html"class="tsd-kind-icon">Age<wbr/>Gender<wbr/>Net</a></li><liclass="tsd-kind-class"><ahref="classes/BoundingBox.html"class="tsd-kind-icon">Bounding<wbr/>Box</a></li><liclass="tsd-kind-class tsd-has-type-parameter"><ahref="classes/Box.html"class="tsd-kind-icon">Box</a></li><liclass="tsd-kind-class tsd-has-type-parameter"><ahref="classes/ComposableTask.html"class="tsd-kind-icon">Composable<wbr/>Task</a></li><liclass="tsd-kind-class tsd-has-type-parameter"><ahref="classes/ComputeAllFaceDescriptorsTask.html"class="tsd-kind-icon">Compute<wbr/>All<wbr/>Face<wbr/>Descriptors<wbr/>Task</a></li><liclass="tsd-kind-class tsd-has-type-parameter"><ahref="classes/ComputeFaceDescriptorsTaskBase.html"class="tsd-kind-icon">Compute<wbr/>Face<wbr/>Descriptors<wbr/>Task<wbr/>Base</a></li><liclass="tsd-kind-class tsd-has-type-parameter"><ahref="classes/ComputeSingleFaceDescriptorTask.html"class="tsd-kind-icon">Compute<wbr/>Single<wbr/>Face<wbr/>Descriptor<wbr/>Task</a></li><liclass="tsd-kind-class tsd-has-type-parameter"><ahref="classes/DetectAllFaceLandmarksTask.html"class="tsd-kind-icon">Detect<wbr/>All<wbr/>Face<wbr/>Landmarks<wbr/>Task</a></li><liclass="tsd-kind-class"><ahref="classes/DetectAllFacesTask.html"class="tsd-kind-icon">Detect<wbr/>All<wbr/>Faces<wbr/>Task</a></li><liclass="tsd-kind-class tsd-has-type-parameter"><ahref="classes/DetectFaceLandmarksTaskBase.html"class="tsd-kind-icon">Detect<wbr/>Face<wbr/>Landmarks<wbr/
<p>Computes a 128 entry vector (face descriptor / face embeddings) from the face shown in an image,
which uniquely represents the features of that persons face. The computed face descriptor can
be used to measure the similarity between faces, by computing the euclidean distance of two
face descriptors.</p>
</div></div><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameters"><li><h5>input: <spanclass="tsd-signature-type">any</span></h5></li></ul><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">Promise</span><spanclass="tsd-signature-symbol"><</span><spanclass="tsd-signature-type">Float32Array</span><spanclass="tsd-signature-symbol"> | </span><spanclass="tsd-signature-type">Float32Array</span><spanclass="tsd-signature-symbol">[]</span><spanclass="tsd-signature-symbol">></span></h4><div><p>Face descriptor with 128 entries or array thereof in case of batch input.</p>
<p>Detects the 68 point face landmark positions of the face shown in an image.</p>
</div></div><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameters"><li><h5>input: <spanclass="tsd-signature-type">any</span></h5></li></ul><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">Promise</span><spanclass="tsd-signature-symbol"><</span><ahref="classes/FaceLandmarks68.html"class="tsd-signature-type"data-tsd-kind="Class">FaceLandmarks68</a><spanclass="tsd-signature-symbol"> | </span><ahref="classes/FaceLandmarks68.html"class="tsd-signature-type"data-tsd-kind="Class">FaceLandmarks68</a><spanclass="tsd-signature-symbol">[]</span><spanclass="tsd-signature-symbol">></span></h4><div><p>68 point face landmarks or array thereof in case of batch input.</p>
<p>Detects the 68 point face landmark positions of the face shown in an image
using a tinier version of the 68 point face landmark model, which is slightly
faster at inference, but also slightly less accurate.</p>
</div></div><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameters"><li><h5>input: <spanclass="tsd-signature-type">any</span></h5></li></ul><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">Promise</span><spanclass="tsd-signature-symbol"><</span><ahref="classes/FaceLandmarks68.html"class="tsd-signature-type"data-tsd-kind="Class">FaceLandmarks68</a><spanclass="tsd-signature-symbol"> | </span><ahref="classes/FaceLandmarks68.html"class="tsd-signature-type"data-tsd-kind="Class">FaceLandmarks68</a><spanclass="tsd-signature-symbol">[]</span><spanclass="tsd-signature-symbol">></span></h4><div><p>68 point face landmarks or array thereof in case of batch input.</p>
<p>The face detection results or face bounding boxes for that image.</p>
</div></div></li></ul><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">Promise</span><spanclass="tsd-signature-symbol"><</span><ahref="index.html#tf"class="tsd-signature-type"data-tsd-kind="Function">tf</a><spanclass="tsd-signature-symbol">[]</span><spanclass="tsd-signature-symbol">></span></h4><div><p>Tensors of the corresponding image region for each detected face.</p>
<p>The face detection results or face bounding boxes for that image.</p>
</div></div></li></ul><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">Promise</span><spanclass="tsd-signature-symbol"><</span><spanclass="tsd-signature-type">HTMLCanvasElement</span><spanclass="tsd-signature-symbol">[]</span><spanclass="tsd-signature-symbol">></span></h4><div><p>The Canvases of the corresponding image region for each detected face.</p>
</div></div><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameters"><li><h5>input: <spanclass="tsd-signature-type">any</span></h5></li></ul><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">Promise</span><spanclass="tsd-signature-symbol"><</span><ahref="index.html#AgeAndGenderPrediction"class="tsd-signature-type"data-tsd-kind="Type alias">AgeAndGenderPrediction</a><spanclass="tsd-signature-symbol"> | </span><ahref="index.html#AgeAndGenderPrediction"class="tsd-signature-type"data-tsd-kind="Type alias">AgeAndGenderPrediction</a><spanclass="tsd-signature-symbol">[]</span><spanclass="tsd-signature-symbol">></span></h4><div><p>Predictions with age, gender and gender probability or array thereof in case of batch input.</p>
<p>Recognizes the facial expressions from a face image.</p>
</div></div><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameters"><li><h5>input: <spanclass="tsd-signature-type">any</span></h5></li></ul><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">Promise</span><spanclass="tsd-signature-symbol"><</span><ahref="classes/FaceExpressions.html"class="tsd-signature-type"data-tsd-kind="Class">FaceExpressions</a><spanclass="tsd-signature-symbol"> | </span><ahref="classes/FaceExpressions.html"class="tsd-signature-type"data-tsd-kind="Class">FaceExpressions</a><spanclass="tsd-signature-symbol">[]</span><spanclass="tsd-signature-symbol">></span></h4><div><p>Facial expressions with corresponding probabilities or array thereof in case of batch input.</p>
<p>(optional, default: see SsdMobilenetv1Options constructor for default parameters).</p>
</div></div></li></ul><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">Promise</span><spanclass="tsd-signature-symbol"><</span><ahref="classes/FaceDetection.html"class="tsd-signature-type"data-tsd-kind="Class">FaceDetection</a><spanclass="tsd-signature-symbol">[]</span><spanclass="tsd-signature-symbol">></span></h4><div><p>Bounding box of each face with score.</p>
<p>(optional, default: see TinyFaceDetectorOptions constructor for default parameters).</p>
</div></div></li></ul><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">Promise</span><spanclass="tsd-signature-symbol"><</span><ahref="classes/FaceDetection.html"class="tsd-signature-type"data-tsd-kind="Class">FaceDetection</a><spanclass="tsd-signature-symbol">[]</span><spanclass="tsd-signature-symbol">></span></h4><div><p>Bounding box of each face with score.</p>
<p>(optional, default: see TinyYolov2Options constructor for default parameters).</p>
</div></div></li></ul><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">Promise</span><spanclass="tsd-signature-symbol"><</span><ahref="classes/FaceDetection.html"class="tsd-signature-type"data-tsd-kind="Class">FaceDetection</a><spanclass="tsd-signature-symbol">[]</span><spanclass="tsd-signature-symbol">></span></h4><div><p>Bounding box of each face with score.</p>
</div></li></ul></section><sectionclass="tsd-panel tsd-member tsd-kind-function"><aname="toNetInput"class="tsd-anchor"></a><h3>to<wbr/>Net<wbr/>Input</h3><ulclass="tsd-signatures tsd-kind-function"><liclass="tsd-signature tsd-kind-icon">to<wbr/>Net<wbr/>Input<spanclass="tsd-signature-symbol">(</span>inputs<spanclass="tsd-signature-symbol">: </span><spanclass="tsd-signature-type">any</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><spanclass="tsd-signature-type">Promise</span><spanclass="tsd-signature-symbol"><</span><ahref="classes/NetInput.html"class="tsd-signature-type"data-tsd-kind="Class">NetInput</a><spanclass="tsd-signature-symbol">></span></li></ul><ulclass="tsd-descriptions"><liclass="tsd-description"><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/vladmandic/face-api/blob/master/src/dom/toNetInput.ts#L15">dom/toNetInput.ts:15</a></li></ul></aside><divclass="tsd-comment tsd-typography"><divclass="lead">
<p>Validates the input to make sure, they are valid net inputs and awaits all media elements
to be finished loading.</p>
</div></div><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameters"><li><h5>inputs: <spanclass="tsd-signature-type">any</span></h5></li></ul><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">Promise</span><spanclass="tsd-signature-symbol"><</span><ahref="classes/NetInput.html"class="tsd-signature-type"data-tsd-kind="Class">NetInput</a><spanclass="tsd-signature-symbol">></span></h4><div><p>A NetInput instance, which can be passed into one of the neural networks.</p>