2021-09-19 01:09:02 +02:00
<!DOCTYPE html> < html class = "default no-js" > < head > < meta charSet = "utf-8" / > < meta http-equiv = "X-UA-Compatible" content = "IE=edge" / > < title > Human | @vladmandic/human - v2.2.2< / title > < meta name = "description" content = "Documentation for @vladmandic/human - v2.2.2" / > < meta name = "viewport" content = "width=device-width, initial-scale=1" / > < link rel = "stylesheet" href = "../assets/style.css" / > < link rel = "stylesheet" href = "../assets/highlight.css" / > < script async src = "../assets/search.js" id = "search-script" > < / script > < / head > < body > < header > < div class = "tsd-page-toolbar" > < div class = "container" > < div class = "table-wrap" > < div class = "table-cell" id = "tsd-search" data-base = ".." > < div class = "field" > < label for = "tsd-search-field" class = "tsd-widget search no-caption" > Search< / label > < input type = "text" id = "tsd-search-field" / > < / div > < ul class = "results" > < li class = "state loading" > Preparing search index...< / li > < li class = "state failure" > The search index is not available< / li > < / ul > < a href = "../index.html" class = "title" > @vladmandic/human - v2.2.2< / a > < / div > < div class = "table-cell" id = "tsd-widgets" > < div id = "tsd-filter" > < a href = "#" class = "tsd-widget options no-caption" data-toggle = "options" > Options< / a > < div class = "tsd-filter-group" > < div class = "tsd-select" id = "tsd-filter-visibility" > < span class = "tsd-select-label" > All< / span > < ul class = "tsd-select-list" > < li data-value = "public" > Public< / li > < li data-value = "protected" > Public/Protected< / li > < li data-value = "private" class = "selected" > All< / li > < / ul > < / div > < input type = "checkbox" id = "tsd-filter-inherited" checked / > < label class = "tsd-widget" for = "tsd-filter-inherited" > Inherited< / label > < / div > < / div > < a href = "#" class = "tsd-widget menu no-caption" data-toggle = "menu" > Menu< / a > < / div > < / div > < / div > < / div > < div class = "tsd-page-title" > < div class = "container" > < ul class = "tsd-breadcrumb" > < li > < a href = "../index.html" > @vladmandic/human - v2.2.2< / a > < / li > < li > < a href = "Human.html" > Human< / a > < / li > < / ul > < h1 > Class Human< / h1 > < / div > < / div > < / header > < div class = "container container-main" > < div class = "row" > < div class = "col-8 col-content" > < section class = "tsd-panel tsd-comment" > < div class = "tsd-comment tsd-typography" > < div class = "lead" >
< p > < em > Human< / em > * library main class< / p >
< / div > < div > < p > All methods and properties are available only as members of Human class< / p >
< ul >
< li > Configuration object definition: < a href = "../interfaces/Config.html" > Config< / a > < / li >
< li > Results object definition: < a href = "../interfaces/Result.html" > Result< / a > < / li >
< li > Possible inputs: < a href = "../index.html#Input" > Input< / a > < / li >
< / ul >
< / div > < dl class = "tsd-comment-tags" > < dt > param userConfig:< / dt > < dd > < p > < a href = "../interfaces/Config.html" > Config< / a > < / p >
< / dd > < dt > returns< / dt > < dd > < p > instance< / p >
< / dd > < / dl > < / div > < / section > < section class = "tsd-panel tsd-hierarchy" > < h3 > Hierarchy< / h3 > < ul class = "tsd-hierarchy" > < li > < span class = "target" > Human< / span > < / li > < / ul > < / section > < section class = "tsd-panel-group tsd-index-group" > < h2 > Index< / h2 > < section class = "tsd-panel tsd-index-panel" > < div class = "tsd-index-content" > < section class = "tsd-index-section " > < h3 > Constructors< / h3 > < ul class = "tsd-index-list" > < li class = "tsd-kind-constructor tsd-parent-kind-class" > < a href = "Human.html#constructor" class = "tsd-kind-icon" > constructor< / a > < / li > < / ul > < / section > < section class = "tsd-index-section " > < h3 > Properties< / h3 > < ul class = "tsd-index-list" > < li class = "tsd-kind-property tsd-parent-kind-class" > < a href = "Human.html#config" class = "tsd-kind-icon" > config< / a > < / li > < li class = "tsd-kind-property tsd-parent-kind-class" > < a href = "Human.html#draw" class = "tsd-kind-icon" > draw< / a > < / li > < li class = "tsd-kind-property tsd-parent-kind-class" > < a href = "Human.html#env" class = "tsd-kind-icon" > env< / a > < / li > < li class = "tsd-kind-property tsd-parent-kind-class" > < a href = "Human.html#events" class = "tsd-kind-icon" > events< / a > < / li > < li class = "tsd-kind-property tsd-parent-kind-class" > < a href = "Human.html#faceTriangulation" class = "tsd-kind-icon" > face< wbr / > Triangulation< / a > < / li > < li class = "tsd-kind-property tsd-parent-kind-class" > < a href = "Human.html#faceUVMap" class = "tsd-kind-icon" > faceUVMap< / a > < / li > < li class = "tsd-kind-property tsd-parent-kind-class" > < a href = "Human.html#gl" class = "tsd-kind-icon" > gl< / a > < / li > < li class = "tsd-kind-property tsd-parent-kind-class" > < a href = "Human.html#performance" class = "tsd-kind-icon" > performance< / a > < / li > < li class = "tsd-kind-property tsd-parent-kind-class" > < a href = "Human.html#process" class = "tsd-kind-icon" > process< / a > < / li > < li class = "tsd-kind-property tsd-parent-kind-class" > < a href = "Human.html#result" class = "tsd-kind-icon" > result< / a > < / li > < li class = "tsd-kind-property tsd-parent-kind-class" > < a href = "Human.html#state" class = "tsd-kind-icon" > state< / a > < / li > < li class = "tsd-kind-property tsd-parent-kind-class" > < a href = "Human.html#version" class = "tsd-kind-icon" > version< / a > < / li > < / ul > < / section > < section class = "tsd-index-section " > < h3 > Methods< / h3 > < ul class = "tsd-index-list" > < li class = "tsd-kind-method tsd-parent-kind-class" > < a href = "Human.html#detect" class = "tsd-kind-icon" > detect< / a > < / li > < li class = "tsd-kind-method tsd-parent-kind-class" > < a href = "Human.html#enhance" class = "tsd-kind-icon" > enhance< / a > < / li > < li class = "tsd-kind-method tsd-parent-kind-class" > < a href = "Human.html#image" class = "tsd-kind-icon" > image< / a > < / li > < li class = "tsd-kind-method tsd-parent-kind-class" > < a href = "Human.html#init" class = "tsd-kind-icon" > init< / a > < / li > < li class = "tsd-kind-method tsd-parent-kind-class" > < a href = "Human.html#load" class = "tsd-kind-icon" > load< / a > < / li > < li class = "tsd-kind-method tsd-parent-kind-class" > < a href = "Human.html#match" class = "tsd-kind-icon" > match< / a > < / li > < li class = "tsd-kind-method tsd-parent-kind-class" > < a href = "Human.html#next" class = "tsd-kind-icon" > next< / a > < / li > < li class = "tsd-kind-method tsd-parent-kind-class" > < a href = "Human.html#segmentation" class = "tsd-kind-icon" > segmentation< / a > < / li > < li class = "tsd-kind-method tsd-parent-kind-class" > < a href = "Human.html#similarity" class = "tsd-kind-icon" > similarity< / a > < / li > < li class = "tsd-kind-method tsd-parent-kind-class" > < a href = "Human.html#warmup" class = "tsd-kind-icon" > warmup< / a > < / li > < / ul > < / section > < / div > < / section > < / section > < section class = "tsd-panel-group tsd-member-group " > < h2 > Constructors< / h2 > < section class = "tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class" > < a name = "constructor" class = "tsd-anchor" > < / a > < h3 > constructor< / h3 > < ul class = "tsd-signatures tsd-kind-constructor tsd-parent-kind-class" > < li class = "tsd-signature tsd-kind-icon" > new < wbr / > Human< span class = "tsd-signature-symbol" > (< / span > userConfig< span class = "tsd-signature-symbol" > ?: < / span > < span class = "tsd-signature-type" > Partial< / span > < span class = "tsd-signature-symbol" > < < / span > < a href = "../interfaces/Config.html" class = "tsd-signature-type" data-tsd-kind = "Interface" > Config< / a > < span class = "tsd-signature-symbol" > > < / span > < span class = "tsd-signature-symbol" > )< / span > < span class = "tsd-signature-symbol"
< p > Constructor for < strong > Human< / strong > library that is futher used for all operations< / p >
< / div > < / div > < h4 class = "tsd-parameters-title" > Parameters< / h4 > < ul class = "tsd-parameters" > < li > < h5 > < span class = "tsd-flag ts-flagOptional" > Optional< / span > userConfig: < span class = "tsd-signature-type" > Partial< / span > < span class = "tsd-signature-symbol" > < < / span > < a href = "../interfaces/Config.html" class = "tsd-signature-type" data-tsd-kind = "Interface" > Config< / a > < span class = "tsd-signature-symbol" > > < / span > < / h5 > < / li > < / ul > < h4 class = "tsd-returns-title" > Returns < a href = "Human.html" class = "tsd-signature-type" data-tsd-kind = "Class" > Human< / a > < / h4 > < div > < p > instance< / p >
< / div > < / li > < / ul > < / section > < / section > < section class = "tsd-panel-group tsd-member-group " > < h2 > Properties< / h2 > < section class = "tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class" > < a name = "config" class = "tsd-anchor" > < / a > < h3 > config< / h3 > < div class = "tsd-signature tsd-kind-icon" > config< span class = "tsd-signature-symbol" > :< / span > < a href = "../interfaces/Config.html" class = "tsd-signature-type" data-tsd-kind = "Interface" > Config< / a > < / div > < aside class = "tsd-sources" > < ul > < li > Defined in < a href = "https://github.com/vladmandic/human/blob/main/src/human.ts#L83" > human.ts:83< / a > < / li > < / ul > < / aside > < div class = "tsd-comment tsd-typography" > < div class = "lead" >
< p > Current configuration< / p >
< ul >
< li > Details: < a href = "../interfaces/Config.html" > Config< / a > < / li >
< / ul >
< / div > < / div > < / section > < section class = "tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class" > < a name = "draw" class = "tsd-anchor" > < / a > < h3 > draw< / h3 > < div class = "tsd-signature tsd-kind-icon" > draw< span class = "tsd-signature-symbol" > :< / span > < span class = "tsd-signature-symbol" > { < / span > all< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > any< / span > < span class = "tsd-signature-symbol" > ; < / span > body< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > any< / span > < span class = "tsd-signature-symbol" > ; < / span > canvas< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > any< / span > < span class = "tsd-signature-symbol" > ; < / span > face< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > any< / span > < span class = "tsd-signature-symbol" > ; < / span > gesture< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > any< / span > < span class = "tsd-signature-symbol" > ; < / span > hand< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > any< / span > < span class = "tsd-signature-symbol" > ; < / span > object< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > any< / span > < span class = "tsd-signature-symbol" > ; < / span > options< span class = "tsd-signature-symbol" > : < / span > < a href = "../interfaces/DrawOptions.html" class = "tsd-signature-type" data-tsd-kind = "Interface" > DrawOptions< / a > < span class = "tsd-signature-symbol" > ; < / span > person< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > any< / span > < span class = "tsd-signature-symbol" > }< / span > < / div > < aside class = "tsd-sources" > < ul > < li > Defined in < a href = "https://github.com/vladmandic/human/blob/main/src/human.ts#L116" > human.ts:116< / a > < / li > < / ul > < / aside > < div class = "tsd-comment tsd-typography" > < div class = "lead" >
< p > Draw helper classes that can draw detected objects on canvas using specified draw< / p >
< ul >
< li > options: < a href = "../interfaces/DrawOptions.html" > DrawOptions< / a > global settings for all draw operations, can be overriden for each draw method< / li >
< li > face: draw detected faces< / li >
< li > body: draw detected people and body parts< / li >
< li > hand: draw detected hands and hand parts< / li >
< li > canvas: draw this.processed canvas which is a this.processed copy of the input< / li >
< li > all: meta-function that performs: canvas, face, body, hand< / li >
< / ul >
< / div > < / div > < div class = "tsd-type-declaration" > < h4 > Type declaration< / h4 > < ul class = "tsd-parameters" > < li class = "tsd-parameter" > < h5 > all< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > any< / span > < / h5 > < / li > < li class = "tsd-parameter" > < h5 > body< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > any< / span > < / h5 > < / li > < li class = "tsd-parameter" > < h5 > canvas< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > any< / span > < / h5 > < / li > < li class = "tsd-parameter" > < h5 > face< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > any< / span > < / h5 > < / li > < li class = "tsd-parameter" > < h5 > gesture< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > any< / span > < / h5 > < / li > < li class = "tsd-parameter" > < h5 > hand< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > any< / span > < / h5 > < / li > < li class = "tsd-parameter" > < h5 > object< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > any< / span > < / h5 > < / li > < li class = "tsd-parameter" > < h5 > options< span class = "tsd-signature-symbol" > : < / span > < a href = "../interfaces/DrawOptions.html" class = "tsd-signature-type" data-tsd-kind = "Interface" > DrawOptions< / a > < / h5 > < / li > < li class = "tsd-parameter" > < h5 > person< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > any< / span > < / h5 > < / li > < / ul > < / div > < / section > < section class = "tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class" > < a name = "env" class = "tsd-anchor" > < / a > < h3 > env< / h3 > < div class = "tsd-signature tsd-kind-icon" > env< span class = "tsd-signature-symbol" > :< / span > < span class = "tsd-signature-type" > Env< / span > < / div > < aside class = "tsd-sources" > < ul > < li > Defined in < a href = "https://github.com/vladmandic/human/blob/main/src/human.ts#L106" > human.ts:106< / a > < / li > < / ul > < / aside > < div class = "tsd-comment tsd-typography" > < div class = "lead" >
< p > Object containing environment information used for diagnostics< / p >
< / div > < / div > < / section > < section class = "tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class" > < a name = "events" class = "tsd-anchor" > < / a > < h3 > events< / h3 > < div class = "tsd-signature tsd-kind-icon" > events< span class = "tsd-signature-symbol" > :< / span > < span class = "tsd-signature-type" > EventTarget< / span > < / div > < aside class = "tsd-sources" > < ul > < li > Defined in < a href = "https://github.com/vladmandic/human/blob/main/src/human.ts#L148" > human.ts:148< / a > < / li > < / ul > < / aside > < div class = "tsd-comment tsd-typography" > < div class = "lead" >
< p > Container for events dispatched by Human< / p >
< / div > < div > < p > Possible events:< / p >
< ul >
< li > < code > create< / code > : triggered when Human object is instantiated< / li >
< li > < code > load< / code > : triggered when models are loaded (explicitly or on-demand)< / li >
< li > < code > image< / code > : triggered when input image is this.processed< / li >
< li > < code > result< / code > : triggered when detection is complete< / li >
< li > < code > warmup< / code > : triggered when warmup is complete< / li >
< li > < code > error< / code > : triggered on some errors< / li >
< / ul >
< / div > < / div > < / section > < section class = "tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class" > < a name = "faceTriangulation" class = "tsd-anchor" > < / a > < h3 > face< wbr / > Triangulation< / h3 > < div class = "tsd-signature tsd-kind-icon" > face< wbr / > Triangulation< span class = "tsd-signature-symbol" > :< / span > < span class = "tsd-signature-type" > number< / span > < span class = "tsd-signature-symbol" > []< / span > < / div > < aside class = "tsd-sources" > < ul > < li > Defined in < a href = "https://github.com/vladmandic/human/blob/main/src/human.ts#L150" > human.ts:150< / a > < / li > < / ul > < / aside > < div class = "tsd-comment tsd-typography" > < div class = "lead" >
< p > Reference face triangualtion array of 468 points, used for triangle references between points< / p >
< / div > < / div > < / section > < section class = "tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class" > < a name = "faceUVMap" class = "tsd-anchor" > < / a > < h3 > faceUVMap< / h3 > < div class = "tsd-signature tsd-kind-icon" > faceUVMap< span class = "tsd-signature-symbol" > :< / span > < span class = "tsd-signature-type" > number< / span > < span class = "tsd-signature-symbol" > []< / span > < span class = "tsd-signature-symbol" > []< / span > < / div > < aside class = "tsd-sources" > < ul > < li > Defined in < a href = "https://github.com/vladmandic/human/blob/main/src/human.ts#L152" > human.ts:152< / a > < / li > < / ul > < / aside > < div class = "tsd-comment tsd-typography" > < div class = "lead" >
< p > Refernce UV map of 468 values, used for 3D mapping of the face mesh< / p >
< / div > < / div > < / section > < section class = "tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class" > < a name = "gl" class = "tsd-anchor" > < / a > < h3 > gl< / h3 > < div class = "tsd-signature tsd-kind-icon" > gl< span class = "tsd-signature-symbol" > :< / span > < span class = "tsd-signature-type" > Record< / span > < span class = "tsd-signature-symbol" > < < / span > < span class = "tsd-signature-type" > string< / span > < span class = "tsd-signature-symbol" > , < / span > < span class = "tsd-signature-type" > unknown< / span > < span class = "tsd-signature-symbol" > > < / span > < / div > < aside class = "tsd-sources" > < ul > < li > Defined in < a href = "https://github.com/vladmandic/human/blob/main/src/human.ts#L159" > human.ts:159< / a > < / li > < / ul > < / aside > < div class = "tsd-comment tsd-typography" > < div class = "lead" >
< p > WebGL debug info< / p >
< / div > < / div > < / section > < section class = "tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class" > < a name = "performance" class = "tsd-anchor" > < / a > < h3 > performance< / h3 > < div class = "tsd-signature tsd-kind-icon" > performance< span class = "tsd-signature-symbol" > :< / span > < span class = "tsd-signature-type" > Record< / span > < span class = "tsd-signature-symbol" > < < / span > < span class = "tsd-signature-type" > string< / span > < span class = "tsd-signature-symbol" > , < / span > < span class = "tsd-signature-type" > number< / span > < span class = "tsd-signature-symbol" > > < / span > < / div > < aside class = "tsd-sources" > < ul > < li > Defined in < a href = "https://github.com/vladmandic/human/blob/main/src/human.ts#L154" > human.ts:154< / a > < / li > < / ul > < / aside > < div class = "tsd-comment tsd-typography" > < div class = "lead" >
< p > Performance object that contains values for all recently performed operations< / p >
< / div > < / div > < / section > < section class = "tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class" > < a name = "process" class = "tsd-anchor" > < / a > < h3 > process< / h3 > < div class = "tsd-signature tsd-kind-icon" > process< span class = "tsd-signature-symbol" > :< / span > < span class = "tsd-signature-symbol" > { < / span > canvas< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > null< / span > < span class = "tsd-signature-symbol" > | < / span > < span class = "tsd-signature-type" > HTMLCanvasElement< / span > < span class = "tsd-signature-symbol" > | < / span > < span class = "tsd-signature-type" > OffscreenCanvas< / span > < span class = "tsd-signature-symbol" > ; < / span > tensor< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > null< / span > < span class = "tsd-signature-symbol" > | < / span > < span class = "tsd-signature-type" > Tensor< / span > < span class = "tsd-signature-symbol" > < < / span > < span class = "tsd-signature-type" > Rank< / span > < span class = "tsd-signature-symbol" > > < / span > < span class = "tsd-signature-symbol" > }< / span > < / div > < aside class = "tsd-sources" > < ul > < li > Defined in < a href = "https://github.com/vladmandic/human/blob/main/src/human.ts#L97" > human.ts:97< / a > < / li > < / ul > < / aside > < div class = "tsd-comment tsd-typography" > < div class = "lead" >
< p > currenty processed image tensor and canvas< / p >
< / div > < / div > < div class = "tsd-type-declaration" > < h4 > Type declaration< / h4 > < ul class = "tsd-parameters" > < li class = "tsd-parameter" > < h5 > canvas< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > null< / span > < span class = "tsd-signature-symbol" > | < / span > < span class = "tsd-signature-type" > HTMLCanvasElement< / span > < span class = "tsd-signature-symbol" > | < / span > < span class = "tsd-signature-type" > OffscreenCanvas< / span > < / h5 > < / li > < li class = "tsd-parameter" > < h5 > tensor< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > null< / span > < span class = "tsd-signature-symbol" > | < / span > < span class = "tsd-signature-type" > Tensor< / span > < span class = "tsd-signature-symbol" > < < / span > < span class = "tsd-signature-type" > Rank< / span > < span class = "tsd-signature-symbol" > > < / span > < / h5 > < / li > < / ul > < / div > < / section > < section class = "tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class" > < a name = "result" class = "tsd-anchor" > < / a > < h3 > result< / h3 > < div class = "tsd-signature tsd-kind-icon" > result< span class = "tsd-signature-symbol" > :< / span > < a href = "../interfaces/Result.html" class = "tsd-signature-type" data-tsd-kind = "Interface" > Result< / a > < / div > < aside class = "tsd-sources" > < ul > < li > Defined in < a href = "https://github.com/vladmandic/human/blob/main/src/human.ts#L88" > human.ts:88< / a > < / li > < / ul > < / aside > < div class = "tsd-comment tsd-typography" > < div class = "lead" >
< p > Last known result of detect run< / p >
< ul >
< li > Can be accessed anytime after initial detection< / li >
< / ul >
< / div > < / div > < / section > < section class = "tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class" > < a name = "state" class = "tsd-anchor" > < / a > < h3 > state< / h3 > < div class = "tsd-signature tsd-kind-icon" > state< span class = "tsd-signature-symbol" > :< / span > < span class = "tsd-signature-type" > string< / span > < / div > < aside class = "tsd-sources" > < ul > < li > Defined in < a href = "https://github.com/vladmandic/human/blob/main/src/human.ts#L94" > human.ts:94< / a > < / li > < / ul > < / aside > < div class = "tsd-comment tsd-typography" > < div class = "lead" >
< p > Current state of Human library< / p >
< ul >
< li > Can be polled to determine operations that are currently executed< / li >
< li > Progresses through: ' config' , ' check' , ' backend' , ' load' , ' run:< model > ' , ' idle' < / li >
< / ul >
< / div > < / div > < / section > < section class = "tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class" > < a name = "version" class = "tsd-anchor" > < / a > < h3 > version< / h3 > < div class = "tsd-signature tsd-kind-icon" > version< span class = "tsd-signature-symbol" > :< / span > < span class = "tsd-signature-type" > string< / span > < / div > < aside class = "tsd-sources" > < ul > < li > Defined in < a href = "https://github.com/vladmandic/human/blob/main/src/human.ts#L78" > human.ts:78< / a > < / li > < / ul > < / aside > < div class = "tsd-comment tsd-typography" > < div class = "lead" >
< p > Current version of Human library in < em > semver< / em > format< / p >
< / div > < / div > < / section > < / section > < section class = "tsd-panel-group tsd-member-group " > < h2 > Methods< / h2 > < section class = "tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class" > < a name = "detect" class = "tsd-anchor" > < / a > < h3 > detect< / h3 > < ul class = "tsd-signatures tsd-kind-method tsd-parent-kind-class" > < li class = "tsd-signature tsd-kind-icon" > detect< span class = "tsd-signature-symbol" > (< / span > input< span class = "tsd-signature-symbol" > : < / span > < a href = "../index.html#Input" class = "tsd-signature-type" data-tsd-kind = "Type alias" > Input< / a > , userConfig< span class = "tsd-signature-symbol" > ?: < / span > < span class = "tsd-signature-type" > Partial< / span > < span class = "tsd-signature-symbol" > < < / span > < a href = "../interfaces/Config.html" class = "tsd-signature-type" data-tsd-kind = "Interface" > Config< / a > < span class = "tsd-signature-symbol" > > < / span > < span class = "tsd-signature-symbol" > )< / span > < span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > Promise< / span > < span class = "tsd-signature-symbol" > < < / span > < a href = "../index.html#Error" class = "tsd-signature-type" data-tsd-kind = "Type alias" > Error< / a > < span class = "tsd-signature-symbol" > | < / span > < a href = "../interfaces/Result.html" class = "tsd-signature-type" data-tsd-kind = "Interface" > Result< / a > < span class = "tsd-signature-symbol" > > < / span > < / li > < / ul > < ul class = "tsd-descriptions" > < li class = "tsd-description" > < aside class = "tsd-sources" > < ul > < li > Defined in < a href = "https://github.com/vladmandic/human/blob/main/src/human.ts#L387" > human.ts:387< / a > < / li > < / ul > < / aside > < div class = "tsd-comment tsd-typography" > < div class = "lead" >
< p > Main detection method< / p >
< ul >
< li > Analyze configuration: < a href = "../interfaces/Config.html" > Config< / a > < / li >
< li > Pre-this.process input: < a href = "../index.html#Input" > Input< / a > < / li >
< li > Run inference for all configured models< / li >
< li > Process and return result: < a href = "../interfaces/Result.html" > Result< / a > < / li >
< / ul >
< / div > < / div > < h4 class = "tsd-parameters-title" > Parameters< / h4 > < ul class = "tsd-parameters" > < li > < h5 > input: < a href = "../index.html#Input" class = "tsd-signature-type" data-tsd-kind = "Type alias" > Input< / a > < / h5 > < / li > < li > < h5 > < span class = "tsd-flag ts-flagOptional" > Optional< / span > userConfig: < span class = "tsd-signature-type" > Partial< / span > < span class = "tsd-signature-symbol" > < < / span > < a href = "../interfaces/Config.html" class = "tsd-signature-type" data-tsd-kind = "Interface" > Config< / a > < span class = "tsd-signature-symbol" > > < / span > < / h5 > < / li > < / ul > < h4 class = "tsd-returns-title" > Returns < span class = "tsd-signature-type" > Promise< / span > < span class = "tsd-signature-symbol" > < < / span > < a href = "../index.html#Error" class = "tsd-signature-type" data-tsd-kind = "Type alias" > Error< / a > < span class = "tsd-signature-symbol" > | < / span > < a href = "../interfaces/Result.html" class = "tsd-signature-type" data-tsd-kind = "Interface" > Result< / a > < span class = "tsd-signature-symbol" > > < / span > < / h4 > < div > < p > result: < a href = "../interfaces/Result.html" > Result< / a > < / p >
< / div > < / li > < / ul > < / section > < section class = "tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class" > < a name = "enhance" class = "tsd-anchor" > < / a > < h3 > enhance< / h3 > < ul class = "tsd-signatures tsd-kind-method tsd-parent-kind-class" > < li class = "tsd-signature tsd-kind-icon" > enhance< span class = "tsd-signature-symbol" > (< / span > input< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > Tensor< / span > < span class = "tsd-signature-symbol" > < < / span > < span class = "tsd-signature-type" > Rank< / span > < span class = "tsd-signature-symbol" > > < / span > < span class = "tsd-signature-symbol" > )< / span > < span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > null< / span > < span class = "tsd-signature-symbol" > | < / span > < span class = "tsd-signature-type" > Tensor< / span > < span class = "tsd-signature-symbol" > < < / span > < span class = "tsd-signature-type" > Rank< / span > < span class = "tsd-signature-symbol" > > < / span > < / li > < / ul > < ul class = "tsd-descriptions" > < li class = "tsd-description" > < aside class = "tsd-sources" > < ul > < li > Defined in < a href = "https://github.com/vladmandic/human/blob/main/src/human.ts#L289" > human.ts:289< / a > < / li > < / ul > < / aside > < div class = "tsd-comment tsd-typography" > < div class = "lead" >
< p > Enhance method performs additional enhacements to face image previously detected for futher processing< / p >
< / div > < / div > < h4 class = "tsd-parameters-title" > Parameters< / h4 > < ul class = "tsd-parameters" > < li > < h5 > input: < span class = "tsd-signature-type" > Tensor< / span > < span class = "tsd-signature-symbol" > < < / span > < span class = "tsd-signature-type" > Rank< / span > < span class = "tsd-signature-symbol" > > < / span > < / h5 > < / li > < / ul > < h4 class = "tsd-returns-title" > Returns < span class = "tsd-signature-type" > null< / span > < span class = "tsd-signature-symbol" > | < / span > < span class = "tsd-signature-type" > Tensor< / span > < span class = "tsd-signature-symbol" > < < / span > < span class = "tsd-signature-type" > Rank< / span > < span class = "tsd-signature-symbol" > > < / span > < / h4 > < div > < p > Tensor< / p >
< / div > < / li > < / ul > < / section > < section class = "tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class" > < a name = "image" class = "tsd-anchor" > < / a > < h3 > image< / h3 > < ul class = "tsd-signatures tsd-kind-method tsd-parent-kind-class" > < li class = "tsd-signature tsd-kind-icon" > image< span class = "tsd-signature-symbol" > (< / span > input< span class = "tsd-signature-symbol" > : < / span > < a href = "../index.html#Input" class = "tsd-signature-type" data-tsd-kind = "Type alias" > Input< / a > < span class = "tsd-signature-symbol" > )< / span > < span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-symbol" > { < / span > canvas< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > HTMLCanvasElement< / span > < span class = "tsd-signature-symbol" > | < / span > < span class = "tsd-signature-type" > OffscreenCanvas< / span > < span class = "tsd-signature-symbol" > ; < / span > tensor< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > null< / span > < span class = "tsd-signature-symbol" > | < / span > < span class = "tsd-signature-type" > Tensor< / span > < span class = "tsd-signature-symbol" > < < / span > < span class = "tsd-signature-type" > Rank< / span > < span class = "tsd-signature-symbol" > > < / span > < span class = "tsd-signature-symbol" > }< / span > < / li > < / ul > < ul class = "tsd-descriptions" > < li class = "tsd-description" > < aside class = "tsd-sources" > < ul > < li > Defined in < a href = "https://github.com/vladmandic/human/blob/main/src/human.ts#L256" > human.ts:256< / a > < / li > < / ul > < / aside > < div class = "tsd-comment tsd-typography" > < div class = "lead" >
< p > Process input as return canvas and tensor< / p >
< / div > < / div > < h4 class = "tsd-parameters-title" > Parameters< / h4 > < ul class = "tsd-parameters" > < li > < h5 > input: < a href = "../index.html#Input" class = "tsd-signature-type" data-tsd-kind = "Type alias" > Input< / a > < / h5 > < / li > < / ul > < h4 class = "tsd-returns-title" > Returns < span class = "tsd-signature-symbol" > { < / span > canvas< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > HTMLCanvasElement< / span > < span class = "tsd-signature-symbol" > | < / span > < span class = "tsd-signature-type" > OffscreenCanvas< / span > < span class = "tsd-signature-symbol" > ; < / span > tensor< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > null< / span > < span class = "tsd-signature-symbol" > | < / span > < span class = "tsd-signature-type" > Tensor< / span > < span class = "tsd-signature-symbol" > < < / span > < span class = "tsd-signature-type" > Rank< / span > < span class = "tsd-signature-symbol" > > < / span > < span class = "tsd-signature-symbol" > }< / span > < / h4 > < div > < / div > < ul class = "tsd-parameters" > < li class = "tsd-parameter" > < h5 > canvas< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > HTMLCanvasElement< / span > < span class = "tsd-signature-symbol" > | < / span > < span class = "tsd-signature-type" > OffscreenCanvas< / span > < / h5 > < / li > < li class = "tsd-parameter" > < h5 > tensor< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > null< / span > < span class = "tsd-signature-symbol" > | < / span > < span class = "tsd-signature-type" > Tensor< / span > < span class = "tsd-signature-symbol" > < < / span > < span class = "tsd-signature-type" > Rank< / span > < span class = "tsd-signature-symbol" > > < / span > < / h5 > < / li > < / ul > < / li > < / ul > < / section > < section class = "tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class" > < a name = "init" class = "tsd-anchor" > < / a > < h3 > init< / h3 > < ul class = "tsd-signatures tsd-kind-method tsd-parent-kind-class" > < li class = "tsd-signature tsd-kind-icon" > init< span class = "tsd-signature-symbol" > (< / span > < span class = "tsd-signature-symbol" > )< / span > < span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > void< / span > < / li > < / ul > < ul class = "tsd-descriptions" > < li class = "tsd-description" > < aside class = "tsd-sources" > < ul > < li > Defined in < a href = "https://github.com/vladmandic/human/blob/main/src/human.ts#L312" > human.ts:312< / a > < / li > < / ul > < / aside > < div class = "tsd-comment tsd-typography" > < div class = "lead" >
< p > Explicit backend initialization< / p >
< ul >
< li > Normally done implicitly during initial load phase< / li >
< li > Call to explictly register and initialize TFJS backend without any other operations< / li >
< li > Used in webworker environments where there can be multiple instances of Human and not all initialized< / li >
< / ul >
< / div > < / div > < h4 class = "tsd-returns-title" > Returns < span class = "tsd-signature-type" > void< / span > < / h4 > < div > < p > Promise< void > < / p >
< / div > < / li > < / ul > < / section > < section class = "tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class" > < a name = "load" class = "tsd-anchor" > < / a > < h3 > load< / h3 > < ul class = "tsd-signatures tsd-kind-method tsd-parent-kind-class" > < li class = "tsd-signature tsd-kind-icon" > load< span class = "tsd-signature-symbol" > (< / span > userConfig< span class = "tsd-signature-symbol" > ?: < / span > < span class = "tsd-signature-type" > Partial< / span > < span class = "tsd-signature-symbol" > < < / span > < a href = "../interfaces/Config.html" class = "tsd-signature-type" data-tsd-kind = "Interface" > Config< / a > < span class = "tsd-signature-symbol" > > < / span > < span class = "tsd-signature-symbol" > )< / span > < span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > Promise< / span > < span class = "tsd-signature-symbol" > < < / span > < span class = "tsd-signature-type" > void< / span > < span class = "tsd-signature-symbol" > > < / span > < / li > < / ul > < ul class = "tsd-descriptions" > < li class = "tsd-description" > < aside class = "tsd-sources" > < ul > < li > Defined in < a href = "https://github.com/vladmandic/human/blob/main/src/human.ts#L322" > human.ts:322< / a > < / li > < / ul > < / aside > < div class = "tsd-comment tsd-typography" > < div class = "lead" >
< p > Load method preloads all configured models on-demand< / p >
< ul >
< li > Not explicitly required as any required model is load implicitly on it' s first run< / li >
< / ul >
< / div > < / div > < h4 class = "tsd-parameters-title" > Parameters< / h4 > < ul class = "tsd-parameters" > < li > < h5 > < span class = "tsd-flag ts-flagOptional" > Optional< / span > userConfig: < span class = "tsd-signature-type" > Partial< / span > < span class = "tsd-signature-symbol" > < < / span > < a href = "../interfaces/Config.html" class = "tsd-signature-type" data-tsd-kind = "Interface" > Config< / a > < span class = "tsd-signature-symbol" > > < / span > < / h5 > < / li > < / ul > < h4 class = "tsd-returns-title" > Returns < span class = "tsd-signature-type" > Promise< / span > < span class = "tsd-signature-symbol" > < < / span > < span class = "tsd-signature-type" > void< / span > < span class = "tsd-signature-symbol" > > < / span > < / h4 > < div > < p > Promise< void > < / p >
< / div > < / li > < / ul > < / section > < section class = "tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class" > < a name = "match" class = "tsd-anchor" > < / a > < h3 > match< / h3 > < ul class = "tsd-signatures tsd-kind-method tsd-parent-kind-class" > < li class = "tsd-signature tsd-kind-icon" > match< span class = "tsd-signature-symbol" > (< / span > faceEmbedding< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > number< / span > < span class = "tsd-signature-symbol" > []< / span > , db< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-symbol" > { < / span > embedding< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > number< / span > < span class = "tsd-signature-symbol" > []< / span > < span class = "tsd-signature-symbol" > ; < / span > name< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > string< / span > < span class = "tsd-signature-symbol" > ; < / span > source< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > string< / span > < span class = "tsd-signature-symbol" > }< / span > < span class = "tsd-signature-symbol" > []< / span > , threshold< span class = "tsd-signature-symbol" > ?: < / span > < span class = "tsd-signature-type" > number< / span > < span class = "tsd-signature-symbol" > )< / span > < span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-symbol" > { < / span > embedding< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > number< / span > < span class = "tsd-signature-symbol" > []< / span > < span class = "tsd-signature-symbol" > ; < / span > name< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > string< / span > < span class = "tsd-signature-symbol" > ; < / span > similarity< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > number< / span > < span class = "tsd-signature-symbol" > ; < / span > source< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > string< / span > < span class = "tsd-signature-symbol" > }< / span > < / li > < / ul > < ul class = "tsd-descriptions" > < li class = "tsd-description" > < aside class = "tsd-sources" > < ul > < li > Defined in < a href = "https://github.com/vladmandic/human/blob/main/src/human.ts#L301" > human.ts:301< / a > < / li > < / ul > < / aside > < div class = "tsd-comment tsd-typography" > < div class = "lead" >
< p > Math method find best match between provided face descriptor and predefined database of known descriptors< / p >
< / div > < / div > < h4 class = "tsd-parameters-title" > Parameters< / h4 > < ul class = "tsd-parameters" > < li > < h5 > faceEmbedding: < span class = "tsd-signature-type" > number< / span > < span class = "tsd-signature-symbol" > []< / span > < / h5 > < / li > < li > < h5 > db: < span class = "tsd-signature-symbol" > { < / span > embedding< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > number< / span > < span class = "tsd-signature-symbol" > []< / span > < span class = "tsd-signature-symbol" > ; < / span > name< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > string< / span > < span class = "tsd-signature-symbol" > ; < / span > source< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > string< / span > < span class = "tsd-signature-symbol" > }< / span > < span class = "tsd-signature-symbol" > []< / span > < / h5 > < / li > < li > < h5 > threshold: < span class = "tsd-signature-type" > number< / span > < span class = "tsd-signature-symbol" > = 0< / span > < / h5 > < / li > < / ul > < h4 class = "tsd-returns-title" > Returns < span class = "tsd-signature-symbol" > { < / span > embedding< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > number< / span > < span class = "tsd-signature-symbol" > []< / span > < span class = "tsd-signature-symbol" > ; < / span > name< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > string< / span > < span class = "tsd-signature-symbol" > ; < / span > similarity< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > number< / span > < span class = "tsd-signature-symbol" > ; < / span > source< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > string< / span > < span class = "tsd-signature-symbol" > }< / span > < / h4 > < div > < p > best match< / p >
< / div > < ul class = "tsd-parameters" > < li class = "tsd-parameter" > < h5 > embedding< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > number< / span > < span class = "tsd-signature-symbol" > []< / span > < / h5 > < / li > < li class = "tsd-parameter" > < h5 > name< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > string< / span > < / h5 > < / li > < li class = "tsd-parameter" > < h5 > similarity< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > number< / span > < / h5 > < / li > < li class = "tsd-parameter" > < h5 > source< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > string< / span > < / h5 > < / li > < / ul > < / li > < / ul > < / section > < section class = "tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class" > < a name = "next" class = "tsd-anchor" > < / a > < h3 > next< / h3 > < ul class = "tsd-signatures tsd-kind-method tsd-parent-kind-class" > < li class = "tsd-signature tsd-kind-icon" > next< span class = "tsd-signature-symbol" > (< / span > result< span class = "tsd-signature-symbol" > ?: < / span > < a href = "../interfaces/Result.html" class = "tsd-signature-type" data-tsd-kind = "Interface" > Result< / a > < span class = "tsd-signature-symbol" > )< / span > < span class = "tsd-signature-symbol" > : < / span > < a href = "../interfaces/Result.html" class = "tsd-signature-type" data-tsd-kind = "Interface" > Result< / a > < / li > < / ul > < ul class = "tsd-descriptions" > < li class = "tsd-description" > < aside class = "tsd-sources" > < ul > < li > Defined in < a href = "https://github.com/vladmandic/human/blob/main/src/human.ts#L363" > human.ts:363< / a > < / li > < / ul > < / aside > < div class = "tsd-comment tsd-typography" > < div class = "lead" >
< p > Runs interpolation using last known result and returns smoothened result
Interpolation is based on time since last known result so can be called independently< / p >
< / div > < / div > < h4 class = "tsd-parameters-title" > Parameters< / h4 > < ul class = "tsd-parameters" > < li > < h5 > result: < a href = "../interfaces/Result.html" class = "tsd-signature-type" data-tsd-kind = "Interface" > Result< / a > < span class = "tsd-signature-symbol" > = ...< / span > < / h5 > < / li > < / ul > < h4 class = "tsd-returns-title" > Returns < a href = "../interfaces/Result.html" class = "tsd-signature-type" data-tsd-kind = "Interface" > Result< / a > < / h4 > < div > < p > result: < a href = "../interfaces/Result.html" > Result< / a > < / p >
< / div > < / li > < / ul > < / section > < section class = "tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class" > < a name = "segmentation" class = "tsd-anchor" > < / a > < h3 > segmentation< / h3 > < ul class = "tsd-signatures tsd-kind-method tsd-parent-kind-class" > < li class = "tsd-signature tsd-kind-icon" > segmentation< span class = "tsd-signature-symbol" > (< / span > input< span class = "tsd-signature-symbol" > : < / span > < a href = "../index.html#Input" class = "tsd-signature-type" data-tsd-kind = "Type alias" > Input< / a > , background< span class = "tsd-signature-symbol" > ?: < / span > < a href = "../index.html#Input" class = "tsd-signature-type" data-tsd-kind = "Type alias" > Input< / a > < span class = "tsd-signature-symbol" > )< / span > < span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > Promise< / span > < span class = "tsd-signature-symbol" > < < / span > < span class = "tsd-signature-type" > null< / span > < span class = "tsd-signature-symbol" > | < / span > < span class = "tsd-signature-type" > HTMLCanvasElement< / span > < span class = "tsd-signature-symbol" > | < / span > < span class = "tsd-signature-type" > OffscreenCanvas< / span > < span class = "tsd-signature-symbol" > > < / span > < / li > < / ul > < ul class = "tsd-descriptions" > < li class = "tsd-description" > < aside class = "tsd-sources" > < ul > < li > Defined in < a href = "https://github.com/vladmandic/human/blob/main/src/human.ts#L279" > human.ts:279< / a > < / li > < / ul > < / aside > < div class = "tsd-comment tsd-typography" > < div class = "lead" >
< p > Segmentation method takes any input and returns this.processed canvas with body segmentation< / p >
< ul >
< li > Optional parameter background is used to fill the background with specific input< / li >
< li > Segmentation is not triggered as part of detect this.process< / li >
< / ul >
< / div > < / div > < h4 class = "tsd-parameters-title" > Parameters< / h4 > < ul class = "tsd-parameters" > < li > < h5 > input: < a href = "../index.html#Input" class = "tsd-signature-type" data-tsd-kind = "Type alias" > Input< / a > < / h5 > < / li > < li > < h5 > < span class = "tsd-flag ts-flagOptional" > Optional< / span > background: < a href = "../index.html#Input" class = "tsd-signature-type" data-tsd-kind = "Type alias" > Input< / a > < / h5 > < / li > < / ul > < h4 class = "tsd-returns-title" > Returns < span class = "tsd-signature-type" > Promise< / span > < span class = "tsd-signature-symbol" > < < / span > < span class = "tsd-signature-type" > null< / span > < span class = "tsd-signature-symbol" > | < / span > < span class = "tsd-signature-type" > HTMLCanvasElement< / span > < span class = "tsd-signature-symbol" > | < / span > < span class = "tsd-signature-type" > OffscreenCanvas< / span > < span class = "tsd-signature-symbol" > > < / span > < / h4 > < div > < p > Canvas< / p >
< / div > < / li > < / ul > < / section > < section class = "tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class" > < a name = "similarity" class = "tsd-anchor" > < / a > < h3 > similarity< / h3 > < ul class = "tsd-signatures tsd-kind-method tsd-parent-kind-class" > < li class = "tsd-signature tsd-kind-icon" > similarity< span class = "tsd-signature-symbol" > (< / span > embedding1< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > number< / span > < span class = "tsd-signature-symbol" > []< / span > , embedding2< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > number< / span > < span class = "tsd-signature-symbol" > []< / span > < span class = "tsd-signature-symbol" > )< / span > < span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > number< / span > < / li > < / ul > < ul class = "tsd-descriptions" > < li class = "tsd-description" > < aside class = "tsd-sources" > < ul > < li > Defined in < a href = "https://github.com/vladmandic/human/blob/main/src/human.ts#L267" > human.ts:267< / a > < / li > < / ul > < / aside > < div class = "tsd-comment tsd-typography" > < div class = "lead" >
< p > Simmilarity method calculates simmilarity between two provided face descriptors (face embeddings)< / p >
< ul >
< li > Calculation is based on normalized Minkowski distance between two descriptors< / li >
< li > Default is Euclidean distance which is Minkowski distance of 2nd order< / li >
< / ul >
< / div > < / div > < h4 class = "tsd-parameters-title" > Parameters< / h4 > < ul class = "tsd-parameters" > < li > < h5 > embedding1: < span class = "tsd-signature-type" > number< / span > < span class = "tsd-signature-symbol" > []< / span > < / h5 > < / li > < li > < h5 > embedding2: < span class = "tsd-signature-type" > number< / span > < span class = "tsd-signature-symbol" > []< / span > < / h5 > < / li > < / ul > < h4 class = "tsd-returns-title" > Returns < span class = "tsd-signature-type" > number< / span > < / h4 > < div > < p > similarity: number< / p >
< / div > < / li > < / ul > < / section > < section class = "tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class" > < a name = "warmup" class = "tsd-anchor" > < / a > < h3 > warmup< / h3 > < ul class = "tsd-signatures tsd-kind-method tsd-parent-kind-class" > < li class = "tsd-signature tsd-kind-icon" > warmup< span class = "tsd-signature-symbol" > (< / span > userConfig< span class = "tsd-signature-symbol" > ?: < / span > < span class = "tsd-signature-type" > Partial< / span > < span class = "tsd-signature-symbol" > < < / span > < a href = "../interfaces/Config.html" class = "tsd-signature-type" data-tsd-kind = "Interface" > Config< / a > < span class = "tsd-signature-symbol" > > < / span > < span class = "tsd-signature-symbol" > )< / span > < span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > Promise< / span > < span class = "tsd-signature-symbol" > < < / span > < a href = "../interfaces/Result.html" class = "tsd-signature-type" data-tsd-kind = "Interface" > Result< / a > < span class = "tsd-signature-symbol" > | < / span > < span class = "tsd-signature-symbol" > { < / span > error< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > any< / span > < span class = "tsd-signature-symbol" > }< / span > < span class = "tsd-signature-symbol" > > < / span > < / li > < / ul > < ul class = "tsd-descriptions" > < li class = "tsd-description" > < aside class = "tsd-sources" > < ul > < li > Defined in < a href = "https://github.com/vladmandic/human/blob/main/src/human.ts#L373" > human.ts:373< / a > < / li > < / ul > < / aside > < div class = "tsd-comment tsd-typography" > < div class = "lead" >
< p > Warmup method pre-initializes all configured models for faster inference< / p >
< ul >
< li > can take significant time on startup< / li >
< li > only used for < code > webgl< / code > and < code > humangl< / code > backends< / li >
< / ul >
< / div > < / div > < h4 class = "tsd-parameters-title" > Parameters< / h4 > < ul class = "tsd-parameters" > < li > < h5 > < span class = "tsd-flag ts-flagOptional" > Optional< / span > userConfig: < span class = "tsd-signature-type" > Partial< / span > < span class = "tsd-signature-symbol" > < < / span > < a href = "../interfaces/Config.html" class = "tsd-signature-type" data-tsd-kind = "Interface" > Config< / a > < span class = "tsd-signature-symbol" > > < / span > < / h5 > < / li > < / ul > < h4 class = "tsd-returns-title" > Returns < span class = "tsd-signature-type" > Promise< / span > < span class = "tsd-signature-symbol" > < < / span > < a href = "../interfaces/Result.html" class = "tsd-signature-type" data-tsd-kind = "Interface" > Result< / a > < span class = "tsd-signature-symbol" > | < / span > < span class = "tsd-signature-symbol" > { < / span > error< span class = "tsd-signature-symbol" > : < / span > < span class = "tsd-signature-type" > any< / span > < span class = "tsd-signature-symbol" > }< / span > < span class = "tsd-signature-symbol" > > < / span > < / h4 > < div > < p > result: < a href = "../interfaces/Result.html" > Result< / a > < / p >
< / div > < / li > < / ul > < / section > < / section > < / div > < div class = "col-4 col-menu menu-sticky-wrap menu-highlight" > < nav class = "tsd-navigation primary" > < ul > < li class = "" > < a href = "../index.html" > Exports< / a > < / li > < / ul > < / nav > < nav class = "tsd-navigation secondary menu-sticky" > < ul > < li class = "current tsd-kind-class" > < a href = "Human.html" class = "tsd-kind-icon" > Human< / a > < ul > < li class = "tsd-kind-constructor tsd-parent-kind-class" > < a href = "Human.html#constructor" class = "tsd-kind-icon" > constructor< / a > < / li > < li class = "tsd-kind-property tsd-parent-kind-class" > < a href = "Human.html#config" class = "tsd-kind-icon" > config< / a > < / li > < li class = "tsd-kind-property tsd-parent-kind-class" > < a href = "Human.html#draw" class = "tsd-kind-icon" > draw< / a > < / li > < li class = "tsd-kind-property tsd-parent-kind-class" > < a href = "Human.html#env" class = "tsd-kind-icon" > env< / a > < / li > < li class = "tsd-kind-property tsd-parent-kind-class" > < a href = "Human.html#events" class = "tsd-kind-icon" > events< / a > < / li > < li class = "tsd-kind-property tsd-parent-kind-class" > < a href = "Human.html#faceTriangulation" class = "tsd-kind-icon" > face< wbr / > Triangulation< / a > < / li > < li class = "tsd-kind-property tsd-parent-kind-class" > < a href = "Human.html#faceUVMap" class = "tsd-kind-icon" > faceUVMap< / a > < / li > < li class = "tsd-kind-property tsd-parent-kind-class" > < a href = "Human.html#gl" class = "tsd-kind-icon" > gl< / a > < / li > < li class = "tsd-kind-property tsd-parent-kind-class" > < a href = "Human.html#performance" class = "tsd-kind-icon" > performance< / a > < / li > < li class = "tsd-kind-property tsd-parent-kind-class" > < a href = "Human.html#process" class = "tsd-kind-icon" > process< / a > < / li > < li class = "tsd-kind-property tsd-parent-kind-class" > < a href = "Human.html#result" class = "tsd-kind-icon" > result< / a > < / li > < li class = "tsd-kind-property tsd-parent-kind-class" > < a href = "Human.html#state" class = "tsd-kind-icon" > state< / a > < / li > < li class = "tsd-kind-property tsd-parent-kind-class" > < a href = "Human.html#version" class = "tsd-kind-icon" > version< / a > < / li > < li class = "tsd-kind-method tsd-parent-kind-class" > < a href = "Human.html#detect" class = "tsd-kind-icon" > detect< / a > < / li > < li class = "tsd-kind-method tsd-parent-kind-class" > < a href = "Human.html#enhance" class = "tsd-kind-icon" > enhance< / a > < / li > < li class = "tsd-kind-method tsd-parent-kind-class" > < a href = "Human.html#image" class = "tsd-kind-icon" > image< / a > < / li > < li class = "tsd-kind-method tsd-parent-kind-class" > < a href = "Human.html#init" class = "tsd-kind-icon" > init< / a > < / li > < li class = "tsd-kind-method tsd-parent-kind-class" > < a href = "Human.html#load" class = "tsd-kind-icon" > load< / a > < / li > < li class = "tsd-kind-method tsd-parent-kind-class" > < a href = "Human.html#match" class = "tsd-kind-icon" > match< / a > < / li > < li class = "tsd-kind-method tsd-parent-kind-class" > < a href = "Human.html#next" class = "tsd-kind-icon" > next< / a > < / li > < li class = "tsd-kind-method tsd-parent-kind-class" > < a href = "Human.html#segmentation" class = "tsd-kind-icon" > segmentation< / a > < / li > < li class = "tsd-kind-method tsd-parent-kind-class" > < a href = "Human.html#similarity" class = "tsd-kind-icon" > similarity< / a > < / li > < li class = "tsd-kind-method tsd-parent-kind-class" > < a href = "Human.html#warmup" class = "tsd-kind-icon" > warmup< / a > < / li > < / ul > < / li > < / ul > < / nav > < / div > < / div > < / div > < footer class = "" > < div class = "container" > < h2 > Legend< / h2 > < div class = "tsd-legend-group" > < ul class = "tsd-legend" > < li class = "tsd-kind-constructor tsd-parent-kind-class" > < span class = "tsd-kind-icon" > Constructor< / span > < / li > < li class = "tsd-kind-property tsd-parent-kind-class" > < span class = "tsd-kind-icon" > Property< / span > < / li > < li class = "tsd-kind-method tsd-parent-kind-class" > < span class = "tsd-kind-icon" > Method< / span > < / li > < / ul > < ul class = "tsd-legend" > < li class = "tsd-kind-property tsd-parent-kind-interface" > < span class = "tsd-kind-icon" > Property< / span > < / li > < / ul > < / div > < h2 > Settings< / h2 > < p > Theme < select id = "theme" > < option value = "os" > OS< / option > < option value = "light" > Light< / option > < option value = "dark" > Dark< / option > < / select > < / p > < / div > < / footer > < div class = "overlay" > < / div > < script src = "../assets/main.js" > < / script > < / body > < / html >