diff --git a/CHANGELOG.md b/CHANGELOG.md index d1f29d11..43321e32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,11 @@ ## Changelog -### **HEAD -> main** 2021/12/14 mandic00@live.com +### **2.5.6** 2021/12/15 mandic00@live.com + +- strong type for string enums + +### **origin/main** 2021/12/14 mandic00@live.com - rebuild - fix node detection in electron environment diff --git a/TODO.md b/TODO.md index 2a7a9d6a..9e3cf8c4 100644 --- a/TODO.md +++ b/TODO.md @@ -34,26 +34,4 @@ Feature is automatically disabled in NodeJS without user impact ## Pending Release Notes -New: -- Demo `demos/faceid` that utilizes multiple algorithm to validate input before triggering face recognition -- Type definitions rollup for `Human` and `TFJS` -- Optional module `liveness` - checks if input appears to be a real-world live image or a recording - best used together with module `antispoofing` that checks if input appears to have a realistic face -- Face masking option in `face.config.detector.mask` - result is shading of face image outside of face area which is useful for increased sensitivity of other modules that rely on detected face as input -- Face crop option in `face.config.detector.cropFactor` - result is user-definable fine-tuning for other modules that rely on detected face as input - -Other: -- Documentation overhaul -- Improved **Safari** compatibility -- Improved `similarity` and `match` score range normalization -- Improved error handling -- Improved VSCode out-of-the-box experience -- Fix for optional `gear`, `ssrnet`, `mobilefacenet` modules -- Fix for Firefox WebGPU compatibility issue -- Fix face detect box scale and rotation -- Fix body interpolation -- Updated `blazepose` implementation -- Strong typing for all string enums in `config` and `results` +N/A diff --git a/dist/human.esm-nobundle.js b/dist/human.esm-nobundle.js index 0cf42d8a..ad004858 100644 --- a/dist/human.esm-nobundle.js +++ b/dist/human.esm-nobundle.js @@ -1351,7 +1351,7 @@ var Env = class { var env = new Env(); // package.json -var version10 = "2.5.5"; +var version10 = "2.5.6"; // src/gear/gear.ts var model; diff --git a/dist/human.esm.js b/dist/human.esm.js index 4a7dcc8e..e213305d 100644 --- a/dist/human.esm.js +++ b/dist/human.esm.js @@ -72115,7 +72115,7 @@ var Env = class { var env2 = new Env(); // package.json -var version9 = "2.5.5"; +var version9 = "2.5.6"; // src/gear/gear.ts var model2; diff --git a/dist/human.js b/dist/human.js index a752ec89..eb429905 100644 --- a/dist/human.js +++ b/dist/human.js @@ -7053,7 +7053,7 @@ return a / b;`,Lae=` c31 * m[6] + c32 * m[7] + c33 * m[8]; gl_FragColor.a = c22.a; } -`;var qx=(e,t,n)=>{let s=new RegExp("\\b"+t+" \\w+ (\\w+)","ig");e.replace(s,(r,a)=>(n[a]=0,r))},k8=class{constructor(t,n,s){fe(this,"uniform",{});fe(this,"attribute",{});fe(this,"gl");fe(this,"id");fe(this,"compile",(t,n)=>{let s=this.gl.createShader(n);return s?(this.gl.shaderSource(s,t),this.gl.compileShader(s),this.gl.getShaderParameter(s,this.gl.COMPILE_STATUS)?s:(J(`filter: gl compile failed: ${this.gl.getShaderInfoLog(s)}`),null)):(J("filter: could not create shader"),null)});this.gl=t;let r=this.compile(n,this.gl.VERTEX_SHADER),a=this.compile(s,this.gl.FRAGMENT_SHADER);if(this.id=this.gl.createProgram(),!(!r||!a)){if(!this.id){J("filter: could not create webgl program");return}if(this.gl.attachShader(this.id,r),this.gl.attachShader(this.id,a),this.gl.linkProgram(this.id),!this.gl.getProgramParameter(this.id,this.gl.LINK_STATUS)){J(`filter: gl link failed: ${this.gl.getProgramInfoLog(this.id)}`);return}this.gl.useProgram(this.id),qx(n,"attribute",this.attribute);for(let o in this.attribute)this.attribute[o]=this.gl.getAttribLocation(this.id,o);qx(n,"uniform",this.uniform),qx(s,"uniform",this.uniform);for(let o in this.uniform)this.uniform[o]=this.gl.getUniformLocation(this.id,o)}}};function S8(){let e=0,t=null,n=!1,s=-1,r=[null,null],a=[],o=null,i=null,l=Xn(100,100),c={},u={INTERMEDIATE:1},d=l.getContext("webgl");if(this.gl=d,!d){J("filter: cannot get webgl context");return}function p(x,A){if(!(x===l.width&&A===l.height)){if(l.width=x,l.height=A,!o){let b=new Float32Array([-1,-1,0,1,1,-1,1,1,-1,1,0,0,-1,1,0,0,1,-1,1,1,1,1,1,0]);o=d.createBuffer(),d.bindBuffer(d.ARRAY_BUFFER,o),d.bufferData(d.ARRAY_BUFFER,b,d.STATIC_DRAW),d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0)}d.viewport(0,0,l.width,l.height),r=[null,null]}}function h(x,A){let b=d.createFramebuffer();d.bindFramebuffer(d.FRAMEBUFFER,b);let w=d.createRenderbuffer();d.bindRenderbuffer(d.RENDERBUFFER,w);let k=d.createTexture();return d.bindTexture(d.TEXTURE_2D,k),d.texImage2D(d.TEXTURE_2D,0,d.RGBA,x,A,0,d.RGBA,d.UNSIGNED_BYTE,null),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.LINEAR),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.LINEAR),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_2D,k,0),d.bindTexture(d.TEXTURE_2D,null),d.bindFramebuffer(d.FRAMEBUFFER,null),{fbo:b,texture:k}}function f(x){return r[x]=r[x]||h(l.width,l.height),r[x]}function m(x=0){if(!i)return;let A=null,b=null,w=!1;e===0?A=t:A=f(s).texture||null,e++,n&&!(x&u.INTERMEDIATE)?(b=null,w=e%2==0):(s=(s+1)%2,b=f(s).fbo||null),d.bindTexture(d.TEXTURE_2D,A),d.bindFramebuffer(d.FRAMEBUFFER,b),d.uniform1f(i.uniform.flipY,w?-1:1),d.drawArrays(d.TRIANGLES,0,6)}function g(x){if(c[x])return i=c[x],d.useProgram((i?i.id:null)||null),i;if(i=new k8(d,y8,x),!i)return J("filter: could not get webgl program"),null;let A=Float32Array.BYTES_PER_ELEMENT,b=4*A;return d.enableVertexAttribArray(i.attribute.pos),d.vertexAttribPointer(i.attribute.pos,2,d.FLOAT,!1,b,0*A),d.enableVertexAttribArray(i.attribute.uv),d.vertexAttribPointer(i.attribute.uv,2,d.FLOAT,!1,b,2*A),c[x]=i,i}let y={colorMatrix:x=>{let A=new Float32Array(x);A[4]/=255,A[9]/=255,A[14]/=255,A[19]/=255;let b=A[18]===1&&A[3]===0&&A[8]===0&&A[13]===0&&A[15]===0&&A[16]===0&&A[17]===0&&A[19]===0?x8:A8,w=g(b);!w||(d.uniform1fv(w.uniform.m,A),m())},brightness:x=>{let A=(x||0)+1;y.colorMatrix([A,0,0,0,0,0,A,0,0,0,0,0,A,0,0,0,0,0,1,0])},saturation:x=>{let A=(x||0)*2/3+1,b=(A-1)*-.5;y.colorMatrix([A,b,b,0,0,b,A,b,0,0,b,b,A,0,0,0,0,0,1,0])},desaturate:()=>{y.saturation(-1)},contrast:x=>{let A=(x||0)+1,b=-128*(A-1);y.colorMatrix([A,0,0,0,b,0,A,0,0,b,0,0,A,0,b,0,0,0,1,0])},negative:()=>{y.contrast(-2)},hue:x=>{x=(x||0)/180*Math.PI;let A=Math.cos(x),b=Math.sin(x),w=.213,k=.715,I=.072;y.colorMatrix([w+A*(1-w)+b*-w,k+A*-k+b*-k,I+A*-I+b*(1-I),0,0,w+A*-w+b*.143,k+A*(1-k)+b*.14,I+A*-I+b*-.283,0,0,w+A*-w+b*-(1-w),k+A*-k+b*k,I+A*(1-I)+b*I,0,0,0,0,0,1,0])},desaturateLuminance:()=>{y.colorMatrix([.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0])},sepia:()=>{y.colorMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0])},brownie:()=>{y.colorMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0])},vintagePinhole:()=>{y.colorMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0])},kodachrome:()=>{y.colorMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0])},technicolor:()=>{y.colorMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0])},polaroid:()=>{y.colorMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0])},shiftToBGR:()=>{y.colorMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0])},convolution:x=>{let A=new Float32Array(x),b=1/l.width,w=1/l.height,k=g(w8);!k||(d.uniform1fv(k.uniform.m,A),d.uniform2f(k.uniform.px,b,w),m())},detectEdges:()=>{y.convolution.call(this,[0,1,0,1,-4,1,0,1,0])},sobelX:()=>{y.convolution.call(this,[-1,0,1,-2,0,2,-1,0,1])},sobelY:()=>{y.convolution.call(this,[-1,-2,-1,0,0,0,1,2,1])},sharpen:x=>{let A=x||1;y.convolution.call(this,[0,-1*A,0,-1*A,1+4*A,-1*A,0,-1*A,0])},emboss:x=>{let A=x||1;y.convolution.call(this,[-2*A,-1*A,0,-1*A,1,1*A,0,1*A,2*A])},blur:x=>{let A=x/7/l.width,b=x/7/l.height,w=g(v8);!w||(d.uniform2f(w.uniform.px,0,b),m(u.INTERMEDIATE),d.uniform2f(w.uniform.px,A,0),m())},pixelate:x=>{let A=x/l.width,b=x/l.height,w=g(b8);!w||(d.uniform2f(w.uniform.size,A,b),m())}};this.add=function(x){let A=Array.prototype.slice.call(arguments,1),b=y[x];a.push({func:b,args:A})},this.reset=function(){a=[]},this.get=function(){return a},this.apply=function(x){p(x.width,x.height),e=0,t||(t=d.createTexture()),d.bindTexture(d.TEXTURE_2D,t),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.NEAREST),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.NEAREST),d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,x);for(let A=0;Ah.data())),o=.99*Math.max(a[0][0],a[1][0],a[2][0]),i=[he(n[0],s[0]),he(n[1],s[1]),he(n[2],s[2])],l=[he(r[0],s[0]),he(r[1],s[1]),he(r[2],s[2])],c=[de(o,l[0]),de(o,l[1]),de(o,l[2])],u=[L(i[0],c[0]),L(i[1],c[1]),L(i[2],c[2])],d=an([u[0],u[1],u[2]],2),p=H(d,[1,t.shape[0],t.shape[1],3]);return te([...n,...s,...r,...i,...l,...c,...u,d,t]),p}var p0=2048,ct=null,cn=null,Tc=null,Nt,ca={inputSum:0,cacheDiff:1,sumMethod:0,inputTensor:void 0};function Xn(e,t){let n;if(pe.browser)if(pe.worker){if(typeof OffscreenCanvas=="undefined")throw new Error("canvas error: attempted to run in web worker but OffscreenCanvas is not supported");n=new OffscreenCanvas(e,t)}else{if(typeof document=="undefined")throw new Error("canvas error: attempted to run in browser but DOM is not defined");n=document.createElement("canvas"),n.width=e,n.height=t}else typeof pe.Canvas!="undefined"?n=new pe.Canvas(e,t):typeof globalThis.Canvas!="undefined"&&(n=new globalThis.Canvas(e,t));return n}function Xx(e,t){let n=t||Xn(e.width,e.height);return n.getContext("2d").drawImage(e,0,0),n}async function Nc(e,t,n=!0){if(!e)return t.debug&&J("input error: input is missing"),{tensor:null,canvas:null};if(!(e instanceof et)&&!(typeof Image!="undefined"&&e instanceof Image)&&!(typeof pe.Canvas!="undefined"&&e instanceof pe.Canvas)&&!(typeof globalThis.Canvas!="undefined"&&e instanceof globalThis.Canvas)&&!(typeof ImageData!="undefined"&&e instanceof ImageData)&&!(typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap)&&!(typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement)&&!(typeof HTMLMediaElement!="undefined"&&e instanceof HTMLMediaElement)&&!(typeof HTMLVideoElement!="undefined"&&e instanceof HTMLVideoElement)&&!(typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement)&&!(typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas))throw new Error("input error: type is not recognized");if(e instanceof et){let s=null;if(e.isDisposedInternal)throw new Error("input error: attempted to use tensor but it is disposed");if(!e.shape)throw new Error("input error: attempted to use tensor without a shape");if(e.shape.length===3){if(e.shape[2]===3)s=Zt(e,0);else if(e.shape[2]===4){let r=pl(e,[0,0,0],[-1,-1,3]);s=Zt(r,0),te(r)}}else e.shape.length===4&&(e.shape[3]===3?s=Ln(e):e.shape[3]===4&&(s=hl(e,[0,0,0,0],[-1,-1,-1,3])));if(s==null||s.shape.length!==4||s.shape[0]!==1||s.shape[3]!==3)throw new Error(`input error: attempted to use tensor with unrecognized shape: ${e.shape}`);if(s.dtype==="int32"){let r=me(s,"float32");te(s),s=r}return{tensor:s,canvas:t.filter.return?cn:null}}else{if(typeof e.readyState!="undefined"&&e.readyState<=2)return t.debug&&J("input stream is not ready"),{tensor:null,canvas:ct};let s=e.naturalWidth||e.videoWidth||e.width||e.shape&&e.shape[1]>0,r=e.naturalHeight||e.videoHeight||e.height||e.shape&&e.shape[2]>0;if(!s||!r)return t.debug&&J("cannot determine input dimensions"),{tensor:null,canvas:ct};let a=s,o=r;if(a>p0&&(a=p0,o=Math.trunc(a*r/s)),o>p0&&(o=p0,a=Math.trunc(o*s/r)),(t.filter.width||0)>0?a=t.filter.width:(t.filter.height||0)>0&&(a=s*((t.filter.height||0)/r)),(t.filter.height||0)>0?o=t.filter.height:(t.filter.width||0)>0&&(o=r*((t.filter.width||0)/s)),!a||!o)throw new Error("input error: cannot determine dimension");(!ct||(ct==null?void 0:ct.width)!==a||(ct==null?void 0:ct.height)!==o)&&(ct=Xn(a,o));let i=ct.getContext("2d");if(typeof ImageData!="undefined"&&e instanceof ImageData?i.putImageData(e,0,0):t.filter.flip&&typeof i.translate!="undefined"?(i.translate(s,0),i.scale(-1,1),i.drawImage(e,0,0,s,r,0,0,ct==null?void 0:ct.width,ct==null?void 0:ct.height),i.setTransform(1,0,0,1,0,0)):i.drawImage(e,0,0,s,r,0,0,ct==null?void 0:ct.width,ct==null?void 0:ct.height),(!cn||ct.width!==cn.width||(ct==null?void 0:ct.height)!==(cn==null?void 0:cn.height))&&(cn=Xn(ct.width,ct.height)),t.filter.enabled&&pe.webgl.supported){if(Nt||(Nt=pe.browser?new S8:null),pe.filter=!!Nt,!Nt||!Nt.add)return t.debug&&J("input process error: cannot initialize filters"),{tensor:null,canvas:ct};Nt.reset(),t.filter.brightness!==0&&Nt.add("brightness",t.filter.brightness),t.filter.contrast!==0&&Nt.add("contrast",t.filter.contrast),t.filter.sharpness!==0&&Nt.add("sharpen",t.filter.sharpness),t.filter.blur!==0&&Nt.add("blur",t.filter.blur),t.filter.saturation!==0&&Nt.add("saturation",t.filter.saturation),t.filter.hue!==0&&Nt.add("hue",t.filter.hue),t.filter.negative&&Nt.add("negative"),t.filter.sepia&&Nt.add("sepia"),t.filter.vintage&&Nt.add("brownie"),t.filter.sepia&&Nt.add("sepia"),t.filter.kodachrome&&Nt.add("kodachrome"),t.filter.technicolor&&Nt.add("technicolor"),t.filter.polaroid&&Nt.add("polaroid"),t.filter.pixelate!==0&&Nt.add("pixelate",t.filter.pixelate),Nt.get()>0?cn=Nt.apply(ct):cn=Nt.draw(ct)}else Xx(ct,cn),Nt&&(Nt=null),pe.filter=!!Nt;if(!n)return{tensor:null,canvas:cn};if(!cn)throw new Error("canvas error: cannot create output");let l,c=3;if(typeof ImageData!="undefined"&&e instanceof ImageData||e.data&&e.width&&e.height)if(pe.browser&&Ys)l=Ys?Ys.fromPixels(e):null;else{c=e.data.length/e.height/e.width;let p=new Uint8Array(e.data.buffer);l=pt(p,[e.height,e.width,c],"int32")}else if((!Tc||cn.width!==Tc.width||cn.height!==Tc.height)&&(Tc=Xn(cn.width,cn.height)),Ys&&pe.browser)t.backend==="webgl"||t.backend==="humangl"||t.backend==="webgpu"?l=Ys.fromPixels(cn):(Tc=Xx(cn),l=Ys.fromPixels(Tc));else{let f=Xx(cn).getContext("2d").getImageData(0,0,a,o);c=f.data.length/a/o;let m=new Uint8Array(f.data.buffer);l=pt(m,[a,o,c])}if(c===4){let p=pl(l,[0,0,0],[-1,-1,3]);te(l),l=p}if(!l)throw new Error("input error: cannot create tensor");let u=me(l,"float32"),d=t.filter.equalization?await d0(u):Zt(u,0);return te([l,u]),{tensor:d,canvas:t.filter.return?cn:null}}}async function I8(e,t){let n=!1;if(e.cacheSensitivity===0||!t.shape||t.shape.length!==4||t.shape[1]>2048||t.shape[2]>2048)return n;if(!ca.inputTensor)ca.inputTensor=Ln(t);else if(ca.inputTensor.shape[1]!==t.shape[1]||ca.inputTensor.shape[2]!==t.shape[2])te(ca.inputTensor),ca.inputTensor=Ln(t);else{let s={};s.diff=he(t,ca.inputTensor),s.squared=L(s.diff,s.diff),s.sum=we(s.squared);let a=(await s.sum.data())[0]/(t.shape[1]||1)/(t.shape[2]||1)/255/3;te([ca.inputTensor,s.diff,s.squared,s.sum]),ca.inputTensor=Ln(t),n=a<=e.cacheSensitivity}return n}async function C8(e,t,n){let s={};if(!t||!n||t.shape.length!==4||t.shape.length!==n.shape.length)return e.debug||J("invalid input tensor or tensor shapes do not match:",t.shape,n.shape),0;if(t.shape[0]!==1||n.shape[0]!==1||t.shape[3]!==3||n.shape[3]!==3)return e.debug||J("input tensors must be of shape [1, height, width, 3]:",t.shape,n.shape),0;s.input1=Ln(t),s.input2=t.shape[1]!==n.shape[1]||t.shape[2]!==n.shape[2]?Se.resizeBilinear(n,[t.shape[1],t.shape[2]]):Ln(n),s.diff=he(s.input1,s.input2),s.squared=L(s.diff,s.diff),s.sum=we(s.squared);let a=(await s.sum.data())[0]/(t.shape[1]||1)/(t.shape[2]||1)/255/3;return te([s.input1,s.input2,s.diff,s.squared,s.sum]),a}var T8=class{constructor(){fe(this,"browser");fe(this,"node");fe(this,"worker");fe(this,"platform","");fe(this,"agent","");fe(this,"backends",[]);fe(this,"initial");fe(this,"filter");fe(this,"tfjs");fe(this,"offscreen");fe(this,"perfadd",!1);fe(this,"wasm",{supported:void 0,backend:void 0,simd:void 0,multithread:void 0});fe(this,"webgl",{supported:void 0,backend:void 0,version:void 0,renderer:void 0});fe(this,"webgpu",{supported:void 0,backend:void 0,adapter:void 0});fe(this,"cpu",{model:void 0,flags:[]});fe(this,"kernels",[]);fe(this,"Canvas");fe(this,"Image");fe(this,"ImageData");if(this.browser=typeof navigator!="undefined",this.node=typeof process!="undefined"&&typeof process.versions!="undefined"&&typeof process.versions.node!="undefined",this.tfjs={version:c0["tfjs-core"]},this.offscreen=typeof OffscreenCanvas!="undefined",this.initial=!0,this.worker=this.browser&&this.offscreen?typeof WorkerGlobalScope!="undefined":void 0,typeof navigator!="undefined"){let t=navigator.userAgent.match(/\(([^()]+)\)/g);if(t&&t[0]){let n=t[0].match(/\(([^()]+)\)/g);this.platform=n&&n[0]?n[0].replace(/\(|\)/g,""):"",this.agent=navigator.userAgent.replace(t[0],""),this.platform[1]&&(this.agent=this.agent.replace(t[1],"")),this.agent=this.agent.replace(/ /g," ")}}else typeof process!="undefined"&&(this.platform=`${process.platform} ${process.arch}`,this.agent=`NodeJS ${process.version}`)}async updateBackend(){this.backends=Object.keys(rs().registryFactory),this.wasm.supported=typeof WebAssembly!="undefined",this.wasm.backend=this.backends.includes("wasm"),this.wasm.supported&&this.wasm.backend&&Ds()==="wasm"&&(this.wasm.simd=await Y().getAsync("WASM_HAS_SIMD_SUPPORT"),this.wasm.multithread=await Y().getAsync("WASM_HAS_MULTITHREAD_SUPPORT"));let t=Xn(100,100),n=t?t.getContext("webgl2"):void 0;if(this.webgl.supported=typeof n!="undefined",this.webgl.backend=this.backends.includes("webgl"),this.webgl.supported&&this.webgl.backend&&(Ds()==="webgl"||Ds()==="humangl")){let s=Rr().gpgpu!=="undefined"?await Rr().getGPGPUContext().gl:null;s&&(this.webgl.version=s.getParameter(s.VERSION),this.webgl.renderer=s.getParameter(s.RENDERER))}this.webgpu.supported=this.browser&&typeof navigator.gpu!="undefined",this.webgpu.backend=this.backends.includes("webgpu");try{this.webgpu.supported&&(this.webgpu.adapter=(await navigator.gpu.requestAdapter()).name)}catch(s){this.webgpu.supported=!1}try{this.kernels=Zr(Ds()).map(s=>s.kernelName.toLowerCase())}catch(s){}}async updateCPU(){let t={model:"",flags:[]};this.node&&this.platform.startsWith("linux"),this.cpu?this.cpu=t:Object.defineProperty(this,"cpu",{value:t})}},pe=new T8;var Kx="2.5.5";var hs,Zx=[],U2e=["white","black","asian","indian","other"],G2e=[15,23,28,35.5,45.5,55.5,65],N8=0,E8=0,Yx=Number.MAX_SAFE_INTEGER;async function R8(e){return pe.initial&&(hs=null),hs?e.debug&&J("cached model:",hs.modelUrl):(hs=await Be(We(e.modelBasePath,e.face.gear.modelPath)),!hs||!hs.modelUrl?J("load model failed:",e.face.gear.modelPath):e.debug&&J("load model:",hs.modelUrl)),hs}async function Jx(e,t,n,s){var o,i;if(!hs)return{age:0,gender:"unknown",genderScore:0,race:[]};let r=Yx<(((o=t.face.gear)==null?void 0:o.skipFrames)||0),a=(((i=t.face.gear)==null?void 0:i.skipTime)||0)>ie()-E8;return t.skipAllowed&&a&&r&&N8===s&&Zx[n]?(Yx++,Zx[n]):(Yx=0,new Promise(async l=>{var y,x;if(!(hs==null?void 0:hs.inputs[0].shape))return;let c={},u=[[0,.1,.9,.9]];c.resize=Se.cropAndResize(e,u,[0],[hs.inputs[0].shape[2],hs.inputs[0].shape[1]]);let d={age:0,gender:"unknown",genderScore:0,race:[]};((y=t.face.gear)==null?void 0:y.enabled)&&([c.age,c.gender,c.race]=hs.execute(c.resize,["age_output","gender_output","race_output"]));let p=await c.gender.data();d.gender=p[0]>p[1]?"male":"female",d.genderScore=Math.round(100*(p[0]>p[1]?p[0]:p[1]))/100;let h=await c.race.data();for(let A=0;A(((x=t.face.gear)==null?void 0:x.minConfidence)||.2)&&d.race.push({score:Math.round(100*h[A])/100,race:U2e[A]});d.race.sort((A,b)=>b.score-A.score);let m=Array.from(await c.age.data()).map((A,b)=>[G2e[b],A]).sort((A,b)=>b[1]-A[1]),g=m[0][0];for(let A=1;Ate(c[A])),Zx[n]=d,N8=s,E8=ie(),l(d)}))}var Xe={tf255:255,tf1:1,tf2:2,tf05:.5,tf127:127.5,rgb:[.2989,.587,.114]};function _8(){Xe.tf255=Ce(255,"float32"),Xe.tf1=Ce(1,"float32"),Xe.tf2=Ce(2,"float32"),Xe.tf05=Ce(.5,"float32"),Xe.tf127=Ce(127.5,"float32"),Xe.rgb=Ct([.2989,.587,.114],"float32")}var Dn,h0=[],$8=0,D8=0,Qx=Number.MAX_SAFE_INTEGER;async function F8(e){return pe.initial&&(Dn=null),Dn?e.debug&&J("cached model:",Dn.modelUrl):(Dn=await Be(We(e.modelBasePath,e.face.ssrnet.modelPathAge)),!Dn||!Dn.modelUrl?J("load model failed:",e.face.ssrnet.modelPathAge):e.debug&&J("load model:",Dn.modelUrl)),Dn}async function eb(e,t,n,s){var o,i,l,c;if(!Dn)return{age:0};let r=Qx<(((o=t.face.ssrnet)==null?void 0:o.skipFrames)||0),a=(((i=t.face.ssrnet)==null?void 0:i.skipTime)||0)>ie()-D8;return t.skipAllowed&&r&&a&&$8===s&&((l=h0[n])==null?void 0:l.age)&&((c=h0[n])==null?void 0:c.age)>0?(Qx++,h0[n]):(Qx=0,new Promise(async u=>{if(!(Dn==null?void 0:Dn.inputs)||!Dn.inputs[0]||!Dn.inputs[0].shape)return;let d={};d.resize=Se.resizeBilinear(e,[Dn.inputs[0].shape[2],Dn.inputs[0].shape[1]],!1),d.enhance=L(d.resize,Xe.tf255);let p={age:0};if(t.face.ssrnet.enabled&&(d.age=Dn.execute(d.enhance)),d.age){let h=await d.age.data();p.age=Math.trunc(10*h[0])/10}Object.keys(d).forEach(h=>te(d[h])),h0[n]=p,$8=s,D8=ie(),u(p)}))}var fs,f0=[],P8=0,O8=0,tb=Number.MAX_SAFE_INTEGER,nb=[.2989,.587,.114];async function M8(e){return pe.initial&&(fs=null),fs?e.debug&&J("cached model:",fs.modelUrl):(fs=await Be(We(e.modelBasePath,e.face.ssrnet.modelPathGender)),!fs||!fs.modelUrl?J("load model failed:",e.face.ssrnet.modelPathGender):e.debug&&J("load model:",fs.modelUrl)),fs}async function sb(e,t,n,s){var o,i,l,c;if(!fs)return{gender:"unknown",genderScore:0};let r=tb<(((o=t.face.ssrnet)==null?void 0:o.skipFrames)||0),a=(((i=t.face.ssrnet)==null?void 0:i.skipTime)||0)>ie()-O8;return t.skipAllowed&&r&&a&&P8===s&&((l=f0[n])==null?void 0:l.gender)&&((c=f0[n])==null?void 0:c.genderScore)>0?(tb++,f0[n]):(tb=0,new Promise(async u=>{if(!(fs==null?void 0:fs.inputs[0].shape))return;let d={};d.resize=Se.resizeBilinear(e,[fs.inputs[0].shape[2],fs.inputs[0].shape[1]],!1),d.enhance=K(()=>{let[f,m,g]=Yt(d.resize,3,3),y=L(f,nb[0]),x=L(m,nb[1]),A=L(g,nb[2]),b=mf([y,x,A]);return L(he(b,Xe.tf05),2)});let p={gender:"unknown",genderScore:0};t.face.ssrnet.enabled&&(d.gender=fs.execute(d.enhance));let h=await d.gender.data();p.gender=h[0]>h[1]?"female":"male",p.genderScore=h[0]>h[1]?Math.trunc(100*h[0])/100:Math.trunc(100*h[1])/100,Object.keys(d).forEach(f=>te(d[f])),f0[n]=p,P8=s,O8=ie(),u(p)}))}var dn,m0=[],rb=Number.MAX_SAFE_INTEGER,z8=0,L8=0;async function B8(e){var t,n;return pe.initial&&(dn=null),dn?e.debug&&J("cached model:",dn.modelUrl):(dn=await Be(We(e.modelBasePath,((t=e.face.antispoof)==null?void 0:t.modelPath)||"")),!dn||!dn.modelUrl?J("load model failed:",(n=e.face.antispoof)==null?void 0:n.modelPath):e.debug&&J("load model:",dn.modelUrl)),dn}async function ab(e,t,n,s){var o,i;if(!dn)return 0;let r=(((o=t.face.antispoof)==null?void 0:o.skipTime)||0)>ie()-L8,a=rb<(((i=t.face.antispoof)==null?void 0:i.skipFrames)||0);return t.skipAllowed&&r&&a&&z8===s&&m0[n]?(rb++,m0[n]):(rb=0,new Promise(async l=>{let c=Se.resizeBilinear(e,[(dn==null?void 0:dn.inputs[0].shape)?dn.inputs[0].shape[2]:0,(dn==null?void 0:dn.inputs[0].shape)?dn.inputs[0].shape[1]:0],!1),u=dn==null?void 0:dn.execute(c),d=(await u.data())[0];m0[n]=Math.round(100*d)/100,z8=s,L8=ie(),te([c,u]),l(m0[n])}))}var or={silhouette:[10,338,297,332,284,251,389,356,454,323,361,288,397,365,379,378,400,377,152,148,176,149,150,136,172,58,132,93,234,127,162,21,54,103,67,109],lipsUpperOuter:[61,185,40,39,37,0,267,269,270,409,291],lipsLowerOuter:[146,91,181,84,17,314,405,321,375,291],lipsUpperInner:[78,191,80,81,82,13,312,311,310,415,308],lipsLowerInner:[78,95,88,178,87,14,317,402,318,324,308],rightEyeUpper0:[246,161,160,159,158,157,173],rightEyeLower0:[33,7,163,144,145,153,154,155,133],rightEyeUpper1:[247,30,29,27,28,56,190],rightEyeLower1:[130,25,110,24,23,22,26,112,243],rightEyeUpper2:[113,225,224,223,222,221,189],rightEyeLower2:[226,31,228,229,230,231,232,233,244],rightEyeLower3:[143,111,117,118,119,120,121,128,245],rightEyebrowUpper:[156,70,63,105,66,107,55,193],rightEyebrowLower:[35,124,46,53,52,65],rightEyeIris:[473,474,475,476,477],leftEyeUpper0:[466,388,387,386,385,384,398],leftEyeLower0:[263,249,390,373,374,380,381,382,362],leftEyeUpper1:[467,260,259,257,258,286,414],leftEyeLower1:[359,255,339,254,253,252,256,341,463],leftEyeUpper2:[342,445,444,443,442,441,413],leftEyeLower2:[446,261,448,449,450,451,452,453,464],leftEyeLower3:[372,340,346,347,348,349,350,357,465],leftEyebrowUpper:[383,300,293,334,296,336,285,417],leftEyebrowLower:[265,353,276,283,282,295],leftEyeIris:[468,469,470,471,472],midwayBetweenEyes:[168],noseTip:[1],noseBottom:[2],noseRightCorner:[98],noseLeftCorner:[327],rightCheek:[205],leftCheek:[425]},ob={count:468,mouth:13,symmetryLine:[13,or.midwayBetweenEyes[0]]},Mp={leftEye:0,rightEye:1,nose:2,mouth:3,leftEar:4,rightEar:5,symmetryLine:[3,2]},ib=[{key:"EyeUpper0",indices:[9,10,11,12,13,14,15]},{key:"EyeUpper1",indices:[25,26,27,28,29,30,31]},{key:"EyeUpper2",indices:[41,42,43,44,45,46,47]},{key:"EyeLower0",indices:[0,1,2,3,4,5,6,7,8]},{key:"EyeLower1",indices:[16,17,18,19,20,21,22,23,24]},{key:"EyeLower2",indices:[32,33,34,35,36,37,38,39,40]},{key:"EyeLower3",indices:[54,55,56,57,58,59,60,61,62]}],zp=[[.499976992607117,.652534008026123],[.500025987625122,.547487020492554],[.499974012374878,.602371990680695],[.482113003730774,.471979022026062],[.500150978565216,.527155995368958],[.499909996986389,.498252987861633],[.499523013830185,.40106201171875],[.289712011814117,.380764007568359],[.499954998493195,.312398016452789],[.499987006187439,.269918978214264],[.500023007392883,.107050001621246],[.500023007392883,.666234016418457],[.5000159740448,.679224014282227],[.500023007392883,.692348003387451],[.499976992607117,.695277988910675],[.499976992607117,.70593398809433],[.499976992607117,.719385027885437],[.499976992607117,.737019002437592],[.499967992305756,.781370997428894],[.499816000461578,.562981009483337],[.473773002624512,.573909997940063],[.104906998574734,.254140973091125],[.365929991006851,.409575998783112],[.338757991790771,.41302502155304],[.311120003461838,.409460008144379],[.274657994508743,.389131009578705],[.393361985683441,.403706014156342],[.345234006643295,.344011008739471],[.370094001293182,.346076011657715],[.319321990013123,.347265005111694],[.297903001308441,.353591024875641],[.24779200553894,.410809993743896],[.396889001131058,.842755019664764],[.280097991228104,.375599980354309],[.106310002505779,.399955987930298],[.2099249958992,.391353011131287],[.355807989835739,.534406006336212],[.471751004457474,.65040397644043],[.474155008792877,.680191993713379],[.439785003662109,.657229006290436],[.414617002010345,.66654098033905],[.450374007225037,.680860996246338],[.428770989179611,.682690978050232],[.374971002340317,.727805018424988],[.486716985702515,.547628998756409],[.485300987958908,.527395009994507],[.257764995098114,.314490020275116],[.401223003864288,.455172002315521],[.429818987846375,.548614978790283],[.421351999044418,.533740997314453],[.276895999908447,.532056987285614],[.483370006084442,.499586999416351],[.33721199631691,.282882988452911],[.296391993761063,.293242990970612],[.169294998049736,.193813979625702],[.447580009698868,.302609980106354],[.392390012741089,.353887975215912],[.354490011930466,.696784019470215],[.067304998636246,.730105042457581],[.442739009857178,.572826027870178],[.457098007202148,.584792017936707],[.381974011659622,.694710969924927],[.392388999462128,.694203019142151],[.277076005935669,.271932005882263],[.422551989555359,.563233017921448],[.385919004678726,.281364023685455],[.383103013038635,.255840003490448],[.331431001424789,.119714021682739],[.229923993349075,.232002973556519],[.364500999450684,.189113974571228],[.229622006416321,.299540996551514],[.173287004232407,.278747975826263],[.472878992557526,.666198015213013],[.446828007698059,.668527007102966],[.422762006521225,.673889994621277],[.445307999849319,.580065965652466],[.388103008270264,.693961024284363],[.403039008378983,.706539988517761],[.403629004955292,.693953037261963],[.460041999816895,.557139039039612],[.431158006191254,.692366003990173],[.452181994915009,.692366003990173],[.475387006998062,.692366003990173],[.465828001499176,.779190003871918],[.472328990697861,.736225962638855],[.473087012767792,.717857003211975],[.473122000694275,.704625964164734],[.473033010959625,.695277988910675],[.427942007780075,.695277988910675],[.426479011774063,.703539967536926],[.423162013292313,.711845993995667],[.4183090031147,.720062971115112],[.390094995498657,.639572978019714],[.013953999616206,.560034036636353],[.499913990497589,.58014702796936],[.413199990987778,.69539999961853],[.409626007080078,.701822996139526],[.468080013990402,.601534962654114],[.422728985548019,.585985004901886],[.463079988956451,.593783974647522],[.37211999297142,.47341400384903],[.334562003612518,.496073007583618],[.411671012639999,.546965003013611],[.242175996303558,.14767599105835],[.290776997804642,.201445996761322],[.327338010072708,.256527006626129],[.399509996175766,.748921036720276],[.441727995872498,.261676013469696],[.429764986038208,.187834024429321],[.412198007106781,.108901023864746],[.288955003023148,.398952007293701],[.218936994671822,.435410976409912],[.41278201341629,.398970007896423],[.257135003805161,.355440020561218],[.427684992551804,.437960982322693],[.448339998722076,.536936044692993],[.178560003638268,.45755398273468],[.247308000922203,.457193970680237],[.286267012357712,.467674970626831],[.332827985286713,.460712015628815],[.368755996227264,.447206974029541],[.398963987827301,.432654976844788],[.476410001516342,.405806005001068],[.189241006970406,.523923993110657],[.228962004184723,.348950982093811],[.490725994110107,.562400996685028],[.404670000076294,.485132992267609],[.019469000399113,.401564002037048],[.426243007183075,.420431017875671],[.396993011236191,.548797011375427],[.266469985246658,.376977026462555],[.439121007919312,.51895797252655],[.032313998788595,.644356966018677],[.419054001569748,.387154996395111],[.462783008813858,.505746960639954],[.238978996872902,.779744982719421],[.198220998048782,.831938028335571],[.107550002634525,.540755033493042],[.183610007166862,.740257024765015],[.134409993886948,.333683013916016],[.385764002799988,.883153975009918],[.490967005491257,.579378008842468],[.382384985685349,.508572995662689],[.174399003386497,.397670984268188],[.318785011768341,.39623498916626],[.343364000320435,.400596976280212],[.396100014448166,.710216999053955],[.187885001301765,.588537991046906],[.430987000465393,.944064974784851],[.318993002176285,.898285031318665],[.266247987747192,.869701027870178],[.500023007392883,.190576016902924],[.499976992607117,.954452991485596],[.366169989109039,.398822009563446],[.393207013607025,.39553701877594],[.410373002290726,.391080021858215],[.194993004202843,.342101991176605],[.388664990663528,.362284004688263],[.365961998701096,.355970978736877],[.343364000320435,.355356991291046],[.318785011768341,.35834002494812],[.301414996385574,.363156020641327],[.058132998645306,.319076001644135],[.301414996385574,.387449026107788],[.499987989664078,.618434011936188],[.415838003158569,.624195992946625],[.445681989192963,.566076993942261],[.465844005346298,.620640993118286],[.49992299079895,.351523995399475],[.288718998432159,.819945991039276],[.335278987884521,.852819979190826],[.440512001514435,.902418971061707],[.128294005990028,.791940987110138],[.408771991729736,.373893976211548],[.455606997013092,.451801002025604],[.499877005815506,.908990025520325],[.375436991453171,.924192011356354],[.11421000212431,.615022003650665],[.448662012815475,.695277988910675],[.4480200111866,.704632043838501],[.447111994028091,.715808033943176],[.444831997156143,.730794012546539],[.430011987686157,.766808986663818],[.406787008047104,.685672998428345],[.400738000869751,.681069016456604],[.392399996519089,.677703022956848],[.367855995893478,.663918972015381],[.247923001646996,.601333022117615],[.452769994735718,.420849978923798],[.43639200925827,.359887003898621],[.416164010763168,.368713974952698],[.413385987281799,.692366003990173],[.228018000721931,.683571994304657],[.468268007040024,.352671027183533],[.411361992359161,.804327011108398],[.499989002943039,.469825029373169],[.479153990745544,.442654013633728],[.499974012374878,.439637005329132],[.432112008333206,.493588984012604],[.499886006116867,.866917014122009],[.49991300702095,.821729004383087],[.456548988819122,.819200992584229],[.344549000263214,.745438992977142],[.37890899181366,.574010014533997],[.374292999505997,.780184984207153],[.319687992334366,.570737957954407],[.357154995203018,.604269981384277],[.295284003019333,.621580958366394],[.447750002145767,.862477004528046],[.410986006259918,.508723020553589],[.31395098567009,.775308012962341],[.354128003120422,.812552988529205],[.324548006057739,.703992962837219],[.189096003770828,.646299958229065],[.279776990413666,.71465802192688],[.1338230073452,.682700991630554],[.336768001317978,.644733011722565],[.429883986711502,.466521978378296],[.455527991056442,.548622965812683],[.437114000320435,.558896005153656],[.467287987470627,.529924988746643],[.414712011814117,.335219979286194],[.37704598903656,.322777986526489],[.344107985496521,.320150971412659],[.312875986099243,.32233202457428],[.283526003360748,.333190023899078],[.241245999932289,.382785975933075],[.102986000478268,.468762993812561],[.267612010240555,.424560010433197],[.297879010438919,.433175981044769],[.333433985710144,.433878004550934],[.366427004337311,.426115989685059],[.396012008190155,.416696012020111],[.420121014118195,.41022801399231],[.007561000064015,.480777025222778],[.432949006557465,.569517970085144],[.458638995885849,.479089021682739],[.473466008901596,.545744001865387],[.476087987422943,.563830018043518],[.468472003936768,.555056989192963],[.433990985155106,.582361996173859],[.483518004417419,.562983989715576],[.482482999563217,.57784903049469],[.42645001411438,.389798998832703],[.438998997211456,.39649498462677],[.450067013502121,.400434017181396],[.289712011814117,.368252992630005],[.276670008897781,.363372981548309],[.517862021923065,.471948027610779],[.710287988185883,.380764007568359],[.526226997375488,.573909997940063],[.895093023777008,.254140973091125],[.634069979190826,.409575998783112],[.661242008209229,.41302502155304],[.688880026340485,.409460008144379],[.725341975688934,.389131009578705],[.606630027294159,.40370500087738],[.654766023159027,.344011008739471],[.629905998706818,.346076011657715],[.680678009986877,.347265005111694],[.702096998691559,.353591024875641],[.75221198797226,.410804986953735],[.602918028831482,.842862963676453],[.719901978969574,.375599980354309],[.893692970275879,.399959981441498],[.790081977844238,.391354024410248],[.643998026847839,.534487962722778],[.528249025344849,.65040397644043],[.525849997997284,.680191040039062],[.560214996337891,.657229006290436],[.585384011268616,.66654098033905],[.549625992774963,.680860996246338],[.57122802734375,.682691991329193],[.624852001667023,.72809898853302],[.513050019741058,.547281980514526],[.51509702205658,.527251958847046],[.742246985435486,.314507007598877],[.598631024360657,.454979002475739],[.570338010787964,.548575043678284],[.578631997108459,.533622980117798],[.723087012767792,.532054007053375],[.516445994377136,.499638974666595],[.662801027297974,.282917976379395],[.70362401008606,.293271005153656],[.830704987049103,.193813979625702],[.552385985851288,.302568018436432],[.607609987258911,.353887975215912],[.645429015159607,.696707010269165],[.932694971561432,.730105042457581],[.557260990142822,.572826027870178],[.542901992797852,.584792017936707],[.6180260181427,.694710969924927],[.607590973377228,.694203019142151],[.722943007946014,.271963000297546],[.577413976192474,.563166975975037],[.614082992076874,.281386971473694],[.616907000541687,.255886018276215],[.668509006500244,.119913995265961],[.770092010498047,.232020974159241],[.635536015033722,.189248979091644],[.77039098739624,.299556016921997],[.826722025871277,.278755009174347],[.527121007442474,.666198015213013],[.553171992301941,.668527007102966],[.577238023281097,.673889994621277],[.554691970348358,.580065965652466],[.611896991729736,.693961024284363],[.59696102142334,.706539988517761],[.596370995044708,.693953037261963],[.539958000183105,.557139039039612],[.568841993808746,.692366003990173],[.547818005084991,.692366003990173],[.52461302280426,.692366003990173],[.534089982509613,.779141008853912],[.527670979499817,.736225962638855],[.526912987232208,.717857003211975],[.526877999305725,.704625964164734],[.526966989040375,.695277988910675],[.572058022022247,.695277988910675],[.573521018028259,.703539967536926],[.57683801651001,.711845993995667],[.581691026687622,.720062971115112],[.609944999217987,.639909982681274],[.986046016216278,.560034036636353],[.5867999792099,.69539999961853],[.590372025966644,.701822996139526],[.531915009021759,.601536989212036],[.577268004417419,.585934996604919],[.536915004253387,.593786001205444],[.627542972564697,.473352015018463],[.665585994720459,.495950996875763],[.588353991508484,.546862006187439],[.757824003696442,.14767599105835],[.709249973297119,.201507985591888],[.672684013843536,.256581008434296],[.600408971309662,.74900496006012],[.55826598405838,.261672019958496],[.570303976535797,.187870979309082],[.588165998458862,.109044015407562],[.711045026779175,.398952007293701],[.781069993972778,.435405015945435],[.587247014045715,.398931980133057],[.742869973182678,.355445981025696],[.572156012058258,.437651991844177],[.55186802148819,.536570012569427],[.821442008018494,.457556009292603],[.752701997756958,.457181990146637],[.71375697851181,.467626988887787],[.66711300611496,.460672974586487],[.631101012229919,.447153985500336],[.6008620262146,.432473003864288],[.523481011390686,.405627012252808],[.810747981071472,.523926019668579],[.771045982837677,.348959028720856],[.509127020835876,.562718033790588],[.595292985439301,.485023975372314],[.980530977249146,.401564002037048],[.573499977588654,.420000016689301],[.602994978427887,.548687994480133],[.733529984951019,.376977026462555],[.560611009597778,.519016981124878],[.967685997486115,.644356966018677],[.580985009670258,.387160003185272],[.537728011608124,.505385041236877],[.760966002941132,.779752969741821],[.801778972148895,.831938028335571],[.892440974712372,.54076099395752],[.816350996494293,.740260004997253],[.865594983100891,.333687007427216],[.614073991775513,.883246004581451],[.508952975273132,.579437971115112],[.617941975593567,.508316040039062],[.825608015060425,.397674977779388],[.681214988231659,.39623498916626],[.656635999679565,.400596976280212],[.603900015354156,.710216999053955],[.81208598613739,.588539004325867],[.56801301240921,.944564998149872],[.681007981300354,.898285031318665],[.733752012252808,.869701027870178],[.633830010890961,.398822009563446],[.606792986392975,.39553701877594],[.589659988880157,.391062021255493],[.805015981197357,.342108011245728],[.611334979534149,.362284004688263],[.634037971496582,.355970978736877],[.656635999679565,.355356991291046],[.681214988231659,.35834002494812],[.698584973812103,.363156020641327],[.941866993904114,.319076001644135],[.698584973812103,.387449026107788],[.584177017211914,.624107003211975],[.554318010807037,.566076993942261],[.534153997898102,.62064003944397],[.711217999458313,.819975018501282],[.664629995822906,.852871000766754],[.559099972248077,.902631998062134],[.871706008911133,.791940987110138],[.591234028339386,.373893976211548],[.544341027736664,.451583981513977],[.624562978744507,.924192011356354],[.88577002286911,.615028977394104],[.551338016986847,.695277988910675],[.551980018615723,.704632043838501],[.552887976169586,.715808033943176],[.555167973041534,.730794012546539],[.569944024085999,.767035007476807],[.593203008174896,.685675978660583],[.599261999130249,.681069016456604],[.607599973678589,.677703022956848],[.631937980651855,.663500010967255],[.752032995223999,.601315021514893],[.547226011753082,.420395016670227],[.563543975353241,.359827995300293],[.583841025829315,.368713974952698],[.586614012718201,.692366003990173],[.771915018558502,.683578014373779],[.531597018241882,.352482974529266],[.588370978832245,.804440975189209],[.52079701423645,.442565023899078],[.567984998226166,.493479013442993],[.543282985687256,.819254994392395],[.655317008495331,.745514988899231],[.621008992195129,.574018001556396],[.625559985637665,.78031200170517],[.680198013782501,.570719003677368],[.64276397228241,.604337990283966],[.704662978649139,.621529996395111],[.552012026309967,.862591981887817],[.589071989059448,.508637011051178],[.685944974422455,.775357007980347],[.645735025405884,.812640011310577],[.675342977046967,.703978002071381],[.810858011245728,.646304965019226],[.72012197971344,.714666962623596],[.866151988506317,.682704985141754],[.663187026977539,.644596993923187],[.570082008838654,.466325998306274],[.544561982154846,.548375964164734],[.562758982181549,.558784961700439],[.531987011432648,.530140042304993],[.585271000862122,.335177004337311],[.622952997684479,.32277899980545],[.655896008014679,.320163011550903],[.687132000923157,.322345972061157],[.716481983661652,.333200991153717],[.758756995201111,.382786989212036],[.897013008594513,.468769013881683],[.732392013072968,.424547016620636],[.70211398601532,.433162987232208],[.66652500629425,.433866024017334],[.633504986763,.426087975502014],[.603875994682312,.416586995124817],[.579657971858978,.409945011138916],[.992439985275269,.480777025222778],[.567192018032074,.569419980049133],[.54136598110199,.478899002075195],[.526564002037048,.546118021011353],[.523913025856018,.563830018043518],[.531529009342194,.555056989192963],[.566035985946655,.582329034805298],[.51631098985672,.563053965568542],[.5174720287323,.577877044677734],[.573594987392426,.389806985855103],[.560697972774506,.395331978797913],[.549755990505219,.399751007556915],[.710287988185883,.368252992630005],[.723330020904541,.363372981548309]],Ml=[127,34,139,11,0,37,232,231,120,72,37,39,128,121,47,232,121,128,104,69,67,175,171,148,157,154,155,118,50,101,73,39,40,9,151,108,48,115,131,194,204,211,74,40,185,80,42,183,40,92,186,230,229,118,202,212,214,83,18,17,76,61,146,160,29,30,56,157,173,106,204,194,135,214,192,203,165,98,21,71,68,51,45,4,144,24,23,77,146,91,205,50,187,201,200,18,91,106,182,90,91,181,85,84,17,206,203,36,148,171,140,92,40,39,193,189,244,159,158,28,247,246,161,236,3,196,54,68,104,193,168,8,117,228,31,189,193,55,98,97,99,126,47,100,166,79,218,155,154,26,209,49,131,135,136,150,47,126,217,223,52,53,45,51,134,211,170,140,67,69,108,43,106,91,230,119,120,226,130,247,63,53,52,238,20,242,46,70,156,78,62,96,46,53,63,143,34,227,173,155,133,123,117,111,44,125,19,236,134,51,216,206,205,154,153,22,39,37,167,200,201,208,36,142,100,57,212,202,20,60,99,28,158,157,35,226,113,160,159,27,204,202,210,113,225,46,43,202,204,62,76,77,137,123,116,41,38,72,203,129,142,64,98,240,49,102,64,41,73,74,212,216,207,42,74,184,169,170,211,170,149,176,105,66,69,122,6,168,123,147,187,96,77,90,65,55,107,89,90,180,101,100,120,63,105,104,93,137,227,15,86,85,129,102,49,14,87,86,55,8,9,100,47,121,145,23,22,88,89,179,6,122,196,88,95,96,138,172,136,215,58,172,115,48,219,42,80,81,195,3,51,43,146,61,171,175,199,81,82,38,53,46,225,144,163,110,246,33,7,52,65,66,229,228,117,34,127,234,107,108,69,109,108,151,48,64,235,62,78,191,129,209,126,111,35,143,163,161,246,117,123,50,222,65,52,19,125,141,221,55,65,3,195,197,25,7,33,220,237,44,70,71,139,122,193,245,247,130,33,71,21,162,153,158,159,170,169,150,188,174,196,216,186,92,144,160,161,2,97,167,141,125,241,164,167,37,72,38,12,145,159,160,38,82,13,63,68,71,226,35,111,158,153,154,101,50,205,206,92,165,209,198,217,165,167,97,220,115,218,133,112,243,239,238,241,214,135,169,190,173,133,171,208,32,125,44,237,86,87,178,85,86,179,84,85,180,83,84,181,201,83,182,137,93,132,76,62,183,61,76,184,57,61,185,212,57,186,214,207,187,34,143,156,79,239,237,123,137,177,44,1,4,201,194,32,64,102,129,213,215,138,59,166,219,242,99,97,2,94,141,75,59,235,24,110,228,25,130,226,23,24,229,22,23,230,26,22,231,112,26,232,189,190,243,221,56,190,28,56,221,27,28,222,29,27,223,30,29,224,247,30,225,238,79,20,166,59,75,60,75,240,147,177,215,20,79,166,187,147,213,112,233,244,233,128,245,128,114,188,114,217,174,131,115,220,217,198,236,198,131,134,177,132,58,143,35,124,110,163,7,228,110,25,356,389,368,11,302,267,452,350,349,302,303,269,357,343,277,452,453,357,333,332,297,175,152,377,384,398,382,347,348,330,303,304,270,9,336,337,278,279,360,418,262,431,304,408,409,310,415,407,270,409,410,450,348,347,422,430,434,313,314,17,306,307,375,387,388,260,286,414,398,335,406,418,364,367,416,423,358,327,251,284,298,281,5,4,373,374,253,307,320,321,425,427,411,421,313,18,321,405,406,320,404,405,315,16,17,426,425,266,377,400,369,322,391,269,417,465,464,386,257,258,466,260,388,456,399,419,284,332,333,417,285,8,346,340,261,413,441,285,327,460,328,355,371,329,392,439,438,382,341,256,429,420,360,364,394,379,277,343,437,443,444,283,275,440,363,431,262,369,297,338,337,273,375,321,450,451,349,446,342,467,293,334,282,458,461,462,276,353,383,308,324,325,276,300,293,372,345,447,382,398,362,352,345,340,274,1,19,456,248,281,436,427,425,381,256,252,269,391,393,200,199,428,266,330,329,287,273,422,250,462,328,258,286,384,265,353,342,387,259,257,424,431,430,342,353,276,273,335,424,292,325,307,366,447,345,271,303,302,423,266,371,294,455,460,279,278,294,271,272,304,432,434,427,272,407,408,394,430,431,395,369,400,334,333,299,351,417,168,352,280,411,325,319,320,295,296,336,319,403,404,330,348,349,293,298,333,323,454,447,15,16,315,358,429,279,14,15,316,285,336,9,329,349,350,374,380,252,318,402,403,6,197,419,318,319,325,367,364,365,435,367,397,344,438,439,272,271,311,195,5,281,273,287,291,396,428,199,311,271,268,283,444,445,373,254,339,263,466,249,282,334,296,449,347,346,264,447,454,336,296,299,338,10,151,278,439,455,292,407,415,358,371,355,340,345,372,390,249,466,346,347,280,442,443,282,19,94,370,441,442,295,248,419,197,263,255,359,440,275,274,300,383,368,351,412,465,263,467,466,301,368,389,380,374,386,395,378,379,412,351,419,436,426,322,373,390,388,2,164,393,370,462,461,164,0,267,302,11,12,374,373,387,268,12,13,293,300,301,446,261,340,385,384,381,330,266,425,426,423,391,429,355,437,391,327,326,440,457,438,341,382,362,459,457,461,434,430,394,414,463,362,396,369,262,354,461,457,316,403,402,315,404,403,314,405,404,313,406,405,421,418,406,366,401,361,306,408,407,291,409,408,287,410,409,432,436,410,434,416,411,264,368,383,309,438,457,352,376,401,274,275,4,421,428,262,294,327,358,433,416,367,289,455,439,462,370,326,2,326,370,305,460,455,254,449,448,255,261,446,253,450,449,252,451,450,256,452,451,341,453,452,413,464,463,441,413,414,258,442,441,257,443,442,259,444,443,260,445,444,467,342,445,459,458,250,289,392,290,290,328,460,376,433,435,250,290,392,411,416,433,341,463,464,453,464,465,357,465,412,343,412,399,360,363,440,437,399,456,420,456,363,401,435,288,372,383,353,339,255,249,448,261,255,133,243,190,133,155,112,33,246,247,33,130,25,398,384,286,362,398,414,362,463,341,263,359,467,263,249,255,466,467,260,75,60,166,238,239,79,162,127,139,72,11,37,121,232,120,73,72,39,114,128,47,233,232,128,103,104,67,152,175,148,173,157,155,119,118,101,74,73,40,107,9,108,49,48,131,32,194,211,184,74,185,191,80,183,185,40,186,119,230,118,210,202,214,84,83,17,77,76,146,161,160,30,190,56,173,182,106,194,138,135,192,129,203,98,54,21,68,5,51,4,145,144,23,90,77,91,207,205,187,83,201,18,181,91,182,180,90,181,16,85,17,205,206,36,176,148,140,165,92,39,245,193,244,27,159,28,30,247,161,174,236,196,103,54,104,55,193,8,111,117,31,221,189,55,240,98,99,142,126,100,219,166,218,112,155,26,198,209,131,169,135,150,114,47,217,224,223,53,220,45,134,32,211,140,109,67,108,146,43,91,231,230,120,113,226,247,105,63,52,241,238,242,124,46,156,95,78,96,70,46,63,116,143,227,116,123,111,1,44,19,3,236,51,207,216,205,26,154,22,165,39,167,199,200,208,101,36,100,43,57,202,242,20,99,56,28,157,124,35,113,29,160,27,211,204,210,124,113,46,106,43,204,96,62,77,227,137,116,73,41,72,36,203,142,235,64,240,48,49,64,42,41,74,214,212,207,183,42,184,210,169,211,140,170,176,104,105,69,193,122,168,50,123,187,89,96,90,66,65,107,179,89,180,119,101,120,68,63,104,234,93,227,16,15,85,209,129,49,15,14,86,107,55,9,120,100,121,153,145,22,178,88,179,197,6,196,89,88,96,135,138,136,138,215,172,218,115,219,41,42,81,5,195,51,57,43,61,208,171,199,41,81,38,224,53,225,24,144,110,105,52,66,118,229,117,227,34,234,66,107,69,10,109,151,219,48,235,183,62,191,142,129,126,116,111,143,7,163,246,118,117,50,223,222,52,94,19,141,222,221,65,196,3,197,45,220,44,156,70,139,188,122,245,139,71,162,145,153,159,149,170,150,122,188,196,206,216,92,163,144,161,164,2,167,242,141,241,0,164,37,11,72,12,144,145,160,12,38,13,70,63,71,31,226,111,157,158,154,36,101,205,203,206,165,126,209,217,98,165,97,237,220,218,237,239,241,210,214,169,140,171,32,241,125,237,179,86,178,180,85,179,181,84,180,182,83,181,194,201,182,177,137,132,184,76,183,185,61,184,186,57,185,216,212,186,192,214,187,139,34,156,218,79,237,147,123,177,45,44,4,208,201,32,98,64,129,192,213,138,235,59,219,141,242,97,97,2,141,240,75,235,229,24,228,31,25,226,230,23,229,231,22,230,232,26,231,233,112,232,244,189,243,189,221,190,222,28,221,223,27,222,224,29,223,225,30,224,113,247,225,99,60,240,213,147,215,60,20,166,192,187,213,243,112,244,244,233,245,245,128,188,188,114,174,134,131,220,174,217,236,236,198,134,215,177,58,156,143,124,25,110,7,31,228,25,264,356,368,0,11,267,451,452,349,267,302,269,350,357,277,350,452,357,299,333,297,396,175,377,381,384,382,280,347,330,269,303,270,151,9,337,344,278,360,424,418,431,270,304,409,272,310,407,322,270,410,449,450,347,432,422,434,18,313,17,291,306,375,259,387,260,424,335,418,434,364,416,391,423,327,301,251,298,275,281,4,254,373,253,375,307,321,280,425,411,200,421,18,335,321,406,321,320,405,314,315,17,423,426,266,396,377,369,270,322,269,413,417,464,385,386,258,248,456,419,298,284,333,168,417,8,448,346,261,417,413,285,326,327,328,277,355,329,309,392,438,381,382,256,279,429,360,365,364,379,355,277,437,282,443,283,281,275,363,395,431,369,299,297,337,335,273,321,348,450,349,359,446,467,283,293,282,250,458,462,300,276,383,292,308,325,283,276,293,264,372,447,346,352,340,354,274,19,363,456,281,426,436,425,380,381,252,267,269,393,421,200,428,371,266,329,432,287,422,290,250,328,385,258,384,446,265,342,386,387,257,422,424,430,445,342,276,422,273,424,306,292,307,352,366,345,268,271,302,358,423,371,327,294,460,331,279,294,303,271,304,436,432,427,304,272,408,395,394,431,378,395,400,296,334,299,6,351,168,376,352,411,307,325,320,285,295,336,320,319,404,329,330,349,334,293,333,366,323,447,316,15,315,331,358,279,317,14,316,8,285,9,277,329,350,253,374,252,319,318,403,351,6,419,324,318,325,397,367,365,288,435,397,278,344,439,310,272,311,248,195,281,375,273,291,175,396,199,312,311,268,276,283,445,390,373,339,295,282,296,448,449,346,356,264,454,337,336,299,337,338,151,294,278,455,308,292,415,429,358,355,265,340,372,388,390,466,352,346,280,295,442,282,354,19,370,285,441,295,195,248,197,457,440,274,301,300,368,417,351,465,251,301,389,385,380,386,394,395,379,399,412,419,410,436,322,387,373,388,326,2,393,354,370,461,393,164,267,268,302,12,386,374,387,312,268,13,298,293,301,265,446,340,380,385,381,280,330,425,322,426,391,420,429,437,393,391,326,344,440,438,458,459,461,364,434,394,428,396,262,274,354,457,317,316,402,316,315,403,315,314,404,314,313,405,313,421,406,323,366,361,292,306,407,306,291,408,291,287,409,287,432,410,427,434,411,372,264,383,459,309,457,366,352,401,1,274,4,418,421,262,331,294,358,435,433,367,392,289,439,328,462,326,94,2,370,289,305,455,339,254,448,359,255,446,254,253,449,253,252,450,252,256,451,256,341,452,414,413,463,286,441,414,286,258,441,258,257,442,257,259,443,259,260,444,260,467,445,309,459,250,305,289,290,305,290,460,401,376,435,309,250,392,376,411,433,453,341,464,357,453,465,343,357,412,437,343,399,344,360,440,420,437,456,360,420,363,361,401,288,265,372,353,390,339,249,339,448,255];var H2e=[127,234,132,58,172,150,149,148,152,377,378,379,397,288,361,454,356,70,63,105,66,107,336,296,334,293,300,168,6,195,4,98,97,2,326,327,33,160,158,133,153,144,362,385,387,263,373,380,57,40,37,0,267,270,287,321,314,17,84,91,78,81,13,311,308,402,14,178],j2e=[33,133,362,263,1,62,308,159,145,386,374,6,102,331,2,13,14,70,105,107,336,334,300,54,10,284,50,280,234,454,58,288,152],q2e=[33,133,362,263,1,78,308],O1e=H2e.map(e=>zp[e]),M1e=j2e.map(e=>zp[e]),z1e=q2e.map(e=>zp[e]);var Lp=e=>[Math.abs(e.endPoint[0]-e.startPoint[0]),Math.abs(e.endPoint[1]-e.startPoint[1])],g0=e=>[e.startPoint[0]+(e.endPoint[0]-e.startPoint[0])/2,e.startPoint[1]+(e.endPoint[1]-e.startPoint[1])/2],lb=(e,t)=>e?[Math.trunc(Math.max(0,e.startPoint[0])),Math.trunc(Math.max(0,e.startPoint[1])),Math.trunc(Math.min(t.shape[2]||0,e.endPoint[0])-Math.max(0,e.startPoint[0])),Math.trunc(Math.min(t.shape[1]||0,e.endPoint[1])-Math.max(0,e.startPoint[1]))]:[0,0,0,0],ub=(e,t)=>e?[e.startPoint[0]/(t.shape[2]||0),e.startPoint[1]/(t.shape[1]||0),(e.endPoint[0]-e.startPoint[0])/(t.shape[2]||0),(e.endPoint[1]-e.startPoint[1])/(t.shape[1]||0)]:[0,0,0,0],W8=(e,t)=>{let n=[e.startPoint[0]*t[0],e.startPoint[1]*t[1]],s=[e.endPoint[0]*t[0],e.endPoint[1]*t[1]];return{startPoint:n,endPoint:s,landmarks:e.landmarks,confidence:e.confidence}},cb=(e,t,n)=>{let s=t.shape[1],r=t.shape[2],a=Se.cropAndResize(t,[[e.startPoint[1]/s,e.startPoint[0]/r,e.endPoint[1]/s,e.endPoint[0]/r]],[0],n),o=de(a,Xe.tf255);return te(a),o},Bp=(e,t)=>{let n=g0(e),s=Lp(e),r=[t*s[0]/2,t*s[1]/2];return{startPoint:[n[0]-r[0],n[1]-r[1]],endPoint:[n[0]+r[0],n[1]+r[1]],landmarks:e.landmarks,confidence:e.confidence}},Wp=e=>{let t=g0(e),n=Lp(e),s=Math.max(...n)/2;return{startPoint:[Math.round(t[0]-s),Math.round(t[1]-s)],endPoint:[Math.round(t[0]+s),Math.round(t[1]+s)],landmarks:e.landmarks,confidence:e.confidence}},y0=e=>{let t=e.map(s=>s[0]),n=e.map(s=>s[1]);return{startPoint:[Math.min(...t),Math.min(...n)],endPoint:[Math.max(...t),Math.max(...n)],landmarks:e}},db=[[1,0,0],[0,1,0],[0,0,1]],X2e=e=>e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI)),K2e=(e,t)=>X2e(Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]));var V8=(e,t)=>[[1,0,e],[0,1,t],[0,0,1]],zl=(e,t)=>{let n=0;for(let s=0;s{let n=[];for(let s=0;s{let n=[],s=e.length;for(let r=0;r{let n=Math.cos(e),s=Math.sin(e),r=[[n,-s,0],[s,n,0],[0,0,1]],a=V8(t[0],t[1]),o=U8(a,r),i=V8(-t[0],-t[1]);return U8(o,i)},Y2e=e=>{let t=[[e[0][0],e[1][0]],[e[0][1],e[1][1]]],n=[e[0][2],e[1][2]],s=[-zl(t[0],n),-zl(t[1],n)];return[t[0].concat(s[0]),t[1].concat(s[1]),[0,0,1]]},J2e=(e,t)=>[zl(e,t[0]),zl(e,t[1])];function H8(e){let t={strides:[e/16,e/8],anchors:[2,6]},n=[];for(let s=0;s[a[0]/r*(p[0]-r/2),a[1]/r*(p[1]-r/2),p[2]||0]),i=n&&n!==0&&Math.abs(n)>.2,l=i?G8(n,[0,0]):db,c=i?o.map(p=>[...J2e(p,l),p[2]]):o,u=i?Y2e(s):db,d=[...g0({startPoint:t.startPoint,endPoint:t.endPoint}),1];return c.map(p=>[Math.round(p[0]+zl(d,u[0])),Math.round(p[1]+zl(d,u[1])),Math.round(p[2]||0)])}function pb(e,t,n,s){let r=t.landmarks.length>=ob.count?ob.symmetryLine:Mp.symmetryLine,a=0,o=db,i;if(e&&pe.kernels.includes("rotatewithoffset"))if(a=K2e(t.landmarks[r[0]],t.landmarks[r[1]]),a&&a!==0&&Math.abs(a)>.2){let c=g0({startPoint:t.startPoint,endPoint:t.endPoint}),u=[c[0]/n.shape[2],c[1]/n.shape[1]],d=Se.rotateWithOffset(n,a,0,u);o=G8(-a,c),i=cb(t,d,[s,s]),te(d)}else i=cb(t,n,[s,s]);else i=cb(t,n,[s,s]);return[a,o,i]}var q8=6,Us,X8=null,Yo=0,Vp=null,A0=()=>Yo;async function K8(e){var t,n;return pe.initial&&(Us=null),Us?e.debug&&J("cached model:",Us.modelUrl):(Us=await Be(We(e.modelBasePath,((t=e.face.detector)==null?void 0:t.modelPath)||"")),!Us||!Us.modelUrl?J("load model failed:",(n=e.face.detector)==null?void 0:n.modelPath):e.debug&&J("load model:",Us.modelUrl)),Yo=Us.inputs[0].shape?Us.inputs[0].shape[2]:0,Vp=Ce(Yo,"int32"),X8=fr(H8(Yo)),Us}function Q2e(e){let t={};t.boxStarts=Pe(e,[0,1],[-1,2]),t.centers=ue(t.boxStarts,X8),t.boxSizes=Pe(e,[0,3],[-1,2]),t.boxSizesNormalized=de(t.boxSizes,Vp),t.centersNormalized=de(t.centers,Vp),t.halfBoxSize=de(t.boxSizesNormalized,Xe.tf2),t.starts=he(t.centersNormalized,t.halfBoxSize),t.ends=ue(t.centersNormalized,t.halfBoxSize),t.startNormalized=L(t.starts,Vp),t.endNormalized=L(t.ends,Vp);let n=Vu([t.startNormalized,t.endNormalized],1);return Object.keys(t).forEach(s=>te(t[s])),n}async function Z8(e,t){var i,l,c,u;if(!e||e.isDisposedInternal||e.shape.length!==4||e.shape[1]<1||e.shape[2]<1)return{boxes:[]};let n={};n.resized=Se.resizeBilinear(e,[Yo,Yo]),n.div=de(n.resized,Xe.tf127),n.normalized=he(n.div,Xe.tf05);let s=Us==null?void 0:Us.execute(n.normalized);if(Array.isArray(s)){let d=s.sort((p,h)=>p.size-h.size);n.concat384=St([d[0],d[2]],2),n.concat512=St([d[1],d[3]],2),n.concat=St([n.concat512,n.concat384],1),n.batch=rt(n.concat,0)}else n.batch=rt(s);te(s),n.boxes=Q2e(n.batch),n.logits=Pe(n.batch,[0,0],[-1,1]),n.sigmoid=as(n.logits),n.scores=rt(n.sigmoid),n.nms=await Se.nonMaxSuppressionAsync(n.boxes,n.scores,((i=t.face.detector)==null?void 0:i.maxDetected)||0,((l=t.face.detector)==null?void 0:l.iouThreshold)||0,((c=t.face.detector)==null?void 0:c.minConfidence)||0);let r=await n.nms.array(),a=[],o=await n.scores.data();for(let d=0;d(((u=t.face.detector)==null?void 0:u.minConfidence)||0)){let h={};h.bbox=Pe(n.boxes,[r[d],0],[1,-1]),h.slice=Pe(n.batch,[r[d],q8-1],[1,-1]),h.squeeze=rt(h.slice),h.landmarks=H(h.squeeze,[q8,-1]);let f=await h.bbox.data();a.push({startPoint:[f[0],f[1]],endPoint:[f[2],f[3]],landmarks:await h.landmarks.array(),confidence:p}),Object.keys(h).forEach(m=>te(h[m]))}}return Object.keys(n).forEach(d=>te(n[d])),{boxes:a,scaleFactor:[e.shape[2]/Yo,e.shape[1]/Yo]}}var mb={};ed(mb,{connected:()=>fb,kpt:()=>hb});var hb=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftPinky","rightPinky","leftIndex","rightIndex","leftThumb","rightThumb","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle","leftHeel","rightHeel","leftFoot","rightFoot","bodyCenter","bodyTop","leftPalm","leftHand","rightPalm","rightHand"],fb={leftLeg:["leftHip","leftKnee","leftAnkle","leftHeel","leftFoot"],rightLeg:["rightHip","rightKnee","rightAnkle","rightHeel","rightFoot"],torso:["leftShoulder","rightShoulder","rightHip","leftHip","leftShoulder","rightShoulder"],leftArm:["leftShoulder","leftElbow","leftWrist","leftPalm"],rightArm:["rightShoulder","rightElbow","rightWrist","rightPalm"],leftEye:["leftEyeInside","leftEye","leftEyeOutside"],rightEye:["rightEyeInside","rightEye","rightEyeOutside"],mouth:["leftMouth","rightMouth"]};var Y8=224,eye,tye=5,x0=[8,16,32,32,32];async function J8(){let e=[],t=0;for(;tn.x)),y:Ct(e.map(n=>n.y))}}function da(e,t=[1,1]){let n=[e.map(i=>i[0]),e.map(i=>i[1])],s=[Math.min(...n[0]),Math.min(...n[1])],r=[Math.max(...n[0]),Math.max(...n[1])],a=[s[0],s[1],r[0]-s[0],r[1]-s[1]],o=[a[0]/t[0],a[1]/t[1],a[2]/t[0],a[3]/t[1]];return{box:a,boxRaw:o}}function Q8(e,t=[1,1]){let n=[e.map(c=>c[0]),e.map(c=>c[1])],s=[Math.min(...n[0]),Math.min(...n[1])],r=[Math.max(...n[0]),Math.max(...n[1])],a=[(s[0]+r[0])/2,(s[1]+r[1])/2],o=Math.max(a[0]-s[0],a[1]-s[1],-a[0]+r[0],-a[1]+r[1]),i=[Math.trunc(a[0]-o),Math.trunc(a[1]-o),Math.trunc(2*o),Math.trunc(2*o)],l=[i[0]/t[0],i[1]/t[1],i[2]/t[0],i[3]/t[1]];return{box:i,boxRaw:l}}function b0(e,t){let n=[e[2]*t,e[3]*t];return[e[0]-(n[0]-e[2])/2,e[1]-(n[1]-e[3])/2,n[0],n[1]]}function gb(e){return[Math.max(0,e[1]),Math.max(0,e[0]),Math.min(1,e[3]+e[1]),Math.min(1,e[2]+e[0])]}var eT={initial:!0},pn={detector:null,landmarks:null},Ec={detector:[224,224],landmarks:[256,256]},yb=Number.MAX_SAFE_INTEGER,nye={landmarks:["ld_3d","activation_segmentation","activation_heatmap","world_3d","output_poseflag"],detector:[]},v0=null,Up,Jo=[[0,0],[0,0],[0,0],[0,0]],tT=0,nT=e=>1-1/(1+Math.exp(e));async function sT(e){if(eT.initial&&(pn.detector=null),!pn.detector&&e.body.detector&&e.body.detector.modelPath){pn.detector=await Be(We(e.modelBasePath,e.body.detector.modelPath||""));let t=Object.values(pn.detector.modelSignature.inputs);Ec.detector[0]=Array.isArray(t)?parseInt(t[0].tensorShape.dim[1].size):0,Ec.detector[1]=Array.isArray(t)?parseInt(t[0].tensorShape.dim[2].size):0,!pn.detector||!pn.detector.modelUrl?J("load model failed:",e.body.detector.modelPath):e.debug&&J("load model:",pn.detector.modelUrl)}else e.debug&&pn.detector&&J("cached model:",pn.detector.modelUrl);return await J8(),pn.detector}async function rT(e){if(eT.initial&&(pn.landmarks=null),pn.landmarks)e.debug&&J("cached model:",pn.landmarks.modelUrl);else{pn.landmarks=await Be(We(e.modelBasePath,e.body.modelPath||""));let t=Object.values(pn.landmarks.modelSignature.inputs);Ec.landmarks[0]=Array.isArray(t)?parseInt(t[0].tensorShape.dim[1].size):0,Ec.landmarks[1]=Array.isArray(t)?parseInt(t[0].tensorShape.dim[2].size):0,!pn.landmarks||!pn.landmarks.modelUrl?J("load model failed:",e.body.modelPath):e.debug&&J("load model:",pn.landmarks.modelUrl)}return pn.landmarks}async function sye(e,t){let n={};if(!e.shape||!e.shape[1]||!e.shape[2])return e;let s;if(Up&&(n.cropped=Se.cropAndResize(e,[Up],[0],[e.shape[1],e.shape[2]])),e.shape[1]!==e.shape[2]){let r=[e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0,e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0],a=[e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0,e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0];Jo=[[0,0],r,a,[0,0]],n.pad=Qs(n.cropped||e,Jo),n.resize=Se.resizeBilinear(n.pad,[t,t]),s=de(n.resize,Xe.tf255)}else e.shape[1]!==t?(n.resize=Se.resizeBilinear(n.cropped||e,[t,t]),s=de(n.resize,Xe.tf255)):s=de(n.cropped||e,Xe.tf255);return Object.keys(n).forEach(r=>te(n[r])),s}function rye(e,t){for(let n of e)n.position=[Math.trunc(n.position[0]*(t[0]+Jo[2][0]+Jo[2][1])/t[0]-Jo[2][0]),Math.trunc(n.position[1]*(t[1]+Jo[1][0]+Jo[1][1])/t[1]-Jo[1][0]),n.position[2]],n.positionRaw=[n.position[0]/t[0],n.position[1]/t[1],n.position[2]];if(Up)for(let n of e)n.positionRaw=[n.positionRaw[0]+Up[1],n.positionRaw[1]+Up[0],n.positionRaw[2]],n.position=[Math.trunc(n.positionRaw[0]*t[0]),Math.trunc(n.positionRaw[1]*t[1]),n.positionRaw[2]];return e}async function aye(e,t,n){var h;let s={};[s.ld,s.segmentation,s.heatmap,s.world,s.poseflag]=(h=pn.landmarks)==null?void 0:h.execute(e,nye.landmarks);let r=(await s.poseflag.data())[0],a=await s.ld.data();Object.keys(s).forEach(f=>te(s[f]));let o=[],i=5;for(let f=0;ff.position),u=da(c,[n[0],n[1]]),d={};for(let[f,m]of Object.entries(fb)){let g=[];for(let y=0;yb.part===m[y]),A=l.find(b=>b.part===m[y+1]);x&&A&&g.push([x.position,A.position])}d[f]=g}return{id:0,score:Math.trunc(100*r)/100,box:u.box,boxRaw:u.boxRaw,keypoints:l,annotations:d}}async function Ab(e,t){let n=[e.shape[2]||0,e.shape[1]||0],s=(t.body.skipTime||0)>ie()-tT,r=yb<(t.body.skipFrames||0);if(t.skipAllowed&&s&&r&&v0!==null)yb++;else{let a={};a.landmarks=await sye(e,256),v0=await aye(a.landmarks,t,n),Object.keys(a).forEach(o=>te(a[o])),tT=ie(),yb=0}return v0?[v0]:[]}var Rc=[{class:1,label:"person"},{class:2,label:"bicycle"},{class:3,label:"car"},{class:4,label:"motorcycle"},{class:5,label:"airplane"},{class:6,label:"bus"},{class:7,label:"train"},{class:8,label:"truck"},{class:9,label:"boat"},{class:10,label:"traffic light"},{class:11,label:"fire hydrant"},{class:12,label:"stop sign"},{class:13,label:"parking meter"},{class:14,label:"bench"},{class:15,label:"bird"},{class:16,label:"cat"},{class:17,label:"dog"},{class:18,label:"horse"},{class:19,label:"sheep"},{class:20,label:"cow"},{class:21,label:"elephant"},{class:22,label:"bear"},{class:23,label:"zebra"},{class:24,label:"giraffe"},{class:25,label:"backpack"},{class:26,label:"umbrella"},{class:27,label:"handbag"},{class:28,label:"tie"},{class:29,label:"suitcase"},{class:30,label:"frisbee"},{class:31,label:"skis"},{class:32,label:"snowboard"},{class:33,label:"sports ball"},{class:34,label:"kite"},{class:35,label:"baseball bat"},{class:36,label:"baseball glove"},{class:37,label:"skateboard"},{class:38,label:"surfboard"},{class:39,label:"tennis racket"},{class:40,label:"bottle"},{class:41,label:"wine glass"},{class:42,label:"cup"},{class:43,label:"fork"},{class:44,label:"knife"},{class:45,label:"spoon"},{class:46,label:"bowl"},{class:47,label:"banana"},{class:48,label:"apple"},{class:49,label:"sandwich"},{class:50,label:"orange"},{class:51,label:"broccoli"},{class:52,label:"carrot"},{class:53,label:"hot dog"},{class:54,label:"pizza"},{class:55,label:"donut"},{class:56,label:"cake"},{class:57,label:"chair"},{class:58,label:"couch"},{class:59,label:"potted plant"},{class:60,label:"bed"},{class:61,label:"dining table"},{class:62,label:"toilet"},{class:63,label:"tv"},{class:64,label:"laptop"},{class:65,label:"mouse"},{class:66,label:"remote"},{class:67,label:"keyboard"},{class:68,label:"cell phone"},{class:69,label:"microwave"},{class:70,label:"oven"},{class:71,label:"toaster"},{class:72,label:"sink"},{class:73,label:"refrigerator"},{class:74,label:"book"},{class:75,label:"clock"},{class:76,label:"vase"},{class:77,label:"scissors"},{class:78,label:"teddy bear"},{class:79,label:"hair drier"},{class:80,label:"toothbrush"}];var ir,Ll=0,xb=[],aT=0,bb=Number.MAX_SAFE_INTEGER;async function oT(e){if(pe.initial&&(ir=null),ir)e.debug&&J("cached model:",ir.modelUrl);else{ir=await Be(We(e.modelBasePath,e.object.modelPath||""));let t=Object.values(ir.modelSignature.inputs);Ll=Array.isArray(t)?parseInt(t[0].tensorShape.dim[2].size):0,!ir||!ir.modelUrl?J("load model failed:",e.object.modelPath):e.debug&&J("load model:",ir.modelUrl)}return ir}async function oye(e,t,n){if(!e)return[];let s={},r=[],a=await e.array();s.squeeze=rt(e);let o=Yt(s.squeeze,6,1);s.stack=an([o[1],o[0],o[3],o[2]],1),s.boxes=rt(s.stack),s.scores=rt(o[4]),s.classes=rt(o[5]),te([e,...o]),s.nms=await Se.nonMaxSuppressionAsync(s.boxes,s.scores,n.object.maxDetected,n.object.iouThreshold,n.object.minConfidence);let i=await s.nms.data(),l=0;for(let c of Array.from(i)){let u=Math.trunc(100*a[0][c][4])/100,d=a[0][c][5],p=Rc[d].label,[h,f]=[a[0][c][0]/Ll,a[0][c][1]/Ll],m=[h,f,a[0][c][2]/Ll-h,a[0][c][3]/Ll-f],g=[Math.trunc(m[0]*t[0]),Math.trunc(m[1]*t[1]),Math.trunc(m[2]*t[0]),Math.trunc(m[3]*t[1])];r.push({id:l++,score:u,class:d,label:p,box:g,boxRaw:m})}return Object.keys(s).forEach(c=>te(s[c])),r}async function vb(e,t){let n=(t.object.skipTime||0)>ie()-aT,s=bb<(t.object.skipFrames||0);return t.skipAllowed&&n&&s&&xb.length>0?(bb++,xb):(bb=0,new Promise(async r=>{let a=[e.shape[2],e.shape[1]],o=Se.resizeBilinear(e,[Ll,Ll]),i=t.object.enabled?ir==null?void 0:ir.execute(o,["tower_0/detections"]):null;aT=ie(),te(o);let l=await oye(i,a,t);xb=l,r(l)}))}var Sb={};ed(Sb,{connected:()=>kb,kpt:()=>wb});var wb=["head","neck","rightShoulder","rightElbow","rightWrist","chest","leftShoulder","leftElbow","leftWrist","bodyCenter","rightHip","rightKnee","rightAnkle","leftHip","leftKnee","leftAnkle"],kb={leftLeg:["leftHip","leftKnee","leftAnkle"],rightLeg:["rightHip","rightKnee","rightAnkle"],torso:["leftShoulder","rightShoulder","rightHip","leftHip","leftShoulder"],leftArm:["leftShoulder","leftElbow","leftWrist"],rightArm:["rightShoulder","rightElbow","rightWrist"],head:[]};var hn,iT=0,Kn={id:0,keypoints:[],box:[0,0,0,0],boxRaw:[0,0,0,0],score:0,annotations:{}},Ib=Number.MAX_SAFE_INTEGER;async function lT(e){return pe.initial&&(hn=null),hn?e.debug&&J("cached model:",hn.modelUrl):(hn=await Be(We(e.modelBasePath,e.body.modelPath||"")),!hn||!hn.modelUrl?J("load model failed:",e.body.modelPath):e.debug&&J("load model:",hn.modelUrl)),hn}async function iye(e,t){let[n,s]=e.shape,r=H(e,[s*n]),a=An(r,0),o=(await a.data())[0];if(te([r,a]),o>t){let i=Fs(r,0),l=Gd(i,n),c=(await l.data())[0],u=de(i,Ce(n,"int32")),d=(await u.data())[0];return te([l,u]),[c,d,o]}return[0,0,o]}async function Cb(e,t){let n=(t.body.skipTime||0)>ie()-iT,s=Ib<(t.body.skipFrames||0);return t.skipAllowed&&n&&s&&Object.keys(Kn.keypoints).length>0?(Ib++,[Kn]):(Ib=0,new Promise(async r=>{var d;let a=K(()=>{if(!(hn==null?void 0:hn.inputs[0].shape))return null;let p=Se.resizeBilinear(e,[hn.inputs[0].shape[2],hn.inputs[0].shape[1]],!1),h=L(p,Xe.tf2);return he(h,Xe.tf1)}),o;if(t.body.enabled&&(o=hn==null?void 0:hn.execute(a)),iT=ie(),te(a),o){Kn.keypoints.length=0;let p=o.squeeze();te(o);let h=p.unstack(2);te(p);for(let f=0;f(((d=t.body)==null?void 0:d.minConfidence)||0)&&Kn.keypoints.push({score:Math.round(100*y)/100,part:wb[f],positionRaw:[m/hn.inputs[0].shape[2],g/hn.inputs[0].shape[1]],position:[Math.round(e.shape[2]*m/hn.inputs[0].shape[2]),Math.round(e.shape[1]*g/hn.inputs[0].shape[1])]})}h.forEach(f=>te(f))}Kn.score=Kn.keypoints.reduce((p,h)=>h.score>p?h.score:p,0);let i=Kn.keypoints.map(p=>p.position[0]),l=Kn.keypoints.map(p=>p.position[1]);Kn.box=[Math.min(...i),Math.min(...l),Math.max(...i)-Math.min(...i),Math.max(...l)-Math.min(...l)];let c=Kn.keypoints.map(p=>p.positionRaw[0]),u=Kn.keypoints.map(p=>p.positionRaw[1]);Kn.boxRaw=[Math.min(...c),Math.min(...u),Math.max(...c)-Math.min(...c),Math.max(...u)-Math.min(...u)];for(let[p,h]of Object.entries(kb)){let f=[];for(let m=0;mx.part===h[m]),y=Kn.keypoints.find(x=>x.part===h[m+1]);g&&y&&g.score>(t.body.minConfidence||0)&&y.score>(t.body.minConfidence||0)&&f.push([g.position,y.position])}Kn.annotations[p]=f}r([Kn])}))}var lye=["angry","disgust","fear","happy","sad","surprise","neutral"],Zn,w0=[],uT=0,cT=0,Tb=Number.MAX_SAFE_INTEGER;async function dT(e){var t,n;return pe.initial&&(Zn=null),Zn?e.debug&&J("cached model:",Zn.modelUrl):(Zn=await Be(We(e.modelBasePath,((t=e.face.emotion)==null?void 0:t.modelPath)||"")),!Zn||!Zn.modelUrl?J("load model failed:",(n=e.face.emotion)==null?void 0:n.modelPath):e.debug&&J("load model:",Zn.modelUrl)),Zn}async function Nb(e,t,n,s){var o,i;if(!Zn)return[];let r=Tb<(((o=t.face.emotion)==null?void 0:o.skipFrames)||0),a=(((i=t.face.emotion)==null?void 0:i.skipTime)||0)>ie()-cT;return t.skipAllowed&&a&&r&&uT===s&&w0[n]&&w0[n].length>0?(Tb++,w0[n]):(Tb=0,new Promise(async l=>{var u,d;let c=[];if((u=t.face.emotion)==null?void 0:u.enabled){let p={},h=(Zn==null?void 0:Zn.inputs[0].shape)?Zn.inputs[0].shape[2]:0;p.resize=Se.resizeBilinear(e,[h,h],!1),p.channels=L(p.resize,Xe.rgb),p.grayscale=we(p.channels,3,!0),p.grayscaleSub=he(p.grayscale,Xe.tf05),p.grayscaleMul=L(p.grayscaleSub,Xe.tf2),p.emotion=Zn==null?void 0:Zn.execute(p.grayscaleMul),cT=ie();let f=await p.emotion.data();for(let m=0;m(((d=t.face.emotion)==null?void 0:d.minConfidence)||0)&&c.push({score:Math.min(.99,Math.trunc(100*f[m])/100),emotion:lye[m]});c.sort((m,g)=>g.score-m.score),Object.keys(p).forEach(m=>te(p[m]))}w0[n]=c,uT=s,l(c)}))}var Is,Eb=[],pT=0,hT=0,fT=Number.MAX_SAFE_INTEGER;async function mT(e){let t=We(e.modelBasePath,e.face.mobilefacenet.modelPath);return pe.initial&&(Is=null),Is?e.debug&&J("cached model:",t):(Is=await Be(t),Is?e.debug&&J("load model:",t):J("load model failed:",e.face.mobilefacenet.modelPath)),Is}async function Rb(e,t,n,s){var o,i;if(!Is)return[];let r=fT<(((o=t.face.embedding)==null?void 0:o.skipFrames)||0),a=(((i=t.face.embedding)==null?void 0:i.skipTime)||0)>ie()-hT;return t.skipAllowed&&a&&r&&pT===s&&Eb[n]?(fT++,Eb[n]):new Promise(async l=>{var u;let c=[];if(((u=t.face.embedding)==null?void 0:u.enabled)&&(Is==null?void 0:Is.inputs[0].shape)){let d={};d.crop=Se.resizeBilinear(e,[Is.inputs[0].shape[2],Is.inputs[0].shape[1]],!1),d.data=Is==null?void 0:Is.execute(d.crop);let p=await d.data.data();c=Array.from(p)}Eb[n]=c,pT=s,hT=ie(),l(c)})}var lr,Qo=0,uye=2.3,_b=or.leftEyeLower0,$b=or.rightEyeLower0,_c={leftBounds:[_b[0],_b[_b.length-1]],rightBounds:[$b[0],$b[$b.length-1]]},$c={upperCenter:3,lowerCenter:4,index:71,numCoordinates:76};async function gT(e){var t,n;return pe.initial&&(lr=null),lr?e.debug&&J("cached model:",lr.modelUrl):(lr=await Be(We(e.modelBasePath,((t=e.face.iris)==null?void 0:t.modelPath)||"")),!lr||!lr.modelUrl?J("load model failed:",(n=e.face.iris)==null?void 0:n.modelPath):e.debug&&J("load model:",lr.modelUrl)),Qo=lr.inputs[0].shape?lr.inputs[0].shape[2]:0,Qo===-1&&(Qo=64),lr}function k0(e,t,n,s){for(let r=0;r{let t=e[_c.leftBounds[0]][2],n=e[_c.rightBounds[0]][2];return t-n},yT=(e,t,n,s,r,a=!1)=>{let o=Wp(Bp(y0([e[n],e[s]]),uye)),i=Lp(o),l=Se.cropAndResize(t,[[o.startPoint[1]/r,o.startPoint[0]/r,o.endPoint[1]/r,o.endPoint[0]/r]],[0],[Qo,Qo]);if(a&&pe.kernels.includes("flipleftright")){let c=Se.flipLeftRight(l);te(l),l=c}return{box:o,boxSize:i,crop:l}},AT=(e,t,n,s=!1)=>{let r=[];for(let a=0;a<$c.numCoordinates;a++){let o=e[a*3],i=e[a*3+1],l=e[a*3+2];r.push([(s?1-o/Qo:o/Qo)*n[0]+t.startPoint[0],i/Qo*n[1]+t.startPoint[1],l])}return{rawCoords:r,iris:r.slice($c.index)}},xT=(e,t,n)=>{let s=e[or[`${n}EyeUpper0`][$c.upperCenter]][2],r=e[or[`${n}EyeLower0`][$c.lowerCenter]][2],a=(s+r)/2;return t.map((o,i)=>{let l=a;return i===2?l=s:i===4&&(l=r),[o[0],o[1],l]})};async function bT(e,t,n,s){if(!lr)return n.debug&&J("face mesh iris detection requested, but model is not loaded"),e;let{box:r,boxSize:a,crop:o}=yT(e,t,_c.leftBounds[0],_c.leftBounds[1],s,!0),{box:i,boxSize:l,crop:c}=yT(e,t,_c.rightBounds[0],_c.rightBounds[1],s,!0),u=St([o,c]);te(o),te(c);let d=lr.execute(u);te(u);let p=await d.data();te(d);let h=p.slice(0,$c.numCoordinates*3),{rawCoords:f,iris:m}=AT(h,r,a,!0),g=p.slice($c.numCoordinates*3),{rawCoords:y,iris:x}=AT(g,i,l),A=cye(e);Math.abs(A)<30?(k0(e,f,"left",null),k0(e,y,"right",null)):A<1?k0(e,f,"left",["EyeUpper0","EyeLower0"]):k0(e,y,"right",["EyeUpper0","EyeLower0"]);let b=xT(e,m,"left"),w=xT(e,x,"right");return e.concat(b).concat(w)}var Dc=[],ur=null,Bl=0,Db=Number.MAX_SAFE_INTEGER,vT=0;async function wT(e,t){var i,l,c,u,d,p,h,f,m,g,y;let n=(((i=t.face.detector)==null?void 0:i.skipTime)||0)>ie()-vT,s=Db<(((l=t.face.detector)==null?void 0:l.skipFrames)||0);if(!t.skipAllowed||!n||!s||Dc.length===0){let x=await Z8(e,t);vT=ie(),Dc=[];for(let A of x.boxes){let b=W8(A,x.scaleFactor),w=(b.endPoint[0]-b.startPoint[0])/(e.shape[2]||1e3),k=(((c=t.face.detector)==null?void 0:c.cropFactor)||1.6)/(w+.75)/1.34,I=Bp(b,k),E=Wp(I);Dc.push(E)}Db=0}else Db++;let r=[],a=[],o=0;for(let x=0;x[X[0]/(e.shape[2]||0),X[1]/(e.shape[1]||0),(X[2]||0)/Bl]);for(let X of Object.keys(or))k.annotations[X]=or[X].map(z=>k.mesh[z]);let T=y0(k.mesh),O=Bp(T,((g=t.face.detector)==null?void 0:g.cropFactor)||1.6);A={...Wp(O),confidence:A.confidence},k.box=lb(A,e),k.boxRaw=ub(A,e),k.score=k.faceScore,a.push(A),te(k.tensor),[b,w,k.tensor]=pb((y=t.face.detector)==null?void 0:y.rotation,A,e,Bl)}}else{k.box=lb(A,e),k.boxRaw=ub(A,e),k.score=k.boxScore,k.mesh=A.landmarks.map(I=>[(A.startPoint[0]+A.endPoint[0])/2+(A.endPoint[0]+A.startPoint[0])*I[0]/A0(),(A.startPoint[1]+A.endPoint[1])/2+(A.endPoint[1]+A.startPoint[1])*I[1]/A0()]),k.meshRaw=k.mesh.map(I=>[I[0]/(e.shape[2]||0),I[1]/(e.shape[1]||0),(I[2]||0)/Bl]);for(let I of Object.keys(Mp))k.annotations[I]=[k.mesh[Mp[I]]]}r.push(k)}return Dc=[...a],r}async function kT(e){var t,n;return pe.initial&&(ur=null),ur?e.debug&&J("cached model:",ur.modelUrl):(ur=await Be(We(e.modelBasePath,((t=e.face.mesh)==null?void 0:t.modelPath)||"")),!ur||!ur.modelUrl?J("load model failed:",(n=e.face.mesh)==null?void 0:n.modelPath):e.debug&&J("load model:",ur.modelUrl)),Bl=ur.inputs[0].shape?ur.inputs[0].shape[2]:0,ur}var ST=Ml,IT=zp;var Cs,S0=[],CT=0,TT=0,Fb=Number.MAX_SAFE_INTEGER;async function NT(e){var n,s;let t=We(e.modelBasePath,((n=e.face.description)==null?void 0:n.modelPath)||"");return pe.initial&&(Cs=null),Cs?e.debug&&J("cached model:",t):(Cs=await Be(t),Cs?e.debug&&J("load model:",t):J("load model failed:",((s=e.face.description)==null?void 0:s.modelPath)||"")),Cs}function Pb(e){let t=e.image||e.tensor||e;if(!(Cs==null?void 0:Cs.inputs[0].shape))return t;let n=Se.resizeBilinear(t,[Cs.inputs[0].shape[2],Cs.inputs[0].shape[1]],!1),s=L(n,Xe.tf255);return te(n),s}async function Ob(e,t,n,s){var o,i,l,c;if(!Cs)return{age:0,gender:"unknown",genderScore:0,descriptor:[]};let r=Fb<(((o=t.face.description)==null?void 0:o.skipFrames)||0),a=(((i=t.face.description)==null?void 0:i.skipTime)||0)>ie()-CT;return t.skipAllowed&&r&&a&&TT===s&&((l=S0[n])==null?void 0:l.age)&&((c=S0[n])==null?void 0:c.age)>0?(Fb++,S0[n]):(Fb=0,new Promise(async u=>{var p,h;let d={age:0,gender:"unknown",genderScore:0,descriptor:[]};if((p=t.face.description)==null?void 0:p.enabled){let f=Pb(e),m=Cs==null?void 0:Cs.execute(f);CT=ie(),te(f);let y=await(await m.find(R=>R.shape[1]===1)).data(),x=Math.trunc(200*Math.abs(y[0]-.5))/100;x>(((h=t.face.description)==null?void 0:h.minConfidence)||0)&&(d.gender=y[0]<=.5?"female":"male",d.genderScore=Math.min(.99,x));let A=Fs(m.find(R=>R.shape[1]===100),1),b=(await A.data())[0];te(A);let k=await m.find(R=>R.shape[1]===100).data();d.age=Math.round(k[b-1]>k[b+1]?10*b-100*k[b-1]:10*b+100*k[b+1])/10;let I=m.find(R=>R.shape[1]===1024),E=I?await I.data():[];d.descriptor=Array.from(E),m.forEach(R=>te(R))}S0[n]=d,TT=s,u(d)}))}function I0(e){return[Math.abs(e.endPoint[0]-e.startPoint[0]),Math.abs(e.endPoint[1]-e.startPoint[1])]}function Gp(e){return[e.startPoint[0]+(e.endPoint[0]-e.startPoint[0])/2,e.startPoint[1]+(e.endPoint[1]-e.startPoint[1])/2]}function ET(e,t,n){let s=t.shape[1],r=t.shape[2],a=[[e.startPoint[1]/s,e.startPoint[0]/r,e.endPoint[1]/s,e.endPoint[0]/r]];return Se.cropAndResize(t,a,[0],n)}function RT(e,t){let n=[e.startPoint[0]*t[0],e.startPoint[1]*t[1]],s=[e.endPoint[0]*t[0],e.endPoint[1]*t[1]],r=e.palmLandmarks.map(a=>[a[0]*t[0],a[1]*t[1]]);return{startPoint:n,endPoint:s,palmLandmarks:r,confidence:e.confidence}}function C0(e,t=1.5){let n=Gp(e),s=I0(e),r=[t*s[0]/2,t*s[1]/2],a=[n[0]-r[0],n[1]-r[1]],o=[n[0]+r[0],n[1]+r[1]];return{startPoint:a,endPoint:o,palmLandmarks:e.palmLandmarks}}function T0(e){let t=Gp(e),n=I0(e),r=Math.max(...n)/2,a=[t[0]-r,t[1]-r],o=[t[0]+r,t[1]+r];return{startPoint:a,endPoint:o,palmLandmarks:e.palmLandmarks}}function dye(e){return e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))}function _T(e,t){let n=Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]);return dye(n)}var $T=(e,t)=>[[1,0,e],[0,1,t],[0,0,1]];function ei(e,t){let n=0;for(let s=0;s[n.x,n.y]),this.anchorsTensor=fr(this.anchors),this.inputSize=this.model&&this.model.inputs&&this.model.inputs[0].shape?this.model.inputs[0].shape[2]:0,this.inputSizeTensor=Ct([this.inputSize,this.inputSize]),this.doubleInputSizeTensor=Ct([this.inputSize*2,this.inputSize*2])}normalizeBoxes(t){let n={};n.boxOffsets=Pe(t,[0,0],[-1,2]),n.boxSizes=Pe(t,[0,2],[-1,2]),n.div=de(n.boxOffsets,this.inputSizeTensor),n.boxCenterPoints=ue(n.div,this.anchorsTensor),n.halfBoxSizes=de(n.boxSizes,this.doubleInputSizeTensor),n.sub=he(n.boxCenterPoints,n.halfBoxSizes),n.startPoints=L(n.sub,this.inputSizeTensor),n.add=ue(n.boxCenterPoints,n.halfBoxSizes),n.endPoints=L(n.add,this.inputSizeTensor);let s=Vu([n.startPoints,n.endPoints],1);return Object.keys(n).forEach(r=>te(n[r])),s}normalizeLandmarks(t,n){let s={};s.reshape=H(t,[-1,7,2]),s.div=de(s.reshape,this.inputSizeTensor),s.landmarks=ue(s.div,this.anchors[n]);let r=L(s.landmarks,this.inputSizeTensor);return Object.keys(s).forEach(a=>te(s[a])),r}async predict(t,n){let s={};s.resize=Se.resizeBilinear(t,[this.inputSize,this.inputSize]),s.div=de(s.resize,Xe.tf127),s.image=he(s.div,Xe.tf1),s.batched=this.model.execute(s.image),s.predictions=rt(s.batched),s.slice=Pe(s.predictions,[0,0],[-1,1]),s.sigmoid=as(s.slice),s.scores=rt(s.sigmoid);let r=await s.scores.data();s.boxes=Pe(s.predictions,[0,1],[-1,4]),s.norm=this.normalizeBoxes(s.boxes),s.nms=await Se.nonMaxSuppressionAsync(s.norm,s.scores,3*n.hand.maxDetected,n.hand.iouThreshold,n.hand.minConfidence);let a=await s.nms.array(),o=[];for(let i of a){let l={};l.box=Pe(s.norm,[i,0],[1,-1]),l.slice=Pe(s.predictions,[i,5],[1,14]),l.norm=this.normalizeLandmarks(l.slice,i),l.palmLandmarks=H(l.norm,[-1,2]);let c=await l.box.data(),u=c.slice(0,2),d=c.slice(2,4),p=await l.palmLandmarks.array(),h={startPoint:u,endPoint:d,palmLandmarks:p,confidence:r[i]},f=RT(h,[t.shape[2]/this.inputSize,t.shape[1]/this.inputSize]);o.push(f),Object.keys(l).forEach(m=>te(l[m]))}return Object.keys(s).forEach(i=>te(s[i])),o}};var hye=5,OT=1.65,MT=[0,5,9,13,17,1,2],fye=0,mye=2,zT=0,Bb=class{constructor(t,n){fe(this,"handDetector");fe(this,"handPoseModel");fe(this,"inputSize");fe(this,"storedBoxes");fe(this,"skipped");fe(this,"detectedHands");this.handDetector=t,this.handPoseModel=n,this.inputSize=this.handPoseModel&&this.handPoseModel.inputs[0].shape?this.handPoseModel.inputs[0].shape[2]:0,this.storedBoxes=[],this.skipped=Number.MAX_SAFE_INTEGER,this.detectedHands=0}calculateLandmarksBoundingBox(t){let n=t.map(o=>o[0]),s=t.map(o=>o[1]),r=[Math.min(...n),Math.min(...s)],a=[Math.max(...n),Math.max(...s)];return{startPoint:r,endPoint:a}}getBoxForPalmLandmarks(t,n){let s=t.map(a=>zb([...a,1],n)),r=this.calculateLandmarksBoundingBox(s);return C0(T0(r),hye)}getBoxForHandLandmarks(t){let n=this.calculateLandmarksBoundingBox(t),s=C0(T0(n),OT);s.palmLandmarks=[];for(let r=0;r[o[0]*(h[0]-this.inputSize/2),o[1]*(h[1]-this.inputSize/2),o[2]*h[2]]),l=Mb(s,[0,0]),c=i.map(h=>[...zb(h,l),h[2]]),u=FT(r),d=[...Gp(n),1],p=[ei(d,u[0]),ei(d,u[1])];return c.map(h=>[Math.trunc(h[0]+p[0]),Math.trunc(h[1]+p[1]),Math.trunc(h[2])])}async estimateHands(t,n){let s=!1,r,a=(n.hand.skipTime||0)>ie()-zT,o=this.skipped<(n.hand.skipFrames||0);n.skipAllowed&&a&&o&&(r=await this.handDetector.predict(t,n),this.skipped=0),n.skipAllowed&&this.skipped++,r&&r.length>0&&(r.length!==this.detectedHands&&this.detectedHands!==n.hand.maxDetected||!n.hand.landmarks)&&(this.detectedHands=0,this.storedBoxes=[...r],this.storedBoxes.length>0&&(s=!0));let i=[];for(let l=0;l=n.hand.minConfidence/4){let w=H(A,[-1,3]),k=await w.array();te(A),te(w);let I=this.transformRawCoords(k,m,u,f),E=this.getBoxForHandLandmarks(I);this.storedBoxes[l]={...E,confidence:b};let R={landmarks:I,confidence:b,boxConfidence:c.confidence,fingerConfidence:b,box:{topLeft:E.startPoint,bottomRight:E.endPoint}};i.push(R)}else this.storedBoxes[l]=null;te(A)}else{let u=C0(T0(c),OT),d={confidence:c.confidence,boxConfidence:c.confidence,fingerConfidence:0,box:{topLeft:u.startPoint,bottomRight:u.endPoint},landmarks:[]};i.push(d)}}return this.storedBoxes=this.storedBoxes.filter(l=>l!==null),this.detectedHands=i.length,i.length>n.hand.maxDetected&&(i.length=n.hand.maxDetected),i}};var Yn={thumb:0,index:1,middle:2,ring:3,pinky:4,all:[0,1,2,3,4],nameMapping:{0:"thumb",1:"index",2:"middle",3:"ring",4:"pinky"},pointsMapping:{0:[[0,1],[1,2],[2,3],[3,4]],1:[[0,5],[5,6],[6,7],[7,8]],2:[[0,9],[9,10],[10,11],[11,12]],3:[[0,13],[13,14],[14,15],[15,16]],4:[[0,17],[17,18],[18,19],[19,20]]},getName:e=>Yn.nameMapping[e],getPoints:e=>Yn.pointsMapping[e]},ti={none:0,half:1,full:2,nameMapping:{0:"none",1:"half",2:"full"},getName:e=>ti.nameMapping[e]},Bt={verticalUp:0,verticalDown:1,horizontalLeft:2,horizontalRight:3,diagonalUpRight:4,diagonalUpLeft:5,diagonalDownRight:6,diagonalDownLeft:7,nameMapping:{0:"verticalUp",1:"verticalDown",2:"horizontalLeft",3:"horizontalRight",4:"diagonalUpRight",5:"diagonalUpLeft",6:"diagonalDownRight",7:"diagonalDownLeft"},getName:e=>Bt.nameMapping[e]},Wl=class{constructor(t){fe(this,"name");fe(this,"curls");fe(this,"directions");fe(this,"weights");fe(this,"weightsRelative");this.name=t,this.curls={},this.directions={},this.weights=[1,1,1,1,1],this.weightsRelative=[1,1,1,1,1]}curl(t,n,s){typeof this.curls[t]=="undefined"&&(this.curls[t]=[]),this.curls[t].push([n,s])}direction(t,n,s){this.directions[t]||(this.directions[t]=[]),this.directions[t].push([n,s])}weight(t,n){this.weights[t]=n;let s=this.weights.reduce((r,a)=>r+a,0);this.weightsRelative=this.weights.map(r=>r*5/s)}matchAgainst(t,n){let s=0;for(let r in t){let a=t[r],o=this.curls[r];if(typeof o=="undefined"){s+=this.weightsRelative[r];continue}for(let[i,l]of o)if(a===i){s+=l*this.weightsRelative[r];break}}for(let r in n){let a=n[r],o=this.directions[r];if(typeof o=="undefined"){s+=this.weightsRelative[r];continue}for(let[i,l]of o)if(a===i){s+=l*this.weightsRelative[r];break}}return s/10}};var{thumb:Sr,index:pa,middle:ha,ring:Vl,pinky:Ul}=Yn,{none:Ir,half:gye,full:Cr}=ti,{verticalUp:Fc,verticalDown:cxe,horizontalLeft:Wb,horizontalRight:yye,diagonalUpRight:Aye,diagonalUpLeft:Pc,diagonalDownRight:dxe,diagonalDownLeft:pxe}=Bt,ni=new Wl("thumbs up");ni.curl(Sr,Ir,1);ni.direction(Sr,Fc,1);ni.direction(Sr,Pc,.25);ni.direction(Sr,Aye,.25);for(let e of[Yn.index,Yn.middle,Yn.ring,Yn.pinky])ni.curl(e,Cr,1),ni.direction(e,Wb,1),ni.direction(e,yye,1);var en=new Wl("victory");en.curl(Sr,gye,.5);en.curl(Sr,Ir,.5);en.direction(Sr,Fc,1);en.direction(Sr,Pc,1);en.curl(pa,Ir,1);en.direction(pa,Fc,.75);en.direction(pa,Pc,1);en.curl(ha,Ir,1);en.direction(ha,Fc,1);en.direction(ha,Pc,.75);en.curl(Vl,Cr,1);en.direction(Vl,Fc,.2);en.direction(Vl,Pc,1);en.direction(Vl,Wb,.2);en.curl(Ul,Cr,1);en.direction(Ul,Fc,.2);en.direction(Ul,Pc,1);en.direction(Ul,Wb,.2);en.weight(pa,2);en.weight(ha,2);var si=new Wl("point");si.curl(Sr,Cr,1);si.curl(pa,Ir,.5);si.curl(ha,Cr,.5);si.curl(Vl,Cr,.5);si.curl(Ul,Cr,.5);si.weight(pa,2);si.weight(ha,2);var ri=new Wl("middle finger");ri.curl(Sr,Ir,1);ri.curl(pa,Cr,.5);ri.curl(ha,Cr,.5);ri.curl(Vl,Cr,.5);ri.curl(Ul,Cr,.5);ri.weight(pa,2);ri.weight(ha,2);var Oc=new Wl("open palm");Oc.curl(Sr,Ir,.75);Oc.curl(pa,Ir,.75);Oc.curl(ha,Ir,.75);Oc.curl(Vl,Ir,.75);Oc.curl(Ul,Ir,.75);var LT=[ni,en,si,ri,Oc];var xye=.7,Gl={HALF_CURL_START_LIMIT:60,NO_CURL_START_LIMIT:130,DISTANCE_VOTE_POWER:1.1,SINGLE_ANGLE_VOTE_POWER:.9,TOTAL_ANGLE_VOTE_POWER:1.6};function BT(e,t,n,s){let r=(t-s)/(e-n),a=Math.atan(r)*180/Math.PI;return a<=0?a=-a:a>0&&(a=180-a),a}function WT(e,t){if(!e||!t)return[0,0];let n=BT(e[0],e[1],t[0],t[1]);if(e.length===2)return n;let s=BT(e[1],e[2],t[1],t[2]);return[n,s]}function VT(e,t=1){let n=0,s=0,r=0;return e>=75&&e<=105?n=1*t:e>=25&&e<=155?s=1*t:r=1*t,[n,s,r]}function bye(e,t,n){let s=e[0]-t[0],r=e[0]-n[0],a=t[0]-n[0],o=e[1]-t[1],i=e[1]-n[1],l=t[1]-n[1],c=e[2]-t[2],u=e[2]-n[2],d=t[2]-n[2],p=Math.sqrt(s*s+o*o+c*c),h=Math.sqrt(r*r+i*i+u*u),f=Math.sqrt(a*a+l*l+d*d),m=(f*f+p*p-h*h)/(2*f*p);m>1?m=1:m<-1&&(m=-1);let g=Math.acos(m);g=57.2958*g%180;let y;return g>Gl.NO_CURL_START_LIMIT?y=ti.none:g>Gl.HALF_CURL_START_LIMIT?y=ti.half:y=ti.full,y}function UT(e,t,n,s){let r;return s===Math.abs(e)?e>0?r=Bt.horizontalLeft:r=Bt.horizontalRight:s===Math.abs(t)?t>0?r=Bt.horizontalLeft:r=Bt.horizontalRight:n>0?r=Bt.horizontalLeft:r=Bt.horizontalRight,r}function GT(e,t,n,s){let r;return s===Math.abs(e)?e<0?r=Bt.verticalDown:r=Bt.verticalUp:s===Math.abs(t)?t<0?r=Bt.verticalDown:r=Bt.verticalUp:n<0?r=Bt.verticalDown:r=Bt.verticalUp,r}function vye(e,t,n,s,r,a,o,i){let l,c=GT(e,t,n,s),u=UT(r,a,o,i);return c===Bt.verticalUp?u===Bt.horizontalLeft?l=Bt.diagonalUpLeft:l=Bt.diagonalUpRight:u===Bt.horizontalLeft?l=Bt.diagonalDownLeft:l=Bt.diagonalDownRight,l}function wye(e,t,n,s){let r=e[0]-t[0],a=e[0]-n[0],o=t[0]-n[0],i=e[1]-t[1],l=e[1]-n[1],c=t[1]-n[1],u=Math.max(Math.abs(r),Math.abs(a),Math.abs(o)),d=Math.max(Math.abs(i),Math.abs(l),Math.abs(c)),p=0,h=0,f=0,m=d/(u+1e-5);m>1.5?p+=Gl.DISTANCE_VOTE_POWER:m>.66?h+=Gl.DISTANCE_VOTE_POWER:f+=Gl.DISTANCE_VOTE_POWER;let g=Math.sqrt(r*r+i*i),y=Math.sqrt(a*a+l*l),x=Math.sqrt(o*o+c*c),A=Math.max(g,y,x),b=e[0],w=e[1],k=n[0],I=n[1];A===g?(k=n[0],I=n[1]):A===x&&(b=t[0],w=t[1]);let P=WT([b,w],[k,I]),$=VT(P,Gl.TOTAL_ANGLE_VOTE_POWER);p+=$[0],h+=$[1],f+=$[2];for(let T of s){let O=VT(T,Gl.SINGLE_ANGLE_VOTE_POWER);p+=O[0],h+=O[1],f+=O[2]}let _;return p===Math.max(p,h,f)?_=GT(l,i,c,d):f===Math.max(h,f)?_=UT(a,r,o,u):_=vye(l,i,c,d,a,r,o,u),_}function HT(e){let t=[],n=[],s=[],r=[];if(!e)return{curls:s,directions:r};for(let a of Yn.all){let o=Yn.getPoints(a),i=[],l=[];for(let c of o){let u=e[c[0]],d=e[c[1]],p=WT(u,d),h=p[0],f=p[1];i.push(h),l.push(f)}t.push(i),n.push(l)}for(let a of Yn.all){let o=a===Yn.thumb?1:0,i=Yn.getPoints(a),l=e[i[o][0]],c=e[i[o+1][1]],u=e[i[3][1]],d=bye(l,c,u),p=wye(l,c,u,t[a].slice(o));s[a]=d,r[a]=p}return{curls:s,directions:r}}function N0(e){if(!e||e.length===0)return null;let t=HT(e),n={};for(let s of Yn.all)n[Yn.getName(s)]={curl:ti.getName(t.curls[s]),direction:Bt.getName(t.directions[s])};return n}function jT(e){let t=[];if(!e||e.length===0)return t;let n=HT(e);for(let s of LT){let r=s.matchAgainst(n.curls,n.directions);r>=xye&&t.push({name:s.name,confidence:r})}return t}var qT={thumb:[1,2,3,4],index:[5,6,7,8],middle:[9,10,11,12],ring:[13,14,15,16],pinky:[17,18,19,20],palm:[0]},fa,ma,XT;async function Vb(e,t){let n=await XT.estimateHands(e,t);if(!n)return[];let s=[];for(let r=0;rn[r].landmarks[d]);let o=n[r].landmarks,i=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,0,0],l=[0,0,0,0];if(o&&o.length>0){for(let u of o)u[0]i[2]&&(i[2]=u[0]),u[1]>i[3]&&(i[3]=u[1]);i[2]-=i[0],i[3]-=i[1],l=[i[0]/(e.shape[2]||0),i[1]/(e.shape[1]||0),i[2]/(e.shape[2]||0),i[3]/(e.shape[1]||0)]}else i=n[r].box?[Math.trunc(Math.max(0,n[r].box.topLeft[0])),Math.trunc(Math.max(0,n[r].box.topLeft[1])),Math.trunc(Math.min(e.shape[2]||0,n[r].box.bottomRight[0])-Math.max(0,n[r].box.topLeft[0])),Math.trunc(Math.min(e.shape[1]||0,n[r].box.bottomRight[1])-Math.max(0,n[r].box.topLeft[1]))]:[0,0,0,0],l=[n[r].box.topLeft[0]/(e.shape[2]||0),n[r].box.topLeft[1]/(e.shape[1]||0),(n[r].box.bottomRight[0]-n[r].box.topLeft[0])/(e.shape[2]||0),(n[r].box.bottomRight[1]-n[r].box.topLeft[1])/(e.shape[1]||0)];let c=N0(o);s.push({id:r,score:Math.round(100*n[r].confidence)/100,boxScore:Math.round(100*n[r].boxConfidence)/100,fingerScore:Math.round(100*n[r].fingerConfidence)/100,label:"hand",box:i,boxRaw:l,keypoints:o,annotations:a,landmarks:c})}return s}async function Ub(e){var n,s,r,a,o,i;pe.initial&&(fa=null,ma=null),!fa||!ma?([fa,ma]=await Promise.all([e.hand.enabled?Be(We(e.modelBasePath,((n=e.hand.detector)==null?void 0:n.modelPath)||""),{fromTFHub:(((s=e.hand.detector)==null?void 0:s.modelPath)||"").includes("tfhub.dev")}):null,e.hand.landmarks?Be(We(e.modelBasePath,((r=e.hand.skeleton)==null?void 0:r.modelPath)||""),{fromTFHub:(((a=e.hand.skeleton)==null?void 0:a.modelPath)||"").includes("tfhub.dev")}):null]),e.hand.enabled&&(!fa||!fa.modelUrl?J("load model failed:",((o=e.hand.detector)==null?void 0:o.modelPath)||""):e.debug&&J("load model:",fa.modelUrl),!ma||!ma.modelUrl?J("load model failed:",((i=e.hand.skeleton)==null?void 0:i.modelPath)||""):e.debug&&J("load model:",ma.modelUrl))):(e.debug&&J("cached model:",fa.modelUrl),e.debug&&J("cached model:",ma.modelUrl));let t=new Lb(fa);return XT=new Bb(t,ma),[fa,ma]}var Et=[null,null],kye=["StatefulPartitionedCall/Postprocessor/Slice","StatefulPartitionedCall/Postprocessor/ExpandDims_1"],ai=[[0,0],[0,0]],Sye=["hand","fist","pinch","point","face","tip","pinchtip"],KT=4,ZT=1.6,Iye=512,Cye=1.4,E0=Number.MAX_SAFE_INTEGER,Gb=0,ga=[0,0],Xt={boxes:[],hands:[]},YT={thumb:[0,1,2,3,4],index:[0,5,6,7,8],middle:[0,9,10,11,12],ring:[0,13,14,15,16],pinky:[0,17,18,19,20],palm:[0]};async function JT(e){var t,n;if(pe.initial&&(Et[0]=null),Et[0])e.debug&&J("cached model:",Et[0].modelUrl);else{R0(["tensorlistreserve","enter","tensorlistfromtensor","merge","loopcond","switch","exit","tensorliststack","nextiteration","tensorlistsetitem","tensorlistgetitem","reciprocal","shape","split","where"],e),Et[0]=await Be(We(e.modelBasePath,((t=e.hand.detector)==null?void 0:t.modelPath)||""));let s=Object.values(Et[0].modelSignature.inputs);ai[0][0]=Array.isArray(s)?parseInt(s[0].tensorShape.dim[1].size):0,ai[0][1]=Array.isArray(s)?parseInt(s[0].tensorShape.dim[2].size):0,!Et[0]||!Et[0].modelUrl?J("load model failed:",(n=e.hand.detector)==null?void 0:n.modelPath):e.debug&&J("load model:",Et[0].modelUrl)}return Et[0]}async function QT(e){var t,n;if(pe.initial&&(Et[1]=null),Et[1])e.debug&&J("cached model:",Et[1].modelUrl);else{Et[1]=await Be(We(e.modelBasePath,((t=e.hand.skeleton)==null?void 0:t.modelPath)||""));let s=Object.values(Et[1].modelSignature.inputs);ai[1][0]=Array.isArray(s)?parseInt(s[0].tensorShape.dim[1].size):0,ai[1][1]=Array.isArray(s)?parseInt(s[0].tensorShape.dim[2].size):0,!Et[1]||!Et[1].modelUrl?J("load model failed:",(n=e.hand.skeleton)==null?void 0:n.modelPath):e.debug&&J("load model:",Et[1].modelUrl)}return Et[1]}async function Tye(e,t){let n=[];if(!e||!Et[0])return n;let s={},r=(e.shape[2]||1)/(e.shape[1]||1),a=Math.min(Math.round((e.shape[1]||0)/8)*8,Iye),o=Math.round(a*r/8)*8;s.resize=Se.resizeBilinear(e,[a,o]),s.cast=me(s.resize,"int32"),[s.rawScores,s.rawBoxes]=await Et[0].executeAsync(s.cast,kye),s.boxes=rt(s.rawBoxes,[0,2]),s.scores=rt(s.rawScores,[0]);let i=os(s.scores,1);te(i[KT]),i.splice(KT,1),s.filtered=an(i,1),te(i),s.max=An(s.filtered,1),s.argmax=Fs(s.filtered,1);let l=0;s.nms=await Se.nonMaxSuppressionAsync(s.boxes,s.max,t.hand.maxDetected,t.hand.iouThreshold,t.hand.minConfidence);let c=await s.nms.data(),u=await s.max.data(),d=await s.argmax.data();for(let p of Array.from(c)){let h=Pe(s.boxes,p,1),f=await h.data();te(h);let m=[f[1],f[0],f[3]-f[1],f[2]-f[0]],g=b0(m,Cye),y=gb(g),x=[Math.trunc(m[0]*ga[0]),Math.trunc(m[1]*ga[1]),Math.trunc(m[2]*ga[0]),Math.trunc(m[3]*ga[1])],A=u[p],b=Sye[d[p]],w={id:l++,score:A,box:x,boxRaw:g,boxCrop:y,label:b};n.push(w)}return Object.keys(s).forEach(p=>te(s[p])),n.sort((p,h)=>h.score-p.score),n.length>(t.hand.maxDetected||1)&&(n.length=t.hand.maxDetected||1),n}async function Hb(e,t,n){let s={id:t.id,score:Math.round(100*t.score)/100,boxScore:Math.round(100*t.score)/100,fingerScore:0,box:t.box,boxRaw:t.boxRaw,label:t.label,keypoints:[],landmarks:{},annotations:{}};if(e&&Et[1]&&n.hand.landmarks&&t.score>(n.hand.minConfidence||0)){let r={};r.crop=Se.cropAndResize(e,[t.boxCrop],[0],[ai[1][0],ai[1][1]],"bilinear"),r.div=de(r.crop,Xe.tf255),[r.score,r.keypoints]=Et[1].execute(r.div,["Identity_1","Identity"]);let a=(await r.score.data())[0],o=(100-Math.trunc(100/(1+Math.exp(a))))/100;if(o>=(n.hand.minConfidence||0)){s.fingerScore=o,r.reshaped=H(r.keypoints,[-1,3]);let c=(await r.reshaped.array()).map(u=>[u[0]/ai[1][1],u[1]/ai[1][0],u[2]||0]).map(u=>[u[0]*t.boxRaw[2],u[1]*t.boxRaw[3],u[2]||0]);s.keypoints=c.map(u=>[ga[0]*(u[0]+t.boxRaw[0]),ga[1]*(u[1]+t.boxRaw[1]),u[2]||0]),s.landmarks=N0(s.keypoints);for(let u of Object.keys(YT))s.annotations[u]=YT[u].map(d=>s.landmarks&&s.keypoints[d]?s.keypoints[d]:null)}Object.keys(r).forEach(i=>te(r[i]))}return s}async function jb(e,t){var r,a;if(!Et[0]||!Et[1]||!((r=Et[0])==null?void 0:r.inputs[0].shape)||!((a=Et[1])==null?void 0:a.inputs[0].shape))return[];ga=[e.shape[2]||0,e.shape[1]||0],E0++;let n=(t.hand.skipTime||0)>ie()-Gb,s=E0<(t.hand.skipFrames||0);return t.skipAllowed&&n&&s?Xt.hands:new Promise(async o=>{let i=3*(t.hand.skipTime||0)>ie()-Gb,l=E0<3*(t.hand.skipFrames||0);t.skipAllowed&&Xt.hands.length===t.hand.maxDetected?Xt.hands=await Promise.all(Xt.boxes.map(u=>Hb(e,u,t))):t.skipAllowed&&i&&l&&Xt.hands.length>0?Xt.hands=await Promise.all(Xt.boxes.map(u=>Hb(e,u,t))):(Xt.boxes=await Tye(e,t),Gb=ie(),Xt.hands=await Promise.all(Xt.boxes.map(u=>Hb(e,u,t))),E0=0);let c=[...Xt.boxes];if(Xt.boxes.length=0,t.cacheSensitivity>0)for(let u=0;u.05&&d.box[3]/(e.shape[1]||1)>.05&&Xt.hands[u].fingerScore&&Xt.hands[u].fingerScore>(t.hand.minConfidence||0)){let p=b0(d.box,ZT),h=b0(d.boxRaw,ZT),f=gb(h);Xt.boxes.push({...c[u],box:p,boxRaw:h,boxCrop:f})}}for(let u=0;uie()-tN,a=qb<(((i=t.face.liveness)==null?void 0:i.skipFrames)||0);return t.skipAllowed&&r&&a&&eN===s&&_0[n]?(qb++,_0[n]):(qb=0,new Promise(async l=>{let c=Se.resizeBilinear(e,[(fn==null?void 0:fn.inputs[0].shape)?fn.inputs[0].shape[2]:0,(fn==null?void 0:fn.inputs[0].shape)?fn.inputs[0].shape[1]:0],!1),u=fn==null?void 0:fn.execute(c),d=(await u.data())[0];_0[n]=Math.round(100*d)/100,eN=s,tN=ie(),te([c,u]),l(_0[n])}))}var Jb={};ed(Jb,{connected:()=>D0,horizontal:()=>Kb,kpt:()=>$0,relative:()=>Yb,vertical:()=>Zb});var $0=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],Kb=[["leftEye","rightEye"],["leftEar","rightEar"],["leftShoulder","rightShoulder"],["leftElbow","rightElbow"],["leftWrist","rightWrist"],["leftHip","rightHip"],["leftKnee","rightKnee"],["leftAnkle","rightAnkle"]],Zb=[["leftKnee","leftShoulder"],["rightKnee","rightShoulder"],["leftAnkle","leftKnee"],["rightAnkle","rightKnee"]],Yb=[[["leftHip","rightHip"],["leftShoulder","rightShoulder"]],[["leftElbow","rightElbow"],["leftShoulder","rightShoulder"]]],D0={leftLeg:["leftHip","leftKnee","leftAnkle"],rightLeg:["rightHip","rightKnee","rightAnkle"],torso:["leftShoulder","rightShoulder","rightHip","leftHip","leftShoulder"],leftArm:["leftShoulder","leftElbow","leftWrist"],rightArm:["rightShoulder","rightElbow","rightWrist"],head:[]};var sN=.005,Ts={keypoints:[],padding:[[0,0],[0,0],[0,0],[0,0]]};function Qb(e){for(let t of Kb){let n=e.keypoints.findIndex(r=>r.part===t[0]),s=e.keypoints.findIndex(r=>r.part===t[1]);if(e.keypoints[n]&&e.keypoints[s]&&e.keypoints[n].position[0]r&&r.part===t[0]),s=e.keypoints.findIndex(r=>r&&r.part===t[1]);e.keypoints[n]&&e.keypoints[s]&&e.keypoints[n].position[1]c&&c.part===t[0]),r=e.keypoints.findIndex(c=>c&&c.part===t[1]),a=e.keypoints.findIndex(c=>c&&c.part===n[0]),o=e.keypoints.findIndex(c=>c&&c.part===n[1]);if(!e.keypoints[a]||!e.keypoints[o])continue;let i=e.keypoints[s]?[Math.abs(e.keypoints[a].position[0]-e.keypoints[s].position[0]),Math.abs(e.keypoints[o].position[0]-e.keypoints[s].position[0])]:[0,0],l=e.keypoints[r]?[Math.abs(e.keypoints[o].position[0]-e.keypoints[r].position[0]),Math.abs(e.keypoints[a].position[0]-e.keypoints[r].position[0])]:[0,0];if(i[0]>i[1]||l[0]>l[1]){let c=e.keypoints[s];e.keypoints[s]=e.keypoints[r],e.keypoints[r]=c}}}function rN(e){for(let t=0;te.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0,e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0],[e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0,e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0],[0,0]],n.pad=Qs(e,Ts.padding),n.resize=Se.resizeBilinear(n.pad,[t,t]);let s=me(n.resize,"int32");return Object.keys(n).forEach(r=>te(n[r])),s}function oN(e,t){e.keypoints=e.keypoints.filter(s=>s&&s.position);for(let s of e.keypoints)s.position=[s.position[0]*(t[0]+Ts.padding[2][0]+Ts.padding[2][1])/t[0]-Ts.padding[2][0],s.position[1]*(t[1]+Ts.padding[1][0]+Ts.padding[1][1])/t[1]-Ts.padding[1][0]],s.positionRaw=[s.position[0]/t[0],s.position[1]/t[1]];let n=da(e.keypoints.map(s=>s.position),t);return e.box=n.box,e.boxRaw=n.boxRaw,e}var Fn,iN=0,e5=Number.MAX_SAFE_INTEGER,Hl={boxes:[],bodies:[],last:0};async function lN(e){return pe.initial&&(Fn=null),Fn?e.debug&&J("cached model:",Fn.modelUrl):(R0(["size"],e),Fn=await Be(We(e.modelBasePath,e.body.modelPath||"")),!Fn||!Fn.modelUrl?J("load model failed:",e.body.modelPath):e.debug&&J("load model:",Fn.modelUrl)),iN=Fn.inputs[0].shape?Fn.inputs[0].shape[2]:0,Fn}async function Nye(e,t,n){let s=e[0][0],r=[],a=0;for(let u=0;ut.body.minConfidence){let d=[s[u][1],s[u][0]];r.push({score:Math.round(100*a)/100,part:$0[u],positionRaw:d,position:[Math.round((n.shape[2]||0)*d[0]),Math.round((n.shape[1]||0)*d[1])]})}a=r.reduce((u,d)=>d.score>u?d.score:u,0);let o=[],i=da(r.map(u=>u.position),[n.shape[2],n.shape[1]]),l={};for(let[u,d]of Object.entries(D0)){let p=[];for(let h=0;hg.part===d[h]),m=r.find(g=>g.part===d[h+1]);f&&m&&f.score>(t.body.minConfidence||0)&&m.score>(t.body.minConfidence||0)&&p.push([f.position,m.position])}l[u]=p}let c={id:0,score:a,box:i.box,boxRaw:i.boxRaw,keypoints:r,annotations:l};return Qb(c),o.push(c),o}async function Eye(e,t,n){let s=[];for(let r=0;rt.body.minConfidence){let i=[];for(let d=0;d<17;d++){let p=a[3*d+2];if(p>t.body.minConfidence){let h=[a[3*d+1],a[3*d+0]];i.push({part:$0[d],score:Math.round(100*p)/100,positionRaw:h,position:[Math.round((n.shape[2]||0)*h[0]),Math.round((n.shape[1]||0)*h[1])]})}}let l=da(i.map(d=>d.position),[n.shape[2],n.shape[1]]),c={};for(let[d,p]of Object.entries(D0)){let h=[];for(let f=0;fy.part===p[f]),g=i.find(y=>y.part===p[f+1]);m&&g&&m.score>(t.body.minConfidence||0)&&g.score>(t.body.minConfidence||0)&&h.push([m.position,g.position])}c[d]=h}let u={id:r,score:o,box:l.box,boxRaw:l.boxRaw,keypoints:[...i],annotations:c};Qb(u),s.push(u)}}return s.sort((r,a)=>a.score-r.score),s.length>t.body.maxDetected&&(s.length=t.body.maxDetected),s}async function t5(e,t){if(!Fn||!(Fn==null?void 0:Fn.inputs[0].shape))return[];t.skipAllowed||(Hl.boxes.length=0),e5++;let n=(t.body.skipTime||0)>ie()-Hl.last,s=e5<(t.body.skipFrames||0);return t.skipAllowed&&n&&s?Hl.bodies:new Promise(async r=>{let a={};e5=0,a.input=aN(e,iN),a.res=Fn==null?void 0:Fn.execute(a.input),Hl.last=ie();let o=await a.res.array();Hl.bodies=a.res.shape[2]===17?await Nye(o,t,e):await Eye(o,t,e);for(let i of Hl.bodies)oN(i,[e.shape[2]||1,e.shape[1]||1]),rN(i.keypoints);Object.keys(a).forEach(i=>te(a[i])),r(Hl.bodies)})}var Gs,F0=[],uN=0,n5=Number.MAX_SAFE_INTEGER,P0=2.5;async function cN(e){if(!Gs||pe.initial){Gs=await Be(We(e.modelBasePath,e.object.modelPath||""));let t=Object.values(Gs.modelSignature.inputs);Gs.inputSize=Array.isArray(t)?parseInt(t[0].tensorShape.dim[2].size):null,!Gs||!Gs.modelUrl?J("load model failed:",e.object.modelPath):e.debug&&J("load model:",Gs.modelUrl)}else e.debug&&J("cached model:",Gs.modelUrl);return Gs}async function Rye(e,t,n,s){let r=0,a=[];for(let c of[1,2,4])K(async()=>{var g,y;let u=c*13,d=(g=e.find(x=>x.shape[1]===u**2&&x.shape[2]===Rc.length))==null?void 0:g.squeeze(),p=(y=e.find(x=>x.shape[1]===u**2&&x.shape[2]s.object.minConfidence&&A!==61){let w=(.5+Math.trunc(x%u))/u,k=(.5+Math.trunc(x/u))/u,I=f[x].map(V=>V*(u/c/t)),[E,R]=[w-P0/c*I[0],k-P0/c*I[1]],[P,$]=[w+P0/c*I[2]-E,k+P0/c*I[3]-R],_=[E,R,P,$];_=_.map(V=>Math.max(0,Math.min(V,1)));let T=[_[0]*n[0],_[1]*n[1],_[2]*n[0],_[3]*n[1]],O={id:r++,score:Math.round(100*b)/100,class:A+1,label:Rc[A].label,box:T.map(V=>Math.trunc(V)),boxRaw:_};a.push(O)}}});e.forEach(c=>te(c));let o=a.map(c=>[c.boxRaw[1],c.boxRaw[0],c.boxRaw[3],c.boxRaw[2]]),i=a.map(c=>c.score),l=[];if(o&&o.length>0){let c=await Se.nonMaxSuppressionAsync(o,i,s.object.maxDetected,s.object.iouThreshold,s.object.minConfidence);l=await c.data(),te(c)}return a=a.filter((c,u)=>l.includes(u)).sort((c,u)=>u.score-c.score),a}async function s5(e,t){let n=(t.object.skipTime||0)>ie()-uN,s=n5<(t.object.skipFrames||0);return t.skipAllowed&&n&&s&&F0.length>0?(n5++,F0):(n5=0,!pe.kernels.includes("mod")||!pe.kernels.includes("sparsetodense")?F0:new Promise(async r=>{let a=[e.shape[2],e.shape[1]],o=Se.resizeBilinear(e,[Gs.inputSize,Gs.inputSize],!1),i=de(o,Xe.tf255),l=i.transpose([0,3,1,2]);te(i),te(o);let c;t.object.enabled&&(c=Gs.execute(l)),uN=ie(),te(l);let u=await Rye(c,Gs.inputSize,a,t);F0=u,r(u)}))}var Hp=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],_ye=Hp.length,jp=Hp.reduce((e,t,n)=>(e[t]=n,e),{}),$ye=[["leftHip","leftShoulder"],["leftElbow","leftShoulder"],["leftElbow","leftWrist"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["rightHip","rightShoulder"],["rightElbow","rightShoulder"],["rightElbow","rightWrist"],["rightHip","rightKnee"],["rightKnee","rightAnkle"],["leftShoulder","rightShoulder"],["leftHip","rightHip"]],ebe=$ye.map(([e,t])=>[jp[e],jp[t]]),dN=[["nose","leftEye"],["leftEye","leftEar"],["nose","rightEye"],["rightEye","rightEar"],["nose","leftShoulder"],["leftShoulder","leftElbow"],["leftElbow","leftWrist"],["leftShoulder","leftHip"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["nose","rightShoulder"],["rightShoulder","rightElbow"],["rightElbow","rightWrist"],["rightShoulder","rightHip"],["rightHip","rightKnee"],["rightKnee","rightAnkle"]];function pN(e){let t=e.reduce(({maxX:n,maxY:s,minX:r,minY:a},{position:{x:o,y:i}})=>({maxX:Math.max(n,o),maxY:Math.max(s,i),minX:Math.min(r,o),minY:Math.min(a,i)}),{maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY,minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY});return[t.minX,t.minY,t.maxX-t.minX,t.maxY-t.minY]}function hN(e,[t,n],[s,r]){let a=t/s,o=n/r,i=(c,u)=>({id:u,score:c.score,boxRaw:[c.box[0]/r,c.box[1]/s,c.box[2]/r,c.box[3]/s],box:[Math.trunc(c.box[0]*o),Math.trunc(c.box[1]*a),Math.trunc(c.box[2]*o),Math.trunc(c.box[3]*a)],keypoints:c.keypoints.map(({score:d,part:p,position:h})=>({score:d,part:p,position:[Math.trunc(h.x*o),Math.trunc(h.y*a)],positionRaw:[h.x/s,h.y/s]})),annotations:{}});return e.map((c,u)=>i(c,u))}var r5=class{constructor(t,n){fe(this,"priorityQueue");fe(this,"numberOfElements");fe(this,"getElementValue");this.priorityQueue=new Array(t),this.numberOfElements=-1,this.getElementValue=n}enqueue(t){this.priorityQueue[++this.numberOfElements]=t,this.swim(this.numberOfElements)}dequeue(){let t=this.priorityQueue[0];return this.exchange(0,this.numberOfElements--),this.sink(0),this.priorityQueue[this.numberOfElements+1]=null,t}empty(){return this.numberOfElements===-1}size(){return this.numberOfElements+1}all(){return this.priorityQueue.slice(0,this.numberOfElements+1)}max(){return this.priorityQueue[0]}swim(t){for(;t>0&&this.less(Math.floor(t/2),t);)this.exchange(t,Math.floor(t/2)),t=Math.floor(t/2)}sink(t){for(;2*t<=this.numberOfElements;){let n=2*t;if(nn?n:e}function fN(e,t,n,s){let r=n-e,a=s-t;return r*r+a*a}function l5(e,t){return{x:e.x+t.x,y:e.y+t.y}}var Ns,Dye=["MobilenetV1/offset_2/BiasAdd","MobilenetV1/heatmap_2/BiasAdd","MobilenetV1/displacement_fwd_2/BiasAdd","MobilenetV1/displacement_bwd_2/BiasAdd"],O0=1,Mc=16,Fye=50**2;function mN(e,t,n,s,r,a,o=2){let i=y=>({y:a.get(y.y,y.x,e),x:a.get(y.y,y.x,a.shape[2]/2+e)}),l=(y,x,A)=>({y:i5(Math.round(y.y/Mc),0,x-1),x:i5(Math.round(y.x/Mc),0,A-1)}),[c,u]=s.shape,d=l(t.position,c,u),p=i(d),f=l5(t.position,p);for(let y=0;y[jp[p],jp[h]]),o=a.map(([,p])=>p),i=a.map(([p])=>p),l=t.shape[2],c=o.length,u=new Array(l),d=o5(e.part,Mc,n);u[e.part.id]={score:e.score,part:Hp[e.part.id],position:d};for(let p=c-1;p>=0;--p){let h=o[p],f=i[p];u[h]&&!u[f]&&(u[f]=mN(p,u[h],f,t,n,r))}for(let p=0;pt){i=!1;break}if(!i)break}return i}function Mye(e,t){let[n,s,r]=t.shape,a=new r5(n*s*r,({score:o})=>o);for(let o=0;o{var o;let a=(o=r[s])==null?void 0:o.position;return a?fN(n,t,a.y,a.x)<=Fye:!1})}function zye(e,t){return t.reduce((s,{position:r,score:a},o)=>(gN(e,r,o)||(s+=a),s),0)/t.length}function Lye(e,t,n,s,r,a){let o=[],i=Mye(a,t);for(;o.lengthh.score>a);let d=zye(o,u),p=pN(u);d>a&&o.push({keypoints:u,box:p,score:Math.round(100*d)/100})}return o}async function u5(e,t){let n=K(()=>{if(!Ns.inputs[0].shape)return[];let o=Se.resizeBilinear(e,[Ns.inputs[0].shape[2],Ns.inputs[0].shape[1]]),i=he(de(me(o,"float32"),127.5),1),c=Ns.execute(i,Dye).map(u=>rt(u,[0]));return c[1]=c[1].sigmoid(),c}),s=await Promise.all(n.map(o=>o.buffer()));for(let o of n)te(o);let r=await Lye(s[0],s[1],s[2],s[3],t.body.maxDetected,t.body.minConfidence);return Ns.inputs[0].shape?hN(r,[e.shape[1],e.shape[2]],[Ns.inputs[0].shape[2],Ns.inputs[0].shape[1]]):[]}async function yN(e){return!Ns||pe.initial?(Ns=await Be(We(e.modelBasePath,e.body.modelPath||"")),!Ns||!Ns.modelUrl?J("load model failed:",e.body.modelPath):e.debug&&J("load model:",Ns.modelUrl)):e.debug&&J("cached model:",Ns.modelUrl),Ns}var Hs,c5=!1;async function d5(e){return!Hs||pe.initial?(Hs=await Be(We(e.modelBasePath,e.segmentation.modelPath||"")),!Hs||!Hs.modelUrl?J("load model failed:",e.segmentation.modelPath):e.debug&&J("load model:",Hs.modelUrl)):e.debug&&J("cached model:",Hs.modelUrl),Hs}async function AN(e,t,n){var m,g;if(c5)return{data:[],canvas:null,alpha:null};c5=!0,Hs||await d5(n);let s=await Nc(e,n),r=((m=s.tensor)==null?void 0:m.shape[2])||0,a=((g=s.tensor)==null?void 0:g.shape[1])||0;if(!s.tensor)return{data:[],canvas:null,alpha:null};let o={};o.resize=Se.resizeBilinear(s.tensor,[Hs.inputs[0].shape?Hs.inputs[0].shape[1]:0,Hs.inputs[0].shape?Hs.inputs[0].shape[2]:0],!1),te(s.tensor),o.norm=de(o.resize,Xe.tf255),o.res=Hs.execute(o.norm),o.squeeze=rt(o.res,0),o.squeeze.shape[2]===2?(o.softmax=Ku(o.squeeze),[o.bg,o.fg]=os(o.softmax,2),o.expand=Zt(o.fg,2),o.pad=Zt(o.expand,0),o.crop=Se.cropAndResize(o.pad,[[0,0,.5,.5]],[0],[r,a]),o.data=rt(o.crop,0)):o.data=Se.resizeBilinear(o.squeeze,[a,r]);let i=Array.from(await o.data.data());if(pe.node&&!pe.Canvas&&typeof ImageData=="undefined")return n.debug&&J("canvas support missing"),Object.keys(o).forEach(y=>te(o[y])),{data:i,canvas:null,alpha:null};let l=Xn(r,a);await Ys.toPixels(o.data,l);let c=l.getContext("2d");n.segmentation.blur&&n.segmentation.blur>0&&(c.filter=`blur(${n.segmentation.blur}px)`);let u=c.getImageData(0,0,r,a),d=Xn(r,a),p=d.getContext("2d");s.canvas&&p.drawImage(s.canvas,0,0),p.globalCompositeOperation="darken",n.segmentation.blur&&n.segmentation.blur>0&&(p.filter=`blur(${n.segmentation.blur}px)`),p.drawImage(l,0,0),p.globalCompositeOperation="source-over",p.filter="none";let h=p.getImageData(0,0,r,a);for(let y=0;yte(o[y])),c5=!1,{data:i,canvas:d,alpha:l}}var p5=class{constructor(){fe(this,"ssrnetage",null);fe(this,"gear",null);fe(this,"blazeposedetect",null);fe(this,"blazepose",null);fe(this,"centernet",null);fe(this,"efficientpose",null);fe(this,"mobilefacenet",null);fe(this,"emotion",null);fe(this,"facedetect",null);fe(this,"faceiris",null);fe(this,"facemesh",null);fe(this,"faceres",null);fe(this,"ssrnetgender",null);fe(this,"handpose",null);fe(this,"handskeleton",null);fe(this,"handtrack",null);fe(this,"liveness",null);fe(this,"movenet",null);fe(this,"nanodet",null);fe(this,"posenet",null);fe(this,"segmentation",null);fe(this,"antispoof",null)}};function h5(e){for(let t of Object.keys(e.models))e.models[t]=null}async function xN(e){var t,n,s,r,a,o,i,l,c,u,d,p,h,f,m,g,y,x,A,b,w,k,I,E,R,P,$,_,T,O;pe.initial&&h5(e),e.config.hand.enabled&&(!e.models.handpose&&((n=(t=e.config.hand.detector)==null?void 0:t.modelPath)==null?void 0:n.includes("handdetect"))&&([e.models.handpose,e.models.handskeleton]=await Ub(e.config)),!e.models.handskeleton&&e.config.hand.landmarks&&((r=(s=e.config.hand.detector)==null?void 0:s.modelPath)==null?void 0:r.includes("handdetect"))&&([e.models.handpose,e.models.handskeleton]=await Ub(e.config))),e.config.body.enabled&&!e.models.blazepose&&((o=(a=e.config.body)==null?void 0:a.modelPath)==null?void 0:o.includes("blazepose"))&&(e.models.blazepose=rT(e.config)),e.config.body.enabled&&!e.models.blazeposedetect&&e.config.body.detector&&e.config.body.detector.modelPath&&(e.models.blazeposedetect=sT(e.config)),e.config.body.enabled&&!e.models.efficientpose&&((l=(i=e.config.body)==null?void 0:i.modelPath)==null?void 0:l.includes("efficientpose"))&&(e.models.efficientpose=lT(e.config)),e.config.body.enabled&&!e.models.movenet&&((u=(c=e.config.body)==null?void 0:c.modelPath)==null?void 0:u.includes("movenet"))&&(e.models.movenet=lN(e.config)),e.config.body.enabled&&!e.models.posenet&&((p=(d=e.config.body)==null?void 0:d.modelPath)==null?void 0:p.includes("posenet"))&&(e.models.posenet=yN(e.config)),e.config.face.enabled&&!e.models.facedetect&&(e.models.facedetect=K8(e.config)),e.config.face.enabled&&((h=e.config.face.antispoof)==null?void 0:h.enabled)&&!e.models.antispoof&&(e.models.antispoof=B8(e.config)),e.config.face.enabled&&((f=e.config.face.liveness)==null?void 0:f.enabled)&&!e.models.liveness&&(e.models.liveness=nN(e.config)),e.config.face.enabled&&((m=e.config.face.description)==null?void 0:m.enabled)&&!e.models.faceres&&(e.models.faceres=NT(e.config)),e.config.face.enabled&&((g=e.config.face.emotion)==null?void 0:g.enabled)&&!e.models.emotion&&(e.models.emotion=dT(e.config)),e.config.face.enabled&&((y=e.config.face.iris)==null?void 0:y.enabled)&&!e.models.faceiris&&(e.models.faceiris=gT(e.config)),e.config.face.enabled&&((x=e.config.face.mesh)==null?void 0:x.enabled)&&!e.models.facemesh&&(e.models.facemesh=kT(e.config)),e.config.face.enabled&&((A=e.config.face.gear)==null?void 0:A.enabled)&&!e.models.gear&&(e.models.gear=R8(e.config)),e.config.face.enabled&&((b=e.config.face.ssrnet)==null?void 0:b.enabled)&&!e.models.ssrnetage&&(e.models.ssrnetage=F8(e.config)),e.config.face.enabled&&((w=e.config.face.ssrnet)==null?void 0:w.enabled)&&!e.models.ssrnetgender&&(e.models.ssrnetgender=M8(e.config)),e.config.face.enabled&&((k=e.config.face.mobilefacenet)==null?void 0:k.enabled)&&!e.models.mobilefacenet&&(e.models.mobilefacenet=mT(e.config)),e.config.hand.enabled&&!e.models.handtrack&&((E=(I=e.config.hand.detector)==null?void 0:I.modelPath)==null?void 0:E.includes("handtrack"))&&(e.models.handtrack=JT(e.config)),e.config.hand.enabled&&e.config.hand.landmarks&&!e.models.handskeleton&&((P=(R=e.config.hand.detector)==null?void 0:R.modelPath)==null?void 0:P.includes("handtrack"))&&(e.models.handskeleton=QT(e.config)),e.config.object.enabled&&!e.models.centernet&&((_=($=e.config.object)==null?void 0:$.modelPath)==null?void 0:_.includes("centernet"))&&(e.models.centernet=oT(e.config)),e.config.object.enabled&&!e.models.nanodet&&((O=(T=e.config.object)==null?void 0:T.modelPath)==null?void 0:O.includes("nanodet"))&&(e.models.nanodet=cN(e.config)),e.config.segmentation.enabled&&!e.models.segmentation&&(e.models.segmentation=d5(e.config));for await(let V of Object.keys(e.models))e.models[V]&&typeof e.models[V]!="undefined"&&(e.models[V]=await e.models[V])}async function bN(e){let t=["const","placeholder","noop","pad","squeeze","add","sub","mul","div"];for(let n of Object.keys(e.models))if(e.models[n]){let s=[];Array.isArray(e.models[n])?s=e.models[n].filter(r=>r!==null).map(r=>r&&r.executor?r:r.model):s=[e.models[n]];for(let r of s){if(!r){e.config.debug&&J("model marked as loaded but not defined:",n);continue}let a=[],o=r==null?void 0:r.executor;if(o&&o.graph.nodes)for(let l of Object.values(o.graph.nodes)){let c=l.op.toLowerCase();a.includes(c)||a.push(c)}else!o&&e.config.debug&&J("model signature not determined:",n);let i=[];for(let l of a)!t.includes(l)&&!e.env.kernels.includes(l)&&!e.env.kernels.includes(l.replace("_",""))&&!e.env.kernels.includes(l.replace("native",""))&&!e.env.kernels.includes(l.replace("v2",""))&&i.push(l);i.length>0&&e.config.debug&&J("model validation:",n,i)}}}var Rt={name:"humangl",priority:999,canvas:null,gl:null,extensions:[],webGLattr:{alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!1,desynchronized:!0}};function Bye(){let e=Rt.gl;!e||(Rt.extensions=e.getSupportedExtensions())}async function vN(e){var t;if(e.config.backend==="humangl"&&(Rt.name in rs().registry&&(!Rt.gl||!Rt.gl.getParameter(Rt.gl.VERSION))&&(J("error: humangl backend invalid context"),h5(e)),!Q2(Rt.name))){try{Rt.canvas=await Xn(100,100)}catch(s){J("error: cannot create canvas:",s);return}try{if(Rt.gl=(t=Rt.canvas)==null?void 0:t.getContext("webgl2",Rt.webGLattr),!Rt.gl.getParameter(Rt.gl.VERSION).includes("2.0")){J("override: using fallback webgl backend as webgl 2.0 is not detected"),e.config.backend="webgl";return}Rt.canvas&&(Rt.canvas.addEventListener("webglcontextlost",async r=>{throw J("error: humangl:",r.type),J("possible browser memory leak using webgl or conflict with multiple backend registrations"),e.emit("error"),new Error("backend error: webgl context lost")}),Rt.canvas.addEventListener("webglcontextrestored",r=>{J("error: humangl context restored:",r)}),Rt.canvas.addEventListener("webglcontextcreationerror",r=>{J("error: humangl context create:",r)}))}catch(s){J("error: cannot get WebGL context:",s);return}try{Om(2,Rt.gl)}catch(s){J("error: cannot set WebGL context:",s);return}try{let s=new jm(Rt.gl);il(Rt.name,()=>new Sp(s),Rt.priority)}catch(s){J("error: cannot register WebGL backend:",s);return}try{Zr("webgl").forEach(r=>{let a={...r,backendName:Rt.name};cr(a)})}catch(s){J("error: cannot update WebGL backend registration:",s);return}let n=Rr().getGPGPUContext?Rr().getGPGPUContext().gl:null;if(n)J(`humangl webgl version:${n.getParameter(n.VERSION)} renderer:${n.getParameter(n.RENDERER)}`);else{J("error: no current gl context:",n,Rt.gl);return}try{Tr.set("WEBGL_VERSION",2)}catch(s){J("error: cannot set WebGL backend flags:",s);return}Bye(),J("backend registered:",Rt.name)}}function Wye(){if(!pe.kernels.includes("mod")){let e={kernelName:"Mod",backendName:Ds(),kernelFunc:t=>K(()=>he(t.inputs.a,L(de(t.inputs.a,t.inputs.b),t.inputs.b)))};cr(e),pe.kernels.push("mod")}if(!pe.kernels.includes("floormod")){let e={kernelName:"FloorMod",backendName:Ds(),kernelFunc:t=>K(()=>ff(t.inputs.a/t.inputs.b)*t.inputs.b+Gd(t.inputs.a,t.inputs.b))};cr(e),pe.kernels.push("floormod")}}async function M0(e,t=!1){if(e.state="backend",t||pe.initial||e.config.backend&&e.config.backend.length>0&&Ds()!==e.config.backend){let n=ie();if(e.config.backend&&e.config.backend.length>0){if(typeof window=="undefined"&&typeof WorkerGlobalScope!="undefined"&&e.config.debug&&e.config.debug&&J("running inside web worker"),pe.browser&&e.config.backend==="tensorflow"&&(e.config.debug&&J("override: backend set to tensorflow while running in browser"),e.config.backend="humangl"),pe.node&&(e.config.backend==="webgl"||e.config.backend==="humangl")&&(e.config.debug&&J(`override: backend set to ${e.config.backend} while running in nodejs`),e.config.backend="tensorflow"),pe.browser&&e.config.backend==="webgpu")if(typeof navigator=="undefined"||typeof navigator.gpu=="undefined")J("override: backend set to webgpu but browser does not support webgpu"),e.config.backend="humangl";else{let r=await navigator.gpu.requestAdapter();e.config.debug&&J("enumerated webgpu adapter:",r)}e.config.backend==="humangl"&&await vN(e);let s=Object.keys(rs().registryFactory);if(e.config.debug&&J("available backends:",s),s.includes(e.config.backend)||(J(`error: backend ${e.config.backend} not found in registry`),e.config.backend=pe.node?"tensorflow":"webgl",e.config.debug&&J(`override: setting backend ${e.config.backend}`)),e.config.debug&&J("setting backend:",e.config.backend),e.config.backend==="wasm"){if(e.config.debug&&J("wasm path:",e.config.wasmPath),typeof(Ol==null?void 0:Ol.setWasmPaths)!="undefined")await m8(e.config.wasmPath);else throw new Error("backend error: attempting to use wasm backend but wasm path is not set");let r=await Y().getAsync("WASM_HAS_SIMD_SUPPORT"),a=await Y().getAsync("WASM_HAS_MULTITHREAD_SUPPORT");e.config.debug&&J(`wasm execution: ${r?"SIMD":"no SIMD"} ${a?"multithreaded":"singlethreaded"}`),e.config.debug&&!r&&J("warning: wasm simd support is not enabled")}try{await ov(e.config.backend),await hf(),_8()}catch(r){return J("error: cannot set backend:",e.config.backend,r),!1}}if(Ds()==="humangl"&&(Tr.set("CHECK_COMPUTATION_FOR_ERRORS",!1),Tr.set("WEBGL_CPU_FORWARD",!0),Tr.set("WEBGL_USE_SHAPES_UNIFORMS",!0),Tr.set("CPU_HANDOFF_SIZE_THRESHOLD",256),typeof e.config.deallocate!="undefined"&&e.config.deallocate&&(J("changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:",!0),Tr.set("WEBGL_DELETE_TEXTURE_THRESHOLD",0)),Rr().getGPGPUContext)){let s=await Rr().getGPGPUContext().gl;e.config.debug&&J(`gl version:${s.getParameter(s.VERSION)} renderer:${s.getParameter(s.RENDERER)}`)}Ds()==="webgpu",av(),await hf(),e.performance.initBackend=Math.trunc(ie()-n),e.config.backend=Ds(),await pe.updateBackend(),Wye()}return!0}function R0(e,t){for(let n of e){let s={kernelName:n,backendName:t.backend,kernelFunc:()=>{t.debug&&J("kernelFunc",n,t.backend)}};cr(s)}pe.kernels=Zr(Ds()).map(n=>n.kernelName.toLowerCase())}var ya={color:"rgba(173, 216, 230, 0.6)",labelColor:"rgba(173, 216, 230, 1)",shadowColor:"black",font:'small-caps 16px "Segoe UI"',lineHeight:18,lineWidth:4,pointSize:2,roundRect:8,drawPoints:!1,drawLabels:!0,drawBoxes:!0,drawGestures:!0,drawPolygons:!0,drawGaze:!0,fillPolygons:!1,useDepth:!0,useCurves:!1},f5=0,jl=e=>{if(!e)J("draw error: invalid canvas");else if(!e.getContext)J("draw error: canvas context not defined");else{let t=e.getContext("2d");if(!t)J("draw error: cannot get canvas context");else return t}return null},zc=e=>Math.round(e*180/Math.PI);function m5(e,t,n,s,r){s=s||0,e.fillStyle=r.useDepth&&s?`rgba(${127.5+2*s}, ${127.5-2*s}, 255, 0.3)`:r.color,e.beginPath(),e.arc(t,n,r.pointSize,0,2*Math.PI),e.fill()}function qp(e,t,n,s,r,a){if(e.beginPath(),a.useCurves){let o=(t+t+s)/2,i=(n+n+r)/2;e.ellipse(o,i,s/2,r/2,0,0,2*Math.PI)}else e.lineWidth=a.lineWidth,e.moveTo(t+a.roundRect,n),e.lineTo(t+s-a.roundRect,n),e.quadraticCurveTo(t+s,n,t+s,n+a.roundRect),e.lineTo(t+s,n+r-a.roundRect),e.quadraticCurveTo(t+s,n+r,t+s-a.roundRect,n+r),e.lineTo(t+a.roundRect,n+r),e.quadraticCurveTo(t,n+r,t,n+r-a.roundRect),e.lineTo(t,n+a.roundRect),e.quadraticCurveTo(t,n,t+a.roundRect,n),e.closePath();e.stroke()}function wN(e,t,n){if(!(t.length<2)){e.beginPath(),e.moveTo(t[0][0],t[0][1]);for(let s of t){let r=s[2]||0;e.strokeStyle=n.useDepth&&r!==0?`rgba(${127.5+2*r}, ${127.5-2*r}, 255, 0.3)`:n.color,e.fillStyle=n.useDepth&&r!==0?`rgba(${127.5+2*r}, ${127.5-2*r}, 255, 0.3)`:n.color,e.lineTo(s[0],Math.round(s[1]))}e.stroke(),n.fillPolygons&&(e.closePath(),e.fill())}}function Vye(e,t,n){if(!(t.length<2)){if(!n.useCurves||t.length<=2){wN(e,t,n);return}e.moveTo(t[0][0],t[0][1]);for(let s=0;s1&&l[1].length>0){let c=i[1]>0?`#${i[1]}`:"",u=`${i[0]} ${c}: ${l[1]}`;s.shadowColor&&s.shadowColor!==""&&(r.fillStyle=s.shadowColor,r.fillText(u,8,2+a*s.lineHeight)),r.fillStyle=s.labelColor,r.fillText(u,6,0+a*s.lineHeight),a+=1}}}}async function y5(e,t,n){var a,o,i,l,c;let s=En(ya,n);if(!t||!e)return;let r=jl(e);if(!!r)for(let u of t){if(r.font=s.font,r.strokeStyle=s.color,r.fillStyle=s.color,s.drawBoxes&&qp(r,u.box[0],u.box[1],u.box[2],u.box[3],s),s.drawLabels){let d=[];if(d.push(`face: ${Math.trunc(100*u.score)}%`),u.genderScore&&d.push(`${u.gender||""} ${Math.trunc(100*u.genderScore)}%`),u.age&&d.push(`age: ${u.age||""}`),u.iris&&d.push(`distance: ${u.iris}`),u.real&&d.push(`real: ${Math.trunc(100*u.real)}%`),u.live&&d.push(`live: ${Math.trunc(100*u.live)}%`),u.emotion&&u.emotion.length>0){let p=u.emotion.map(h=>`${Math.trunc(100*h.score)}% ${h.emotion}`);p.length>3&&(p.length=3),d.push(p.join(" "))}u.rotation&&u.rotation.angle&&u.rotation.gaze&&(u.rotation.angle.roll&&d.push(`roll: ${zc(u.rotation.angle.roll)}\xB0 yaw:${zc(u.rotation.angle.yaw)}\xB0 pitch:${zc(u.rotation.angle.pitch)}\xB0`),u.rotation.gaze.bearing&&d.push(`gaze: ${zc(u.rotation.gaze.bearing)}\xB0`)),d.length===0&&d.push("face"),r.fillStyle=s.color;for(let p=d.length-1;p>=0;p--){let h=Math.max(u.box[0],0),f=p*s.lineHeight+u.box[1];s.shadowColor&&s.shadowColor!==""&&(r.fillStyle=s.shadowColor,r.fillText(d[p],h+5,f+16)),r.fillStyle=s.labelColor,r.fillText(d[p],h+4,f+15)}}if(r.lineWidth=1,u.mesh&&u.mesh.length>0){if(s.drawPoints)for(let d of u.mesh)m5(r,d[0],d[1],d[2],s);if(s.drawPolygons){if(r.lineWidth=1,u.mesh.length>450)for(let d=0;du.mesh[h]);wN(r,p,s)}if(u.annotations&&u.annotations.leftEyeIris&&u.annotations.leftEyeIris[0]){r.strokeStyle=s.useDepth?"rgba(255, 200, 255, 0.3)":s.color,r.beginPath();let d=Math.abs(u.annotations.leftEyeIris[3][0]-u.annotations.leftEyeIris[1][0])/2,p=Math.abs(u.annotations.leftEyeIris[4][1]-u.annotations.leftEyeIris[2][1])/2;r.ellipse(u.annotations.leftEyeIris[0][0],u.annotations.leftEyeIris[0][1],d,p,0,0,2*Math.PI),r.stroke(),s.fillPolygons&&(r.fillStyle=s.useDepth?"rgba(255, 255, 200, 0.3)":s.color,r.fill())}if(u.annotations&&u.annotations.rightEyeIris&&u.annotations.rightEyeIris[0]){r.strokeStyle=s.useDepth?"rgba(255, 200, 255, 0.3)":s.color,r.beginPath();let d=Math.abs(u.annotations.rightEyeIris[3][0]-u.annotations.rightEyeIris[1][0])/2,p=Math.abs(u.annotations.rightEyeIris[4][1]-u.annotations.rightEyeIris[2][1])/2;r.ellipse(u.annotations.rightEyeIris[0][0],u.annotations.rightEyeIris[0][1],d,p,0,0,2*Math.PI),r.stroke(),s.fillPolygons&&(r.fillStyle=s.useDepth?"rgba(255, 255, 200, 0.3)":s.color,r.fill())}if(s.drawGaze&&((a=u.rotation)==null?void 0:a.angle)&&typeof Path2D!="undefined"){r.strokeStyle="pink";let d=u.box[0]+u.box[2]/2-u.box[3]*zc(u.rotation.angle.yaw)/90,p=u.box[1]+u.box[3]/2+u.box[2]*zc(u.rotation.angle.pitch)/90,h=new Path2D(` +`;var qx=(e,t,n)=>{let s=new RegExp("\\b"+t+" \\w+ (\\w+)","ig");e.replace(s,(r,a)=>(n[a]=0,r))},k8=class{constructor(t,n,s){fe(this,"uniform",{});fe(this,"attribute",{});fe(this,"gl");fe(this,"id");fe(this,"compile",(t,n)=>{let s=this.gl.createShader(n);return s?(this.gl.shaderSource(s,t),this.gl.compileShader(s),this.gl.getShaderParameter(s,this.gl.COMPILE_STATUS)?s:(J(`filter: gl compile failed: ${this.gl.getShaderInfoLog(s)}`),null)):(J("filter: could not create shader"),null)});this.gl=t;let r=this.compile(n,this.gl.VERTEX_SHADER),a=this.compile(s,this.gl.FRAGMENT_SHADER);if(this.id=this.gl.createProgram(),!(!r||!a)){if(!this.id){J("filter: could not create webgl program");return}if(this.gl.attachShader(this.id,r),this.gl.attachShader(this.id,a),this.gl.linkProgram(this.id),!this.gl.getProgramParameter(this.id,this.gl.LINK_STATUS)){J(`filter: gl link failed: ${this.gl.getProgramInfoLog(this.id)}`);return}this.gl.useProgram(this.id),qx(n,"attribute",this.attribute);for(let o in this.attribute)this.attribute[o]=this.gl.getAttribLocation(this.id,o);qx(n,"uniform",this.uniform),qx(s,"uniform",this.uniform);for(let o in this.uniform)this.uniform[o]=this.gl.getUniformLocation(this.id,o)}}};function S8(){let e=0,t=null,n=!1,s=-1,r=[null,null],a=[],o=null,i=null,l=Xn(100,100),c={},u={INTERMEDIATE:1},d=l.getContext("webgl");if(this.gl=d,!d){J("filter: cannot get webgl context");return}function p(x,A){if(!(x===l.width&&A===l.height)){if(l.width=x,l.height=A,!o){let b=new Float32Array([-1,-1,0,1,1,-1,1,1,-1,1,0,0,-1,1,0,0,1,-1,1,1,1,1,1,0]);o=d.createBuffer(),d.bindBuffer(d.ARRAY_BUFFER,o),d.bufferData(d.ARRAY_BUFFER,b,d.STATIC_DRAW),d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0)}d.viewport(0,0,l.width,l.height),r=[null,null]}}function h(x,A){let b=d.createFramebuffer();d.bindFramebuffer(d.FRAMEBUFFER,b);let w=d.createRenderbuffer();d.bindRenderbuffer(d.RENDERBUFFER,w);let k=d.createTexture();return d.bindTexture(d.TEXTURE_2D,k),d.texImage2D(d.TEXTURE_2D,0,d.RGBA,x,A,0,d.RGBA,d.UNSIGNED_BYTE,null),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.LINEAR),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.LINEAR),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_2D,k,0),d.bindTexture(d.TEXTURE_2D,null),d.bindFramebuffer(d.FRAMEBUFFER,null),{fbo:b,texture:k}}function f(x){return r[x]=r[x]||h(l.width,l.height),r[x]}function m(x=0){if(!i)return;let A=null,b=null,w=!1;e===0?A=t:A=f(s).texture||null,e++,n&&!(x&u.INTERMEDIATE)?(b=null,w=e%2==0):(s=(s+1)%2,b=f(s).fbo||null),d.bindTexture(d.TEXTURE_2D,A),d.bindFramebuffer(d.FRAMEBUFFER,b),d.uniform1f(i.uniform.flipY,w?-1:1),d.drawArrays(d.TRIANGLES,0,6)}function g(x){if(c[x])return i=c[x],d.useProgram((i?i.id:null)||null),i;if(i=new k8(d,y8,x),!i)return J("filter: could not get webgl program"),null;let A=Float32Array.BYTES_PER_ELEMENT,b=4*A;return d.enableVertexAttribArray(i.attribute.pos),d.vertexAttribPointer(i.attribute.pos,2,d.FLOAT,!1,b,0*A),d.enableVertexAttribArray(i.attribute.uv),d.vertexAttribPointer(i.attribute.uv,2,d.FLOAT,!1,b,2*A),c[x]=i,i}let y={colorMatrix:x=>{let A=new Float32Array(x);A[4]/=255,A[9]/=255,A[14]/=255,A[19]/=255;let b=A[18]===1&&A[3]===0&&A[8]===0&&A[13]===0&&A[15]===0&&A[16]===0&&A[17]===0&&A[19]===0?x8:A8,w=g(b);!w||(d.uniform1fv(w.uniform.m,A),m())},brightness:x=>{let A=(x||0)+1;y.colorMatrix([A,0,0,0,0,0,A,0,0,0,0,0,A,0,0,0,0,0,1,0])},saturation:x=>{let A=(x||0)*2/3+1,b=(A-1)*-.5;y.colorMatrix([A,b,b,0,0,b,A,b,0,0,b,b,A,0,0,0,0,0,1,0])},desaturate:()=>{y.saturation(-1)},contrast:x=>{let A=(x||0)+1,b=-128*(A-1);y.colorMatrix([A,0,0,0,b,0,A,0,0,b,0,0,A,0,b,0,0,0,1,0])},negative:()=>{y.contrast(-2)},hue:x=>{x=(x||0)/180*Math.PI;let A=Math.cos(x),b=Math.sin(x),w=.213,k=.715,I=.072;y.colorMatrix([w+A*(1-w)+b*-w,k+A*-k+b*-k,I+A*-I+b*(1-I),0,0,w+A*-w+b*.143,k+A*(1-k)+b*.14,I+A*-I+b*-.283,0,0,w+A*-w+b*-(1-w),k+A*-k+b*k,I+A*(1-I)+b*I,0,0,0,0,0,1,0])},desaturateLuminance:()=>{y.colorMatrix([.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0])},sepia:()=>{y.colorMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0])},brownie:()=>{y.colorMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0])},vintagePinhole:()=>{y.colorMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0])},kodachrome:()=>{y.colorMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0])},technicolor:()=>{y.colorMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0])},polaroid:()=>{y.colorMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0])},shiftToBGR:()=>{y.colorMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0])},convolution:x=>{let A=new Float32Array(x),b=1/l.width,w=1/l.height,k=g(w8);!k||(d.uniform1fv(k.uniform.m,A),d.uniform2f(k.uniform.px,b,w),m())},detectEdges:()=>{y.convolution.call(this,[0,1,0,1,-4,1,0,1,0])},sobelX:()=>{y.convolution.call(this,[-1,0,1,-2,0,2,-1,0,1])},sobelY:()=>{y.convolution.call(this,[-1,-2,-1,0,0,0,1,2,1])},sharpen:x=>{let A=x||1;y.convolution.call(this,[0,-1*A,0,-1*A,1+4*A,-1*A,0,-1*A,0])},emboss:x=>{let A=x||1;y.convolution.call(this,[-2*A,-1*A,0,-1*A,1,1*A,0,1*A,2*A])},blur:x=>{let A=x/7/l.width,b=x/7/l.height,w=g(v8);!w||(d.uniform2f(w.uniform.px,0,b),m(u.INTERMEDIATE),d.uniform2f(w.uniform.px,A,0),m())},pixelate:x=>{let A=x/l.width,b=x/l.height,w=g(b8);!w||(d.uniform2f(w.uniform.size,A,b),m())}};this.add=function(x){let A=Array.prototype.slice.call(arguments,1),b=y[x];a.push({func:b,args:A})},this.reset=function(){a=[]},this.get=function(){return a},this.apply=function(x){p(x.width,x.height),e=0,t||(t=d.createTexture()),d.bindTexture(d.TEXTURE_2D,t),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.NEAREST),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.NEAREST),d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,x);for(let A=0;Ah.data())),o=.99*Math.max(a[0][0],a[1][0],a[2][0]),i=[he(n[0],s[0]),he(n[1],s[1]),he(n[2],s[2])],l=[he(r[0],s[0]),he(r[1],s[1]),he(r[2],s[2])],c=[de(o,l[0]),de(o,l[1]),de(o,l[2])],u=[L(i[0],c[0]),L(i[1],c[1]),L(i[2],c[2])],d=an([u[0],u[1],u[2]],2),p=H(d,[1,t.shape[0],t.shape[1],3]);return te([...n,...s,...r,...i,...l,...c,...u,d,t]),p}var p0=2048,ct=null,cn=null,Tc=null,Nt,ca={inputSum:0,cacheDiff:1,sumMethod:0,inputTensor:void 0};function Xn(e,t){let n;if(pe.browser)if(pe.worker){if(typeof OffscreenCanvas=="undefined")throw new Error("canvas error: attempted to run in web worker but OffscreenCanvas is not supported");n=new OffscreenCanvas(e,t)}else{if(typeof document=="undefined")throw new Error("canvas error: attempted to run in browser but DOM is not defined");n=document.createElement("canvas"),n.width=e,n.height=t}else typeof pe.Canvas!="undefined"?n=new pe.Canvas(e,t):typeof globalThis.Canvas!="undefined"&&(n=new globalThis.Canvas(e,t));return n}function Xx(e,t){let n=t||Xn(e.width,e.height);return n.getContext("2d").drawImage(e,0,0),n}async function Nc(e,t,n=!0){if(!e)return t.debug&&J("input error: input is missing"),{tensor:null,canvas:null};if(!(e instanceof et)&&!(typeof Image!="undefined"&&e instanceof Image)&&!(typeof pe.Canvas!="undefined"&&e instanceof pe.Canvas)&&!(typeof globalThis.Canvas!="undefined"&&e instanceof globalThis.Canvas)&&!(typeof ImageData!="undefined"&&e instanceof ImageData)&&!(typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap)&&!(typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement)&&!(typeof HTMLMediaElement!="undefined"&&e instanceof HTMLMediaElement)&&!(typeof HTMLVideoElement!="undefined"&&e instanceof HTMLVideoElement)&&!(typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement)&&!(typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas))throw new Error("input error: type is not recognized");if(e instanceof et){let s=null;if(e.isDisposedInternal)throw new Error("input error: attempted to use tensor but it is disposed");if(!e.shape)throw new Error("input error: attempted to use tensor without a shape");if(e.shape.length===3){if(e.shape[2]===3)s=Zt(e,0);else if(e.shape[2]===4){let r=pl(e,[0,0,0],[-1,-1,3]);s=Zt(r,0),te(r)}}else e.shape.length===4&&(e.shape[3]===3?s=Ln(e):e.shape[3]===4&&(s=hl(e,[0,0,0,0],[-1,-1,-1,3])));if(s==null||s.shape.length!==4||s.shape[0]!==1||s.shape[3]!==3)throw new Error(`input error: attempted to use tensor with unrecognized shape: ${e.shape}`);if(s.dtype==="int32"){let r=me(s,"float32");te(s),s=r}return{tensor:s,canvas:t.filter.return?cn:null}}else{if(typeof e.readyState!="undefined"&&e.readyState<=2)return t.debug&&J("input stream is not ready"),{tensor:null,canvas:ct};let s=e.naturalWidth||e.videoWidth||e.width||e.shape&&e.shape[1]>0,r=e.naturalHeight||e.videoHeight||e.height||e.shape&&e.shape[2]>0;if(!s||!r)return t.debug&&J("cannot determine input dimensions"),{tensor:null,canvas:ct};let a=s,o=r;if(a>p0&&(a=p0,o=Math.trunc(a*r/s)),o>p0&&(o=p0,a=Math.trunc(o*s/r)),(t.filter.width||0)>0?a=t.filter.width:(t.filter.height||0)>0&&(a=s*((t.filter.height||0)/r)),(t.filter.height||0)>0?o=t.filter.height:(t.filter.width||0)>0&&(o=r*((t.filter.width||0)/s)),!a||!o)throw new Error("input error: cannot determine dimension");(!ct||(ct==null?void 0:ct.width)!==a||(ct==null?void 0:ct.height)!==o)&&(ct=Xn(a,o));let i=ct.getContext("2d");if(typeof ImageData!="undefined"&&e instanceof ImageData?i.putImageData(e,0,0):t.filter.flip&&typeof i.translate!="undefined"?(i.translate(s,0),i.scale(-1,1),i.drawImage(e,0,0,s,r,0,0,ct==null?void 0:ct.width,ct==null?void 0:ct.height),i.setTransform(1,0,0,1,0,0)):i.drawImage(e,0,0,s,r,0,0,ct==null?void 0:ct.width,ct==null?void 0:ct.height),(!cn||ct.width!==cn.width||(ct==null?void 0:ct.height)!==(cn==null?void 0:cn.height))&&(cn=Xn(ct.width,ct.height)),t.filter.enabled&&pe.webgl.supported){if(Nt||(Nt=pe.browser?new S8:null),pe.filter=!!Nt,!Nt||!Nt.add)return t.debug&&J("input process error: cannot initialize filters"),{tensor:null,canvas:ct};Nt.reset(),t.filter.brightness!==0&&Nt.add("brightness",t.filter.brightness),t.filter.contrast!==0&&Nt.add("contrast",t.filter.contrast),t.filter.sharpness!==0&&Nt.add("sharpen",t.filter.sharpness),t.filter.blur!==0&&Nt.add("blur",t.filter.blur),t.filter.saturation!==0&&Nt.add("saturation",t.filter.saturation),t.filter.hue!==0&&Nt.add("hue",t.filter.hue),t.filter.negative&&Nt.add("negative"),t.filter.sepia&&Nt.add("sepia"),t.filter.vintage&&Nt.add("brownie"),t.filter.sepia&&Nt.add("sepia"),t.filter.kodachrome&&Nt.add("kodachrome"),t.filter.technicolor&&Nt.add("technicolor"),t.filter.polaroid&&Nt.add("polaroid"),t.filter.pixelate!==0&&Nt.add("pixelate",t.filter.pixelate),Nt.get()>0?cn=Nt.apply(ct):cn=Nt.draw(ct)}else Xx(ct,cn),Nt&&(Nt=null),pe.filter=!!Nt;if(!n)return{tensor:null,canvas:cn};if(!cn)throw new Error("canvas error: cannot create output");let l,c=3;if(typeof ImageData!="undefined"&&e instanceof ImageData||e.data&&e.width&&e.height)if(pe.browser&&Ys)l=Ys?Ys.fromPixels(e):null;else{c=e.data.length/e.height/e.width;let p=new Uint8Array(e.data.buffer);l=pt(p,[e.height,e.width,c],"int32")}else if((!Tc||cn.width!==Tc.width||cn.height!==Tc.height)&&(Tc=Xn(cn.width,cn.height)),Ys&&pe.browser)t.backend==="webgl"||t.backend==="humangl"||t.backend==="webgpu"?l=Ys.fromPixels(cn):(Tc=Xx(cn),l=Ys.fromPixels(Tc));else{let f=Xx(cn).getContext("2d").getImageData(0,0,a,o);c=f.data.length/a/o;let m=new Uint8Array(f.data.buffer);l=pt(m,[a,o,c])}if(c===4){let p=pl(l,[0,0,0],[-1,-1,3]);te(l),l=p}if(!l)throw new Error("input error: cannot create tensor");let u=me(l,"float32"),d=t.filter.equalization?await d0(u):Zt(u,0);return te([l,u]),{tensor:d,canvas:t.filter.return?cn:null}}}async function I8(e,t){let n=!1;if(e.cacheSensitivity===0||!t.shape||t.shape.length!==4||t.shape[1]>2048||t.shape[2]>2048)return n;if(!ca.inputTensor)ca.inputTensor=Ln(t);else if(ca.inputTensor.shape[1]!==t.shape[1]||ca.inputTensor.shape[2]!==t.shape[2])te(ca.inputTensor),ca.inputTensor=Ln(t);else{let s={};s.diff=he(t,ca.inputTensor),s.squared=L(s.diff,s.diff),s.sum=we(s.squared);let a=(await s.sum.data())[0]/(t.shape[1]||1)/(t.shape[2]||1)/255/3;te([ca.inputTensor,s.diff,s.squared,s.sum]),ca.inputTensor=Ln(t),n=a<=e.cacheSensitivity}return n}async function C8(e,t,n){let s={};if(!t||!n||t.shape.length!==4||t.shape.length!==n.shape.length)return e.debug||J("invalid input tensor or tensor shapes do not match:",t.shape,n.shape),0;if(t.shape[0]!==1||n.shape[0]!==1||t.shape[3]!==3||n.shape[3]!==3)return e.debug||J("input tensors must be of shape [1, height, width, 3]:",t.shape,n.shape),0;s.input1=Ln(t),s.input2=t.shape[1]!==n.shape[1]||t.shape[2]!==n.shape[2]?Se.resizeBilinear(n,[t.shape[1],t.shape[2]]):Ln(n),s.diff=he(s.input1,s.input2),s.squared=L(s.diff,s.diff),s.sum=we(s.squared);let a=(await s.sum.data())[0]/(t.shape[1]||1)/(t.shape[2]||1)/255/3;return te([s.input1,s.input2,s.diff,s.squared,s.sum]),a}var T8=class{constructor(){fe(this,"browser");fe(this,"node");fe(this,"worker");fe(this,"platform","");fe(this,"agent","");fe(this,"backends",[]);fe(this,"initial");fe(this,"filter");fe(this,"tfjs");fe(this,"offscreen");fe(this,"perfadd",!1);fe(this,"wasm",{supported:void 0,backend:void 0,simd:void 0,multithread:void 0});fe(this,"webgl",{supported:void 0,backend:void 0,version:void 0,renderer:void 0});fe(this,"webgpu",{supported:void 0,backend:void 0,adapter:void 0});fe(this,"cpu",{model:void 0,flags:[]});fe(this,"kernels",[]);fe(this,"Canvas");fe(this,"Image");fe(this,"ImageData");if(this.browser=typeof navigator!="undefined",this.node=typeof process!="undefined"&&typeof process.versions!="undefined"&&typeof process.versions.node!="undefined",this.tfjs={version:c0["tfjs-core"]},this.offscreen=typeof OffscreenCanvas!="undefined",this.initial=!0,this.worker=this.browser&&this.offscreen?typeof WorkerGlobalScope!="undefined":void 0,typeof navigator!="undefined"){let t=navigator.userAgent.match(/\(([^()]+)\)/g);if(t&&t[0]){let n=t[0].match(/\(([^()]+)\)/g);this.platform=n&&n[0]?n[0].replace(/\(|\)/g,""):"",this.agent=navigator.userAgent.replace(t[0],""),this.platform[1]&&(this.agent=this.agent.replace(t[1],"")),this.agent=this.agent.replace(/ /g," ")}}else typeof process!="undefined"&&(this.platform=`${process.platform} ${process.arch}`,this.agent=`NodeJS ${process.version}`)}async updateBackend(){this.backends=Object.keys(rs().registryFactory),this.wasm.supported=typeof WebAssembly!="undefined",this.wasm.backend=this.backends.includes("wasm"),this.wasm.supported&&this.wasm.backend&&Ds()==="wasm"&&(this.wasm.simd=await Y().getAsync("WASM_HAS_SIMD_SUPPORT"),this.wasm.multithread=await Y().getAsync("WASM_HAS_MULTITHREAD_SUPPORT"));let t=Xn(100,100),n=t?t.getContext("webgl2"):void 0;if(this.webgl.supported=typeof n!="undefined",this.webgl.backend=this.backends.includes("webgl"),this.webgl.supported&&this.webgl.backend&&(Ds()==="webgl"||Ds()==="humangl")){let s=Rr().gpgpu!=="undefined"?await Rr().getGPGPUContext().gl:null;s&&(this.webgl.version=s.getParameter(s.VERSION),this.webgl.renderer=s.getParameter(s.RENDERER))}this.webgpu.supported=this.browser&&typeof navigator.gpu!="undefined",this.webgpu.backend=this.backends.includes("webgpu");try{this.webgpu.supported&&(this.webgpu.adapter=(await navigator.gpu.requestAdapter()).name)}catch(s){this.webgpu.supported=!1}try{this.kernels=Zr(Ds()).map(s=>s.kernelName.toLowerCase())}catch(s){}}async updateCPU(){let t={model:"",flags:[]};this.node&&this.platform.startsWith("linux"),this.cpu?this.cpu=t:Object.defineProperty(this,"cpu",{value:t})}},pe=new T8;var Kx="2.5.6";var hs,Zx=[],U2e=["white","black","asian","indian","other"],G2e=[15,23,28,35.5,45.5,55.5,65],N8=0,E8=0,Yx=Number.MAX_SAFE_INTEGER;async function R8(e){return pe.initial&&(hs=null),hs?e.debug&&J("cached model:",hs.modelUrl):(hs=await Be(We(e.modelBasePath,e.face.gear.modelPath)),!hs||!hs.modelUrl?J("load model failed:",e.face.gear.modelPath):e.debug&&J("load model:",hs.modelUrl)),hs}async function Jx(e,t,n,s){var o,i;if(!hs)return{age:0,gender:"unknown",genderScore:0,race:[]};let r=Yx<(((o=t.face.gear)==null?void 0:o.skipFrames)||0),a=(((i=t.face.gear)==null?void 0:i.skipTime)||0)>ie()-E8;return t.skipAllowed&&a&&r&&N8===s&&Zx[n]?(Yx++,Zx[n]):(Yx=0,new Promise(async l=>{var y,x;if(!(hs==null?void 0:hs.inputs[0].shape))return;let c={},u=[[0,.1,.9,.9]];c.resize=Se.cropAndResize(e,u,[0],[hs.inputs[0].shape[2],hs.inputs[0].shape[1]]);let d={age:0,gender:"unknown",genderScore:0,race:[]};((y=t.face.gear)==null?void 0:y.enabled)&&([c.age,c.gender,c.race]=hs.execute(c.resize,["age_output","gender_output","race_output"]));let p=await c.gender.data();d.gender=p[0]>p[1]?"male":"female",d.genderScore=Math.round(100*(p[0]>p[1]?p[0]:p[1]))/100;let h=await c.race.data();for(let A=0;A(((x=t.face.gear)==null?void 0:x.minConfidence)||.2)&&d.race.push({score:Math.round(100*h[A])/100,race:U2e[A]});d.race.sort((A,b)=>b.score-A.score);let m=Array.from(await c.age.data()).map((A,b)=>[G2e[b],A]).sort((A,b)=>b[1]-A[1]),g=m[0][0];for(let A=1;Ate(c[A])),Zx[n]=d,N8=s,E8=ie(),l(d)}))}var Xe={tf255:255,tf1:1,tf2:2,tf05:.5,tf127:127.5,rgb:[.2989,.587,.114]};function _8(){Xe.tf255=Ce(255,"float32"),Xe.tf1=Ce(1,"float32"),Xe.tf2=Ce(2,"float32"),Xe.tf05=Ce(.5,"float32"),Xe.tf127=Ce(127.5,"float32"),Xe.rgb=Ct([.2989,.587,.114],"float32")}var Dn,h0=[],$8=0,D8=0,Qx=Number.MAX_SAFE_INTEGER;async function F8(e){return pe.initial&&(Dn=null),Dn?e.debug&&J("cached model:",Dn.modelUrl):(Dn=await Be(We(e.modelBasePath,e.face.ssrnet.modelPathAge)),!Dn||!Dn.modelUrl?J("load model failed:",e.face.ssrnet.modelPathAge):e.debug&&J("load model:",Dn.modelUrl)),Dn}async function eb(e,t,n,s){var o,i,l,c;if(!Dn)return{age:0};let r=Qx<(((o=t.face.ssrnet)==null?void 0:o.skipFrames)||0),a=(((i=t.face.ssrnet)==null?void 0:i.skipTime)||0)>ie()-D8;return t.skipAllowed&&r&&a&&$8===s&&((l=h0[n])==null?void 0:l.age)&&((c=h0[n])==null?void 0:c.age)>0?(Qx++,h0[n]):(Qx=0,new Promise(async u=>{if(!(Dn==null?void 0:Dn.inputs)||!Dn.inputs[0]||!Dn.inputs[0].shape)return;let d={};d.resize=Se.resizeBilinear(e,[Dn.inputs[0].shape[2],Dn.inputs[0].shape[1]],!1),d.enhance=L(d.resize,Xe.tf255);let p={age:0};if(t.face.ssrnet.enabled&&(d.age=Dn.execute(d.enhance)),d.age){let h=await d.age.data();p.age=Math.trunc(10*h[0])/10}Object.keys(d).forEach(h=>te(d[h])),h0[n]=p,$8=s,D8=ie(),u(p)}))}var fs,f0=[],P8=0,O8=0,tb=Number.MAX_SAFE_INTEGER,nb=[.2989,.587,.114];async function M8(e){return pe.initial&&(fs=null),fs?e.debug&&J("cached model:",fs.modelUrl):(fs=await Be(We(e.modelBasePath,e.face.ssrnet.modelPathGender)),!fs||!fs.modelUrl?J("load model failed:",e.face.ssrnet.modelPathGender):e.debug&&J("load model:",fs.modelUrl)),fs}async function sb(e,t,n,s){var o,i,l,c;if(!fs)return{gender:"unknown",genderScore:0};let r=tb<(((o=t.face.ssrnet)==null?void 0:o.skipFrames)||0),a=(((i=t.face.ssrnet)==null?void 0:i.skipTime)||0)>ie()-O8;return t.skipAllowed&&r&&a&&P8===s&&((l=f0[n])==null?void 0:l.gender)&&((c=f0[n])==null?void 0:c.genderScore)>0?(tb++,f0[n]):(tb=0,new Promise(async u=>{if(!(fs==null?void 0:fs.inputs[0].shape))return;let d={};d.resize=Se.resizeBilinear(e,[fs.inputs[0].shape[2],fs.inputs[0].shape[1]],!1),d.enhance=K(()=>{let[f,m,g]=Yt(d.resize,3,3),y=L(f,nb[0]),x=L(m,nb[1]),A=L(g,nb[2]),b=mf([y,x,A]);return L(he(b,Xe.tf05),2)});let p={gender:"unknown",genderScore:0};t.face.ssrnet.enabled&&(d.gender=fs.execute(d.enhance));let h=await d.gender.data();p.gender=h[0]>h[1]?"female":"male",p.genderScore=h[0]>h[1]?Math.trunc(100*h[0])/100:Math.trunc(100*h[1])/100,Object.keys(d).forEach(f=>te(d[f])),f0[n]=p,P8=s,O8=ie(),u(p)}))}var dn,m0=[],rb=Number.MAX_SAFE_INTEGER,z8=0,L8=0;async function B8(e){var t,n;return pe.initial&&(dn=null),dn?e.debug&&J("cached model:",dn.modelUrl):(dn=await Be(We(e.modelBasePath,((t=e.face.antispoof)==null?void 0:t.modelPath)||"")),!dn||!dn.modelUrl?J("load model failed:",(n=e.face.antispoof)==null?void 0:n.modelPath):e.debug&&J("load model:",dn.modelUrl)),dn}async function ab(e,t,n,s){var o,i;if(!dn)return 0;let r=(((o=t.face.antispoof)==null?void 0:o.skipTime)||0)>ie()-L8,a=rb<(((i=t.face.antispoof)==null?void 0:i.skipFrames)||0);return t.skipAllowed&&r&&a&&z8===s&&m0[n]?(rb++,m0[n]):(rb=0,new Promise(async l=>{let c=Se.resizeBilinear(e,[(dn==null?void 0:dn.inputs[0].shape)?dn.inputs[0].shape[2]:0,(dn==null?void 0:dn.inputs[0].shape)?dn.inputs[0].shape[1]:0],!1),u=dn==null?void 0:dn.execute(c),d=(await u.data())[0];m0[n]=Math.round(100*d)/100,z8=s,L8=ie(),te([c,u]),l(m0[n])}))}var or={silhouette:[10,338,297,332,284,251,389,356,454,323,361,288,397,365,379,378,400,377,152,148,176,149,150,136,172,58,132,93,234,127,162,21,54,103,67,109],lipsUpperOuter:[61,185,40,39,37,0,267,269,270,409,291],lipsLowerOuter:[146,91,181,84,17,314,405,321,375,291],lipsUpperInner:[78,191,80,81,82,13,312,311,310,415,308],lipsLowerInner:[78,95,88,178,87,14,317,402,318,324,308],rightEyeUpper0:[246,161,160,159,158,157,173],rightEyeLower0:[33,7,163,144,145,153,154,155,133],rightEyeUpper1:[247,30,29,27,28,56,190],rightEyeLower1:[130,25,110,24,23,22,26,112,243],rightEyeUpper2:[113,225,224,223,222,221,189],rightEyeLower2:[226,31,228,229,230,231,232,233,244],rightEyeLower3:[143,111,117,118,119,120,121,128,245],rightEyebrowUpper:[156,70,63,105,66,107,55,193],rightEyebrowLower:[35,124,46,53,52,65],rightEyeIris:[473,474,475,476,477],leftEyeUpper0:[466,388,387,386,385,384,398],leftEyeLower0:[263,249,390,373,374,380,381,382,362],leftEyeUpper1:[467,260,259,257,258,286,414],leftEyeLower1:[359,255,339,254,253,252,256,341,463],leftEyeUpper2:[342,445,444,443,442,441,413],leftEyeLower2:[446,261,448,449,450,451,452,453,464],leftEyeLower3:[372,340,346,347,348,349,350,357,465],leftEyebrowUpper:[383,300,293,334,296,336,285,417],leftEyebrowLower:[265,353,276,283,282,295],leftEyeIris:[468,469,470,471,472],midwayBetweenEyes:[168],noseTip:[1],noseBottom:[2],noseRightCorner:[98],noseLeftCorner:[327],rightCheek:[205],leftCheek:[425]},ob={count:468,mouth:13,symmetryLine:[13,or.midwayBetweenEyes[0]]},Mp={leftEye:0,rightEye:1,nose:2,mouth:3,leftEar:4,rightEar:5,symmetryLine:[3,2]},ib=[{key:"EyeUpper0",indices:[9,10,11,12,13,14,15]},{key:"EyeUpper1",indices:[25,26,27,28,29,30,31]},{key:"EyeUpper2",indices:[41,42,43,44,45,46,47]},{key:"EyeLower0",indices:[0,1,2,3,4,5,6,7,8]},{key:"EyeLower1",indices:[16,17,18,19,20,21,22,23,24]},{key:"EyeLower2",indices:[32,33,34,35,36,37,38,39,40]},{key:"EyeLower3",indices:[54,55,56,57,58,59,60,61,62]}],zp=[[.499976992607117,.652534008026123],[.500025987625122,.547487020492554],[.499974012374878,.602371990680695],[.482113003730774,.471979022026062],[.500150978565216,.527155995368958],[.499909996986389,.498252987861633],[.499523013830185,.40106201171875],[.289712011814117,.380764007568359],[.499954998493195,.312398016452789],[.499987006187439,.269918978214264],[.500023007392883,.107050001621246],[.500023007392883,.666234016418457],[.5000159740448,.679224014282227],[.500023007392883,.692348003387451],[.499976992607117,.695277988910675],[.499976992607117,.70593398809433],[.499976992607117,.719385027885437],[.499976992607117,.737019002437592],[.499967992305756,.781370997428894],[.499816000461578,.562981009483337],[.473773002624512,.573909997940063],[.104906998574734,.254140973091125],[.365929991006851,.409575998783112],[.338757991790771,.41302502155304],[.311120003461838,.409460008144379],[.274657994508743,.389131009578705],[.393361985683441,.403706014156342],[.345234006643295,.344011008739471],[.370094001293182,.346076011657715],[.319321990013123,.347265005111694],[.297903001308441,.353591024875641],[.24779200553894,.410809993743896],[.396889001131058,.842755019664764],[.280097991228104,.375599980354309],[.106310002505779,.399955987930298],[.2099249958992,.391353011131287],[.355807989835739,.534406006336212],[.471751004457474,.65040397644043],[.474155008792877,.680191993713379],[.439785003662109,.657229006290436],[.414617002010345,.66654098033905],[.450374007225037,.680860996246338],[.428770989179611,.682690978050232],[.374971002340317,.727805018424988],[.486716985702515,.547628998756409],[.485300987958908,.527395009994507],[.257764995098114,.314490020275116],[.401223003864288,.455172002315521],[.429818987846375,.548614978790283],[.421351999044418,.533740997314453],[.276895999908447,.532056987285614],[.483370006084442,.499586999416351],[.33721199631691,.282882988452911],[.296391993761063,.293242990970612],[.169294998049736,.193813979625702],[.447580009698868,.302609980106354],[.392390012741089,.353887975215912],[.354490011930466,.696784019470215],[.067304998636246,.730105042457581],[.442739009857178,.572826027870178],[.457098007202148,.584792017936707],[.381974011659622,.694710969924927],[.392388999462128,.694203019142151],[.277076005935669,.271932005882263],[.422551989555359,.563233017921448],[.385919004678726,.281364023685455],[.383103013038635,.255840003490448],[.331431001424789,.119714021682739],[.229923993349075,.232002973556519],[.364500999450684,.189113974571228],[.229622006416321,.299540996551514],[.173287004232407,.278747975826263],[.472878992557526,.666198015213013],[.446828007698059,.668527007102966],[.422762006521225,.673889994621277],[.445307999849319,.580065965652466],[.388103008270264,.693961024284363],[.403039008378983,.706539988517761],[.403629004955292,.693953037261963],[.460041999816895,.557139039039612],[.431158006191254,.692366003990173],[.452181994915009,.692366003990173],[.475387006998062,.692366003990173],[.465828001499176,.779190003871918],[.472328990697861,.736225962638855],[.473087012767792,.717857003211975],[.473122000694275,.704625964164734],[.473033010959625,.695277988910675],[.427942007780075,.695277988910675],[.426479011774063,.703539967536926],[.423162013292313,.711845993995667],[.4183090031147,.720062971115112],[.390094995498657,.639572978019714],[.013953999616206,.560034036636353],[.499913990497589,.58014702796936],[.413199990987778,.69539999961853],[.409626007080078,.701822996139526],[.468080013990402,.601534962654114],[.422728985548019,.585985004901886],[.463079988956451,.593783974647522],[.37211999297142,.47341400384903],[.334562003612518,.496073007583618],[.411671012639999,.546965003013611],[.242175996303558,.14767599105835],[.290776997804642,.201445996761322],[.327338010072708,.256527006626129],[.399509996175766,.748921036720276],[.441727995872498,.261676013469696],[.429764986038208,.187834024429321],[.412198007106781,.108901023864746],[.288955003023148,.398952007293701],[.218936994671822,.435410976409912],[.41278201341629,.398970007896423],[.257135003805161,.355440020561218],[.427684992551804,.437960982322693],[.448339998722076,.536936044692993],[.178560003638268,.45755398273468],[.247308000922203,.457193970680237],[.286267012357712,.467674970626831],[.332827985286713,.460712015628815],[.368755996227264,.447206974029541],[.398963987827301,.432654976844788],[.476410001516342,.405806005001068],[.189241006970406,.523923993110657],[.228962004184723,.348950982093811],[.490725994110107,.562400996685028],[.404670000076294,.485132992267609],[.019469000399113,.401564002037048],[.426243007183075,.420431017875671],[.396993011236191,.548797011375427],[.266469985246658,.376977026462555],[.439121007919312,.51895797252655],[.032313998788595,.644356966018677],[.419054001569748,.387154996395111],[.462783008813858,.505746960639954],[.238978996872902,.779744982719421],[.198220998048782,.831938028335571],[.107550002634525,.540755033493042],[.183610007166862,.740257024765015],[.134409993886948,.333683013916016],[.385764002799988,.883153975009918],[.490967005491257,.579378008842468],[.382384985685349,.508572995662689],[.174399003386497,.397670984268188],[.318785011768341,.39623498916626],[.343364000320435,.400596976280212],[.396100014448166,.710216999053955],[.187885001301765,.588537991046906],[.430987000465393,.944064974784851],[.318993002176285,.898285031318665],[.266247987747192,.869701027870178],[.500023007392883,.190576016902924],[.499976992607117,.954452991485596],[.366169989109039,.398822009563446],[.393207013607025,.39553701877594],[.410373002290726,.391080021858215],[.194993004202843,.342101991176605],[.388664990663528,.362284004688263],[.365961998701096,.355970978736877],[.343364000320435,.355356991291046],[.318785011768341,.35834002494812],[.301414996385574,.363156020641327],[.058132998645306,.319076001644135],[.301414996385574,.387449026107788],[.499987989664078,.618434011936188],[.415838003158569,.624195992946625],[.445681989192963,.566076993942261],[.465844005346298,.620640993118286],[.49992299079895,.351523995399475],[.288718998432159,.819945991039276],[.335278987884521,.852819979190826],[.440512001514435,.902418971061707],[.128294005990028,.791940987110138],[.408771991729736,.373893976211548],[.455606997013092,.451801002025604],[.499877005815506,.908990025520325],[.375436991453171,.924192011356354],[.11421000212431,.615022003650665],[.448662012815475,.695277988910675],[.4480200111866,.704632043838501],[.447111994028091,.715808033943176],[.444831997156143,.730794012546539],[.430011987686157,.766808986663818],[.406787008047104,.685672998428345],[.400738000869751,.681069016456604],[.392399996519089,.677703022956848],[.367855995893478,.663918972015381],[.247923001646996,.601333022117615],[.452769994735718,.420849978923798],[.43639200925827,.359887003898621],[.416164010763168,.368713974952698],[.413385987281799,.692366003990173],[.228018000721931,.683571994304657],[.468268007040024,.352671027183533],[.411361992359161,.804327011108398],[.499989002943039,.469825029373169],[.479153990745544,.442654013633728],[.499974012374878,.439637005329132],[.432112008333206,.493588984012604],[.499886006116867,.866917014122009],[.49991300702095,.821729004383087],[.456548988819122,.819200992584229],[.344549000263214,.745438992977142],[.37890899181366,.574010014533997],[.374292999505997,.780184984207153],[.319687992334366,.570737957954407],[.357154995203018,.604269981384277],[.295284003019333,.621580958366394],[.447750002145767,.862477004528046],[.410986006259918,.508723020553589],[.31395098567009,.775308012962341],[.354128003120422,.812552988529205],[.324548006057739,.703992962837219],[.189096003770828,.646299958229065],[.279776990413666,.71465802192688],[.1338230073452,.682700991630554],[.336768001317978,.644733011722565],[.429883986711502,.466521978378296],[.455527991056442,.548622965812683],[.437114000320435,.558896005153656],[.467287987470627,.529924988746643],[.414712011814117,.335219979286194],[.37704598903656,.322777986526489],[.344107985496521,.320150971412659],[.312875986099243,.32233202457428],[.283526003360748,.333190023899078],[.241245999932289,.382785975933075],[.102986000478268,.468762993812561],[.267612010240555,.424560010433197],[.297879010438919,.433175981044769],[.333433985710144,.433878004550934],[.366427004337311,.426115989685059],[.396012008190155,.416696012020111],[.420121014118195,.41022801399231],[.007561000064015,.480777025222778],[.432949006557465,.569517970085144],[.458638995885849,.479089021682739],[.473466008901596,.545744001865387],[.476087987422943,.563830018043518],[.468472003936768,.555056989192963],[.433990985155106,.582361996173859],[.483518004417419,.562983989715576],[.482482999563217,.57784903049469],[.42645001411438,.389798998832703],[.438998997211456,.39649498462677],[.450067013502121,.400434017181396],[.289712011814117,.368252992630005],[.276670008897781,.363372981548309],[.517862021923065,.471948027610779],[.710287988185883,.380764007568359],[.526226997375488,.573909997940063],[.895093023777008,.254140973091125],[.634069979190826,.409575998783112],[.661242008209229,.41302502155304],[.688880026340485,.409460008144379],[.725341975688934,.389131009578705],[.606630027294159,.40370500087738],[.654766023159027,.344011008739471],[.629905998706818,.346076011657715],[.680678009986877,.347265005111694],[.702096998691559,.353591024875641],[.75221198797226,.410804986953735],[.602918028831482,.842862963676453],[.719901978969574,.375599980354309],[.893692970275879,.399959981441498],[.790081977844238,.391354024410248],[.643998026847839,.534487962722778],[.528249025344849,.65040397644043],[.525849997997284,.680191040039062],[.560214996337891,.657229006290436],[.585384011268616,.66654098033905],[.549625992774963,.680860996246338],[.57122802734375,.682691991329193],[.624852001667023,.72809898853302],[.513050019741058,.547281980514526],[.51509702205658,.527251958847046],[.742246985435486,.314507007598877],[.598631024360657,.454979002475739],[.570338010787964,.548575043678284],[.578631997108459,.533622980117798],[.723087012767792,.532054007053375],[.516445994377136,.499638974666595],[.662801027297974,.282917976379395],[.70362401008606,.293271005153656],[.830704987049103,.193813979625702],[.552385985851288,.302568018436432],[.607609987258911,.353887975215912],[.645429015159607,.696707010269165],[.932694971561432,.730105042457581],[.557260990142822,.572826027870178],[.542901992797852,.584792017936707],[.6180260181427,.694710969924927],[.607590973377228,.694203019142151],[.722943007946014,.271963000297546],[.577413976192474,.563166975975037],[.614082992076874,.281386971473694],[.616907000541687,.255886018276215],[.668509006500244,.119913995265961],[.770092010498047,.232020974159241],[.635536015033722,.189248979091644],[.77039098739624,.299556016921997],[.826722025871277,.278755009174347],[.527121007442474,.666198015213013],[.553171992301941,.668527007102966],[.577238023281097,.673889994621277],[.554691970348358,.580065965652466],[.611896991729736,.693961024284363],[.59696102142334,.706539988517761],[.596370995044708,.693953037261963],[.539958000183105,.557139039039612],[.568841993808746,.692366003990173],[.547818005084991,.692366003990173],[.52461302280426,.692366003990173],[.534089982509613,.779141008853912],[.527670979499817,.736225962638855],[.526912987232208,.717857003211975],[.526877999305725,.704625964164734],[.526966989040375,.695277988910675],[.572058022022247,.695277988910675],[.573521018028259,.703539967536926],[.57683801651001,.711845993995667],[.581691026687622,.720062971115112],[.609944999217987,.639909982681274],[.986046016216278,.560034036636353],[.5867999792099,.69539999961853],[.590372025966644,.701822996139526],[.531915009021759,.601536989212036],[.577268004417419,.585934996604919],[.536915004253387,.593786001205444],[.627542972564697,.473352015018463],[.665585994720459,.495950996875763],[.588353991508484,.546862006187439],[.757824003696442,.14767599105835],[.709249973297119,.201507985591888],[.672684013843536,.256581008434296],[.600408971309662,.74900496006012],[.55826598405838,.261672019958496],[.570303976535797,.187870979309082],[.588165998458862,.109044015407562],[.711045026779175,.398952007293701],[.781069993972778,.435405015945435],[.587247014045715,.398931980133057],[.742869973182678,.355445981025696],[.572156012058258,.437651991844177],[.55186802148819,.536570012569427],[.821442008018494,.457556009292603],[.752701997756958,.457181990146637],[.71375697851181,.467626988887787],[.66711300611496,.460672974586487],[.631101012229919,.447153985500336],[.6008620262146,.432473003864288],[.523481011390686,.405627012252808],[.810747981071472,.523926019668579],[.771045982837677,.348959028720856],[.509127020835876,.562718033790588],[.595292985439301,.485023975372314],[.980530977249146,.401564002037048],[.573499977588654,.420000016689301],[.602994978427887,.548687994480133],[.733529984951019,.376977026462555],[.560611009597778,.519016981124878],[.967685997486115,.644356966018677],[.580985009670258,.387160003185272],[.537728011608124,.505385041236877],[.760966002941132,.779752969741821],[.801778972148895,.831938028335571],[.892440974712372,.54076099395752],[.816350996494293,.740260004997253],[.865594983100891,.333687007427216],[.614073991775513,.883246004581451],[.508952975273132,.579437971115112],[.617941975593567,.508316040039062],[.825608015060425,.397674977779388],[.681214988231659,.39623498916626],[.656635999679565,.400596976280212],[.603900015354156,.710216999053955],[.81208598613739,.588539004325867],[.56801301240921,.944564998149872],[.681007981300354,.898285031318665],[.733752012252808,.869701027870178],[.633830010890961,.398822009563446],[.606792986392975,.39553701877594],[.589659988880157,.391062021255493],[.805015981197357,.342108011245728],[.611334979534149,.362284004688263],[.634037971496582,.355970978736877],[.656635999679565,.355356991291046],[.681214988231659,.35834002494812],[.698584973812103,.363156020641327],[.941866993904114,.319076001644135],[.698584973812103,.387449026107788],[.584177017211914,.624107003211975],[.554318010807037,.566076993942261],[.534153997898102,.62064003944397],[.711217999458313,.819975018501282],[.664629995822906,.852871000766754],[.559099972248077,.902631998062134],[.871706008911133,.791940987110138],[.591234028339386,.373893976211548],[.544341027736664,.451583981513977],[.624562978744507,.924192011356354],[.88577002286911,.615028977394104],[.551338016986847,.695277988910675],[.551980018615723,.704632043838501],[.552887976169586,.715808033943176],[.555167973041534,.730794012546539],[.569944024085999,.767035007476807],[.593203008174896,.685675978660583],[.599261999130249,.681069016456604],[.607599973678589,.677703022956848],[.631937980651855,.663500010967255],[.752032995223999,.601315021514893],[.547226011753082,.420395016670227],[.563543975353241,.359827995300293],[.583841025829315,.368713974952698],[.586614012718201,.692366003990173],[.771915018558502,.683578014373779],[.531597018241882,.352482974529266],[.588370978832245,.804440975189209],[.52079701423645,.442565023899078],[.567984998226166,.493479013442993],[.543282985687256,.819254994392395],[.655317008495331,.745514988899231],[.621008992195129,.574018001556396],[.625559985637665,.78031200170517],[.680198013782501,.570719003677368],[.64276397228241,.604337990283966],[.704662978649139,.621529996395111],[.552012026309967,.862591981887817],[.589071989059448,.508637011051178],[.685944974422455,.775357007980347],[.645735025405884,.812640011310577],[.675342977046967,.703978002071381],[.810858011245728,.646304965019226],[.72012197971344,.714666962623596],[.866151988506317,.682704985141754],[.663187026977539,.644596993923187],[.570082008838654,.466325998306274],[.544561982154846,.548375964164734],[.562758982181549,.558784961700439],[.531987011432648,.530140042304993],[.585271000862122,.335177004337311],[.622952997684479,.32277899980545],[.655896008014679,.320163011550903],[.687132000923157,.322345972061157],[.716481983661652,.333200991153717],[.758756995201111,.382786989212036],[.897013008594513,.468769013881683],[.732392013072968,.424547016620636],[.70211398601532,.433162987232208],[.66652500629425,.433866024017334],[.633504986763,.426087975502014],[.603875994682312,.416586995124817],[.579657971858978,.409945011138916],[.992439985275269,.480777025222778],[.567192018032074,.569419980049133],[.54136598110199,.478899002075195],[.526564002037048,.546118021011353],[.523913025856018,.563830018043518],[.531529009342194,.555056989192963],[.566035985946655,.582329034805298],[.51631098985672,.563053965568542],[.5174720287323,.577877044677734],[.573594987392426,.389806985855103],[.560697972774506,.395331978797913],[.549755990505219,.399751007556915],[.710287988185883,.368252992630005],[.723330020904541,.363372981548309]],Ml=[127,34,139,11,0,37,232,231,120,72,37,39,128,121,47,232,121,128,104,69,67,175,171,148,157,154,155,118,50,101,73,39,40,9,151,108,48,115,131,194,204,211,74,40,185,80,42,183,40,92,186,230,229,118,202,212,214,83,18,17,76,61,146,160,29,30,56,157,173,106,204,194,135,214,192,203,165,98,21,71,68,51,45,4,144,24,23,77,146,91,205,50,187,201,200,18,91,106,182,90,91,181,85,84,17,206,203,36,148,171,140,92,40,39,193,189,244,159,158,28,247,246,161,236,3,196,54,68,104,193,168,8,117,228,31,189,193,55,98,97,99,126,47,100,166,79,218,155,154,26,209,49,131,135,136,150,47,126,217,223,52,53,45,51,134,211,170,140,67,69,108,43,106,91,230,119,120,226,130,247,63,53,52,238,20,242,46,70,156,78,62,96,46,53,63,143,34,227,173,155,133,123,117,111,44,125,19,236,134,51,216,206,205,154,153,22,39,37,167,200,201,208,36,142,100,57,212,202,20,60,99,28,158,157,35,226,113,160,159,27,204,202,210,113,225,46,43,202,204,62,76,77,137,123,116,41,38,72,203,129,142,64,98,240,49,102,64,41,73,74,212,216,207,42,74,184,169,170,211,170,149,176,105,66,69,122,6,168,123,147,187,96,77,90,65,55,107,89,90,180,101,100,120,63,105,104,93,137,227,15,86,85,129,102,49,14,87,86,55,8,9,100,47,121,145,23,22,88,89,179,6,122,196,88,95,96,138,172,136,215,58,172,115,48,219,42,80,81,195,3,51,43,146,61,171,175,199,81,82,38,53,46,225,144,163,110,246,33,7,52,65,66,229,228,117,34,127,234,107,108,69,109,108,151,48,64,235,62,78,191,129,209,126,111,35,143,163,161,246,117,123,50,222,65,52,19,125,141,221,55,65,3,195,197,25,7,33,220,237,44,70,71,139,122,193,245,247,130,33,71,21,162,153,158,159,170,169,150,188,174,196,216,186,92,144,160,161,2,97,167,141,125,241,164,167,37,72,38,12,145,159,160,38,82,13,63,68,71,226,35,111,158,153,154,101,50,205,206,92,165,209,198,217,165,167,97,220,115,218,133,112,243,239,238,241,214,135,169,190,173,133,171,208,32,125,44,237,86,87,178,85,86,179,84,85,180,83,84,181,201,83,182,137,93,132,76,62,183,61,76,184,57,61,185,212,57,186,214,207,187,34,143,156,79,239,237,123,137,177,44,1,4,201,194,32,64,102,129,213,215,138,59,166,219,242,99,97,2,94,141,75,59,235,24,110,228,25,130,226,23,24,229,22,23,230,26,22,231,112,26,232,189,190,243,221,56,190,28,56,221,27,28,222,29,27,223,30,29,224,247,30,225,238,79,20,166,59,75,60,75,240,147,177,215,20,79,166,187,147,213,112,233,244,233,128,245,128,114,188,114,217,174,131,115,220,217,198,236,198,131,134,177,132,58,143,35,124,110,163,7,228,110,25,356,389,368,11,302,267,452,350,349,302,303,269,357,343,277,452,453,357,333,332,297,175,152,377,384,398,382,347,348,330,303,304,270,9,336,337,278,279,360,418,262,431,304,408,409,310,415,407,270,409,410,450,348,347,422,430,434,313,314,17,306,307,375,387,388,260,286,414,398,335,406,418,364,367,416,423,358,327,251,284,298,281,5,4,373,374,253,307,320,321,425,427,411,421,313,18,321,405,406,320,404,405,315,16,17,426,425,266,377,400,369,322,391,269,417,465,464,386,257,258,466,260,388,456,399,419,284,332,333,417,285,8,346,340,261,413,441,285,327,460,328,355,371,329,392,439,438,382,341,256,429,420,360,364,394,379,277,343,437,443,444,283,275,440,363,431,262,369,297,338,337,273,375,321,450,451,349,446,342,467,293,334,282,458,461,462,276,353,383,308,324,325,276,300,293,372,345,447,382,398,362,352,345,340,274,1,19,456,248,281,436,427,425,381,256,252,269,391,393,200,199,428,266,330,329,287,273,422,250,462,328,258,286,384,265,353,342,387,259,257,424,431,430,342,353,276,273,335,424,292,325,307,366,447,345,271,303,302,423,266,371,294,455,460,279,278,294,271,272,304,432,434,427,272,407,408,394,430,431,395,369,400,334,333,299,351,417,168,352,280,411,325,319,320,295,296,336,319,403,404,330,348,349,293,298,333,323,454,447,15,16,315,358,429,279,14,15,316,285,336,9,329,349,350,374,380,252,318,402,403,6,197,419,318,319,325,367,364,365,435,367,397,344,438,439,272,271,311,195,5,281,273,287,291,396,428,199,311,271,268,283,444,445,373,254,339,263,466,249,282,334,296,449,347,346,264,447,454,336,296,299,338,10,151,278,439,455,292,407,415,358,371,355,340,345,372,390,249,466,346,347,280,442,443,282,19,94,370,441,442,295,248,419,197,263,255,359,440,275,274,300,383,368,351,412,465,263,467,466,301,368,389,380,374,386,395,378,379,412,351,419,436,426,322,373,390,388,2,164,393,370,462,461,164,0,267,302,11,12,374,373,387,268,12,13,293,300,301,446,261,340,385,384,381,330,266,425,426,423,391,429,355,437,391,327,326,440,457,438,341,382,362,459,457,461,434,430,394,414,463,362,396,369,262,354,461,457,316,403,402,315,404,403,314,405,404,313,406,405,421,418,406,366,401,361,306,408,407,291,409,408,287,410,409,432,436,410,434,416,411,264,368,383,309,438,457,352,376,401,274,275,4,421,428,262,294,327,358,433,416,367,289,455,439,462,370,326,2,326,370,305,460,455,254,449,448,255,261,446,253,450,449,252,451,450,256,452,451,341,453,452,413,464,463,441,413,414,258,442,441,257,443,442,259,444,443,260,445,444,467,342,445,459,458,250,289,392,290,290,328,460,376,433,435,250,290,392,411,416,433,341,463,464,453,464,465,357,465,412,343,412,399,360,363,440,437,399,456,420,456,363,401,435,288,372,383,353,339,255,249,448,261,255,133,243,190,133,155,112,33,246,247,33,130,25,398,384,286,362,398,414,362,463,341,263,359,467,263,249,255,466,467,260,75,60,166,238,239,79,162,127,139,72,11,37,121,232,120,73,72,39,114,128,47,233,232,128,103,104,67,152,175,148,173,157,155,119,118,101,74,73,40,107,9,108,49,48,131,32,194,211,184,74,185,191,80,183,185,40,186,119,230,118,210,202,214,84,83,17,77,76,146,161,160,30,190,56,173,182,106,194,138,135,192,129,203,98,54,21,68,5,51,4,145,144,23,90,77,91,207,205,187,83,201,18,181,91,182,180,90,181,16,85,17,205,206,36,176,148,140,165,92,39,245,193,244,27,159,28,30,247,161,174,236,196,103,54,104,55,193,8,111,117,31,221,189,55,240,98,99,142,126,100,219,166,218,112,155,26,198,209,131,169,135,150,114,47,217,224,223,53,220,45,134,32,211,140,109,67,108,146,43,91,231,230,120,113,226,247,105,63,52,241,238,242,124,46,156,95,78,96,70,46,63,116,143,227,116,123,111,1,44,19,3,236,51,207,216,205,26,154,22,165,39,167,199,200,208,101,36,100,43,57,202,242,20,99,56,28,157,124,35,113,29,160,27,211,204,210,124,113,46,106,43,204,96,62,77,227,137,116,73,41,72,36,203,142,235,64,240,48,49,64,42,41,74,214,212,207,183,42,184,210,169,211,140,170,176,104,105,69,193,122,168,50,123,187,89,96,90,66,65,107,179,89,180,119,101,120,68,63,104,234,93,227,16,15,85,209,129,49,15,14,86,107,55,9,120,100,121,153,145,22,178,88,179,197,6,196,89,88,96,135,138,136,138,215,172,218,115,219,41,42,81,5,195,51,57,43,61,208,171,199,41,81,38,224,53,225,24,144,110,105,52,66,118,229,117,227,34,234,66,107,69,10,109,151,219,48,235,183,62,191,142,129,126,116,111,143,7,163,246,118,117,50,223,222,52,94,19,141,222,221,65,196,3,197,45,220,44,156,70,139,188,122,245,139,71,162,145,153,159,149,170,150,122,188,196,206,216,92,163,144,161,164,2,167,242,141,241,0,164,37,11,72,12,144,145,160,12,38,13,70,63,71,31,226,111,157,158,154,36,101,205,203,206,165,126,209,217,98,165,97,237,220,218,237,239,241,210,214,169,140,171,32,241,125,237,179,86,178,180,85,179,181,84,180,182,83,181,194,201,182,177,137,132,184,76,183,185,61,184,186,57,185,216,212,186,192,214,187,139,34,156,218,79,237,147,123,177,45,44,4,208,201,32,98,64,129,192,213,138,235,59,219,141,242,97,97,2,141,240,75,235,229,24,228,31,25,226,230,23,229,231,22,230,232,26,231,233,112,232,244,189,243,189,221,190,222,28,221,223,27,222,224,29,223,225,30,224,113,247,225,99,60,240,213,147,215,60,20,166,192,187,213,243,112,244,244,233,245,245,128,188,188,114,174,134,131,220,174,217,236,236,198,134,215,177,58,156,143,124,25,110,7,31,228,25,264,356,368,0,11,267,451,452,349,267,302,269,350,357,277,350,452,357,299,333,297,396,175,377,381,384,382,280,347,330,269,303,270,151,9,337,344,278,360,424,418,431,270,304,409,272,310,407,322,270,410,449,450,347,432,422,434,18,313,17,291,306,375,259,387,260,424,335,418,434,364,416,391,423,327,301,251,298,275,281,4,254,373,253,375,307,321,280,425,411,200,421,18,335,321,406,321,320,405,314,315,17,423,426,266,396,377,369,270,322,269,413,417,464,385,386,258,248,456,419,298,284,333,168,417,8,448,346,261,417,413,285,326,327,328,277,355,329,309,392,438,381,382,256,279,429,360,365,364,379,355,277,437,282,443,283,281,275,363,395,431,369,299,297,337,335,273,321,348,450,349,359,446,467,283,293,282,250,458,462,300,276,383,292,308,325,283,276,293,264,372,447,346,352,340,354,274,19,363,456,281,426,436,425,380,381,252,267,269,393,421,200,428,371,266,329,432,287,422,290,250,328,385,258,384,446,265,342,386,387,257,422,424,430,445,342,276,422,273,424,306,292,307,352,366,345,268,271,302,358,423,371,327,294,460,331,279,294,303,271,304,436,432,427,304,272,408,395,394,431,378,395,400,296,334,299,6,351,168,376,352,411,307,325,320,285,295,336,320,319,404,329,330,349,334,293,333,366,323,447,316,15,315,331,358,279,317,14,316,8,285,9,277,329,350,253,374,252,319,318,403,351,6,419,324,318,325,397,367,365,288,435,397,278,344,439,310,272,311,248,195,281,375,273,291,175,396,199,312,311,268,276,283,445,390,373,339,295,282,296,448,449,346,356,264,454,337,336,299,337,338,151,294,278,455,308,292,415,429,358,355,265,340,372,388,390,466,352,346,280,295,442,282,354,19,370,285,441,295,195,248,197,457,440,274,301,300,368,417,351,465,251,301,389,385,380,386,394,395,379,399,412,419,410,436,322,387,373,388,326,2,393,354,370,461,393,164,267,268,302,12,386,374,387,312,268,13,298,293,301,265,446,340,380,385,381,280,330,425,322,426,391,420,429,437,393,391,326,344,440,438,458,459,461,364,434,394,428,396,262,274,354,457,317,316,402,316,315,403,315,314,404,314,313,405,313,421,406,323,366,361,292,306,407,306,291,408,291,287,409,287,432,410,427,434,411,372,264,383,459,309,457,366,352,401,1,274,4,418,421,262,331,294,358,435,433,367,392,289,439,328,462,326,94,2,370,289,305,455,339,254,448,359,255,446,254,253,449,253,252,450,252,256,451,256,341,452,414,413,463,286,441,414,286,258,441,258,257,442,257,259,443,259,260,444,260,467,445,309,459,250,305,289,290,305,290,460,401,376,435,309,250,392,376,411,433,453,341,464,357,453,465,343,357,412,437,343,399,344,360,440,420,437,456,360,420,363,361,401,288,265,372,353,390,339,249,339,448,255];var H2e=[127,234,132,58,172,150,149,148,152,377,378,379,397,288,361,454,356,70,63,105,66,107,336,296,334,293,300,168,6,195,4,98,97,2,326,327,33,160,158,133,153,144,362,385,387,263,373,380,57,40,37,0,267,270,287,321,314,17,84,91,78,81,13,311,308,402,14,178],j2e=[33,133,362,263,1,62,308,159,145,386,374,6,102,331,2,13,14,70,105,107,336,334,300,54,10,284,50,280,234,454,58,288,152],q2e=[33,133,362,263,1,78,308],O1e=H2e.map(e=>zp[e]),M1e=j2e.map(e=>zp[e]),z1e=q2e.map(e=>zp[e]);var Lp=e=>[Math.abs(e.endPoint[0]-e.startPoint[0]),Math.abs(e.endPoint[1]-e.startPoint[1])],g0=e=>[e.startPoint[0]+(e.endPoint[0]-e.startPoint[0])/2,e.startPoint[1]+(e.endPoint[1]-e.startPoint[1])/2],lb=(e,t)=>e?[Math.trunc(Math.max(0,e.startPoint[0])),Math.trunc(Math.max(0,e.startPoint[1])),Math.trunc(Math.min(t.shape[2]||0,e.endPoint[0])-Math.max(0,e.startPoint[0])),Math.trunc(Math.min(t.shape[1]||0,e.endPoint[1])-Math.max(0,e.startPoint[1]))]:[0,0,0,0],ub=(e,t)=>e?[e.startPoint[0]/(t.shape[2]||0),e.startPoint[1]/(t.shape[1]||0),(e.endPoint[0]-e.startPoint[0])/(t.shape[2]||0),(e.endPoint[1]-e.startPoint[1])/(t.shape[1]||0)]:[0,0,0,0],W8=(e,t)=>{let n=[e.startPoint[0]*t[0],e.startPoint[1]*t[1]],s=[e.endPoint[0]*t[0],e.endPoint[1]*t[1]];return{startPoint:n,endPoint:s,landmarks:e.landmarks,confidence:e.confidence}},cb=(e,t,n)=>{let s=t.shape[1],r=t.shape[2],a=Se.cropAndResize(t,[[e.startPoint[1]/s,e.startPoint[0]/r,e.endPoint[1]/s,e.endPoint[0]/r]],[0],n),o=de(a,Xe.tf255);return te(a),o},Bp=(e,t)=>{let n=g0(e),s=Lp(e),r=[t*s[0]/2,t*s[1]/2];return{startPoint:[n[0]-r[0],n[1]-r[1]],endPoint:[n[0]+r[0],n[1]+r[1]],landmarks:e.landmarks,confidence:e.confidence}},Wp=e=>{let t=g0(e),n=Lp(e),s=Math.max(...n)/2;return{startPoint:[Math.round(t[0]-s),Math.round(t[1]-s)],endPoint:[Math.round(t[0]+s),Math.round(t[1]+s)],landmarks:e.landmarks,confidence:e.confidence}},y0=e=>{let t=e.map(s=>s[0]),n=e.map(s=>s[1]);return{startPoint:[Math.min(...t),Math.min(...n)],endPoint:[Math.max(...t),Math.max(...n)],landmarks:e}},db=[[1,0,0],[0,1,0],[0,0,1]],X2e=e=>e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI)),K2e=(e,t)=>X2e(Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]));var V8=(e,t)=>[[1,0,e],[0,1,t],[0,0,1]],zl=(e,t)=>{let n=0;for(let s=0;s{let n=[];for(let s=0;s{let n=[],s=e.length;for(let r=0;r{let n=Math.cos(e),s=Math.sin(e),r=[[n,-s,0],[s,n,0],[0,0,1]],a=V8(t[0],t[1]),o=U8(a,r),i=V8(-t[0],-t[1]);return U8(o,i)},Y2e=e=>{let t=[[e[0][0],e[1][0]],[e[0][1],e[1][1]]],n=[e[0][2],e[1][2]],s=[-zl(t[0],n),-zl(t[1],n)];return[t[0].concat(s[0]),t[1].concat(s[1]),[0,0,1]]},J2e=(e,t)=>[zl(e,t[0]),zl(e,t[1])];function H8(e){let t={strides:[e/16,e/8],anchors:[2,6]},n=[];for(let s=0;s[a[0]/r*(p[0]-r/2),a[1]/r*(p[1]-r/2),p[2]||0]),i=n&&n!==0&&Math.abs(n)>.2,l=i?G8(n,[0,0]):db,c=i?o.map(p=>[...J2e(p,l),p[2]]):o,u=i?Y2e(s):db,d=[...g0({startPoint:t.startPoint,endPoint:t.endPoint}),1];return c.map(p=>[Math.round(p[0]+zl(d,u[0])),Math.round(p[1]+zl(d,u[1])),Math.round(p[2]||0)])}function pb(e,t,n,s){let r=t.landmarks.length>=ob.count?ob.symmetryLine:Mp.symmetryLine,a=0,o=db,i;if(e&&pe.kernels.includes("rotatewithoffset"))if(a=K2e(t.landmarks[r[0]],t.landmarks[r[1]]),a&&a!==0&&Math.abs(a)>.2){let c=g0({startPoint:t.startPoint,endPoint:t.endPoint}),u=[c[0]/n.shape[2],c[1]/n.shape[1]],d=Se.rotateWithOffset(n,a,0,u);o=G8(-a,c),i=cb(t,d,[s,s]),te(d)}else i=cb(t,n,[s,s]);else i=cb(t,n,[s,s]);return[a,o,i]}var q8=6,Us,X8=null,Yo=0,Vp=null,A0=()=>Yo;async function K8(e){var t,n;return pe.initial&&(Us=null),Us?e.debug&&J("cached model:",Us.modelUrl):(Us=await Be(We(e.modelBasePath,((t=e.face.detector)==null?void 0:t.modelPath)||"")),!Us||!Us.modelUrl?J("load model failed:",(n=e.face.detector)==null?void 0:n.modelPath):e.debug&&J("load model:",Us.modelUrl)),Yo=Us.inputs[0].shape?Us.inputs[0].shape[2]:0,Vp=Ce(Yo,"int32"),X8=fr(H8(Yo)),Us}function Q2e(e){let t={};t.boxStarts=Pe(e,[0,1],[-1,2]),t.centers=ue(t.boxStarts,X8),t.boxSizes=Pe(e,[0,3],[-1,2]),t.boxSizesNormalized=de(t.boxSizes,Vp),t.centersNormalized=de(t.centers,Vp),t.halfBoxSize=de(t.boxSizesNormalized,Xe.tf2),t.starts=he(t.centersNormalized,t.halfBoxSize),t.ends=ue(t.centersNormalized,t.halfBoxSize),t.startNormalized=L(t.starts,Vp),t.endNormalized=L(t.ends,Vp);let n=Vu([t.startNormalized,t.endNormalized],1);return Object.keys(t).forEach(s=>te(t[s])),n}async function Z8(e,t){var i,l,c,u;if(!e||e.isDisposedInternal||e.shape.length!==4||e.shape[1]<1||e.shape[2]<1)return{boxes:[]};let n={};n.resized=Se.resizeBilinear(e,[Yo,Yo]),n.div=de(n.resized,Xe.tf127),n.normalized=he(n.div,Xe.tf05);let s=Us==null?void 0:Us.execute(n.normalized);if(Array.isArray(s)){let d=s.sort((p,h)=>p.size-h.size);n.concat384=St([d[0],d[2]],2),n.concat512=St([d[1],d[3]],2),n.concat=St([n.concat512,n.concat384],1),n.batch=rt(n.concat,0)}else n.batch=rt(s);te(s),n.boxes=Q2e(n.batch),n.logits=Pe(n.batch,[0,0],[-1,1]),n.sigmoid=as(n.logits),n.scores=rt(n.sigmoid),n.nms=await Se.nonMaxSuppressionAsync(n.boxes,n.scores,((i=t.face.detector)==null?void 0:i.maxDetected)||0,((l=t.face.detector)==null?void 0:l.iouThreshold)||0,((c=t.face.detector)==null?void 0:c.minConfidence)||0);let r=await n.nms.array(),a=[],o=await n.scores.data();for(let d=0;d(((u=t.face.detector)==null?void 0:u.minConfidence)||0)){let h={};h.bbox=Pe(n.boxes,[r[d],0],[1,-1]),h.slice=Pe(n.batch,[r[d],q8-1],[1,-1]),h.squeeze=rt(h.slice),h.landmarks=H(h.squeeze,[q8,-1]);let f=await h.bbox.data();a.push({startPoint:[f[0],f[1]],endPoint:[f[2],f[3]],landmarks:await h.landmarks.array(),confidence:p}),Object.keys(h).forEach(m=>te(h[m]))}}return Object.keys(n).forEach(d=>te(n[d])),{boxes:a,scaleFactor:[e.shape[2]/Yo,e.shape[1]/Yo]}}var mb={};ed(mb,{connected:()=>fb,kpt:()=>hb});var hb=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftPinky","rightPinky","leftIndex","rightIndex","leftThumb","rightThumb","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle","leftHeel","rightHeel","leftFoot","rightFoot","bodyCenter","bodyTop","leftPalm","leftHand","rightPalm","rightHand"],fb={leftLeg:["leftHip","leftKnee","leftAnkle","leftHeel","leftFoot"],rightLeg:["rightHip","rightKnee","rightAnkle","rightHeel","rightFoot"],torso:["leftShoulder","rightShoulder","rightHip","leftHip","leftShoulder","rightShoulder"],leftArm:["leftShoulder","leftElbow","leftWrist","leftPalm"],rightArm:["rightShoulder","rightElbow","rightWrist","rightPalm"],leftEye:["leftEyeInside","leftEye","leftEyeOutside"],rightEye:["rightEyeInside","rightEye","rightEyeOutside"],mouth:["leftMouth","rightMouth"]};var Y8=224,eye,tye=5,x0=[8,16,32,32,32];async function J8(){let e=[],t=0;for(;tn.x)),y:Ct(e.map(n=>n.y))}}function da(e,t=[1,1]){let n=[e.map(i=>i[0]),e.map(i=>i[1])],s=[Math.min(...n[0]),Math.min(...n[1])],r=[Math.max(...n[0]),Math.max(...n[1])],a=[s[0],s[1],r[0]-s[0],r[1]-s[1]],o=[a[0]/t[0],a[1]/t[1],a[2]/t[0],a[3]/t[1]];return{box:a,boxRaw:o}}function Q8(e,t=[1,1]){let n=[e.map(c=>c[0]),e.map(c=>c[1])],s=[Math.min(...n[0]),Math.min(...n[1])],r=[Math.max(...n[0]),Math.max(...n[1])],a=[(s[0]+r[0])/2,(s[1]+r[1])/2],o=Math.max(a[0]-s[0],a[1]-s[1],-a[0]+r[0],-a[1]+r[1]),i=[Math.trunc(a[0]-o),Math.trunc(a[1]-o),Math.trunc(2*o),Math.trunc(2*o)],l=[i[0]/t[0],i[1]/t[1],i[2]/t[0],i[3]/t[1]];return{box:i,boxRaw:l}}function b0(e,t){let n=[e[2]*t,e[3]*t];return[e[0]-(n[0]-e[2])/2,e[1]-(n[1]-e[3])/2,n[0],n[1]]}function gb(e){return[Math.max(0,e[1]),Math.max(0,e[0]),Math.min(1,e[3]+e[1]),Math.min(1,e[2]+e[0])]}var eT={initial:!0},pn={detector:null,landmarks:null},Ec={detector:[224,224],landmarks:[256,256]},yb=Number.MAX_SAFE_INTEGER,nye={landmarks:["ld_3d","activation_segmentation","activation_heatmap","world_3d","output_poseflag"],detector:[]},v0=null,Up,Jo=[[0,0],[0,0],[0,0],[0,0]],tT=0,nT=e=>1-1/(1+Math.exp(e));async function sT(e){if(eT.initial&&(pn.detector=null),!pn.detector&&e.body.detector&&e.body.detector.modelPath){pn.detector=await Be(We(e.modelBasePath,e.body.detector.modelPath||""));let t=Object.values(pn.detector.modelSignature.inputs);Ec.detector[0]=Array.isArray(t)?parseInt(t[0].tensorShape.dim[1].size):0,Ec.detector[1]=Array.isArray(t)?parseInt(t[0].tensorShape.dim[2].size):0,!pn.detector||!pn.detector.modelUrl?J("load model failed:",e.body.detector.modelPath):e.debug&&J("load model:",pn.detector.modelUrl)}else e.debug&&pn.detector&&J("cached model:",pn.detector.modelUrl);return await J8(),pn.detector}async function rT(e){if(eT.initial&&(pn.landmarks=null),pn.landmarks)e.debug&&J("cached model:",pn.landmarks.modelUrl);else{pn.landmarks=await Be(We(e.modelBasePath,e.body.modelPath||""));let t=Object.values(pn.landmarks.modelSignature.inputs);Ec.landmarks[0]=Array.isArray(t)?parseInt(t[0].tensorShape.dim[1].size):0,Ec.landmarks[1]=Array.isArray(t)?parseInt(t[0].tensorShape.dim[2].size):0,!pn.landmarks||!pn.landmarks.modelUrl?J("load model failed:",e.body.modelPath):e.debug&&J("load model:",pn.landmarks.modelUrl)}return pn.landmarks}async function sye(e,t){let n={};if(!e.shape||!e.shape[1]||!e.shape[2])return e;let s;if(Up&&(n.cropped=Se.cropAndResize(e,[Up],[0],[e.shape[1],e.shape[2]])),e.shape[1]!==e.shape[2]){let r=[e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0,e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0],a=[e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0,e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0];Jo=[[0,0],r,a,[0,0]],n.pad=Qs(n.cropped||e,Jo),n.resize=Se.resizeBilinear(n.pad,[t,t]),s=de(n.resize,Xe.tf255)}else e.shape[1]!==t?(n.resize=Se.resizeBilinear(n.cropped||e,[t,t]),s=de(n.resize,Xe.tf255)):s=de(n.cropped||e,Xe.tf255);return Object.keys(n).forEach(r=>te(n[r])),s}function rye(e,t){for(let n of e)n.position=[Math.trunc(n.position[0]*(t[0]+Jo[2][0]+Jo[2][1])/t[0]-Jo[2][0]),Math.trunc(n.position[1]*(t[1]+Jo[1][0]+Jo[1][1])/t[1]-Jo[1][0]),n.position[2]],n.positionRaw=[n.position[0]/t[0],n.position[1]/t[1],n.position[2]];if(Up)for(let n of e)n.positionRaw=[n.positionRaw[0]+Up[1],n.positionRaw[1]+Up[0],n.positionRaw[2]],n.position=[Math.trunc(n.positionRaw[0]*t[0]),Math.trunc(n.positionRaw[1]*t[1]),n.positionRaw[2]];return e}async function aye(e,t,n){var h;let s={};[s.ld,s.segmentation,s.heatmap,s.world,s.poseflag]=(h=pn.landmarks)==null?void 0:h.execute(e,nye.landmarks);let r=(await s.poseflag.data())[0],a=await s.ld.data();Object.keys(s).forEach(f=>te(s[f]));let o=[],i=5;for(let f=0;ff.position),u=da(c,[n[0],n[1]]),d={};for(let[f,m]of Object.entries(fb)){let g=[];for(let y=0;yb.part===m[y]),A=l.find(b=>b.part===m[y+1]);x&&A&&g.push([x.position,A.position])}d[f]=g}return{id:0,score:Math.trunc(100*r)/100,box:u.box,boxRaw:u.boxRaw,keypoints:l,annotations:d}}async function Ab(e,t){let n=[e.shape[2]||0,e.shape[1]||0],s=(t.body.skipTime||0)>ie()-tT,r=yb<(t.body.skipFrames||0);if(t.skipAllowed&&s&&r&&v0!==null)yb++;else{let a={};a.landmarks=await sye(e,256),v0=await aye(a.landmarks,t,n),Object.keys(a).forEach(o=>te(a[o])),tT=ie(),yb=0}return v0?[v0]:[]}var Rc=[{class:1,label:"person"},{class:2,label:"bicycle"},{class:3,label:"car"},{class:4,label:"motorcycle"},{class:5,label:"airplane"},{class:6,label:"bus"},{class:7,label:"train"},{class:8,label:"truck"},{class:9,label:"boat"},{class:10,label:"traffic light"},{class:11,label:"fire hydrant"},{class:12,label:"stop sign"},{class:13,label:"parking meter"},{class:14,label:"bench"},{class:15,label:"bird"},{class:16,label:"cat"},{class:17,label:"dog"},{class:18,label:"horse"},{class:19,label:"sheep"},{class:20,label:"cow"},{class:21,label:"elephant"},{class:22,label:"bear"},{class:23,label:"zebra"},{class:24,label:"giraffe"},{class:25,label:"backpack"},{class:26,label:"umbrella"},{class:27,label:"handbag"},{class:28,label:"tie"},{class:29,label:"suitcase"},{class:30,label:"frisbee"},{class:31,label:"skis"},{class:32,label:"snowboard"},{class:33,label:"sports ball"},{class:34,label:"kite"},{class:35,label:"baseball bat"},{class:36,label:"baseball glove"},{class:37,label:"skateboard"},{class:38,label:"surfboard"},{class:39,label:"tennis racket"},{class:40,label:"bottle"},{class:41,label:"wine glass"},{class:42,label:"cup"},{class:43,label:"fork"},{class:44,label:"knife"},{class:45,label:"spoon"},{class:46,label:"bowl"},{class:47,label:"banana"},{class:48,label:"apple"},{class:49,label:"sandwich"},{class:50,label:"orange"},{class:51,label:"broccoli"},{class:52,label:"carrot"},{class:53,label:"hot dog"},{class:54,label:"pizza"},{class:55,label:"donut"},{class:56,label:"cake"},{class:57,label:"chair"},{class:58,label:"couch"},{class:59,label:"potted plant"},{class:60,label:"bed"},{class:61,label:"dining table"},{class:62,label:"toilet"},{class:63,label:"tv"},{class:64,label:"laptop"},{class:65,label:"mouse"},{class:66,label:"remote"},{class:67,label:"keyboard"},{class:68,label:"cell phone"},{class:69,label:"microwave"},{class:70,label:"oven"},{class:71,label:"toaster"},{class:72,label:"sink"},{class:73,label:"refrigerator"},{class:74,label:"book"},{class:75,label:"clock"},{class:76,label:"vase"},{class:77,label:"scissors"},{class:78,label:"teddy bear"},{class:79,label:"hair drier"},{class:80,label:"toothbrush"}];var ir,Ll=0,xb=[],aT=0,bb=Number.MAX_SAFE_INTEGER;async function oT(e){if(pe.initial&&(ir=null),ir)e.debug&&J("cached model:",ir.modelUrl);else{ir=await Be(We(e.modelBasePath,e.object.modelPath||""));let t=Object.values(ir.modelSignature.inputs);Ll=Array.isArray(t)?parseInt(t[0].tensorShape.dim[2].size):0,!ir||!ir.modelUrl?J("load model failed:",e.object.modelPath):e.debug&&J("load model:",ir.modelUrl)}return ir}async function oye(e,t,n){if(!e)return[];let s={},r=[],a=await e.array();s.squeeze=rt(e);let o=Yt(s.squeeze,6,1);s.stack=an([o[1],o[0],o[3],o[2]],1),s.boxes=rt(s.stack),s.scores=rt(o[4]),s.classes=rt(o[5]),te([e,...o]),s.nms=await Se.nonMaxSuppressionAsync(s.boxes,s.scores,n.object.maxDetected,n.object.iouThreshold,n.object.minConfidence);let i=await s.nms.data(),l=0;for(let c of Array.from(i)){let u=Math.trunc(100*a[0][c][4])/100,d=a[0][c][5],p=Rc[d].label,[h,f]=[a[0][c][0]/Ll,a[0][c][1]/Ll],m=[h,f,a[0][c][2]/Ll-h,a[0][c][3]/Ll-f],g=[Math.trunc(m[0]*t[0]),Math.trunc(m[1]*t[1]),Math.trunc(m[2]*t[0]),Math.trunc(m[3]*t[1])];r.push({id:l++,score:u,class:d,label:p,box:g,boxRaw:m})}return Object.keys(s).forEach(c=>te(s[c])),r}async function vb(e,t){let n=(t.object.skipTime||0)>ie()-aT,s=bb<(t.object.skipFrames||0);return t.skipAllowed&&n&&s&&xb.length>0?(bb++,xb):(bb=0,new Promise(async r=>{let a=[e.shape[2],e.shape[1]],o=Se.resizeBilinear(e,[Ll,Ll]),i=t.object.enabled?ir==null?void 0:ir.execute(o,["tower_0/detections"]):null;aT=ie(),te(o);let l=await oye(i,a,t);xb=l,r(l)}))}var Sb={};ed(Sb,{connected:()=>kb,kpt:()=>wb});var wb=["head","neck","rightShoulder","rightElbow","rightWrist","chest","leftShoulder","leftElbow","leftWrist","bodyCenter","rightHip","rightKnee","rightAnkle","leftHip","leftKnee","leftAnkle"],kb={leftLeg:["leftHip","leftKnee","leftAnkle"],rightLeg:["rightHip","rightKnee","rightAnkle"],torso:["leftShoulder","rightShoulder","rightHip","leftHip","leftShoulder"],leftArm:["leftShoulder","leftElbow","leftWrist"],rightArm:["rightShoulder","rightElbow","rightWrist"],head:[]};var hn,iT=0,Kn={id:0,keypoints:[],box:[0,0,0,0],boxRaw:[0,0,0,0],score:0,annotations:{}},Ib=Number.MAX_SAFE_INTEGER;async function lT(e){return pe.initial&&(hn=null),hn?e.debug&&J("cached model:",hn.modelUrl):(hn=await Be(We(e.modelBasePath,e.body.modelPath||"")),!hn||!hn.modelUrl?J("load model failed:",e.body.modelPath):e.debug&&J("load model:",hn.modelUrl)),hn}async function iye(e,t){let[n,s]=e.shape,r=H(e,[s*n]),a=An(r,0),o=(await a.data())[0];if(te([r,a]),o>t){let i=Fs(r,0),l=Gd(i,n),c=(await l.data())[0],u=de(i,Ce(n,"int32")),d=(await u.data())[0];return te([l,u]),[c,d,o]}return[0,0,o]}async function Cb(e,t){let n=(t.body.skipTime||0)>ie()-iT,s=Ib<(t.body.skipFrames||0);return t.skipAllowed&&n&&s&&Object.keys(Kn.keypoints).length>0?(Ib++,[Kn]):(Ib=0,new Promise(async r=>{var d;let a=K(()=>{if(!(hn==null?void 0:hn.inputs[0].shape))return null;let p=Se.resizeBilinear(e,[hn.inputs[0].shape[2],hn.inputs[0].shape[1]],!1),h=L(p,Xe.tf2);return he(h,Xe.tf1)}),o;if(t.body.enabled&&(o=hn==null?void 0:hn.execute(a)),iT=ie(),te(a),o){Kn.keypoints.length=0;let p=o.squeeze();te(o);let h=p.unstack(2);te(p);for(let f=0;f(((d=t.body)==null?void 0:d.minConfidence)||0)&&Kn.keypoints.push({score:Math.round(100*y)/100,part:wb[f],positionRaw:[m/hn.inputs[0].shape[2],g/hn.inputs[0].shape[1]],position:[Math.round(e.shape[2]*m/hn.inputs[0].shape[2]),Math.round(e.shape[1]*g/hn.inputs[0].shape[1])]})}h.forEach(f=>te(f))}Kn.score=Kn.keypoints.reduce((p,h)=>h.score>p?h.score:p,0);let i=Kn.keypoints.map(p=>p.position[0]),l=Kn.keypoints.map(p=>p.position[1]);Kn.box=[Math.min(...i),Math.min(...l),Math.max(...i)-Math.min(...i),Math.max(...l)-Math.min(...l)];let c=Kn.keypoints.map(p=>p.positionRaw[0]),u=Kn.keypoints.map(p=>p.positionRaw[1]);Kn.boxRaw=[Math.min(...c),Math.min(...u),Math.max(...c)-Math.min(...c),Math.max(...u)-Math.min(...u)];for(let[p,h]of Object.entries(kb)){let f=[];for(let m=0;mx.part===h[m]),y=Kn.keypoints.find(x=>x.part===h[m+1]);g&&y&&g.score>(t.body.minConfidence||0)&&y.score>(t.body.minConfidence||0)&&f.push([g.position,y.position])}Kn.annotations[p]=f}r([Kn])}))}var lye=["angry","disgust","fear","happy","sad","surprise","neutral"],Zn,w0=[],uT=0,cT=0,Tb=Number.MAX_SAFE_INTEGER;async function dT(e){var t,n;return pe.initial&&(Zn=null),Zn?e.debug&&J("cached model:",Zn.modelUrl):(Zn=await Be(We(e.modelBasePath,((t=e.face.emotion)==null?void 0:t.modelPath)||"")),!Zn||!Zn.modelUrl?J("load model failed:",(n=e.face.emotion)==null?void 0:n.modelPath):e.debug&&J("load model:",Zn.modelUrl)),Zn}async function Nb(e,t,n,s){var o,i;if(!Zn)return[];let r=Tb<(((o=t.face.emotion)==null?void 0:o.skipFrames)||0),a=(((i=t.face.emotion)==null?void 0:i.skipTime)||0)>ie()-cT;return t.skipAllowed&&a&&r&&uT===s&&w0[n]&&w0[n].length>0?(Tb++,w0[n]):(Tb=0,new Promise(async l=>{var u,d;let c=[];if((u=t.face.emotion)==null?void 0:u.enabled){let p={},h=(Zn==null?void 0:Zn.inputs[0].shape)?Zn.inputs[0].shape[2]:0;p.resize=Se.resizeBilinear(e,[h,h],!1),p.channels=L(p.resize,Xe.rgb),p.grayscale=we(p.channels,3,!0),p.grayscaleSub=he(p.grayscale,Xe.tf05),p.grayscaleMul=L(p.grayscaleSub,Xe.tf2),p.emotion=Zn==null?void 0:Zn.execute(p.grayscaleMul),cT=ie();let f=await p.emotion.data();for(let m=0;m(((d=t.face.emotion)==null?void 0:d.minConfidence)||0)&&c.push({score:Math.min(.99,Math.trunc(100*f[m])/100),emotion:lye[m]});c.sort((m,g)=>g.score-m.score),Object.keys(p).forEach(m=>te(p[m]))}w0[n]=c,uT=s,l(c)}))}var Is,Eb=[],pT=0,hT=0,fT=Number.MAX_SAFE_INTEGER;async function mT(e){let t=We(e.modelBasePath,e.face.mobilefacenet.modelPath);return pe.initial&&(Is=null),Is?e.debug&&J("cached model:",t):(Is=await Be(t),Is?e.debug&&J("load model:",t):J("load model failed:",e.face.mobilefacenet.modelPath)),Is}async function Rb(e,t,n,s){var o,i;if(!Is)return[];let r=fT<(((o=t.face.embedding)==null?void 0:o.skipFrames)||0),a=(((i=t.face.embedding)==null?void 0:i.skipTime)||0)>ie()-hT;return t.skipAllowed&&a&&r&&pT===s&&Eb[n]?(fT++,Eb[n]):new Promise(async l=>{var u;let c=[];if(((u=t.face.embedding)==null?void 0:u.enabled)&&(Is==null?void 0:Is.inputs[0].shape)){let d={};d.crop=Se.resizeBilinear(e,[Is.inputs[0].shape[2],Is.inputs[0].shape[1]],!1),d.data=Is==null?void 0:Is.execute(d.crop);let p=await d.data.data();c=Array.from(p)}Eb[n]=c,pT=s,hT=ie(),l(c)})}var lr,Qo=0,uye=2.3,_b=or.leftEyeLower0,$b=or.rightEyeLower0,_c={leftBounds:[_b[0],_b[_b.length-1]],rightBounds:[$b[0],$b[$b.length-1]]},$c={upperCenter:3,lowerCenter:4,index:71,numCoordinates:76};async function gT(e){var t,n;return pe.initial&&(lr=null),lr?e.debug&&J("cached model:",lr.modelUrl):(lr=await Be(We(e.modelBasePath,((t=e.face.iris)==null?void 0:t.modelPath)||"")),!lr||!lr.modelUrl?J("load model failed:",(n=e.face.iris)==null?void 0:n.modelPath):e.debug&&J("load model:",lr.modelUrl)),Qo=lr.inputs[0].shape?lr.inputs[0].shape[2]:0,Qo===-1&&(Qo=64),lr}function k0(e,t,n,s){for(let r=0;r{let t=e[_c.leftBounds[0]][2],n=e[_c.rightBounds[0]][2];return t-n},yT=(e,t,n,s,r,a=!1)=>{let o=Wp(Bp(y0([e[n],e[s]]),uye)),i=Lp(o),l=Se.cropAndResize(t,[[o.startPoint[1]/r,o.startPoint[0]/r,o.endPoint[1]/r,o.endPoint[0]/r]],[0],[Qo,Qo]);if(a&&pe.kernels.includes("flipleftright")){let c=Se.flipLeftRight(l);te(l),l=c}return{box:o,boxSize:i,crop:l}},AT=(e,t,n,s=!1)=>{let r=[];for(let a=0;a<$c.numCoordinates;a++){let o=e[a*3],i=e[a*3+1],l=e[a*3+2];r.push([(s?1-o/Qo:o/Qo)*n[0]+t.startPoint[0],i/Qo*n[1]+t.startPoint[1],l])}return{rawCoords:r,iris:r.slice($c.index)}},xT=(e,t,n)=>{let s=e[or[`${n}EyeUpper0`][$c.upperCenter]][2],r=e[or[`${n}EyeLower0`][$c.lowerCenter]][2],a=(s+r)/2;return t.map((o,i)=>{let l=a;return i===2?l=s:i===4&&(l=r),[o[0],o[1],l]})};async function bT(e,t,n,s){if(!lr)return n.debug&&J("face mesh iris detection requested, but model is not loaded"),e;let{box:r,boxSize:a,crop:o}=yT(e,t,_c.leftBounds[0],_c.leftBounds[1],s,!0),{box:i,boxSize:l,crop:c}=yT(e,t,_c.rightBounds[0],_c.rightBounds[1],s,!0),u=St([o,c]);te(o),te(c);let d=lr.execute(u);te(u);let p=await d.data();te(d);let h=p.slice(0,$c.numCoordinates*3),{rawCoords:f,iris:m}=AT(h,r,a,!0),g=p.slice($c.numCoordinates*3),{rawCoords:y,iris:x}=AT(g,i,l),A=cye(e);Math.abs(A)<30?(k0(e,f,"left",null),k0(e,y,"right",null)):A<1?k0(e,f,"left",["EyeUpper0","EyeLower0"]):k0(e,y,"right",["EyeUpper0","EyeLower0"]);let b=xT(e,m,"left"),w=xT(e,x,"right");return e.concat(b).concat(w)}var Dc=[],ur=null,Bl=0,Db=Number.MAX_SAFE_INTEGER,vT=0;async function wT(e,t){var i,l,c,u,d,p,h,f,m,g,y;let n=(((i=t.face.detector)==null?void 0:i.skipTime)||0)>ie()-vT,s=Db<(((l=t.face.detector)==null?void 0:l.skipFrames)||0);if(!t.skipAllowed||!n||!s||Dc.length===0){let x=await Z8(e,t);vT=ie(),Dc=[];for(let A of x.boxes){let b=W8(A,x.scaleFactor),w=(b.endPoint[0]-b.startPoint[0])/(e.shape[2]||1e3),k=(((c=t.face.detector)==null?void 0:c.cropFactor)||1.6)/(w+.75)/1.34,I=Bp(b,k),E=Wp(I);Dc.push(E)}Db=0}else Db++;let r=[],a=[],o=0;for(let x=0;x[X[0]/(e.shape[2]||0),X[1]/(e.shape[1]||0),(X[2]||0)/Bl]);for(let X of Object.keys(or))k.annotations[X]=or[X].map(z=>k.mesh[z]);let T=y0(k.mesh),O=Bp(T,((g=t.face.detector)==null?void 0:g.cropFactor)||1.6);A={...Wp(O),confidence:A.confidence},k.box=lb(A,e),k.boxRaw=ub(A,e),k.score=k.faceScore,a.push(A),te(k.tensor),[b,w,k.tensor]=pb((y=t.face.detector)==null?void 0:y.rotation,A,e,Bl)}}else{k.box=lb(A,e),k.boxRaw=ub(A,e),k.score=k.boxScore,k.mesh=A.landmarks.map(I=>[(A.startPoint[0]+A.endPoint[0])/2+(A.endPoint[0]+A.startPoint[0])*I[0]/A0(),(A.startPoint[1]+A.endPoint[1])/2+(A.endPoint[1]+A.startPoint[1])*I[1]/A0()]),k.meshRaw=k.mesh.map(I=>[I[0]/(e.shape[2]||0),I[1]/(e.shape[1]||0),(I[2]||0)/Bl]);for(let I of Object.keys(Mp))k.annotations[I]=[k.mesh[Mp[I]]]}r.push(k)}return Dc=[...a],r}async function kT(e){var t,n;return pe.initial&&(ur=null),ur?e.debug&&J("cached model:",ur.modelUrl):(ur=await Be(We(e.modelBasePath,((t=e.face.mesh)==null?void 0:t.modelPath)||"")),!ur||!ur.modelUrl?J("load model failed:",(n=e.face.mesh)==null?void 0:n.modelPath):e.debug&&J("load model:",ur.modelUrl)),Bl=ur.inputs[0].shape?ur.inputs[0].shape[2]:0,ur}var ST=Ml,IT=zp;var Cs,S0=[],CT=0,TT=0,Fb=Number.MAX_SAFE_INTEGER;async function NT(e){var n,s;let t=We(e.modelBasePath,((n=e.face.description)==null?void 0:n.modelPath)||"");return pe.initial&&(Cs=null),Cs?e.debug&&J("cached model:",t):(Cs=await Be(t),Cs?e.debug&&J("load model:",t):J("load model failed:",((s=e.face.description)==null?void 0:s.modelPath)||"")),Cs}function Pb(e){let t=e.image||e.tensor||e;if(!(Cs==null?void 0:Cs.inputs[0].shape))return t;let n=Se.resizeBilinear(t,[Cs.inputs[0].shape[2],Cs.inputs[0].shape[1]],!1),s=L(n,Xe.tf255);return te(n),s}async function Ob(e,t,n,s){var o,i,l,c;if(!Cs)return{age:0,gender:"unknown",genderScore:0,descriptor:[]};let r=Fb<(((o=t.face.description)==null?void 0:o.skipFrames)||0),a=(((i=t.face.description)==null?void 0:i.skipTime)||0)>ie()-CT;return t.skipAllowed&&r&&a&&TT===s&&((l=S0[n])==null?void 0:l.age)&&((c=S0[n])==null?void 0:c.age)>0?(Fb++,S0[n]):(Fb=0,new Promise(async u=>{var p,h;let d={age:0,gender:"unknown",genderScore:0,descriptor:[]};if((p=t.face.description)==null?void 0:p.enabled){let f=Pb(e),m=Cs==null?void 0:Cs.execute(f);CT=ie(),te(f);let y=await(await m.find(R=>R.shape[1]===1)).data(),x=Math.trunc(200*Math.abs(y[0]-.5))/100;x>(((h=t.face.description)==null?void 0:h.minConfidence)||0)&&(d.gender=y[0]<=.5?"female":"male",d.genderScore=Math.min(.99,x));let A=Fs(m.find(R=>R.shape[1]===100),1),b=(await A.data())[0];te(A);let k=await m.find(R=>R.shape[1]===100).data();d.age=Math.round(k[b-1]>k[b+1]?10*b-100*k[b-1]:10*b+100*k[b+1])/10;let I=m.find(R=>R.shape[1]===1024),E=I?await I.data():[];d.descriptor=Array.from(E),m.forEach(R=>te(R))}S0[n]=d,TT=s,u(d)}))}function I0(e){return[Math.abs(e.endPoint[0]-e.startPoint[0]),Math.abs(e.endPoint[1]-e.startPoint[1])]}function Gp(e){return[e.startPoint[0]+(e.endPoint[0]-e.startPoint[0])/2,e.startPoint[1]+(e.endPoint[1]-e.startPoint[1])/2]}function ET(e,t,n){let s=t.shape[1],r=t.shape[2],a=[[e.startPoint[1]/s,e.startPoint[0]/r,e.endPoint[1]/s,e.endPoint[0]/r]];return Se.cropAndResize(t,a,[0],n)}function RT(e,t){let n=[e.startPoint[0]*t[0],e.startPoint[1]*t[1]],s=[e.endPoint[0]*t[0],e.endPoint[1]*t[1]],r=e.palmLandmarks.map(a=>[a[0]*t[0],a[1]*t[1]]);return{startPoint:n,endPoint:s,palmLandmarks:r,confidence:e.confidence}}function C0(e,t=1.5){let n=Gp(e),s=I0(e),r=[t*s[0]/2,t*s[1]/2],a=[n[0]-r[0],n[1]-r[1]],o=[n[0]+r[0],n[1]+r[1]];return{startPoint:a,endPoint:o,palmLandmarks:e.palmLandmarks}}function T0(e){let t=Gp(e),n=I0(e),r=Math.max(...n)/2,a=[t[0]-r,t[1]-r],o=[t[0]+r,t[1]+r];return{startPoint:a,endPoint:o,palmLandmarks:e.palmLandmarks}}function dye(e){return e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))}function _T(e,t){let n=Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]);return dye(n)}var $T=(e,t)=>[[1,0,e],[0,1,t],[0,0,1]];function ei(e,t){let n=0;for(let s=0;s[n.x,n.y]),this.anchorsTensor=fr(this.anchors),this.inputSize=this.model&&this.model.inputs&&this.model.inputs[0].shape?this.model.inputs[0].shape[2]:0,this.inputSizeTensor=Ct([this.inputSize,this.inputSize]),this.doubleInputSizeTensor=Ct([this.inputSize*2,this.inputSize*2])}normalizeBoxes(t){let n={};n.boxOffsets=Pe(t,[0,0],[-1,2]),n.boxSizes=Pe(t,[0,2],[-1,2]),n.div=de(n.boxOffsets,this.inputSizeTensor),n.boxCenterPoints=ue(n.div,this.anchorsTensor),n.halfBoxSizes=de(n.boxSizes,this.doubleInputSizeTensor),n.sub=he(n.boxCenterPoints,n.halfBoxSizes),n.startPoints=L(n.sub,this.inputSizeTensor),n.add=ue(n.boxCenterPoints,n.halfBoxSizes),n.endPoints=L(n.add,this.inputSizeTensor);let s=Vu([n.startPoints,n.endPoints],1);return Object.keys(n).forEach(r=>te(n[r])),s}normalizeLandmarks(t,n){let s={};s.reshape=H(t,[-1,7,2]),s.div=de(s.reshape,this.inputSizeTensor),s.landmarks=ue(s.div,this.anchors[n]);let r=L(s.landmarks,this.inputSizeTensor);return Object.keys(s).forEach(a=>te(s[a])),r}async predict(t,n){let s={};s.resize=Se.resizeBilinear(t,[this.inputSize,this.inputSize]),s.div=de(s.resize,Xe.tf127),s.image=he(s.div,Xe.tf1),s.batched=this.model.execute(s.image),s.predictions=rt(s.batched),s.slice=Pe(s.predictions,[0,0],[-1,1]),s.sigmoid=as(s.slice),s.scores=rt(s.sigmoid);let r=await s.scores.data();s.boxes=Pe(s.predictions,[0,1],[-1,4]),s.norm=this.normalizeBoxes(s.boxes),s.nms=await Se.nonMaxSuppressionAsync(s.norm,s.scores,3*n.hand.maxDetected,n.hand.iouThreshold,n.hand.minConfidence);let a=await s.nms.array(),o=[];for(let i of a){let l={};l.box=Pe(s.norm,[i,0],[1,-1]),l.slice=Pe(s.predictions,[i,5],[1,14]),l.norm=this.normalizeLandmarks(l.slice,i),l.palmLandmarks=H(l.norm,[-1,2]);let c=await l.box.data(),u=c.slice(0,2),d=c.slice(2,4),p=await l.palmLandmarks.array(),h={startPoint:u,endPoint:d,palmLandmarks:p,confidence:r[i]},f=RT(h,[t.shape[2]/this.inputSize,t.shape[1]/this.inputSize]);o.push(f),Object.keys(l).forEach(m=>te(l[m]))}return Object.keys(s).forEach(i=>te(s[i])),o}};var hye=5,OT=1.65,MT=[0,5,9,13,17,1,2],fye=0,mye=2,zT=0,Bb=class{constructor(t,n){fe(this,"handDetector");fe(this,"handPoseModel");fe(this,"inputSize");fe(this,"storedBoxes");fe(this,"skipped");fe(this,"detectedHands");this.handDetector=t,this.handPoseModel=n,this.inputSize=this.handPoseModel&&this.handPoseModel.inputs[0].shape?this.handPoseModel.inputs[0].shape[2]:0,this.storedBoxes=[],this.skipped=Number.MAX_SAFE_INTEGER,this.detectedHands=0}calculateLandmarksBoundingBox(t){let n=t.map(o=>o[0]),s=t.map(o=>o[1]),r=[Math.min(...n),Math.min(...s)],a=[Math.max(...n),Math.max(...s)];return{startPoint:r,endPoint:a}}getBoxForPalmLandmarks(t,n){let s=t.map(a=>zb([...a,1],n)),r=this.calculateLandmarksBoundingBox(s);return C0(T0(r),hye)}getBoxForHandLandmarks(t){let n=this.calculateLandmarksBoundingBox(t),s=C0(T0(n),OT);s.palmLandmarks=[];for(let r=0;r[o[0]*(h[0]-this.inputSize/2),o[1]*(h[1]-this.inputSize/2),o[2]*h[2]]),l=Mb(s,[0,0]),c=i.map(h=>[...zb(h,l),h[2]]),u=FT(r),d=[...Gp(n),1],p=[ei(d,u[0]),ei(d,u[1])];return c.map(h=>[Math.trunc(h[0]+p[0]),Math.trunc(h[1]+p[1]),Math.trunc(h[2])])}async estimateHands(t,n){let s=!1,r,a=(n.hand.skipTime||0)>ie()-zT,o=this.skipped<(n.hand.skipFrames||0);n.skipAllowed&&a&&o&&(r=await this.handDetector.predict(t,n),this.skipped=0),n.skipAllowed&&this.skipped++,r&&r.length>0&&(r.length!==this.detectedHands&&this.detectedHands!==n.hand.maxDetected||!n.hand.landmarks)&&(this.detectedHands=0,this.storedBoxes=[...r],this.storedBoxes.length>0&&(s=!0));let i=[];for(let l=0;l=n.hand.minConfidence/4){let w=H(A,[-1,3]),k=await w.array();te(A),te(w);let I=this.transformRawCoords(k,m,u,f),E=this.getBoxForHandLandmarks(I);this.storedBoxes[l]={...E,confidence:b};let R={landmarks:I,confidence:b,boxConfidence:c.confidence,fingerConfidence:b,box:{topLeft:E.startPoint,bottomRight:E.endPoint}};i.push(R)}else this.storedBoxes[l]=null;te(A)}else{let u=C0(T0(c),OT),d={confidence:c.confidence,boxConfidence:c.confidence,fingerConfidence:0,box:{topLeft:u.startPoint,bottomRight:u.endPoint},landmarks:[]};i.push(d)}}return this.storedBoxes=this.storedBoxes.filter(l=>l!==null),this.detectedHands=i.length,i.length>n.hand.maxDetected&&(i.length=n.hand.maxDetected),i}};var Yn={thumb:0,index:1,middle:2,ring:3,pinky:4,all:[0,1,2,3,4],nameMapping:{0:"thumb",1:"index",2:"middle",3:"ring",4:"pinky"},pointsMapping:{0:[[0,1],[1,2],[2,3],[3,4]],1:[[0,5],[5,6],[6,7],[7,8]],2:[[0,9],[9,10],[10,11],[11,12]],3:[[0,13],[13,14],[14,15],[15,16]],4:[[0,17],[17,18],[18,19],[19,20]]},getName:e=>Yn.nameMapping[e],getPoints:e=>Yn.pointsMapping[e]},ti={none:0,half:1,full:2,nameMapping:{0:"none",1:"half",2:"full"},getName:e=>ti.nameMapping[e]},Bt={verticalUp:0,verticalDown:1,horizontalLeft:2,horizontalRight:3,diagonalUpRight:4,diagonalUpLeft:5,diagonalDownRight:6,diagonalDownLeft:7,nameMapping:{0:"verticalUp",1:"verticalDown",2:"horizontalLeft",3:"horizontalRight",4:"diagonalUpRight",5:"diagonalUpLeft",6:"diagonalDownRight",7:"diagonalDownLeft"},getName:e=>Bt.nameMapping[e]},Wl=class{constructor(t){fe(this,"name");fe(this,"curls");fe(this,"directions");fe(this,"weights");fe(this,"weightsRelative");this.name=t,this.curls={},this.directions={},this.weights=[1,1,1,1,1],this.weightsRelative=[1,1,1,1,1]}curl(t,n,s){typeof this.curls[t]=="undefined"&&(this.curls[t]=[]),this.curls[t].push([n,s])}direction(t,n,s){this.directions[t]||(this.directions[t]=[]),this.directions[t].push([n,s])}weight(t,n){this.weights[t]=n;let s=this.weights.reduce((r,a)=>r+a,0);this.weightsRelative=this.weights.map(r=>r*5/s)}matchAgainst(t,n){let s=0;for(let r in t){let a=t[r],o=this.curls[r];if(typeof o=="undefined"){s+=this.weightsRelative[r];continue}for(let[i,l]of o)if(a===i){s+=l*this.weightsRelative[r];break}}for(let r in n){let a=n[r],o=this.directions[r];if(typeof o=="undefined"){s+=this.weightsRelative[r];continue}for(let[i,l]of o)if(a===i){s+=l*this.weightsRelative[r];break}}return s/10}};var{thumb:Sr,index:pa,middle:ha,ring:Vl,pinky:Ul}=Yn,{none:Ir,half:gye,full:Cr}=ti,{verticalUp:Fc,verticalDown:cxe,horizontalLeft:Wb,horizontalRight:yye,diagonalUpRight:Aye,diagonalUpLeft:Pc,diagonalDownRight:dxe,diagonalDownLeft:pxe}=Bt,ni=new Wl("thumbs up");ni.curl(Sr,Ir,1);ni.direction(Sr,Fc,1);ni.direction(Sr,Pc,.25);ni.direction(Sr,Aye,.25);for(let e of[Yn.index,Yn.middle,Yn.ring,Yn.pinky])ni.curl(e,Cr,1),ni.direction(e,Wb,1),ni.direction(e,yye,1);var en=new Wl("victory");en.curl(Sr,gye,.5);en.curl(Sr,Ir,.5);en.direction(Sr,Fc,1);en.direction(Sr,Pc,1);en.curl(pa,Ir,1);en.direction(pa,Fc,.75);en.direction(pa,Pc,1);en.curl(ha,Ir,1);en.direction(ha,Fc,1);en.direction(ha,Pc,.75);en.curl(Vl,Cr,1);en.direction(Vl,Fc,.2);en.direction(Vl,Pc,1);en.direction(Vl,Wb,.2);en.curl(Ul,Cr,1);en.direction(Ul,Fc,.2);en.direction(Ul,Pc,1);en.direction(Ul,Wb,.2);en.weight(pa,2);en.weight(ha,2);var si=new Wl("point");si.curl(Sr,Cr,1);si.curl(pa,Ir,.5);si.curl(ha,Cr,.5);si.curl(Vl,Cr,.5);si.curl(Ul,Cr,.5);si.weight(pa,2);si.weight(ha,2);var ri=new Wl("middle finger");ri.curl(Sr,Ir,1);ri.curl(pa,Cr,.5);ri.curl(ha,Cr,.5);ri.curl(Vl,Cr,.5);ri.curl(Ul,Cr,.5);ri.weight(pa,2);ri.weight(ha,2);var Oc=new Wl("open palm");Oc.curl(Sr,Ir,.75);Oc.curl(pa,Ir,.75);Oc.curl(ha,Ir,.75);Oc.curl(Vl,Ir,.75);Oc.curl(Ul,Ir,.75);var LT=[ni,en,si,ri,Oc];var xye=.7,Gl={HALF_CURL_START_LIMIT:60,NO_CURL_START_LIMIT:130,DISTANCE_VOTE_POWER:1.1,SINGLE_ANGLE_VOTE_POWER:.9,TOTAL_ANGLE_VOTE_POWER:1.6};function BT(e,t,n,s){let r=(t-s)/(e-n),a=Math.atan(r)*180/Math.PI;return a<=0?a=-a:a>0&&(a=180-a),a}function WT(e,t){if(!e||!t)return[0,0];let n=BT(e[0],e[1],t[0],t[1]);if(e.length===2)return n;let s=BT(e[1],e[2],t[1],t[2]);return[n,s]}function VT(e,t=1){let n=0,s=0,r=0;return e>=75&&e<=105?n=1*t:e>=25&&e<=155?s=1*t:r=1*t,[n,s,r]}function bye(e,t,n){let s=e[0]-t[0],r=e[0]-n[0],a=t[0]-n[0],o=e[1]-t[1],i=e[1]-n[1],l=t[1]-n[1],c=e[2]-t[2],u=e[2]-n[2],d=t[2]-n[2],p=Math.sqrt(s*s+o*o+c*c),h=Math.sqrt(r*r+i*i+u*u),f=Math.sqrt(a*a+l*l+d*d),m=(f*f+p*p-h*h)/(2*f*p);m>1?m=1:m<-1&&(m=-1);let g=Math.acos(m);g=57.2958*g%180;let y;return g>Gl.NO_CURL_START_LIMIT?y=ti.none:g>Gl.HALF_CURL_START_LIMIT?y=ti.half:y=ti.full,y}function UT(e,t,n,s){let r;return s===Math.abs(e)?e>0?r=Bt.horizontalLeft:r=Bt.horizontalRight:s===Math.abs(t)?t>0?r=Bt.horizontalLeft:r=Bt.horizontalRight:n>0?r=Bt.horizontalLeft:r=Bt.horizontalRight,r}function GT(e,t,n,s){let r;return s===Math.abs(e)?e<0?r=Bt.verticalDown:r=Bt.verticalUp:s===Math.abs(t)?t<0?r=Bt.verticalDown:r=Bt.verticalUp:n<0?r=Bt.verticalDown:r=Bt.verticalUp,r}function vye(e,t,n,s,r,a,o,i){let l,c=GT(e,t,n,s),u=UT(r,a,o,i);return c===Bt.verticalUp?u===Bt.horizontalLeft?l=Bt.diagonalUpLeft:l=Bt.diagonalUpRight:u===Bt.horizontalLeft?l=Bt.diagonalDownLeft:l=Bt.diagonalDownRight,l}function wye(e,t,n,s){let r=e[0]-t[0],a=e[0]-n[0],o=t[0]-n[0],i=e[1]-t[1],l=e[1]-n[1],c=t[1]-n[1],u=Math.max(Math.abs(r),Math.abs(a),Math.abs(o)),d=Math.max(Math.abs(i),Math.abs(l),Math.abs(c)),p=0,h=0,f=0,m=d/(u+1e-5);m>1.5?p+=Gl.DISTANCE_VOTE_POWER:m>.66?h+=Gl.DISTANCE_VOTE_POWER:f+=Gl.DISTANCE_VOTE_POWER;let g=Math.sqrt(r*r+i*i),y=Math.sqrt(a*a+l*l),x=Math.sqrt(o*o+c*c),A=Math.max(g,y,x),b=e[0],w=e[1],k=n[0],I=n[1];A===g?(k=n[0],I=n[1]):A===x&&(b=t[0],w=t[1]);let P=WT([b,w],[k,I]),$=VT(P,Gl.TOTAL_ANGLE_VOTE_POWER);p+=$[0],h+=$[1],f+=$[2];for(let T of s){let O=VT(T,Gl.SINGLE_ANGLE_VOTE_POWER);p+=O[0],h+=O[1],f+=O[2]}let _;return p===Math.max(p,h,f)?_=GT(l,i,c,d):f===Math.max(h,f)?_=UT(a,r,o,u):_=vye(l,i,c,d,a,r,o,u),_}function HT(e){let t=[],n=[],s=[],r=[];if(!e)return{curls:s,directions:r};for(let a of Yn.all){let o=Yn.getPoints(a),i=[],l=[];for(let c of o){let u=e[c[0]],d=e[c[1]],p=WT(u,d),h=p[0],f=p[1];i.push(h),l.push(f)}t.push(i),n.push(l)}for(let a of Yn.all){let o=a===Yn.thumb?1:0,i=Yn.getPoints(a),l=e[i[o][0]],c=e[i[o+1][1]],u=e[i[3][1]],d=bye(l,c,u),p=wye(l,c,u,t[a].slice(o));s[a]=d,r[a]=p}return{curls:s,directions:r}}function N0(e){if(!e||e.length===0)return null;let t=HT(e),n={};for(let s of Yn.all)n[Yn.getName(s)]={curl:ti.getName(t.curls[s]),direction:Bt.getName(t.directions[s])};return n}function jT(e){let t=[];if(!e||e.length===0)return t;let n=HT(e);for(let s of LT){let r=s.matchAgainst(n.curls,n.directions);r>=xye&&t.push({name:s.name,confidence:r})}return t}var qT={thumb:[1,2,3,4],index:[5,6,7,8],middle:[9,10,11,12],ring:[13,14,15,16],pinky:[17,18,19,20],palm:[0]},fa,ma,XT;async function Vb(e,t){let n=await XT.estimateHands(e,t);if(!n)return[];let s=[];for(let r=0;rn[r].landmarks[d]);let o=n[r].landmarks,i=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,0,0],l=[0,0,0,0];if(o&&o.length>0){for(let u of o)u[0]i[2]&&(i[2]=u[0]),u[1]>i[3]&&(i[3]=u[1]);i[2]-=i[0],i[3]-=i[1],l=[i[0]/(e.shape[2]||0),i[1]/(e.shape[1]||0),i[2]/(e.shape[2]||0),i[3]/(e.shape[1]||0)]}else i=n[r].box?[Math.trunc(Math.max(0,n[r].box.topLeft[0])),Math.trunc(Math.max(0,n[r].box.topLeft[1])),Math.trunc(Math.min(e.shape[2]||0,n[r].box.bottomRight[0])-Math.max(0,n[r].box.topLeft[0])),Math.trunc(Math.min(e.shape[1]||0,n[r].box.bottomRight[1])-Math.max(0,n[r].box.topLeft[1]))]:[0,0,0,0],l=[n[r].box.topLeft[0]/(e.shape[2]||0),n[r].box.topLeft[1]/(e.shape[1]||0),(n[r].box.bottomRight[0]-n[r].box.topLeft[0])/(e.shape[2]||0),(n[r].box.bottomRight[1]-n[r].box.topLeft[1])/(e.shape[1]||0)];let c=N0(o);s.push({id:r,score:Math.round(100*n[r].confidence)/100,boxScore:Math.round(100*n[r].boxConfidence)/100,fingerScore:Math.round(100*n[r].fingerConfidence)/100,label:"hand",box:i,boxRaw:l,keypoints:o,annotations:a,landmarks:c})}return s}async function Ub(e){var n,s,r,a,o,i;pe.initial&&(fa=null,ma=null),!fa||!ma?([fa,ma]=await Promise.all([e.hand.enabled?Be(We(e.modelBasePath,((n=e.hand.detector)==null?void 0:n.modelPath)||""),{fromTFHub:(((s=e.hand.detector)==null?void 0:s.modelPath)||"").includes("tfhub.dev")}):null,e.hand.landmarks?Be(We(e.modelBasePath,((r=e.hand.skeleton)==null?void 0:r.modelPath)||""),{fromTFHub:(((a=e.hand.skeleton)==null?void 0:a.modelPath)||"").includes("tfhub.dev")}):null]),e.hand.enabled&&(!fa||!fa.modelUrl?J("load model failed:",((o=e.hand.detector)==null?void 0:o.modelPath)||""):e.debug&&J("load model:",fa.modelUrl),!ma||!ma.modelUrl?J("load model failed:",((i=e.hand.skeleton)==null?void 0:i.modelPath)||""):e.debug&&J("load model:",ma.modelUrl))):(e.debug&&J("cached model:",fa.modelUrl),e.debug&&J("cached model:",ma.modelUrl));let t=new Lb(fa);return XT=new Bb(t,ma),[fa,ma]}var Et=[null,null],kye=["StatefulPartitionedCall/Postprocessor/Slice","StatefulPartitionedCall/Postprocessor/ExpandDims_1"],ai=[[0,0],[0,0]],Sye=["hand","fist","pinch","point","face","tip","pinchtip"],KT=4,ZT=1.6,Iye=512,Cye=1.4,E0=Number.MAX_SAFE_INTEGER,Gb=0,ga=[0,0],Xt={boxes:[],hands:[]},YT={thumb:[0,1,2,3,4],index:[0,5,6,7,8],middle:[0,9,10,11,12],ring:[0,13,14,15,16],pinky:[0,17,18,19,20],palm:[0]};async function JT(e){var t,n;if(pe.initial&&(Et[0]=null),Et[0])e.debug&&J("cached model:",Et[0].modelUrl);else{R0(["tensorlistreserve","enter","tensorlistfromtensor","merge","loopcond","switch","exit","tensorliststack","nextiteration","tensorlistsetitem","tensorlistgetitem","reciprocal","shape","split","where"],e),Et[0]=await Be(We(e.modelBasePath,((t=e.hand.detector)==null?void 0:t.modelPath)||""));let s=Object.values(Et[0].modelSignature.inputs);ai[0][0]=Array.isArray(s)?parseInt(s[0].tensorShape.dim[1].size):0,ai[0][1]=Array.isArray(s)?parseInt(s[0].tensorShape.dim[2].size):0,!Et[0]||!Et[0].modelUrl?J("load model failed:",(n=e.hand.detector)==null?void 0:n.modelPath):e.debug&&J("load model:",Et[0].modelUrl)}return Et[0]}async function QT(e){var t,n;if(pe.initial&&(Et[1]=null),Et[1])e.debug&&J("cached model:",Et[1].modelUrl);else{Et[1]=await Be(We(e.modelBasePath,((t=e.hand.skeleton)==null?void 0:t.modelPath)||""));let s=Object.values(Et[1].modelSignature.inputs);ai[1][0]=Array.isArray(s)?parseInt(s[0].tensorShape.dim[1].size):0,ai[1][1]=Array.isArray(s)?parseInt(s[0].tensorShape.dim[2].size):0,!Et[1]||!Et[1].modelUrl?J("load model failed:",(n=e.hand.skeleton)==null?void 0:n.modelPath):e.debug&&J("load model:",Et[1].modelUrl)}return Et[1]}async function Tye(e,t){let n=[];if(!e||!Et[0])return n;let s={},r=(e.shape[2]||1)/(e.shape[1]||1),a=Math.min(Math.round((e.shape[1]||0)/8)*8,Iye),o=Math.round(a*r/8)*8;s.resize=Se.resizeBilinear(e,[a,o]),s.cast=me(s.resize,"int32"),[s.rawScores,s.rawBoxes]=await Et[0].executeAsync(s.cast,kye),s.boxes=rt(s.rawBoxes,[0,2]),s.scores=rt(s.rawScores,[0]);let i=os(s.scores,1);te(i[KT]),i.splice(KT,1),s.filtered=an(i,1),te(i),s.max=An(s.filtered,1),s.argmax=Fs(s.filtered,1);let l=0;s.nms=await Se.nonMaxSuppressionAsync(s.boxes,s.max,t.hand.maxDetected,t.hand.iouThreshold,t.hand.minConfidence);let c=await s.nms.data(),u=await s.max.data(),d=await s.argmax.data();for(let p of Array.from(c)){let h=Pe(s.boxes,p,1),f=await h.data();te(h);let m=[f[1],f[0],f[3]-f[1],f[2]-f[0]],g=b0(m,Cye),y=gb(g),x=[Math.trunc(m[0]*ga[0]),Math.trunc(m[1]*ga[1]),Math.trunc(m[2]*ga[0]),Math.trunc(m[3]*ga[1])],A=u[p],b=Sye[d[p]],w={id:l++,score:A,box:x,boxRaw:g,boxCrop:y,label:b};n.push(w)}return Object.keys(s).forEach(p=>te(s[p])),n.sort((p,h)=>h.score-p.score),n.length>(t.hand.maxDetected||1)&&(n.length=t.hand.maxDetected||1),n}async function Hb(e,t,n){let s={id:t.id,score:Math.round(100*t.score)/100,boxScore:Math.round(100*t.score)/100,fingerScore:0,box:t.box,boxRaw:t.boxRaw,label:t.label,keypoints:[],landmarks:{},annotations:{}};if(e&&Et[1]&&n.hand.landmarks&&t.score>(n.hand.minConfidence||0)){let r={};r.crop=Se.cropAndResize(e,[t.boxCrop],[0],[ai[1][0],ai[1][1]],"bilinear"),r.div=de(r.crop,Xe.tf255),[r.score,r.keypoints]=Et[1].execute(r.div,["Identity_1","Identity"]);let a=(await r.score.data())[0],o=(100-Math.trunc(100/(1+Math.exp(a))))/100;if(o>=(n.hand.minConfidence||0)){s.fingerScore=o,r.reshaped=H(r.keypoints,[-1,3]);let c=(await r.reshaped.array()).map(u=>[u[0]/ai[1][1],u[1]/ai[1][0],u[2]||0]).map(u=>[u[0]*t.boxRaw[2],u[1]*t.boxRaw[3],u[2]||0]);s.keypoints=c.map(u=>[ga[0]*(u[0]+t.boxRaw[0]),ga[1]*(u[1]+t.boxRaw[1]),u[2]||0]),s.landmarks=N0(s.keypoints);for(let u of Object.keys(YT))s.annotations[u]=YT[u].map(d=>s.landmarks&&s.keypoints[d]?s.keypoints[d]:null)}Object.keys(r).forEach(i=>te(r[i]))}return s}async function jb(e,t){var r,a;if(!Et[0]||!Et[1]||!((r=Et[0])==null?void 0:r.inputs[0].shape)||!((a=Et[1])==null?void 0:a.inputs[0].shape))return[];ga=[e.shape[2]||0,e.shape[1]||0],E0++;let n=(t.hand.skipTime||0)>ie()-Gb,s=E0<(t.hand.skipFrames||0);return t.skipAllowed&&n&&s?Xt.hands:new Promise(async o=>{let i=3*(t.hand.skipTime||0)>ie()-Gb,l=E0<3*(t.hand.skipFrames||0);t.skipAllowed&&Xt.hands.length===t.hand.maxDetected?Xt.hands=await Promise.all(Xt.boxes.map(u=>Hb(e,u,t))):t.skipAllowed&&i&&l&&Xt.hands.length>0?Xt.hands=await Promise.all(Xt.boxes.map(u=>Hb(e,u,t))):(Xt.boxes=await Tye(e,t),Gb=ie(),Xt.hands=await Promise.all(Xt.boxes.map(u=>Hb(e,u,t))),E0=0);let c=[...Xt.boxes];if(Xt.boxes.length=0,t.cacheSensitivity>0)for(let u=0;u.05&&d.box[3]/(e.shape[1]||1)>.05&&Xt.hands[u].fingerScore&&Xt.hands[u].fingerScore>(t.hand.minConfidence||0)){let p=b0(d.box,ZT),h=b0(d.boxRaw,ZT),f=gb(h);Xt.boxes.push({...c[u],box:p,boxRaw:h,boxCrop:f})}}for(let u=0;uie()-tN,a=qb<(((i=t.face.liveness)==null?void 0:i.skipFrames)||0);return t.skipAllowed&&r&&a&&eN===s&&_0[n]?(qb++,_0[n]):(qb=0,new Promise(async l=>{let c=Se.resizeBilinear(e,[(fn==null?void 0:fn.inputs[0].shape)?fn.inputs[0].shape[2]:0,(fn==null?void 0:fn.inputs[0].shape)?fn.inputs[0].shape[1]:0],!1),u=fn==null?void 0:fn.execute(c),d=(await u.data())[0];_0[n]=Math.round(100*d)/100,eN=s,tN=ie(),te([c,u]),l(_0[n])}))}var Jb={};ed(Jb,{connected:()=>D0,horizontal:()=>Kb,kpt:()=>$0,relative:()=>Yb,vertical:()=>Zb});var $0=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],Kb=[["leftEye","rightEye"],["leftEar","rightEar"],["leftShoulder","rightShoulder"],["leftElbow","rightElbow"],["leftWrist","rightWrist"],["leftHip","rightHip"],["leftKnee","rightKnee"],["leftAnkle","rightAnkle"]],Zb=[["leftKnee","leftShoulder"],["rightKnee","rightShoulder"],["leftAnkle","leftKnee"],["rightAnkle","rightKnee"]],Yb=[[["leftHip","rightHip"],["leftShoulder","rightShoulder"]],[["leftElbow","rightElbow"],["leftShoulder","rightShoulder"]]],D0={leftLeg:["leftHip","leftKnee","leftAnkle"],rightLeg:["rightHip","rightKnee","rightAnkle"],torso:["leftShoulder","rightShoulder","rightHip","leftHip","leftShoulder"],leftArm:["leftShoulder","leftElbow","leftWrist"],rightArm:["rightShoulder","rightElbow","rightWrist"],head:[]};var sN=.005,Ts={keypoints:[],padding:[[0,0],[0,0],[0,0],[0,0]]};function Qb(e){for(let t of Kb){let n=e.keypoints.findIndex(r=>r.part===t[0]),s=e.keypoints.findIndex(r=>r.part===t[1]);if(e.keypoints[n]&&e.keypoints[s]&&e.keypoints[n].position[0]r&&r.part===t[0]),s=e.keypoints.findIndex(r=>r&&r.part===t[1]);e.keypoints[n]&&e.keypoints[s]&&e.keypoints[n].position[1]c&&c.part===t[0]),r=e.keypoints.findIndex(c=>c&&c.part===t[1]),a=e.keypoints.findIndex(c=>c&&c.part===n[0]),o=e.keypoints.findIndex(c=>c&&c.part===n[1]);if(!e.keypoints[a]||!e.keypoints[o])continue;let i=e.keypoints[s]?[Math.abs(e.keypoints[a].position[0]-e.keypoints[s].position[0]),Math.abs(e.keypoints[o].position[0]-e.keypoints[s].position[0])]:[0,0],l=e.keypoints[r]?[Math.abs(e.keypoints[o].position[0]-e.keypoints[r].position[0]),Math.abs(e.keypoints[a].position[0]-e.keypoints[r].position[0])]:[0,0];if(i[0]>i[1]||l[0]>l[1]){let c=e.keypoints[s];e.keypoints[s]=e.keypoints[r],e.keypoints[r]=c}}}function rN(e){for(let t=0;te.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0,e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0],[e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0,e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0],[0,0]],n.pad=Qs(e,Ts.padding),n.resize=Se.resizeBilinear(n.pad,[t,t]);let s=me(n.resize,"int32");return Object.keys(n).forEach(r=>te(n[r])),s}function oN(e,t){e.keypoints=e.keypoints.filter(s=>s&&s.position);for(let s of e.keypoints)s.position=[s.position[0]*(t[0]+Ts.padding[2][0]+Ts.padding[2][1])/t[0]-Ts.padding[2][0],s.position[1]*(t[1]+Ts.padding[1][0]+Ts.padding[1][1])/t[1]-Ts.padding[1][0]],s.positionRaw=[s.position[0]/t[0],s.position[1]/t[1]];let n=da(e.keypoints.map(s=>s.position),t);return e.box=n.box,e.boxRaw=n.boxRaw,e}var Fn,iN=0,e5=Number.MAX_SAFE_INTEGER,Hl={boxes:[],bodies:[],last:0};async function lN(e){return pe.initial&&(Fn=null),Fn?e.debug&&J("cached model:",Fn.modelUrl):(R0(["size"],e),Fn=await Be(We(e.modelBasePath,e.body.modelPath||"")),!Fn||!Fn.modelUrl?J("load model failed:",e.body.modelPath):e.debug&&J("load model:",Fn.modelUrl)),iN=Fn.inputs[0].shape?Fn.inputs[0].shape[2]:0,Fn}async function Nye(e,t,n){let s=e[0][0],r=[],a=0;for(let u=0;ut.body.minConfidence){let d=[s[u][1],s[u][0]];r.push({score:Math.round(100*a)/100,part:$0[u],positionRaw:d,position:[Math.round((n.shape[2]||0)*d[0]),Math.round((n.shape[1]||0)*d[1])]})}a=r.reduce((u,d)=>d.score>u?d.score:u,0);let o=[],i=da(r.map(u=>u.position),[n.shape[2],n.shape[1]]),l={};for(let[u,d]of Object.entries(D0)){let p=[];for(let h=0;hg.part===d[h]),m=r.find(g=>g.part===d[h+1]);f&&m&&f.score>(t.body.minConfidence||0)&&m.score>(t.body.minConfidence||0)&&p.push([f.position,m.position])}l[u]=p}let c={id:0,score:a,box:i.box,boxRaw:i.boxRaw,keypoints:r,annotations:l};return Qb(c),o.push(c),o}async function Eye(e,t,n){let s=[];for(let r=0;rt.body.minConfidence){let i=[];for(let d=0;d<17;d++){let p=a[3*d+2];if(p>t.body.minConfidence){let h=[a[3*d+1],a[3*d+0]];i.push({part:$0[d],score:Math.round(100*p)/100,positionRaw:h,position:[Math.round((n.shape[2]||0)*h[0]),Math.round((n.shape[1]||0)*h[1])]})}}let l=da(i.map(d=>d.position),[n.shape[2],n.shape[1]]),c={};for(let[d,p]of Object.entries(D0)){let h=[];for(let f=0;fy.part===p[f]),g=i.find(y=>y.part===p[f+1]);m&&g&&m.score>(t.body.minConfidence||0)&&g.score>(t.body.minConfidence||0)&&h.push([m.position,g.position])}c[d]=h}let u={id:r,score:o,box:l.box,boxRaw:l.boxRaw,keypoints:[...i],annotations:c};Qb(u),s.push(u)}}return s.sort((r,a)=>a.score-r.score),s.length>t.body.maxDetected&&(s.length=t.body.maxDetected),s}async function t5(e,t){if(!Fn||!(Fn==null?void 0:Fn.inputs[0].shape))return[];t.skipAllowed||(Hl.boxes.length=0),e5++;let n=(t.body.skipTime||0)>ie()-Hl.last,s=e5<(t.body.skipFrames||0);return t.skipAllowed&&n&&s?Hl.bodies:new Promise(async r=>{let a={};e5=0,a.input=aN(e,iN),a.res=Fn==null?void 0:Fn.execute(a.input),Hl.last=ie();let o=await a.res.array();Hl.bodies=a.res.shape[2]===17?await Nye(o,t,e):await Eye(o,t,e);for(let i of Hl.bodies)oN(i,[e.shape[2]||1,e.shape[1]||1]),rN(i.keypoints);Object.keys(a).forEach(i=>te(a[i])),r(Hl.bodies)})}var Gs,F0=[],uN=0,n5=Number.MAX_SAFE_INTEGER,P0=2.5;async function cN(e){if(!Gs||pe.initial){Gs=await Be(We(e.modelBasePath,e.object.modelPath||""));let t=Object.values(Gs.modelSignature.inputs);Gs.inputSize=Array.isArray(t)?parseInt(t[0].tensorShape.dim[2].size):null,!Gs||!Gs.modelUrl?J("load model failed:",e.object.modelPath):e.debug&&J("load model:",Gs.modelUrl)}else e.debug&&J("cached model:",Gs.modelUrl);return Gs}async function Rye(e,t,n,s){let r=0,a=[];for(let c of[1,2,4])K(async()=>{var g,y;let u=c*13,d=(g=e.find(x=>x.shape[1]===u**2&&x.shape[2]===Rc.length))==null?void 0:g.squeeze(),p=(y=e.find(x=>x.shape[1]===u**2&&x.shape[2]s.object.minConfidence&&A!==61){let w=(.5+Math.trunc(x%u))/u,k=(.5+Math.trunc(x/u))/u,I=f[x].map(V=>V*(u/c/t)),[E,R]=[w-P0/c*I[0],k-P0/c*I[1]],[P,$]=[w+P0/c*I[2]-E,k+P0/c*I[3]-R],_=[E,R,P,$];_=_.map(V=>Math.max(0,Math.min(V,1)));let T=[_[0]*n[0],_[1]*n[1],_[2]*n[0],_[3]*n[1]],O={id:r++,score:Math.round(100*b)/100,class:A+1,label:Rc[A].label,box:T.map(V=>Math.trunc(V)),boxRaw:_};a.push(O)}}});e.forEach(c=>te(c));let o=a.map(c=>[c.boxRaw[1],c.boxRaw[0],c.boxRaw[3],c.boxRaw[2]]),i=a.map(c=>c.score),l=[];if(o&&o.length>0){let c=await Se.nonMaxSuppressionAsync(o,i,s.object.maxDetected,s.object.iouThreshold,s.object.minConfidence);l=await c.data(),te(c)}return a=a.filter((c,u)=>l.includes(u)).sort((c,u)=>u.score-c.score),a}async function s5(e,t){let n=(t.object.skipTime||0)>ie()-uN,s=n5<(t.object.skipFrames||0);return t.skipAllowed&&n&&s&&F0.length>0?(n5++,F0):(n5=0,!pe.kernels.includes("mod")||!pe.kernels.includes("sparsetodense")?F0:new Promise(async r=>{let a=[e.shape[2],e.shape[1]],o=Se.resizeBilinear(e,[Gs.inputSize,Gs.inputSize],!1),i=de(o,Xe.tf255),l=i.transpose([0,3,1,2]);te(i),te(o);let c;t.object.enabled&&(c=Gs.execute(l)),uN=ie(),te(l);let u=await Rye(c,Gs.inputSize,a,t);F0=u,r(u)}))}var Hp=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],_ye=Hp.length,jp=Hp.reduce((e,t,n)=>(e[t]=n,e),{}),$ye=[["leftHip","leftShoulder"],["leftElbow","leftShoulder"],["leftElbow","leftWrist"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["rightHip","rightShoulder"],["rightElbow","rightShoulder"],["rightElbow","rightWrist"],["rightHip","rightKnee"],["rightKnee","rightAnkle"],["leftShoulder","rightShoulder"],["leftHip","rightHip"]],ebe=$ye.map(([e,t])=>[jp[e],jp[t]]),dN=[["nose","leftEye"],["leftEye","leftEar"],["nose","rightEye"],["rightEye","rightEar"],["nose","leftShoulder"],["leftShoulder","leftElbow"],["leftElbow","leftWrist"],["leftShoulder","leftHip"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["nose","rightShoulder"],["rightShoulder","rightElbow"],["rightElbow","rightWrist"],["rightShoulder","rightHip"],["rightHip","rightKnee"],["rightKnee","rightAnkle"]];function pN(e){let t=e.reduce(({maxX:n,maxY:s,minX:r,minY:a},{position:{x:o,y:i}})=>({maxX:Math.max(n,o),maxY:Math.max(s,i),minX:Math.min(r,o),minY:Math.min(a,i)}),{maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY,minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY});return[t.minX,t.minY,t.maxX-t.minX,t.maxY-t.minY]}function hN(e,[t,n],[s,r]){let a=t/s,o=n/r,i=(c,u)=>({id:u,score:c.score,boxRaw:[c.box[0]/r,c.box[1]/s,c.box[2]/r,c.box[3]/s],box:[Math.trunc(c.box[0]*o),Math.trunc(c.box[1]*a),Math.trunc(c.box[2]*o),Math.trunc(c.box[3]*a)],keypoints:c.keypoints.map(({score:d,part:p,position:h})=>({score:d,part:p,position:[Math.trunc(h.x*o),Math.trunc(h.y*a)],positionRaw:[h.x/s,h.y/s]})),annotations:{}});return e.map((c,u)=>i(c,u))}var r5=class{constructor(t,n){fe(this,"priorityQueue");fe(this,"numberOfElements");fe(this,"getElementValue");this.priorityQueue=new Array(t),this.numberOfElements=-1,this.getElementValue=n}enqueue(t){this.priorityQueue[++this.numberOfElements]=t,this.swim(this.numberOfElements)}dequeue(){let t=this.priorityQueue[0];return this.exchange(0,this.numberOfElements--),this.sink(0),this.priorityQueue[this.numberOfElements+1]=null,t}empty(){return this.numberOfElements===-1}size(){return this.numberOfElements+1}all(){return this.priorityQueue.slice(0,this.numberOfElements+1)}max(){return this.priorityQueue[0]}swim(t){for(;t>0&&this.less(Math.floor(t/2),t);)this.exchange(t,Math.floor(t/2)),t=Math.floor(t/2)}sink(t){for(;2*t<=this.numberOfElements;){let n=2*t;if(nn?n:e}function fN(e,t,n,s){let r=n-e,a=s-t;return r*r+a*a}function l5(e,t){return{x:e.x+t.x,y:e.y+t.y}}var Ns,Dye=["MobilenetV1/offset_2/BiasAdd","MobilenetV1/heatmap_2/BiasAdd","MobilenetV1/displacement_fwd_2/BiasAdd","MobilenetV1/displacement_bwd_2/BiasAdd"],O0=1,Mc=16,Fye=50**2;function mN(e,t,n,s,r,a,o=2){let i=y=>({y:a.get(y.y,y.x,e),x:a.get(y.y,y.x,a.shape[2]/2+e)}),l=(y,x,A)=>({y:i5(Math.round(y.y/Mc),0,x-1),x:i5(Math.round(y.x/Mc),0,A-1)}),[c,u]=s.shape,d=l(t.position,c,u),p=i(d),f=l5(t.position,p);for(let y=0;y[jp[p],jp[h]]),o=a.map(([,p])=>p),i=a.map(([p])=>p),l=t.shape[2],c=o.length,u=new Array(l),d=o5(e.part,Mc,n);u[e.part.id]={score:e.score,part:Hp[e.part.id],position:d};for(let p=c-1;p>=0;--p){let h=o[p],f=i[p];u[h]&&!u[f]&&(u[f]=mN(p,u[h],f,t,n,r))}for(let p=0;pt){i=!1;break}if(!i)break}return i}function Mye(e,t){let[n,s,r]=t.shape,a=new r5(n*s*r,({score:o})=>o);for(let o=0;o{var o;let a=(o=r[s])==null?void 0:o.position;return a?fN(n,t,a.y,a.x)<=Fye:!1})}function zye(e,t){return t.reduce((s,{position:r,score:a},o)=>(gN(e,r,o)||(s+=a),s),0)/t.length}function Lye(e,t,n,s,r,a){let o=[],i=Mye(a,t);for(;o.lengthh.score>a);let d=zye(o,u),p=pN(u);d>a&&o.push({keypoints:u,box:p,score:Math.round(100*d)/100})}return o}async function u5(e,t){let n=K(()=>{if(!Ns.inputs[0].shape)return[];let o=Se.resizeBilinear(e,[Ns.inputs[0].shape[2],Ns.inputs[0].shape[1]]),i=he(de(me(o,"float32"),127.5),1),c=Ns.execute(i,Dye).map(u=>rt(u,[0]));return c[1]=c[1].sigmoid(),c}),s=await Promise.all(n.map(o=>o.buffer()));for(let o of n)te(o);let r=await Lye(s[0],s[1],s[2],s[3],t.body.maxDetected,t.body.minConfidence);return Ns.inputs[0].shape?hN(r,[e.shape[1],e.shape[2]],[Ns.inputs[0].shape[2],Ns.inputs[0].shape[1]]):[]}async function yN(e){return!Ns||pe.initial?(Ns=await Be(We(e.modelBasePath,e.body.modelPath||"")),!Ns||!Ns.modelUrl?J("load model failed:",e.body.modelPath):e.debug&&J("load model:",Ns.modelUrl)):e.debug&&J("cached model:",Ns.modelUrl),Ns}var Hs,c5=!1;async function d5(e){return!Hs||pe.initial?(Hs=await Be(We(e.modelBasePath,e.segmentation.modelPath||"")),!Hs||!Hs.modelUrl?J("load model failed:",e.segmentation.modelPath):e.debug&&J("load model:",Hs.modelUrl)):e.debug&&J("cached model:",Hs.modelUrl),Hs}async function AN(e,t,n){var m,g;if(c5)return{data:[],canvas:null,alpha:null};c5=!0,Hs||await d5(n);let s=await Nc(e,n),r=((m=s.tensor)==null?void 0:m.shape[2])||0,a=((g=s.tensor)==null?void 0:g.shape[1])||0;if(!s.tensor)return{data:[],canvas:null,alpha:null};let o={};o.resize=Se.resizeBilinear(s.tensor,[Hs.inputs[0].shape?Hs.inputs[0].shape[1]:0,Hs.inputs[0].shape?Hs.inputs[0].shape[2]:0],!1),te(s.tensor),o.norm=de(o.resize,Xe.tf255),o.res=Hs.execute(o.norm),o.squeeze=rt(o.res,0),o.squeeze.shape[2]===2?(o.softmax=Ku(o.squeeze),[o.bg,o.fg]=os(o.softmax,2),o.expand=Zt(o.fg,2),o.pad=Zt(o.expand,0),o.crop=Se.cropAndResize(o.pad,[[0,0,.5,.5]],[0],[r,a]),o.data=rt(o.crop,0)):o.data=Se.resizeBilinear(o.squeeze,[a,r]);let i=Array.from(await o.data.data());if(pe.node&&!pe.Canvas&&typeof ImageData=="undefined")return n.debug&&J("canvas support missing"),Object.keys(o).forEach(y=>te(o[y])),{data:i,canvas:null,alpha:null};let l=Xn(r,a);await Ys.toPixels(o.data,l);let c=l.getContext("2d");n.segmentation.blur&&n.segmentation.blur>0&&(c.filter=`blur(${n.segmentation.blur}px)`);let u=c.getImageData(0,0,r,a),d=Xn(r,a),p=d.getContext("2d");s.canvas&&p.drawImage(s.canvas,0,0),p.globalCompositeOperation="darken",n.segmentation.blur&&n.segmentation.blur>0&&(p.filter=`blur(${n.segmentation.blur}px)`),p.drawImage(l,0,0),p.globalCompositeOperation="source-over",p.filter="none";let h=p.getImageData(0,0,r,a);for(let y=0;yte(o[y])),c5=!1,{data:i,canvas:d,alpha:l}}var p5=class{constructor(){fe(this,"ssrnetage",null);fe(this,"gear",null);fe(this,"blazeposedetect",null);fe(this,"blazepose",null);fe(this,"centernet",null);fe(this,"efficientpose",null);fe(this,"mobilefacenet",null);fe(this,"emotion",null);fe(this,"facedetect",null);fe(this,"faceiris",null);fe(this,"facemesh",null);fe(this,"faceres",null);fe(this,"ssrnetgender",null);fe(this,"handpose",null);fe(this,"handskeleton",null);fe(this,"handtrack",null);fe(this,"liveness",null);fe(this,"movenet",null);fe(this,"nanodet",null);fe(this,"posenet",null);fe(this,"segmentation",null);fe(this,"antispoof",null)}};function h5(e){for(let t of Object.keys(e.models))e.models[t]=null}async function xN(e){var t,n,s,r,a,o,i,l,c,u,d,p,h,f,m,g,y,x,A,b,w,k,I,E,R,P,$,_,T,O;pe.initial&&h5(e),e.config.hand.enabled&&(!e.models.handpose&&((n=(t=e.config.hand.detector)==null?void 0:t.modelPath)==null?void 0:n.includes("handdetect"))&&([e.models.handpose,e.models.handskeleton]=await Ub(e.config)),!e.models.handskeleton&&e.config.hand.landmarks&&((r=(s=e.config.hand.detector)==null?void 0:s.modelPath)==null?void 0:r.includes("handdetect"))&&([e.models.handpose,e.models.handskeleton]=await Ub(e.config))),e.config.body.enabled&&!e.models.blazepose&&((o=(a=e.config.body)==null?void 0:a.modelPath)==null?void 0:o.includes("blazepose"))&&(e.models.blazepose=rT(e.config)),e.config.body.enabled&&!e.models.blazeposedetect&&e.config.body.detector&&e.config.body.detector.modelPath&&(e.models.blazeposedetect=sT(e.config)),e.config.body.enabled&&!e.models.efficientpose&&((l=(i=e.config.body)==null?void 0:i.modelPath)==null?void 0:l.includes("efficientpose"))&&(e.models.efficientpose=lT(e.config)),e.config.body.enabled&&!e.models.movenet&&((u=(c=e.config.body)==null?void 0:c.modelPath)==null?void 0:u.includes("movenet"))&&(e.models.movenet=lN(e.config)),e.config.body.enabled&&!e.models.posenet&&((p=(d=e.config.body)==null?void 0:d.modelPath)==null?void 0:p.includes("posenet"))&&(e.models.posenet=yN(e.config)),e.config.face.enabled&&!e.models.facedetect&&(e.models.facedetect=K8(e.config)),e.config.face.enabled&&((h=e.config.face.antispoof)==null?void 0:h.enabled)&&!e.models.antispoof&&(e.models.antispoof=B8(e.config)),e.config.face.enabled&&((f=e.config.face.liveness)==null?void 0:f.enabled)&&!e.models.liveness&&(e.models.liveness=nN(e.config)),e.config.face.enabled&&((m=e.config.face.description)==null?void 0:m.enabled)&&!e.models.faceres&&(e.models.faceres=NT(e.config)),e.config.face.enabled&&((g=e.config.face.emotion)==null?void 0:g.enabled)&&!e.models.emotion&&(e.models.emotion=dT(e.config)),e.config.face.enabled&&((y=e.config.face.iris)==null?void 0:y.enabled)&&!e.models.faceiris&&(e.models.faceiris=gT(e.config)),e.config.face.enabled&&((x=e.config.face.mesh)==null?void 0:x.enabled)&&!e.models.facemesh&&(e.models.facemesh=kT(e.config)),e.config.face.enabled&&((A=e.config.face.gear)==null?void 0:A.enabled)&&!e.models.gear&&(e.models.gear=R8(e.config)),e.config.face.enabled&&((b=e.config.face.ssrnet)==null?void 0:b.enabled)&&!e.models.ssrnetage&&(e.models.ssrnetage=F8(e.config)),e.config.face.enabled&&((w=e.config.face.ssrnet)==null?void 0:w.enabled)&&!e.models.ssrnetgender&&(e.models.ssrnetgender=M8(e.config)),e.config.face.enabled&&((k=e.config.face.mobilefacenet)==null?void 0:k.enabled)&&!e.models.mobilefacenet&&(e.models.mobilefacenet=mT(e.config)),e.config.hand.enabled&&!e.models.handtrack&&((E=(I=e.config.hand.detector)==null?void 0:I.modelPath)==null?void 0:E.includes("handtrack"))&&(e.models.handtrack=JT(e.config)),e.config.hand.enabled&&e.config.hand.landmarks&&!e.models.handskeleton&&((P=(R=e.config.hand.detector)==null?void 0:R.modelPath)==null?void 0:P.includes("handtrack"))&&(e.models.handskeleton=QT(e.config)),e.config.object.enabled&&!e.models.centernet&&((_=($=e.config.object)==null?void 0:$.modelPath)==null?void 0:_.includes("centernet"))&&(e.models.centernet=oT(e.config)),e.config.object.enabled&&!e.models.nanodet&&((O=(T=e.config.object)==null?void 0:T.modelPath)==null?void 0:O.includes("nanodet"))&&(e.models.nanodet=cN(e.config)),e.config.segmentation.enabled&&!e.models.segmentation&&(e.models.segmentation=d5(e.config));for await(let V of Object.keys(e.models))e.models[V]&&typeof e.models[V]!="undefined"&&(e.models[V]=await e.models[V])}async function bN(e){let t=["const","placeholder","noop","pad","squeeze","add","sub","mul","div"];for(let n of Object.keys(e.models))if(e.models[n]){let s=[];Array.isArray(e.models[n])?s=e.models[n].filter(r=>r!==null).map(r=>r&&r.executor?r:r.model):s=[e.models[n]];for(let r of s){if(!r){e.config.debug&&J("model marked as loaded but not defined:",n);continue}let a=[],o=r==null?void 0:r.executor;if(o&&o.graph.nodes)for(let l of Object.values(o.graph.nodes)){let c=l.op.toLowerCase();a.includes(c)||a.push(c)}else!o&&e.config.debug&&J("model signature not determined:",n);let i=[];for(let l of a)!t.includes(l)&&!e.env.kernels.includes(l)&&!e.env.kernels.includes(l.replace("_",""))&&!e.env.kernels.includes(l.replace("native",""))&&!e.env.kernels.includes(l.replace("v2",""))&&i.push(l);i.length>0&&e.config.debug&&J("model validation:",n,i)}}}var Rt={name:"humangl",priority:999,canvas:null,gl:null,extensions:[],webGLattr:{alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!1,desynchronized:!0}};function Bye(){let e=Rt.gl;!e||(Rt.extensions=e.getSupportedExtensions())}async function vN(e){var t;if(e.config.backend==="humangl"&&(Rt.name in rs().registry&&(!Rt.gl||!Rt.gl.getParameter(Rt.gl.VERSION))&&(J("error: humangl backend invalid context"),h5(e)),!Q2(Rt.name))){try{Rt.canvas=await Xn(100,100)}catch(s){J("error: cannot create canvas:",s);return}try{if(Rt.gl=(t=Rt.canvas)==null?void 0:t.getContext("webgl2",Rt.webGLattr),!Rt.gl.getParameter(Rt.gl.VERSION).includes("2.0")){J("override: using fallback webgl backend as webgl 2.0 is not detected"),e.config.backend="webgl";return}Rt.canvas&&(Rt.canvas.addEventListener("webglcontextlost",async r=>{throw J("error: humangl:",r.type),J("possible browser memory leak using webgl or conflict with multiple backend registrations"),e.emit("error"),new Error("backend error: webgl context lost")}),Rt.canvas.addEventListener("webglcontextrestored",r=>{J("error: humangl context restored:",r)}),Rt.canvas.addEventListener("webglcontextcreationerror",r=>{J("error: humangl context create:",r)}))}catch(s){J("error: cannot get WebGL context:",s);return}try{Om(2,Rt.gl)}catch(s){J("error: cannot set WebGL context:",s);return}try{let s=new jm(Rt.gl);il(Rt.name,()=>new Sp(s),Rt.priority)}catch(s){J("error: cannot register WebGL backend:",s);return}try{Zr("webgl").forEach(r=>{let a={...r,backendName:Rt.name};cr(a)})}catch(s){J("error: cannot update WebGL backend registration:",s);return}let n=Rr().getGPGPUContext?Rr().getGPGPUContext().gl:null;if(n)J(`humangl webgl version:${n.getParameter(n.VERSION)} renderer:${n.getParameter(n.RENDERER)}`);else{J("error: no current gl context:",n,Rt.gl);return}try{Tr.set("WEBGL_VERSION",2)}catch(s){J("error: cannot set WebGL backend flags:",s);return}Bye(),J("backend registered:",Rt.name)}}function Wye(){if(!pe.kernels.includes("mod")){let e={kernelName:"Mod",backendName:Ds(),kernelFunc:t=>K(()=>he(t.inputs.a,L(de(t.inputs.a,t.inputs.b),t.inputs.b)))};cr(e),pe.kernels.push("mod")}if(!pe.kernels.includes("floormod")){let e={kernelName:"FloorMod",backendName:Ds(),kernelFunc:t=>K(()=>ff(t.inputs.a/t.inputs.b)*t.inputs.b+Gd(t.inputs.a,t.inputs.b))};cr(e),pe.kernels.push("floormod")}}async function M0(e,t=!1){if(e.state="backend",t||pe.initial||e.config.backend&&e.config.backend.length>0&&Ds()!==e.config.backend){let n=ie();if(e.config.backend&&e.config.backend.length>0){if(typeof window=="undefined"&&typeof WorkerGlobalScope!="undefined"&&e.config.debug&&e.config.debug&&J("running inside web worker"),pe.browser&&e.config.backend==="tensorflow"&&(e.config.debug&&J("override: backend set to tensorflow while running in browser"),e.config.backend="humangl"),pe.node&&(e.config.backend==="webgl"||e.config.backend==="humangl")&&(e.config.debug&&J(`override: backend set to ${e.config.backend} while running in nodejs`),e.config.backend="tensorflow"),pe.browser&&e.config.backend==="webgpu")if(typeof navigator=="undefined"||typeof navigator.gpu=="undefined")J("override: backend set to webgpu but browser does not support webgpu"),e.config.backend="humangl";else{let r=await navigator.gpu.requestAdapter();e.config.debug&&J("enumerated webgpu adapter:",r)}e.config.backend==="humangl"&&await vN(e);let s=Object.keys(rs().registryFactory);if(e.config.debug&&J("available backends:",s),s.includes(e.config.backend)||(J(`error: backend ${e.config.backend} not found in registry`),e.config.backend=pe.node?"tensorflow":"webgl",e.config.debug&&J(`override: setting backend ${e.config.backend}`)),e.config.debug&&J("setting backend:",e.config.backend),e.config.backend==="wasm"){if(e.config.debug&&J("wasm path:",e.config.wasmPath),typeof(Ol==null?void 0:Ol.setWasmPaths)!="undefined")await m8(e.config.wasmPath);else throw new Error("backend error: attempting to use wasm backend but wasm path is not set");let r=await Y().getAsync("WASM_HAS_SIMD_SUPPORT"),a=await Y().getAsync("WASM_HAS_MULTITHREAD_SUPPORT");e.config.debug&&J(`wasm execution: ${r?"SIMD":"no SIMD"} ${a?"multithreaded":"singlethreaded"}`),e.config.debug&&!r&&J("warning: wasm simd support is not enabled")}try{await ov(e.config.backend),await hf(),_8()}catch(r){return J("error: cannot set backend:",e.config.backend,r),!1}}if(Ds()==="humangl"&&(Tr.set("CHECK_COMPUTATION_FOR_ERRORS",!1),Tr.set("WEBGL_CPU_FORWARD",!0),Tr.set("WEBGL_USE_SHAPES_UNIFORMS",!0),Tr.set("CPU_HANDOFF_SIZE_THRESHOLD",256),typeof e.config.deallocate!="undefined"&&e.config.deallocate&&(J("changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:",!0),Tr.set("WEBGL_DELETE_TEXTURE_THRESHOLD",0)),Rr().getGPGPUContext)){let s=await Rr().getGPGPUContext().gl;e.config.debug&&J(`gl version:${s.getParameter(s.VERSION)} renderer:${s.getParameter(s.RENDERER)}`)}Ds()==="webgpu",av(),await hf(),e.performance.initBackend=Math.trunc(ie()-n),e.config.backend=Ds(),await pe.updateBackend(),Wye()}return!0}function R0(e,t){for(let n of e){let s={kernelName:n,backendName:t.backend,kernelFunc:()=>{t.debug&&J("kernelFunc",n,t.backend)}};cr(s)}pe.kernels=Zr(Ds()).map(n=>n.kernelName.toLowerCase())}var ya={color:"rgba(173, 216, 230, 0.6)",labelColor:"rgba(173, 216, 230, 1)",shadowColor:"black",font:'small-caps 16px "Segoe UI"',lineHeight:18,lineWidth:4,pointSize:2,roundRect:8,drawPoints:!1,drawLabels:!0,drawBoxes:!0,drawGestures:!0,drawPolygons:!0,drawGaze:!0,fillPolygons:!1,useDepth:!0,useCurves:!1},f5=0,jl=e=>{if(!e)J("draw error: invalid canvas");else if(!e.getContext)J("draw error: canvas context not defined");else{let t=e.getContext("2d");if(!t)J("draw error: cannot get canvas context");else return t}return null},zc=e=>Math.round(e*180/Math.PI);function m5(e,t,n,s,r){s=s||0,e.fillStyle=r.useDepth&&s?`rgba(${127.5+2*s}, ${127.5-2*s}, 255, 0.3)`:r.color,e.beginPath(),e.arc(t,n,r.pointSize,0,2*Math.PI),e.fill()}function qp(e,t,n,s,r,a){if(e.beginPath(),a.useCurves){let o=(t+t+s)/2,i=(n+n+r)/2;e.ellipse(o,i,s/2,r/2,0,0,2*Math.PI)}else e.lineWidth=a.lineWidth,e.moveTo(t+a.roundRect,n),e.lineTo(t+s-a.roundRect,n),e.quadraticCurveTo(t+s,n,t+s,n+a.roundRect),e.lineTo(t+s,n+r-a.roundRect),e.quadraticCurveTo(t+s,n+r,t+s-a.roundRect,n+r),e.lineTo(t+a.roundRect,n+r),e.quadraticCurveTo(t,n+r,t,n+r-a.roundRect),e.lineTo(t,n+a.roundRect),e.quadraticCurveTo(t,n,t+a.roundRect,n),e.closePath();e.stroke()}function wN(e,t,n){if(!(t.length<2)){e.beginPath(),e.moveTo(t[0][0],t[0][1]);for(let s of t){let r=s[2]||0;e.strokeStyle=n.useDepth&&r!==0?`rgba(${127.5+2*r}, ${127.5-2*r}, 255, 0.3)`:n.color,e.fillStyle=n.useDepth&&r!==0?`rgba(${127.5+2*r}, ${127.5-2*r}, 255, 0.3)`:n.color,e.lineTo(s[0],Math.round(s[1]))}e.stroke(),n.fillPolygons&&(e.closePath(),e.fill())}}function Vye(e,t,n){if(!(t.length<2)){if(!n.useCurves||t.length<=2){wN(e,t,n);return}e.moveTo(t[0][0],t[0][1]);for(let s=0;s1&&l[1].length>0){let c=i[1]>0?`#${i[1]}`:"",u=`${i[0]} ${c}: ${l[1]}`;s.shadowColor&&s.shadowColor!==""&&(r.fillStyle=s.shadowColor,r.fillText(u,8,2+a*s.lineHeight)),r.fillStyle=s.labelColor,r.fillText(u,6,0+a*s.lineHeight),a+=1}}}}async function y5(e,t,n){var a,o,i,l,c;let s=En(ya,n);if(!t||!e)return;let r=jl(e);if(!!r)for(let u of t){if(r.font=s.font,r.strokeStyle=s.color,r.fillStyle=s.color,s.drawBoxes&&qp(r,u.box[0],u.box[1],u.box[2],u.box[3],s),s.drawLabels){let d=[];if(d.push(`face: ${Math.trunc(100*u.score)}%`),u.genderScore&&d.push(`${u.gender||""} ${Math.trunc(100*u.genderScore)}%`),u.age&&d.push(`age: ${u.age||""}`),u.iris&&d.push(`distance: ${u.iris}`),u.real&&d.push(`real: ${Math.trunc(100*u.real)}%`),u.live&&d.push(`live: ${Math.trunc(100*u.live)}%`),u.emotion&&u.emotion.length>0){let p=u.emotion.map(h=>`${Math.trunc(100*h.score)}% ${h.emotion}`);p.length>3&&(p.length=3),d.push(p.join(" "))}u.rotation&&u.rotation.angle&&u.rotation.gaze&&(u.rotation.angle.roll&&d.push(`roll: ${zc(u.rotation.angle.roll)}\xB0 yaw:${zc(u.rotation.angle.yaw)}\xB0 pitch:${zc(u.rotation.angle.pitch)}\xB0`),u.rotation.gaze.bearing&&d.push(`gaze: ${zc(u.rotation.gaze.bearing)}\xB0`)),d.length===0&&d.push("face"),r.fillStyle=s.color;for(let p=d.length-1;p>=0;p--){let h=Math.max(u.box[0],0),f=p*s.lineHeight+u.box[1];s.shadowColor&&s.shadowColor!==""&&(r.fillStyle=s.shadowColor,r.fillText(d[p],h+5,f+16)),r.fillStyle=s.labelColor,r.fillText(d[p],h+4,f+15)}}if(r.lineWidth=1,u.mesh&&u.mesh.length>0){if(s.drawPoints)for(let d of u.mesh)m5(r,d[0],d[1],d[2],s);if(s.drawPolygons){if(r.lineWidth=1,u.mesh.length>450)for(let d=0;du.mesh[h]);wN(r,p,s)}if(u.annotations&&u.annotations.leftEyeIris&&u.annotations.leftEyeIris[0]){r.strokeStyle=s.useDepth?"rgba(255, 200, 255, 0.3)":s.color,r.beginPath();let d=Math.abs(u.annotations.leftEyeIris[3][0]-u.annotations.leftEyeIris[1][0])/2,p=Math.abs(u.annotations.leftEyeIris[4][1]-u.annotations.leftEyeIris[2][1])/2;r.ellipse(u.annotations.leftEyeIris[0][0],u.annotations.leftEyeIris[0][1],d,p,0,0,2*Math.PI),r.stroke(),s.fillPolygons&&(r.fillStyle=s.useDepth?"rgba(255, 255, 200, 0.3)":s.color,r.fill())}if(u.annotations&&u.annotations.rightEyeIris&&u.annotations.rightEyeIris[0]){r.strokeStyle=s.useDepth?"rgba(255, 200, 255, 0.3)":s.color,r.beginPath();let d=Math.abs(u.annotations.rightEyeIris[3][0]-u.annotations.rightEyeIris[1][0])/2,p=Math.abs(u.annotations.rightEyeIris[4][1]-u.annotations.rightEyeIris[2][1])/2;r.ellipse(u.annotations.rightEyeIris[0][0],u.annotations.rightEyeIris[0][1],d,p,0,0,2*Math.PI),r.stroke(),s.fillPolygons&&(r.fillStyle=s.useDepth?"rgba(255, 255, 200, 0.3)":s.color,r.fill())}if(s.drawGaze&&((a=u.rotation)==null?void 0:a.angle)&&typeof Path2D!="undefined"){r.strokeStyle="pink";let d=u.box[0]+u.box[2]/2-u.box[3]*zc(u.rotation.angle.yaw)/90,p=u.box[1]+u.box[3]/2+u.box[2]*zc(u.rotation.angle.pitch)/90,h=new Path2D(` M ${u.box[0]+u.box[2]/2} ${u.box[1]} C ${d} ${u.box[1]}, diff --git a/dist/human.node-gpu.js b/dist/human.node-gpu.js index 30a27add..4cfece09 100644 --- a/dist/human.node-gpu.js +++ b/dist/human.node-gpu.js @@ -1371,7 +1371,7 @@ var env = new Env(); var tf36 = __toModule(require_tfjs_esm()); // package.json -var version2 = "2.5.5"; +var version2 = "2.5.6"; // src/tfjs/humangl.ts var tf31 = __toModule(require_tfjs_esm()); diff --git a/dist/human.node-wasm.js b/dist/human.node-wasm.js index 184822c6..9df2d7b2 100644 --- a/dist/human.node-wasm.js +++ b/dist/human.node-wasm.js @@ -1372,7 +1372,7 @@ var env = new Env(); var tf36 = __toModule(require_tfjs_esm()); // package.json -var version2 = "2.5.5"; +var version2 = "2.5.6"; // src/tfjs/humangl.ts var tf31 = __toModule(require_tfjs_esm()); diff --git a/dist/human.node.js b/dist/human.node.js index c891c9c3..1333e41e 100644 --- a/dist/human.node.js +++ b/dist/human.node.js @@ -1371,7 +1371,7 @@ var env = new Env(); var tf36 = __toModule(require_tfjs_esm()); // package.json -var version2 = "2.5.5"; +var version2 = "2.5.6"; // src/tfjs/humangl.ts var tf31 = __toModule(require_tfjs_esm()); diff --git a/test/build.log b/test/build.log index 3e1dee1d..0f39ecfb 100644 --- a/test/build.log +++ b/test/build.log @@ -1,24 +1,24 @@ -2021-12-15 09:25:05 INFO:  Application: {"name":"@vladmandic/human","version":"2.5.5"} -2021-12-15 09:25:05 INFO:  Environment: {"profile":"production","config":".build.json","package":"package.json","tsconfig":true,"eslintrc":true,"git":true} -2021-12-15 09:25:05 INFO:  Toolchain: {"build":"0.6.6","esbuild":"0.13.15","typescript":"4.5.4","typedoc":"0.22.10","eslint":"8.4.1"} -2021-12-15 09:25:05 INFO:  Build: {"profile":"production","steps":["clean","compile","typings","typedoc","lint","changelog"]} -2021-12-15 09:25:05 STATE: Clean: {"locations":["dist/*","types/lib/*","typedoc/*"]} -2021-12-15 09:25:05 STATE: Compile: {"name":"tfjs/nodejs/cpu","format":"cjs","platform":"node","input":"tfjs/tf-node.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":102,"outputBytes":1275} -2021-12-15 09:25:06 STATE: Compile: {"name":"human/nodejs/cpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node.js","files":63,"inputBytes":561428,"outputBytes":464499} -2021-12-15 09:25:06 STATE: Compile: {"name":"tfjs/nodejs/gpu","format":"cjs","platform":"node","input":"tfjs/tf-node-gpu.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":110,"outputBytes":1283} -2021-12-15 09:25:06 STATE: Compile: {"name":"human/nodejs/gpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-gpu.js","files":63,"inputBytes":561436,"outputBytes":464503} -2021-12-15 09:25:06 STATE: Compile: {"name":"tfjs/nodejs/wasm","format":"cjs","platform":"node","input":"tfjs/tf-node-wasm.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":149,"outputBytes":1350} -2021-12-15 09:25:06 STATE: Compile: {"name":"human/nodejs/wasm","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-wasm.js","files":63,"inputBytes":561503,"outputBytes":464575} -2021-12-15 09:25:06 STATE: Compile: {"name":"tfjs/browser/version","format":"esm","platform":"browser","input":"tfjs/tf-version.ts","output":"dist/tfjs.version.js","files":1,"inputBytes":1063,"outputBytes":1652} -2021-12-15 09:25:06 STATE: Compile: {"name":"tfjs/browser/esm/nobundle","format":"esm","platform":"browser","input":"tfjs/tf-browser.ts","output":"dist/tfjs.esm.js","files":2,"inputBytes":2326,"outputBytes":912} -2021-12-15 09:25:06 STATE: Compile: {"name":"human/browser/esm/nobundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm-nobundle.js","files":63,"inputBytes":561065,"outputBytes":466261} -2021-12-15 09:25:06 STATE: Compile: {"name":"tfjs/browser/esm/custom","format":"esm","platform":"browser","input":"tfjs/tf-custom.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":110,"outputBytes":2515619} -2021-12-15 09:25:06 STATE: Compile: {"name":"human/browser/iife/bundle","format":"iife","platform":"browser","input":"src/human.ts","output":"dist/human.js","files":63,"inputBytes":3075772,"outputBytes":1631838} -2021-12-15 09:25:06 STATE: Compile: {"name":"human/browser/esm/bundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm.js","files":63,"inputBytes":3075772,"outputBytes":2988731} -2021-12-15 09:25:18 STATE: Typings: {"input":"src/human.ts","output":"types/lib","files":110} -2021-12-15 09:25:22 STATE: TypeDoc: {"input":"src/human.ts","output":"typedoc","objects":69,"generated":true} -2021-12-15 09:25:22 STATE: Compile: {"name":"demo/typescript","format":"esm","platform":"browser","input":"demo/typescript/index.ts","output":"demo/typescript/index.js","files":1,"inputBytes":5864,"outputBytes":4127} -2021-12-15 09:25:22 STATE: Compile: {"name":"demo/faceid","format":"esm","platform":"browser","input":"demo/faceid/index.ts","output":"demo/faceid/index.js","files":2,"inputBytes":15174,"outputBytes":11794} -2021-12-15 09:25:46 STATE: Lint: {"locations":["*.json","src/**/*.ts","test/**/*.js","demo/**/*.js"],"files":93,"errors":0,"warnings":0} -2021-12-15 09:25:46 STATE: ChangeLog: {"repository":"https://github.com/vladmandic/human","branch":"main","output":"CHANGELOG.md"} -2021-12-15 09:25:46 INFO:  Done... +2021-12-15 09:26:43 INFO:  Application: {"name":"@vladmandic/human","version":"2.5.6"} +2021-12-15 09:26:43 INFO:  Environment: {"profile":"production","config":".build.json","package":"package.json","tsconfig":true,"eslintrc":true,"git":true} +2021-12-15 09:26:43 INFO:  Toolchain: {"build":"0.6.6","esbuild":"0.13.15","typescript":"4.5.4","typedoc":"0.22.10","eslint":"8.4.1"} +2021-12-15 09:26:43 INFO:  Build: {"profile":"production","steps":["clean","compile","typings","typedoc","lint","changelog"]} +2021-12-15 09:26:43 STATE: Clean: {"locations":["dist/*","types/lib/*","typedoc/*"]} +2021-12-15 09:26:43 STATE: Compile: {"name":"tfjs/nodejs/cpu","format":"cjs","platform":"node","input":"tfjs/tf-node.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":102,"outputBytes":1275} +2021-12-15 09:26:44 STATE: Compile: {"name":"human/nodejs/cpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node.js","files":63,"inputBytes":561428,"outputBytes":464499} +2021-12-15 09:26:44 STATE: Compile: {"name":"tfjs/nodejs/gpu","format":"cjs","platform":"node","input":"tfjs/tf-node-gpu.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":110,"outputBytes":1283} +2021-12-15 09:26:44 STATE: Compile: {"name":"human/nodejs/gpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-gpu.js","files":63,"inputBytes":561436,"outputBytes":464503} +2021-12-15 09:26:44 STATE: Compile: {"name":"tfjs/nodejs/wasm","format":"cjs","platform":"node","input":"tfjs/tf-node-wasm.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":149,"outputBytes":1350} +2021-12-15 09:26:44 STATE: Compile: {"name":"human/nodejs/wasm","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-wasm.js","files":63,"inputBytes":561503,"outputBytes":464575} +2021-12-15 09:26:44 STATE: Compile: {"name":"tfjs/browser/version","format":"esm","platform":"browser","input":"tfjs/tf-version.ts","output":"dist/tfjs.version.js","files":1,"inputBytes":1063,"outputBytes":1652} +2021-12-15 09:26:44 STATE: Compile: {"name":"tfjs/browser/esm/nobundle","format":"esm","platform":"browser","input":"tfjs/tf-browser.ts","output":"dist/tfjs.esm.js","files":2,"inputBytes":2326,"outputBytes":912} +2021-12-15 09:26:44 STATE: Compile: {"name":"human/browser/esm/nobundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm-nobundle.js","files":63,"inputBytes":561065,"outputBytes":466261} +2021-12-15 09:26:44 STATE: Compile: {"name":"tfjs/browser/esm/custom","format":"esm","platform":"browser","input":"tfjs/tf-custom.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":110,"outputBytes":2515619} +2021-12-15 09:26:44 STATE: Compile: {"name":"human/browser/iife/bundle","format":"iife","platform":"browser","input":"src/human.ts","output":"dist/human.js","files":63,"inputBytes":3075772,"outputBytes":1631838} +2021-12-15 09:26:44 STATE: Compile: {"name":"human/browser/esm/bundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm.js","files":63,"inputBytes":3075772,"outputBytes":2988731} +2021-12-15 09:26:55 STATE: Typings: {"input":"src/human.ts","output":"types/lib","files":110} +2021-12-15 09:26:59 STATE: TypeDoc: {"input":"src/human.ts","output":"typedoc","objects":69,"generated":true} +2021-12-15 09:26:59 STATE: Compile: {"name":"demo/typescript","format":"esm","platform":"browser","input":"demo/typescript/index.ts","output":"demo/typescript/index.js","files":1,"inputBytes":5864,"outputBytes":4127} +2021-12-15 09:26:59 STATE: Compile: {"name":"demo/faceid","format":"esm","platform":"browser","input":"demo/faceid/index.ts","output":"demo/faceid/index.js","files":2,"inputBytes":15174,"outputBytes":11794} +2021-12-15 09:27:20 STATE: Lint: {"locations":["*.json","src/**/*.ts","test/**/*.js","demo/**/*.js"],"files":93,"errors":0,"warnings":0} +2021-12-15 09:27:20 STATE: ChangeLog: {"repository":"https://github.com/vladmandic/human","branch":"main","output":"CHANGELOG.md"} +2021-12-15 09:27:20 INFO:  Done... diff --git a/test/test.log b/test/test.log index ad6df429..6a7bbbae 100644 --- a/test/test.log +++ b/test/test.log @@ -1,684 +1,684 @@ -2021-12-14 15:42:16 INFO:  @vladmandic/human version 2.5.5 -2021-12-14 15:42:16 INFO:  User: vlado Platform: linux Arch: x64 Node: v17.2.0 -2021-12-14 15:42:16 INFO:  tests: ["test-node.js","test-node-gpu.js","test-node-wasm.js"] -2021-12-14 15:42:16 INFO:  demos: ["../demo/nodejs/node.js","../demo/nodejs/node-canvas.js","../demo/nodejs/node-env.js","../demo/nodejs/node-event.js","../demo/nodejs/node-multiprocess.js"] -2021-12-14 15:42:16 INFO:  -2021-12-14 15:42:16 INFO:  test-node.js start -2021-12-14 15:42:17 INFO:  test-node.js test: configuration validation -2021-12-14 15:42:17 STATE: test-node.js passed: configuration default validation [] -2021-12-14 15:42:17 STATE: test-node.js passed: configuration invalid validation [{"reason":"unknown property","where":"config.invalid = true"}] -2021-12-14 15:42:17 INFO:  test-node.js test: model load -2021-12-14 15:42:18 STATE: test-node.js passed: models loaded 22 12 [{"name":"ssrnetage","loaded":false},{"name":"gear","loaded":false},{"name":"blazeposedetect","loaded":false},{"name":"blazepose","loaded":false},{"name":"centernet","loaded":true},{"name":"efficientpose","loaded":false},{"name":"mobilefacenet","loaded":false},{"name":"emotion","loaded":true},{"name":"facedetect","loaded":true},{"name":"faceiris","loaded":true},{"name":"facemesh","loaded":true},{"name":"faceres","loaded":true},{"name":"ssrnetgender","loaded":false},{"name":"handpose","loaded":false},{"name":"handskeleton","loaded":true},{"name":"handtrack","loaded":true},{"name":"liveness","loaded":true},{"name":"movenet","loaded":true},{"name":"nanodet","loaded":false},{"name":"posenet","loaded":false},{"name":"segmentation","loaded":true},{"name":"antispoof","loaded":true}] -2021-12-14 15:42:18 INFO:  test-node.js test: warmup -2021-12-14 15:42:18 STATE: test-node.js passed: create human -2021-12-14 15:42:18 INFO:  test-node.js human version: 2.5.5 -2021-12-14 15:42:18 INFO:  test-node.js platform: linux x64 agent: NodeJS v17.2.0 -2021-12-14 15:42:18 INFO:  test-node.js tfjs version: 3.12.0 -2021-12-14 15:42:18 INFO:  test-node.js tensorflow binding version: 2.7.0-dev20211101 -2021-12-14 15:42:18 STATE: test-node.js passed: set backend: tensorflow -2021-12-14 15:42:18 STATE: test-node.js tensors 1919 -2021-12-14 15:42:18 STATE: test-node.js passed: load models -2021-12-14 15:42:18 STATE: test-node.js result: defined models: 22 loaded models: 12 -2021-12-14 15:42:18 STATE: test-node.js passed: warmup: none default -2021-12-14 15:42:18 DATA:  test-node.js result: face: 0 body: 0 hand: 0 gesture: 0 object: 0 person: 0 {} {} {} -2021-12-14 15:42:18 DATA:  test-node.js result: performance: load: null total: null -2021-12-14 15:42:18 STATE: test-node.js passed: warmup none result match -2021-12-14 15:42:18 STATE: test-node.js event: image -2021-12-14 15:42:19 STATE: test-node.js event: detect -2021-12-14 15:42:19 STATE: test-node.js event: warmup -2021-12-14 15:42:19 STATE: test-node.js passed: warmup: face default -2021-12-14 15:42:19 DATA:  test-node.js result: face: 1 body: 1 hand: 1 gesture: 10 object: 1 person: 1 {"score":1,"age":30.6,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.42,"keypoints":4} -2021-12-14 15:42:19 DATA:  test-node.js result: performance: load: null total: 960 -2021-12-14 15:42:19 STATE: test-node.js passed: warmup face result match -2021-12-14 15:42:19 STATE: test-node.js event: image -2021-12-14 15:42:19 STATE: test-node.js event: detect -2021-12-14 15:42:19 STATE: test-node.js event: warmup -2021-12-14 15:42:19 STATE: test-node.js passed: warmup: body default -2021-12-14 15:42:19 DATA:  test-node.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:42:19 DATA:  test-node.js result: performance: load: null total: 729 -2021-12-14 15:42:19 STATE: test-node.js passed: warmup body result match -2021-12-14 15:42:19 STATE: test-node.js details: {"face":{"boxScore":0.92,"faceScore":1,"age":23.6,"gender":"female","genderScore":0.95},"emotion":[{"score":0.55,"emotion":"neutral"},{"score":0.26,"emotion":"fear"},{"score":0.12,"emotion":"sad"}],"body":{"score":0.92,"keypoints":17},"hand":{"boxScore":0.52,"fingerScore":0.73,"keypoints":21},"gestures":[{"face":0,"gesture":"facing right"},{"hand":0,"gesture":"palm forward"},{"hand":0,"gesture":"palm up"},{"hand":0,"gesture":"open palm"},{"iris":0,"gesture":"looking right"},{"iris":0,"gesture":"looking up"}]} -2021-12-14 15:42:19 INFO:  test-node.js test: details verification -2021-12-14 15:42:20 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2021-12-14 15:42:20 STATE: test-node.js event: image -2021-12-14 15:42:21 STATE: test-node.js event: detect -2021-12-14 15:42:21 STATE: test-node.js passed: detect: samples/in/ai-body.jpg default -2021-12-14 15:42:21 DATA:  test-node.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:42:21 DATA:  test-node.js result: performance: load: null total: 750 -2021-12-14 15:42:21 STATE: test-node.js passed: details face length 1 -2021-12-14 15:42:21 STATE: test-node.js passed: details face score 1 0.93 1 -2021-12-14 15:42:21 STATE: test-node.js passed: details face age/gender 23.6 female 0.95 73.26 -2021-12-14 15:42:21 STATE: test-node.js passed: details face arrays 4 478 1024 -2021-12-14 15:42:21 STATE: test-node.js passed: details face emotion 3 {"score":0.58,"emotion":"neutral"} -2021-12-14 15:42:21 STATE: test-node.js passed: details face anti-spoofing 0.87 -2021-12-14 15:42:21 STATE: test-node.js passed: details face liveness 0.95 -2021-12-14 15:42:21 STATE: test-node.js passed: details body length 1 -2021-12-14 15:42:21 STATE: test-node.js passed: details body 0.92 17 6 -2021-12-14 15:42:21 STATE: test-node.js passed: details hand length 1 -2021-12-14 15:42:21 STATE: test-node.js passed: details hand 0.51 0.73 point -2021-12-14 15:42:21 STATE: test-node.js passed: details hand arrays 21 5 6 -2021-12-14 15:42:21 STATE: test-node.js passed: details gesture length 6 -2021-12-14 15:42:21 STATE: test-node.js passed: details gesture first {"face":0,"gesture":"facing right"} -2021-12-14 15:42:21 STATE: test-node.js passed: details object length 1 -2021-12-14 15:42:21 STATE: test-node.js passed: details object 0.72 person -2021-12-14 15:42:21 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,4] {"checksum":1371996800} -2021-12-14 15:42:21 STATE: test-node.js event: image -2021-12-14 15:42:22 STATE: test-node.js event: detect -2021-12-14 15:42:22 STATE: test-node.js passed: tensor shape: [1,1200,1200,4] dtype: float32 -2021-12-14 15:42:22 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1200,1200,4] {"checksum":1371996800} -2021-12-14 15:42:22 STATE: test-node.js event: image -2021-12-14 15:42:23 STATE: test-node.js event: detect -2021-12-14 15:42:23 STATE: test-node.js passed: tensor shape: [1200,1200,4] dtype: float32 -2021-12-14 15:42:23 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2021-12-14 15:42:23 STATE: test-node.js event: image -2021-12-14 15:42:24 STATE: test-node.js event: detect -2021-12-14 15:42:24 STATE: test-node.js passed: tensor shape: [1,1200,1200,3] dtype: float32 -2021-12-14 15:42:24 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1200,1200,3] {"checksum":1004796864} -2021-12-14 15:42:24 STATE: test-node.js event: image -2021-12-14 15:42:25 STATE: test-node.js event: detect -2021-12-14 15:42:25 STATE: test-node.js passed: tensor shape: [1200,1200,3] dtype: float32 -2021-12-14 15:42:25 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,4] {"checksum":1371996871} -2021-12-14 15:42:25 STATE: test-node.js event: image -2021-12-14 15:42:26 STATE: test-node.js event: detect -2021-12-14 15:42:26 STATE: test-node.js passed: tensor shape: [1,1200,1200,4] dtype: int32 -2021-12-14 15:42:26 INFO:  test-node.js test default -2021-12-14 15:42:26 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2021-12-14 15:42:26 STATE: test-node.js event: image -2021-12-14 15:42:27 STATE: test-node.js event: detect -2021-12-14 15:42:27 STATE: test-node.js passed: detect: samples/in/ai-body.jpg default -2021-12-14 15:42:27 DATA:  test-node.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:42:27 DATA:  test-node.js result: performance: load: null total: 622 -2021-12-14 15:42:27 STATE: test-node.js passed: default result face match 1 female 0.95 -2021-12-14 15:42:27 INFO:  test-node.js test sync -2021-12-14 15:42:28 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2021-12-14 15:42:28 STATE: test-node.js event: image -2021-12-14 15:42:28 STATE: test-node.js event: detect -2021-12-14 15:42:28 STATE: test-node.js passed: detect: samples/in/ai-body.jpg default -2021-12-14 15:42:28 DATA:  test-node.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:42:28 DATA:  test-node.js result: performance: load: null total: 626 -2021-12-14 15:42:28 STATE: test-node.js passed: default sync 1 female 0.95 -2021-12-14 15:42:28 INFO:  test-node.js test: image process -2021-12-14 15:42:28 STATE: test-node.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} -2021-12-14 15:42:28 STATE: test-node.js passed: image input null [1,256,256,3] -2021-12-14 15:42:28 INFO:  test-node.js test: image null -2021-12-14 15:42:28 STATE: test-node.js passed: invalid input could not convert input to tensor -2021-12-14 15:42:28 INFO:  test-node.js test face similarity -2021-12-14 15:42:28 STATE: test-node.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} -2021-12-14 15:42:28 STATE: test-node.js event: image -2021-12-14 15:42:29 STATE: test-node.js event: detect -2021-12-14 15:42:29 STATE: test-node.js passed: detect: samples/in/ai-face.jpg default -2021-12-14 15:42:29 DATA:  test-node.js result: face: 1 body: 1 hand: 1 gesture: 8 object: 1 person: 1 {"score":1,"age":30.6,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":3} -2021-12-14 15:42:29 DATA:  test-node.js result: performance: load: null total: 587 -2021-12-14 15:42:29 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2021-12-14 15:42:29 STATE: test-node.js event: image -2021-12-14 15:42:30 STATE: test-node.js event: detect -2021-12-14 15:42:30 STATE: test-node.js passed: detect: samples/in/ai-body.jpg default -2021-12-14 15:42:30 DATA:  test-node.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:42:30 DATA:  test-node.js result: performance: load: null total: 578 -2021-12-14 15:42:30 STATE: test-node.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289056} -2021-12-14 15:42:30 STATE: test-node.js event: image -2021-12-14 15:42:31 STATE: test-node.js event: detect -2021-12-14 15:42:31 STATE: test-node.js passed: detect: samples/in/ai-upper.jpg default -2021-12-14 15:42:31 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":7} -2021-12-14 15:42:31 DATA:  test-node.js result: performance: load: null total: 536 -2021-12-14 15:42:31 STATE: test-node.js passed: face descriptor -2021-12-14 15:42:31 STATE: test-node.js passed: face similarity {"similarity":[1,0.5204253812157617,0.5018512391128399],"descriptors":[1024,1024,1024]} -2021-12-14 15:42:31 INFO:  test-node.js test face matching -2021-12-14 15:42:31 STATE: test-node.js passed: face database 57 -2021-12-14 15:42:31 STATE: test-node.js passed: face match {"first":{"index":4,"similarity":0.9339157281721077}} {"second":{"index":4,"similarity":0.5272109558655983}} {"third":{"index":4,"similarity":0.47187667831692687}} -2021-12-14 15:42:31 INFO:  test-node.js test object -2021-12-14 15:42:31 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2021-12-14 15:42:31 STATE: test-node.js event: image -2021-12-14 15:42:32 STATE: test-node.js event: detect -2021-12-14 15:42:32 STATE: test-node.js passed: detect: samples/in/ai-body.jpg default -2021-12-14 15:42:32 DATA:  test-node.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:42:32 DATA:  test-node.js result: performance: load: null total: 618 -2021-12-14 15:42:32 STATE: test-node.js passed: object result match -2021-12-14 15:42:32 INFO:  test-node.js test sensitive -2021-12-14 15:42:32 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2021-12-14 15:42:32 STATE: test-node.js event: image -2021-12-14 15:42:33 STATE: test-node.js event: detect -2021-12-14 15:42:33 STATE: test-node.js passed: detect: samples/in/ai-body.jpg default -2021-12-14 15:42:33 DATA:  test-node.js result: face: 1 body: 1 hand: 2 gesture: 8 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:42:33 DATA:  test-node.js result: performance: load: null total: 652 -2021-12-14 15:42:33 STATE: test-node.js passed: sensitive result match -2021-12-14 15:42:33 STATE: test-node.js passed: sensitive face result match -2021-12-14 15:42:33 STATE: test-node.js passed: sensitive face emotion result [{"score":0.58,"emotion":"neutral"},{"score":0.24,"emotion":"fear"},{"score":0.11,"emotion":"sad"}] -2021-12-14 15:42:33 STATE: test-node.js passed: sensitive body result match -2021-12-14 15:42:33 STATE: test-node.js passed: sensitive hand result match -2021-12-14 15:42:33 INFO:  test-node.js test detectors -2021-12-14 15:42:33 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2021-12-14 15:42:33 STATE: test-node.js event: image -2021-12-14 15:42:34 STATE: test-node.js event: detect -2021-12-14 15:42:34 STATE: test-node.js passed: detect: samples/in/ai-body.jpg default -2021-12-14 15:42:34 DATA:  test-node.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 1 person: 1 {"score":0.93} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:42:34 DATA:  test-node.js result: performance: load: null total: 440 -2021-12-14 15:42:34 STATE: test-node.js passed: detector result face match -2021-12-14 15:42:34 STATE: test-node.js passed: detector result hand match -2021-12-14 15:42:34 INFO:  test-node.js test: multi-instance -2021-12-14 15:42:34 STATE: test-node.js event: image -2021-12-14 15:42:35 STATE: test-node.js event: detect -2021-12-14 15:42:35 STATE: test-node.js passed: detect: random default -2021-12-14 15:42:35 DATA:  test-node.js result: face: 0 body: 1 hand: 0 gesture: 0 object: 0 person: 0 {} {} {"score":0.06,"keypoints":15} -2021-12-14 15:42:35 DATA:  test-node.js result: performance: load: null total: 482 -2021-12-14 15:42:35 INFO:  test-node.js test: first instance -2021-12-14 15:42:35 STATE: test-node.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289056} -2021-12-14 15:42:35 STATE: test-node.js passed: detect: samples/in/ai-upper.jpg default -2021-12-14 15:42:35 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 1 person: 1 {"score":0.96} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":16} -2021-12-14 15:42:35 DATA:  test-node.js result: performance: load: null total: 481 -2021-12-14 15:42:35 INFO:  test-node.js test: second instance -2021-12-14 15:42:35 STATE: test-node.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289056} -2021-12-14 15:42:36 STATE: test-node.js passed: detect: samples/in/ai-upper.jpg default -2021-12-14 15:42:36 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 1 person: 1 {"score":0.96} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":16} -2021-12-14 15:42:36 DATA:  test-node.js result: performance: load: null total: 406 -2021-12-14 15:42:36 INFO:  test-node.js test: concurrent -2021-12-14 15:42:36 STATE: test-node.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} -2021-12-14 15:42:36 STATE: test-node.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} -2021-12-14 15:42:36 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2021-12-14 15:42:37 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2021-12-14 15:42:37 STATE: test-node.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289056} -2021-12-14 15:42:37 STATE: test-node.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289056} -2021-12-14 15:42:37 STATE: test-node.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} -2021-12-14 15:42:38 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2021-12-14 15:42:38 STATE: test-node.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289056} -2021-12-14 15:42:38 STATE: test-node.js event: image -2021-12-14 15:42:38 STATE: test-node.js event: image -2021-12-14 15:42:38 STATE: test-node.js event: image -2021-12-14 15:42:42 STATE: test-node.js passed: detect: samples/in/ai-upper.jpg default -2021-12-14 15:42:42 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 1 person: 1 {"score":0.96} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":16} -2021-12-14 15:42:42 DATA:  test-node.js result: performance: load: null total: 4476 -2021-12-14 15:42:42 STATE: test-node.js passed: detect: samples/in/ai-upper.jpg default -2021-12-14 15:42:42 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 1 person: 1 {"score":0.96} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":16} -2021-12-14 15:42:42 DATA:  test-node.js result: performance: load: null total: 4476 -2021-12-14 15:42:42 STATE: test-node.js passed: detect: samples/in/ai-face.jpg default -2021-12-14 15:42:42 DATA:  test-node.js result: face: 1 body: 1 hand: 1 gesture: 2 object: 1 person: 1 {"score":0.91} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":17} -2021-12-14 15:42:42 DATA:  test-node.js result: performance: load: null total: 4846 -2021-12-14 15:42:42 STATE: test-node.js passed: detect: samples/in/ai-face.jpg default -2021-12-14 15:42:42 DATA:  test-node.js result: face: 1 body: 1 hand: 1 gesture: 2 object: 1 person: 1 {"score":0.91} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":17} -2021-12-14 15:42:42 DATA:  test-node.js result: performance: load: null total: 4846 -2021-12-14 15:42:42 STATE: test-node.js passed: detect: samples/in/ai-body.jpg default -2021-12-14 15:42:42 DATA:  test-node.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 1 person: 1 {"score":0.93} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:42:42 DATA:  test-node.js result: performance: load: null total: 4846 -2021-12-14 15:42:42 STATE: test-node.js passed: detect: samples/in/ai-body.jpg default -2021-12-14 15:42:42 DATA:  test-node.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 1 person: 1 {"score":0.93} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:42:42 DATA:  test-node.js result: performance: load: null total: 4846 -2021-12-14 15:42:42 STATE: test-node.js event: detect -2021-12-14 15:42:42 STATE: test-node.js passed: detect: samples/in/ai-upper.jpg default -2021-12-14 15:42:42 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 1 person: 1 {"score":0.96} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":16} -2021-12-14 15:42:42 DATA:  test-node.js result: performance: load: null total: 4160 -2021-12-14 15:42:42 STATE: test-node.js event: detect -2021-12-14 15:42:42 STATE: test-node.js event: detect -2021-12-14 15:42:42 STATE: test-node.js passed: detect: samples/in/ai-face.jpg default -2021-12-14 15:42:42 DATA:  test-node.js result: face: 1 body: 1 hand: 1 gesture: 2 object: 1 person: 1 {"score":0.91} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":17} -2021-12-14 15:42:42 DATA:  test-node.js result: performance: load: null total: 4161 -2021-12-14 15:42:42 STATE: test-node.js passed: detect: samples/in/ai-body.jpg default -2021-12-14 15:42:42 DATA:  test-node.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 1 person: 1 {"score":0.93} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:42:42 DATA:  test-node.js result: performance: load: null total: 4161 -2021-12-14 15:42:42 INFO:  test-node.js test: monkey-patch -2021-12-14 15:42:42 STATE: test-node.js event: image -2021-12-14 15:42:43 STATE: test-node.js event: detect -2021-12-14 15:42:43 STATE: test-node.js passed: monkey patch -2021-12-14 15:42:43 STATE: test-node.js passed: segmentation [65536] -2021-12-14 15:42:43 STATE: test-node.js passeed: equal usage -2021-12-14 15:42:43 INFO:  test-node.js test: input compare -2021-12-14 15:42:43 STATE: test-node.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} -2021-12-14 15:42:44 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2021-12-14 15:42:44 STATE: test-node.js passed: image compare 0 23.275441687091504 -2021-12-14 15:42:44 INFO:  test-node.js events: {"image":21,"detect":21,"warmup":2} -2021-12-14 15:42:44 INFO:  test-node.js tensors 1925 -2021-12-14 15:42:44 INFO:  test-node.js test complete: 26535 ms -2021-12-14 15:42:44 INFO:  -2021-12-14 15:42:44 INFO:  test-node-gpu.js start -2021-12-14 15:42:45 INFO:  test-node-gpu.js test: configuration validation -2021-12-14 15:42:45 STATE: test-node-gpu.js passed: configuration default validation [] -2021-12-14 15:42:45 STATE: test-node-gpu.js passed: configuration invalid validation [{"reason":"unknown property","where":"config.invalid = true"}] -2021-12-14 15:42:45 INFO:  test-node-gpu.js test: model load -2021-12-14 15:42:46 STATE: test-node-gpu.js passed: models loaded 22 12 [{"name":"ssrnetage","loaded":false},{"name":"gear","loaded":false},{"name":"blazeposedetect","loaded":false},{"name":"blazepose","loaded":false},{"name":"centernet","loaded":true},{"name":"efficientpose","loaded":false},{"name":"mobilefacenet","loaded":false},{"name":"emotion","loaded":true},{"name":"facedetect","loaded":true},{"name":"faceiris","loaded":true},{"name":"facemesh","loaded":true},{"name":"faceres","loaded":true},{"name":"ssrnetgender","loaded":false},{"name":"handpose","loaded":false},{"name":"handskeleton","loaded":true},{"name":"handtrack","loaded":true},{"name":"liveness","loaded":true},{"name":"movenet","loaded":true},{"name":"nanodet","loaded":false},{"name":"posenet","loaded":false},{"name":"segmentation","loaded":true},{"name":"antispoof","loaded":true}] -2021-12-14 15:42:46 INFO:  test-node-gpu.js test: warmup -2021-12-14 15:42:46 STATE: test-node-gpu.js passed: create human -2021-12-14 15:42:46 INFO:  test-node-gpu.js human version: 2.5.5 -2021-12-14 15:42:46 INFO:  test-node-gpu.js platform: linux x64 agent: NodeJS v17.2.0 -2021-12-14 15:42:46 INFO:  test-node-gpu.js tfjs version: 3.12.0 -2021-12-14 15:42:46 INFO:  test-node-gpu.js tensorflow binding version: 2.7.0-dev20211101 -2021-12-14 15:42:46 STATE: test-node-gpu.js passed: set backend: tensorflow -2021-12-14 15:42:46 STATE: test-node-gpu.js tensors 1919 -2021-12-14 15:42:46 STATE: test-node-gpu.js passed: load models -2021-12-14 15:42:46 STATE: test-node-gpu.js result: defined models: 22 loaded models: 12 -2021-12-14 15:42:46 STATE: test-node-gpu.js passed: warmup: none default -2021-12-14 15:42:46 DATA:  test-node-gpu.js result: face: 0 body: 0 hand: 0 gesture: 0 object: 0 person: 0 {} {} {} -2021-12-14 15:42:46 DATA:  test-node-gpu.js result: performance: load: null total: null -2021-12-14 15:42:46 STATE: test-node-gpu.js passed: warmup none result match -2021-12-14 15:42:46 STATE: test-node-gpu.js event: image -2021-12-14 15:42:47 STATE: test-node-gpu.js event: detect -2021-12-14 15:42:47 STATE: test-node-gpu.js event: warmup -2021-12-14 15:42:47 STATE: test-node-gpu.js passed: warmup: face default -2021-12-14 15:42:47 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 10 object: 1 person: 1 {"score":1,"age":30.6,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.42,"keypoints":4} -2021-12-14 15:42:47 DATA:  test-node-gpu.js result: performance: load: null total: 922 -2021-12-14 15:42:47 STATE: test-node-gpu.js passed: warmup face result match -2021-12-14 15:42:47 STATE: test-node-gpu.js event: image -2021-12-14 15:42:47 STATE: test-node-gpu.js event: detect -2021-12-14 15:42:47 STATE: test-node-gpu.js event: warmup -2021-12-14 15:42:47 STATE: test-node-gpu.js passed: warmup: body default -2021-12-14 15:42:47 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:42:47 DATA:  test-node-gpu.js result: performance: load: null total: 665 -2021-12-14 15:42:47 STATE: test-node-gpu.js passed: warmup body result match -2021-12-14 15:42:47 STATE: test-node-gpu.js details: {"face":{"boxScore":0.92,"faceScore":1,"age":23.6,"gender":"female","genderScore":0.95},"emotion":[{"score":0.55,"emotion":"neutral"},{"score":0.26,"emotion":"fear"},{"score":0.12,"emotion":"sad"}],"body":{"score":0.92,"keypoints":17},"hand":{"boxScore":0.52,"fingerScore":0.73,"keypoints":21},"gestures":[{"face":0,"gesture":"facing right"},{"hand":0,"gesture":"palm forward"},{"hand":0,"gesture":"palm up"},{"hand":0,"gesture":"open palm"},{"iris":0,"gesture":"looking right"},{"iris":0,"gesture":"looking up"}]} -2021-12-14 15:42:47 INFO:  test-node-gpu.js test: details verification -2021-12-14 15:42:48 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2021-12-14 15:42:48 STATE: test-node-gpu.js event: image -2021-12-14 15:42:49 STATE: test-node-gpu.js event: detect -2021-12-14 15:42:49 STATE: test-node-gpu.js passed: detect: samples/in/ai-body.jpg default -2021-12-14 15:42:49 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:42:49 DATA:  test-node-gpu.js result: performance: load: null total: 801 -2021-12-14 15:42:49 STATE: test-node-gpu.js passed: details face length 1 -2021-12-14 15:42:49 STATE: test-node-gpu.js passed: details face score 1 0.93 1 -2021-12-14 15:42:49 STATE: test-node-gpu.js passed: details face age/gender 23.6 female 0.95 73.26 -2021-12-14 15:42:49 STATE: test-node-gpu.js passed: details face arrays 4 478 1024 -2021-12-14 15:42:49 STATE: test-node-gpu.js passed: details face emotion 3 {"score":0.58,"emotion":"neutral"} -2021-12-14 15:42:49 STATE: test-node-gpu.js passed: details face anti-spoofing 0.87 -2021-12-14 15:42:49 STATE: test-node-gpu.js passed: details face liveness 0.95 -2021-12-14 15:42:49 STATE: test-node-gpu.js passed: details body length 1 -2021-12-14 15:42:49 STATE: test-node-gpu.js passed: details body 0.92 17 6 -2021-12-14 15:42:49 STATE: test-node-gpu.js passed: details hand length 1 -2021-12-14 15:42:49 STATE: test-node-gpu.js passed: details hand 0.51 0.73 point -2021-12-14 15:42:49 STATE: test-node-gpu.js passed: details hand arrays 21 5 6 -2021-12-14 15:42:49 STATE: test-node-gpu.js passed: details gesture length 6 -2021-12-14 15:42:49 STATE: test-node-gpu.js passed: details gesture first {"face":0,"gesture":"facing right"} -2021-12-14 15:42:49 STATE: test-node-gpu.js passed: details object length 1 -2021-12-14 15:42:49 STATE: test-node-gpu.js passed: details object 0.72 person -2021-12-14 15:42:49 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,4] {"checksum":1371996800} -2021-12-14 15:42:49 STATE: test-node-gpu.js event: image -2021-12-14 15:42:50 STATE: test-node-gpu.js event: detect -2021-12-14 15:42:50 STATE: test-node-gpu.js passed: tensor shape: [1,1200,1200,4] dtype: float32 -2021-12-14 15:42:50 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1200,1200,4] {"checksum":1371996800} -2021-12-14 15:42:50 STATE: test-node-gpu.js event: image -2021-12-14 15:42:51 STATE: test-node-gpu.js event: detect -2021-12-14 15:42:51 STATE: test-node-gpu.js passed: tensor shape: [1200,1200,4] dtype: float32 -2021-12-14 15:42:51 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2021-12-14 15:42:51 STATE: test-node-gpu.js event: image -2021-12-14 15:42:52 STATE: test-node-gpu.js event: detect -2021-12-14 15:42:52 STATE: test-node-gpu.js passed: tensor shape: [1,1200,1200,3] dtype: float32 -2021-12-14 15:42:52 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1200,1200,3] {"checksum":1004796864} -2021-12-14 15:42:52 STATE: test-node-gpu.js event: image -2021-12-14 15:42:53 STATE: test-node-gpu.js event: detect -2021-12-14 15:42:53 STATE: test-node-gpu.js passed: tensor shape: [1200,1200,3] dtype: float32 -2021-12-14 15:42:54 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,4] {"checksum":1371996871} -2021-12-14 15:42:54 STATE: test-node-gpu.js event: image -2021-12-14 15:42:54 STATE: test-node-gpu.js event: detect -2021-12-14 15:42:54 STATE: test-node-gpu.js passed: tensor shape: [1,1200,1200,4] dtype: int32 -2021-12-14 15:42:54 INFO:  test-node-gpu.js test default -2021-12-14 15:42:55 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2021-12-14 15:42:55 STATE: test-node-gpu.js event: image -2021-12-14 15:42:55 STATE: test-node-gpu.js event: detect -2021-12-14 15:42:55 STATE: test-node-gpu.js passed: detect: samples/in/ai-body.jpg default -2021-12-14 15:42:55 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:42:55 DATA:  test-node-gpu.js result: performance: load: null total: 611 -2021-12-14 15:42:55 STATE: test-node-gpu.js passed: default result face match 1 female 0.95 -2021-12-14 15:42:55 INFO:  test-node-gpu.js test sync -2021-12-14 15:42:56 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2021-12-14 15:42:56 STATE: test-node-gpu.js event: image -2021-12-14 15:42:56 STATE: test-node-gpu.js event: detect -2021-12-14 15:42:56 STATE: test-node-gpu.js passed: detect: samples/in/ai-body.jpg default -2021-12-14 15:42:56 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:42:56 DATA:  test-node-gpu.js result: performance: load: null total: 601 -2021-12-14 15:42:56 STATE: test-node-gpu.js passed: default sync 1 female 0.95 -2021-12-14 15:42:56 INFO:  test-node-gpu.js test: image process -2021-12-14 15:42:56 STATE: test-node-gpu.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} -2021-12-14 15:42:56 STATE: test-node-gpu.js passed: image input null [1,256,256,3] -2021-12-14 15:42:56 INFO:  test-node-gpu.js test: image null -2021-12-14 15:42:56 STATE: test-node-gpu.js passed: invalid input could not convert input to tensor -2021-12-14 15:42:56 INFO:  test-node-gpu.js test face similarity -2021-12-14 15:42:56 STATE: test-node-gpu.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} -2021-12-14 15:42:56 STATE: test-node-gpu.js event: image -2021-12-14 15:42:57 STATE: test-node-gpu.js event: detect -2021-12-14 15:42:57 STATE: test-node-gpu.js passed: detect: samples/in/ai-face.jpg default -2021-12-14 15:42:57 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 8 object: 1 person: 1 {"score":1,"age":30.6,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":3} -2021-12-14 15:42:57 DATA:  test-node-gpu.js result: performance: load: null total: 562 -2021-12-14 15:42:57 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2021-12-14 15:42:57 STATE: test-node-gpu.js event: image -2021-12-14 15:42:58 STATE: test-node-gpu.js event: detect -2021-12-14 15:42:58 STATE: test-node-gpu.js passed: detect: samples/in/ai-body.jpg default -2021-12-14 15:42:58 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:42:58 DATA:  test-node-gpu.js result: performance: load: null total: 635 -2021-12-14 15:42:58 STATE: test-node-gpu.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289056} -2021-12-14 15:42:58 STATE: test-node-gpu.js event: image -2021-12-14 15:42:59 STATE: test-node-gpu.js event: detect -2021-12-14 15:42:59 STATE: test-node-gpu.js passed: detect: samples/in/ai-upper.jpg default -2021-12-14 15:42:59 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":7} -2021-12-14 15:42:59 DATA:  test-node-gpu.js result: performance: load: null total: 679 -2021-12-14 15:42:59 STATE: test-node-gpu.js passed: face descriptor -2021-12-14 15:42:59 STATE: test-node-gpu.js passed: face similarity {"similarity":[1,0.5204253812157617,0.5018512391128399],"descriptors":[1024,1024,1024]} -2021-12-14 15:42:59 INFO:  test-node-gpu.js test face matching -2021-12-14 15:42:59 STATE: test-node-gpu.js passed: face database 57 -2021-12-14 15:42:59 STATE: test-node-gpu.js passed: face match {"first":{"index":4,"similarity":0.9339157281721077}} {"second":{"index":4,"similarity":0.5272109558655983}} {"third":{"index":4,"similarity":0.47187667831692687}} -2021-12-14 15:42:59 INFO:  test-node-gpu.js test object -2021-12-14 15:43:00 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2021-12-14 15:43:00 STATE: test-node-gpu.js event: image -2021-12-14 15:43:00 STATE: test-node-gpu.js event: detect -2021-12-14 15:43:00 STATE: test-node-gpu.js passed: detect: samples/in/ai-body.jpg default -2021-12-14 15:43:00 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:43:00 DATA:  test-node-gpu.js result: performance: load: null total: 877 -2021-12-14 15:43:00 STATE: test-node-gpu.js passed: object result match -2021-12-14 15:43:00 INFO:  test-node-gpu.js test sensitive -2021-12-14 15:43:01 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2021-12-14 15:43:01 STATE: test-node-gpu.js event: image -2021-12-14 15:43:02 STATE: test-node-gpu.js event: detect -2021-12-14 15:43:02 STATE: test-node-gpu.js passed: detect: samples/in/ai-body.jpg default -2021-12-14 15:43:02 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 2 gesture: 8 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:43:02 DATA:  test-node-gpu.js result: performance: load: null total: 960 -2021-12-14 15:43:02 STATE: test-node-gpu.js passed: sensitive result match -2021-12-14 15:43:02 STATE: test-node-gpu.js passed: sensitive face result match -2021-12-14 15:43:02 STATE: test-node-gpu.js passed: sensitive face emotion result [{"score":0.58,"emotion":"neutral"},{"score":0.24,"emotion":"fear"},{"score":0.11,"emotion":"sad"}] -2021-12-14 15:43:02 STATE: test-node-gpu.js passed: sensitive body result match -2021-12-14 15:43:02 STATE: test-node-gpu.js passed: sensitive hand result match -2021-12-14 15:43:02 INFO:  test-node-gpu.js test detectors -2021-12-14 15:43:02 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2021-12-14 15:43:02 STATE: test-node-gpu.js event: image -2021-12-14 15:43:03 STATE: test-node-gpu.js event: detect -2021-12-14 15:43:03 STATE: test-node-gpu.js passed: detect: samples/in/ai-body.jpg default -2021-12-14 15:43:03 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 1 person: 1 {"score":0.93} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:43:03 DATA:  test-node-gpu.js result: performance: load: null total: 416 -2021-12-14 15:43:03 STATE: test-node-gpu.js passed: detector result face match -2021-12-14 15:43:03 STATE: test-node-gpu.js passed: detector result hand match -2021-12-14 15:43:03 INFO:  test-node-gpu.js test: multi-instance -2021-12-14 15:43:03 STATE: test-node-gpu.js event: image -2021-12-14 15:43:03 STATE: test-node-gpu.js event: detect -2021-12-14 15:43:03 STATE: test-node-gpu.js passed: detect: random default -2021-12-14 15:43:03 DATA:  test-node-gpu.js result: face: 0 body: 1 hand: 0 gesture: 0 object: 0 person: 0 {} {} {"score":0.06,"keypoints":15} -2021-12-14 15:43:03 DATA:  test-node-gpu.js result: performance: load: null total: 410 -2021-12-14 15:43:03 INFO:  test-node-gpu.js test: first instance -2021-12-14 15:43:04 STATE: test-node-gpu.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289056} -2021-12-14 15:43:04 STATE: test-node-gpu.js passed: detect: samples/in/ai-upper.jpg default -2021-12-14 15:43:04 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 1 person: 1 {"score":0.96} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":16} -2021-12-14 15:43:04 DATA:  test-node-gpu.js result: performance: load: null total: 486 -2021-12-14 15:43:04 INFO:  test-node-gpu.js test: second instance -2021-12-14 15:43:04 STATE: test-node-gpu.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289056} -2021-12-14 15:43:05 STATE: test-node-gpu.js passed: detect: samples/in/ai-upper.jpg default -2021-12-14 15:43:05 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 1 person: 1 {"score":0.96} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":16} -2021-12-14 15:43:05 DATA:  test-node-gpu.js result: performance: load: null total: 391 -2021-12-14 15:43:05 INFO:  test-node-gpu.js test: concurrent -2021-12-14 15:43:05 STATE: test-node-gpu.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} -2021-12-14 15:43:05 STATE: test-node-gpu.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} -2021-12-14 15:43:05 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2021-12-14 15:43:06 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2021-12-14 15:43:06 STATE: test-node-gpu.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289056} -2021-12-14 15:43:06 STATE: test-node-gpu.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289056} -2021-12-14 15:43:06 STATE: test-node-gpu.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} -2021-12-14 15:43:07 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2021-12-14 15:43:07 STATE: test-node-gpu.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289056} -2021-12-14 15:43:07 STATE: test-node-gpu.js event: image -2021-12-14 15:43:07 STATE: test-node-gpu.js event: image -2021-12-14 15:43:07 STATE: test-node-gpu.js event: image -2021-12-14 15:43:10 STATE: test-node-gpu.js passed: detect: samples/in/ai-upper.jpg default -2021-12-14 15:43:10 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 1 person: 1 {"score":0.96} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":16} -2021-12-14 15:43:10 DATA:  test-node-gpu.js result: performance: load: null total: 3708 -2021-12-14 15:43:10 STATE: test-node-gpu.js passed: detect: samples/in/ai-upper.jpg default -2021-12-14 15:43:10 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 1 person: 1 {"score":0.96} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":16} -2021-12-14 15:43:10 DATA:  test-node-gpu.js result: performance: load: null total: 3708 -2021-12-14 15:43:10 STATE: test-node-gpu.js passed: detect: samples/in/ai-face.jpg default -2021-12-14 15:43:10 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 2 object: 1 person: 1 {"score":0.91} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":17} -2021-12-14 15:43:10 DATA:  test-node-gpu.js result: performance: load: null total: 4058 -2021-12-14 15:43:10 STATE: test-node-gpu.js passed: detect: samples/in/ai-face.jpg default -2021-12-14 15:43:10 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 2 object: 1 person: 1 {"score":0.91} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":17} -2021-12-14 15:43:10 DATA:  test-node-gpu.js result: performance: load: null total: 4058 -2021-12-14 15:43:10 STATE: test-node-gpu.js passed: detect: samples/in/ai-body.jpg default -2021-12-14 15:43:10 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 1 person: 1 {"score":0.93} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:43:10 DATA:  test-node-gpu.js result: performance: load: null total: 4058 -2021-12-14 15:43:10 STATE: test-node-gpu.js passed: detect: samples/in/ai-body.jpg default -2021-12-14 15:43:10 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 1 person: 1 {"score":0.93} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:43:10 DATA:  test-node-gpu.js result: performance: load: null total: 4058 -2021-12-14 15:43:10 STATE: test-node-gpu.js event: detect -2021-12-14 15:43:10 STATE: test-node-gpu.js passed: detect: samples/in/ai-upper.jpg default -2021-12-14 15:43:10 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 1 person: 1 {"score":0.96} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":16} -2021-12-14 15:43:10 DATA:  test-node-gpu.js result: performance: load: null total: 3502 -2021-12-14 15:43:10 STATE: test-node-gpu.js event: detect -2021-12-14 15:43:10 STATE: test-node-gpu.js event: detect -2021-12-14 15:43:10 STATE: test-node-gpu.js passed: detect: samples/in/ai-face.jpg default -2021-12-14 15:43:10 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 2 object: 1 person: 1 {"score":0.91} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":17} -2021-12-14 15:43:10 DATA:  test-node-gpu.js result: performance: load: null total: 3502 -2021-12-14 15:43:10 STATE: test-node-gpu.js passed: detect: samples/in/ai-body.jpg default -2021-12-14 15:43:10 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 1 person: 1 {"score":0.93} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:43:10 DATA:  test-node-gpu.js result: performance: load: null total: 3502 -2021-12-14 15:43:10 INFO:  test-node-gpu.js test: monkey-patch -2021-12-14 15:43:10 STATE: test-node-gpu.js event: image -2021-12-14 15:43:11 STATE: test-node-gpu.js event: detect -2021-12-14 15:43:11 STATE: test-node-gpu.js passed: monkey patch -2021-12-14 15:43:11 STATE: test-node-gpu.js passed: segmentation [65536] -2021-12-14 15:43:11 STATE: test-node-gpu.js passeed: equal usage -2021-12-14 15:43:11 INFO:  test-node-gpu.js test: input compare -2021-12-14 15:43:11 STATE: test-node-gpu.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} -2021-12-14 15:43:11 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2021-12-14 15:43:11 STATE: test-node-gpu.js passed: image compare 0 23.275441687091504 -2021-12-14 15:43:11 INFO:  test-node-gpu.js events: {"image":21,"detect":21,"warmup":2} -2021-12-14 15:43:11 INFO:  test-node-gpu.js tensors 1925 -2021-12-14 15:43:11 INFO:  test-node-gpu.js test complete: 25786 ms -2021-12-14 15:43:11 INFO:  -2021-12-14 15:43:11 INFO:  test-node-wasm.js start -2021-12-14 15:43:12 STATE: test-node-wasm.js passed: model server: https://vladmandic.github.io/human/models/ -2021-12-14 15:43:12 INFO:  test-node-wasm.js test: configuration validation -2021-12-14 15:43:12 STATE: test-node-wasm.js passed: configuration default validation [] -2021-12-14 15:43:12 STATE: test-node-wasm.js passed: configuration invalid validation [{"reason":"unknown property","where":"config.invalid = true"}] -2021-12-14 15:43:12 INFO:  test-node-wasm.js test: model load -2021-12-14 15:43:14 STATE: test-node-wasm.js passed: models loaded 22 12 [{"name":"ssrnetage","loaded":false},{"name":"gear","loaded":false},{"name":"blazeposedetect","loaded":false},{"name":"blazepose","loaded":false},{"name":"centernet","loaded":true},{"name":"efficientpose","loaded":false},{"name":"mobilefacenet","loaded":false},{"name":"emotion","loaded":true},{"name":"facedetect","loaded":true},{"name":"faceiris","loaded":true},{"name":"facemesh","loaded":true},{"name":"faceres","loaded":true},{"name":"ssrnetgender","loaded":false},{"name":"handpose","loaded":false},{"name":"handskeleton","loaded":true},{"name":"handtrack","loaded":true},{"name":"liveness","loaded":true},{"name":"movenet","loaded":true},{"name":"nanodet","loaded":false},{"name":"posenet","loaded":false},{"name":"segmentation","loaded":true},{"name":"antispoof","loaded":true}] -2021-12-14 15:43:14 INFO:  test-node-wasm.js test: warmup -2021-12-14 15:43:14 STATE: test-node-wasm.js passed: create human -2021-12-14 15:43:14 INFO:  test-node-wasm.js human version: 2.5.5 -2021-12-14 15:43:14 INFO:  test-node-wasm.js platform: linux x64 agent: NodeJS v17.2.0 -2021-12-14 15:43:14 INFO:  test-node-wasm.js tfjs version: 3.12.0 -2021-12-14 15:43:14 STATE: test-node-wasm.js passed: set backend: wasm -2021-12-14 15:43:14 STATE: test-node-wasm.js tensors 1919 -2021-12-14 15:43:14 STATE: test-node-wasm.js passed: load models -2021-12-14 15:43:14 STATE: test-node-wasm.js result: defined models: 22 loaded models: 12 -2021-12-14 15:43:14 STATE: test-node-wasm.js passed: warmup: none default -2021-12-14 15:43:14 DATA:  test-node-wasm.js result: face: 0 body: 0 hand: 0 gesture: 0 object: 0 person: 0 {} {} {} -2021-12-14 15:43:14 DATA:  test-node-wasm.js result: performance: load: null total: null -2021-12-14 15:43:14 STATE: test-node-wasm.js passed: warmup none result match -2021-12-14 15:43:14 STATE: test-node-wasm.js event: image -2021-12-14 15:43:15 STATE: test-node-wasm.js event: detect -2021-12-14 15:43:15 STATE: test-node-wasm.js event: warmup -2021-12-14 15:43:15 STATE: test-node-wasm.js passed: warmup: face default -2021-12-14 15:43:15 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 8 object: 1 person: 1 {"score":1,"age":30.6,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":3} -2021-12-14 15:43:15 DATA:  test-node-wasm.js result: performance: load: null total: 1706 -2021-12-14 15:43:15 STATE: test-node-wasm.js passed: warmup face result match -2021-12-14 15:43:16 STATE: test-node-wasm.js event: image -2021-12-14 15:43:17 STATE: test-node-wasm.js event: detect -2021-12-14 15:43:17 STATE: test-node-wasm.js event: warmup -2021-12-14 15:43:17 STATE: test-node-wasm.js passed: warmup: body default -2021-12-14 15:43:17 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:43:17 DATA:  test-node-wasm.js result: performance: load: null total: 1115 -2021-12-14 15:43:17 STATE: test-node-wasm.js passed: warmup body result match -2021-12-14 15:43:17 STATE: test-node-wasm.js details: {"face":{"boxScore":0.93,"faceScore":1,"age":23.6,"gender":"female","genderScore":0.95},"emotion":[{"score":0.58,"emotion":"neutral"},{"score":0.24,"emotion":"fear"},{"score":0.11,"emotion":"sad"}],"body":{"score":0.92,"keypoints":17},"hand":{"boxScore":0.51,"fingerScore":0.73,"keypoints":21},"gestures":[{"face":0,"gesture":"facing right"},{"hand":0,"gesture":"palm forward"},{"hand":0,"gesture":"palm up"},{"hand":0,"gesture":"open palm"},{"iris":0,"gesture":"looking right"},{"iris":0,"gesture":"looking up"}]} -2021-12-14 15:43:17 INFO:  test-node-wasm.js test: details verification -2021-12-14 15:43:18 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} -2021-12-14 15:43:18 STATE: test-node-wasm.js event: image -2021-12-14 15:43:18 STATE: test-node-wasm.js event: detect -2021-12-14 15:43:18 STATE: test-node-wasm.js passed: detect: samples/in/ai-body.jpg default -2021-12-14 15:43:18 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:43:18 DATA:  test-node-wasm.js result: performance: load: null total: 811 -2021-12-14 15:43:18 STATE: test-node-wasm.js passed: details face length 1 -2021-12-14 15:43:18 STATE: test-node-wasm.js passed: details face score 1 0.93 1 -2021-12-14 15:43:18 STATE: test-node-wasm.js passed: details face age/gender 23.6 female 0.95 73.26 -2021-12-14 15:43:18 STATE: test-node-wasm.js passed: details face arrays 4 478 1024 -2021-12-14 15:43:18 STATE: test-node-wasm.js passed: details face emotion 3 {"score":0.58,"emotion":"neutral"} -2021-12-14 15:43:18 STATE: test-node-wasm.js passed: details face anti-spoofing 0.87 -2021-12-14 15:43:18 STATE: test-node-wasm.js passed: details face liveness 0.95 -2021-12-14 15:43:18 STATE: test-node-wasm.js passed: details body length 1 -2021-12-14 15:43:18 STATE: test-node-wasm.js passed: details body 0.92 17 6 -2021-12-14 15:43:18 STATE: test-node-wasm.js passed: details hand length 1 -2021-12-14 15:43:18 STATE: test-node-wasm.js passed: details hand 0.51 0.73 point -2021-12-14 15:43:18 STATE: test-node-wasm.js passed: details hand arrays 21 5 6 -2021-12-14 15:43:18 STATE: test-node-wasm.js passed: details gesture length 6 -2021-12-14 15:43:18 STATE: test-node-wasm.js passed: details gesture first {"face":0,"gesture":"facing right"} -2021-12-14 15:43:18 STATE: test-node-wasm.js passed: details object length 1 -2021-12-14 15:43:18 STATE: test-node-wasm.js passed: details object 0.72 person -2021-12-14 15:43:19 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,4] {"checksum":1413675264} -2021-12-14 15:43:19 STATE: test-node-wasm.js event: image -2021-12-14 15:43:20 STATE: test-node-wasm.js event: detect -2021-12-14 15:43:20 STATE: test-node-wasm.js passed: tensor shape: [1,1200,1200,4] dtype: float32 -2021-12-14 15:43:20 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1200,1200,4] {"checksum":1413675264} -2021-12-14 15:43:21 STATE: test-node-wasm.js event: image -2021-12-14 15:43:21 STATE: test-node-wasm.js event: detect -2021-12-14 15:43:21 STATE: test-node-wasm.js passed: tensor shape: [1200,1200,4] dtype: float32 -2021-12-14 15:43:22 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} -2021-12-14 15:43:22 STATE: test-node-wasm.js event: image -2021-12-14 15:43:23 STATE: test-node-wasm.js event: detect -2021-12-14 15:43:23 STATE: test-node-wasm.js passed: tensor shape: [1,1200,1200,3] dtype: float32 -2021-12-14 15:43:23 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1200,1200,3] {"checksum":1038921856} -2021-12-14 15:43:23 STATE: test-node-wasm.js event: image -2021-12-14 15:43:24 STATE: test-node-wasm.js event: detect -2021-12-14 15:43:24 STATE: test-node-wasm.js passed: tensor shape: [1200,1200,3] dtype: float32 -2021-12-14 15:43:24 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,4] {"checksum":1371996871} -2021-12-14 15:43:25 STATE: test-node-wasm.js event: image -2021-12-14 15:43:25 STATE: test-node-wasm.js event: detect -2021-12-14 15:43:25 STATE: test-node-wasm.js passed: tensor shape: [1,1200,1200,4] dtype: int32 -2021-12-14 15:43:25 INFO:  test-node-wasm.js test default -2021-12-14 15:43:26 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} -2021-12-14 15:43:26 STATE: test-node-wasm.js event: image -2021-12-14 15:43:27 STATE: test-node-wasm.js event: detect -2021-12-14 15:43:27 STATE: test-node-wasm.js passed: detect: samples/in/ai-body.jpg default -2021-12-14 15:43:27 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:43:27 DATA:  test-node-wasm.js result: performance: load: null total: 769 -2021-12-14 15:43:27 STATE: test-node-wasm.js passed: default result face match 1 female 0.94 -2021-12-14 15:43:27 INFO:  test-node-wasm.js test sync -2021-12-14 15:43:27 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} -2021-12-14 15:43:27 STATE: test-node-wasm.js event: image -2021-12-14 15:43:28 STATE: test-node-wasm.js event: detect -2021-12-14 15:43:28 STATE: test-node-wasm.js passed: detect: samples/in/ai-body.jpg default -2021-12-14 15:43:28 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:43:28 DATA:  test-node-wasm.js result: performance: load: null total: 775 -2021-12-14 15:43:28 STATE: test-node-wasm.js passed: default sync 1 female 0.94 -2021-12-14 15:43:28 INFO:  test-node-wasm.js test: image process -2021-12-14 15:43:28 STATE: test-node-wasm.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34697856} -2021-12-14 15:43:28 STATE: test-node-wasm.js passed: image input null [1,256,256,3] -2021-12-14 15:43:28 INFO:  test-node-wasm.js test: image null -2021-12-14 15:43:28 STATE: test-node-wasm.js passed: invalid input could not convert input to tensor -2021-12-14 15:43:28 INFO:  test-node-wasm.js test face similarity -2021-12-14 15:43:28 STATE: test-node-wasm.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34697856} -2021-12-14 15:43:28 STATE: test-node-wasm.js event: image -2021-12-14 15:43:29 STATE: test-node-wasm.js event: detect -2021-12-14 15:43:29 STATE: test-node-wasm.js passed: detect: samples/in/ai-face.jpg default -2021-12-14 15:43:29 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 8 object: 1 person: 1 {"score":1,"age":30.6,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":3} -2021-12-14 15:43:29 DATA:  test-node-wasm.js result: performance: load: null total: 740 -2021-12-14 15:43:29 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} -2021-12-14 15:43:29 STATE: test-node-wasm.js event: image -2021-12-14 15:43:30 STATE: test-node-wasm.js event: detect -2021-12-14 15:43:30 STATE: test-node-wasm.js passed: detect: samples/in/ai-body.jpg default -2021-12-14 15:43:30 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:43:30 DATA:  test-node-wasm.js result: performance: load: null total: 751 -2021-12-14 15:43:30 STATE: test-node-wasm.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151155104} -2021-12-14 15:43:30 STATE: test-node-wasm.js event: image -2021-12-14 15:43:31 STATE: test-node-wasm.js event: detect -2021-12-14 15:43:31 STATE: test-node-wasm.js passed: detect: samples/in/ai-upper.jpg default -2021-12-14 15:43:31 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 1 person: 1 {"score":1,"age":23.5,"gender":"female"} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":7} -2021-12-14 15:43:31 DATA:  test-node-wasm.js result: performance: load: null total: 670 -2021-12-14 15:43:31 STATE: test-node-wasm.js passed: face descriptor -2021-12-14 15:43:31 STATE: test-node-wasm.js passed: face similarity {"similarity":[1,0.5502973648074503,0.49721702784432575],"descriptors":[1024,1024,1024]} -2021-12-14 15:43:31 INFO:  test-node-wasm.js test face matching -2021-12-14 15:43:31 STATE: test-node-wasm.js passed: face database 57 -2021-12-14 15:43:31 STATE: test-node-wasm.js passed: face match {"first":{"index":4,"similarity":0.933916055561213}} {"second":{"index":4,"similarity":0.5456802676954908}} {"third":{"index":4,"similarity":0.4681398205326839}} -2021-12-14 15:43:31 INFO:  test-node-wasm.js test object -2021-12-14 15:43:32 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} -2021-12-14 15:43:32 STATE: test-node-wasm.js event: image -2021-12-14 15:43:33 STATE: test-node-wasm.js event: detect -2021-12-14 15:43:33 STATE: test-node-wasm.js passed: detect: samples/in/ai-body.jpg default -2021-12-14 15:43:33 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:43:33 DATA:  test-node-wasm.js result: performance: load: null total: 824 -2021-12-14 15:43:33 STATE: test-node-wasm.js passed: object result match -2021-12-14 15:43:33 INFO:  test-node-wasm.js test sensitive -2021-12-14 15:43:33 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} -2021-12-14 15:43:33 STATE: test-node-wasm.js event: image -2021-12-14 15:43:34 STATE: test-node-wasm.js event: detect -2021-12-14 15:43:34 STATE: test-node-wasm.js passed: detect: samples/in/ai-body.jpg default -2021-12-14 15:43:34 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 2 gesture: 8 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:43:34 DATA:  test-node-wasm.js result: performance: load: null total: 1024 -2021-12-14 15:43:34 STATE: test-node-wasm.js passed: sensitive result match -2021-12-14 15:43:34 STATE: test-node-wasm.js passed: sensitive face result match -2021-12-14 15:43:34 STATE: test-node-wasm.js passed: sensitive face emotion result [{"score":0.92,"emotion":"neutral"}] -2021-12-14 15:43:34 STATE: test-node-wasm.js passed: sensitive body result match -2021-12-14 15:43:34 STATE: test-node-wasm.js passed: sensitive hand result match -2021-12-14 15:43:34 INFO:  test-node-wasm.js test detectors -2021-12-14 15:43:35 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} -2021-12-14 15:43:35 STATE: test-node-wasm.js event: image -2021-12-14 15:43:36 STATE: test-node-wasm.js event: detect -2021-12-14 15:43:36 STATE: test-node-wasm.js passed: detect: samples/in/ai-body.jpg default -2021-12-14 15:43:36 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 1 person: 1 {"score":0.93} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:43:36 DATA:  test-node-wasm.js result: performance: load: null total: 783 -2021-12-14 15:43:36 STATE: test-node-wasm.js passed: detector result face match -2021-12-14 15:43:36 STATE: test-node-wasm.js passed: detector result hand match -2021-12-14 15:43:36 INFO:  test-node-wasm.js test: multi-instance -2021-12-14 15:43:36 STATE: test-node-wasm.js event: image -2021-12-14 15:43:37 STATE: test-node-wasm.js event: detect -2021-12-14 15:43:37 STATE: test-node-wasm.js passed: detect: random default -2021-12-14 15:43:37 DATA:  test-node-wasm.js result: face: 0 body: 1 hand: 0 gesture: 0 object: 0 person: 0 {} {} {"score":0.08,"keypoints":15} -2021-12-14 15:43:37 DATA:  test-node-wasm.js result: performance: load: null total: 586 -2021-12-14 15:43:37 INFO:  test-node-wasm.js test: first instance -2021-12-14 15:43:37 STATE: test-node-wasm.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151155104} -2021-12-14 15:43:37 STATE: test-node-wasm.js passed: detect: samples/in/ai-upper.jpg default -2021-12-14 15:43:37 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 1 person: 1 {"score":0.96} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":16} -2021-12-14 15:43:37 DATA:  test-node-wasm.js result: performance: load: null total: 556 -2021-12-14 15:43:37 INFO:  test-node-wasm.js test: second instance -2021-12-14 15:43:38 STATE: test-node-wasm.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151155104} -2021-12-14 15:43:38 STATE: test-node-wasm.js passed: detect: samples/in/ai-upper.jpg default -2021-12-14 15:43:38 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 1 person: 1 {"score":0.96} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":16} -2021-12-14 15:43:38 DATA:  test-node-wasm.js result: performance: load: null total: 546 -2021-12-14 15:43:38 INFO:  test-node-wasm.js test: concurrent -2021-12-14 15:43:38 STATE: test-node-wasm.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34697856} -2021-12-14 15:43:38 STATE: test-node-wasm.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34697856} -2021-12-14 15:43:39 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} -2021-12-14 15:43:39 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} -2021-12-14 15:43:40 STATE: test-node-wasm.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151155104} -2021-12-14 15:43:40 STATE: test-node-wasm.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151155104} -2021-12-14 15:43:40 STATE: test-node-wasm.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34697856} -2021-12-14 15:43:40 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} -2021-12-14 15:43:41 STATE: test-node-wasm.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151155104} -2021-12-14 15:43:41 STATE: test-node-wasm.js event: image -2021-12-14 15:43:41 STATE: test-node-wasm.js event: image -2021-12-14 15:43:41 STATE: test-node-wasm.js event: image -2021-12-14 15:43:46 STATE: test-node-wasm.js passed: detect: samples/in/ai-upper.jpg default -2021-12-14 15:43:46 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 1 person: 1 {"score":0.96} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":16} -2021-12-14 15:43:46 DATA:  test-node-wasm.js result: performance: load: null total: 5963 -2021-12-14 15:43:46 STATE: test-node-wasm.js passed: detect: samples/in/ai-upper.jpg default -2021-12-14 15:43:46 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 1 person: 1 {"score":0.96} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":16} -2021-12-14 15:43:46 DATA:  test-node-wasm.js result: performance: load: null total: 5963 -2021-12-14 15:43:46 STATE: test-node-wasm.js passed: detect: samples/in/ai-face.jpg default -2021-12-14 15:43:46 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 2 object: 1 person: 1 {"score":0.91} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":17} -2021-12-14 15:43:46 DATA:  test-node-wasm.js result: performance: load: null total: 6518 -2021-12-14 15:43:46 STATE: test-node-wasm.js passed: detect: samples/in/ai-face.jpg default -2021-12-14 15:43:46 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 2 object: 1 person: 1 {"score":0.91} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":17} -2021-12-14 15:43:46 DATA:  test-node-wasm.js result: performance: load: null total: 6518 -2021-12-14 15:43:46 STATE: test-node-wasm.js passed: detect: samples/in/ai-body.jpg default -2021-12-14 15:43:46 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 1 person: 1 {"score":0.93} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:43:46 DATA:  test-node-wasm.js result: performance: load: null total: 6518 -2021-12-14 15:43:46 STATE: test-node-wasm.js passed: detect: samples/in/ai-body.jpg default -2021-12-14 15:43:46 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 1 person: 1 {"score":0.93} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:43:46 DATA:  test-node-wasm.js result: performance: load: null total: 6518 -2021-12-14 15:43:46 STATE: test-node-wasm.js event: detect -2021-12-14 15:43:46 STATE: test-node-wasm.js passed: detect: samples/in/ai-upper.jpg default -2021-12-14 15:43:46 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 1 person: 1 {"score":0.96} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":16} -2021-12-14 15:43:46 DATA:  test-node-wasm.js result: performance: load: null total: 5742 -2021-12-14 15:43:46 STATE: test-node-wasm.js event: detect -2021-12-14 15:43:46 STATE: test-node-wasm.js event: detect -2021-12-14 15:43:46 STATE: test-node-wasm.js passed: detect: samples/in/ai-face.jpg default -2021-12-14 15:43:46 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 2 object: 1 person: 1 {"score":0.91} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":17} -2021-12-14 15:43:46 DATA:  test-node-wasm.js result: performance: load: null total: 5743 -2021-12-14 15:43:46 STATE: test-node-wasm.js passed: detect: samples/in/ai-body.jpg default -2021-12-14 15:43:46 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 1 person: 1 {"score":0.93} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2021-12-14 15:43:46 DATA:  test-node-wasm.js result: performance: load: null total: 5743 -2021-12-14 15:43:46 INFO:  test-node-wasm.js test: monkey-patch -2021-12-14 15:43:46 STATE: test-node-wasm.js event: image -2021-12-14 15:43:47 STATE: test-node-wasm.js event: detect -2021-12-14 15:43:47 STATE: test-node-wasm.js passed: monkey patch -2021-12-14 15:43:47 STATE: test-node-wasm.js passed: segmentation [65536] -2021-12-14 15:43:47 STATE: test-node-wasm.js passeed: equal usage -2021-12-14 15:43:47 INFO:  test-node-wasm.js test: input compare -2021-12-14 15:43:47 STATE: test-node-wasm.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34697856} -2021-12-14 15:43:48 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} -2021-12-14 15:43:48 STATE: test-node-wasm.js passed: image compare 0 23.280073018790848 -2021-12-14 15:43:48 INFO:  test-node-wasm.js events: {"image":21,"detect":21,"warmup":2} -2021-12-14 15:43:48 INFO:  test-node-wasm.js tensors 1927 -2021-12-14 15:43:48 INFO:  test-node-wasm.js test complete: 35628 ms -2021-12-14 15:43:48 INFO:  all tests complete -2021-12-14 15:43:48 INFO:  failed: {"count":0,"messages":[]} -2021-12-14 15:43:48 INFO:  status: {"test":"test-node.js","passed":101,"failed":0} -2021-12-14 15:43:48 INFO:  status: {"test":"test-node-gpu.js","passed":101,"failed":0} -2021-12-14 15:43:48 INFO:  status: {"test":"test-node-wasm.js","passed":102,"failed":0} +2021-12-15 09:28:52 INFO:  @vladmandic/human version 2.5.6 +2021-12-15 09:28:52 INFO:  User: vlado Platform: linux Arch: x64 Node: v17.2.0 +2021-12-15 09:28:52 INFO:  tests: ["test-node.js","test-node-gpu.js","test-node-wasm.js"] +2021-12-15 09:28:52 INFO:  demos: ["../demo/nodejs/node.js","../demo/nodejs/node-canvas.js","../demo/nodejs/node-env.js","../demo/nodejs/node-event.js","../demo/nodejs/node-multiprocess.js"] +2021-12-15 09:28:52 INFO:  +2021-12-15 09:28:52 INFO:  test-node.js start +2021-12-15 09:28:53 INFO:  test-node.js test: configuration validation +2021-12-15 09:28:53 STATE: test-node.js passed: configuration default validation [] +2021-12-15 09:28:53 STATE: test-node.js passed: configuration invalid validation [{"reason":"unknown property","where":"config.invalid = true"}] +2021-12-15 09:28:53 INFO:  test-node.js test: model load +2021-12-15 09:28:53 STATE: test-node.js passed: models loaded 22 12 [{"name":"ssrnetage","loaded":false},{"name":"gear","loaded":false},{"name":"blazeposedetect","loaded":false},{"name":"blazepose","loaded":false},{"name":"centernet","loaded":true},{"name":"efficientpose","loaded":false},{"name":"mobilefacenet","loaded":false},{"name":"emotion","loaded":true},{"name":"facedetect","loaded":true},{"name":"faceiris","loaded":true},{"name":"facemesh","loaded":true},{"name":"faceres","loaded":true},{"name":"ssrnetgender","loaded":false},{"name":"handpose","loaded":false},{"name":"handskeleton","loaded":true},{"name":"handtrack","loaded":true},{"name":"liveness","loaded":true},{"name":"movenet","loaded":true},{"name":"nanodet","loaded":false},{"name":"posenet","loaded":false},{"name":"segmentation","loaded":true},{"name":"antispoof","loaded":true}] +2021-12-15 09:28:53 INFO:  test-node.js test: warmup +2021-12-15 09:28:53 STATE: test-node.js passed: create human +2021-12-15 09:28:53 INFO:  test-node.js human version: 2.5.6 +2021-12-15 09:28:53 INFO:  test-node.js platform: linux x64 agent: NodeJS v17.2.0 +2021-12-15 09:28:53 INFO:  test-node.js tfjs version: 3.12.0 +2021-12-15 09:28:53 INFO:  test-node.js tensorflow binding version: 2.7.0-dev20211101 +2021-12-15 09:28:53 STATE: test-node.js passed: set backend: tensorflow +2021-12-15 09:28:53 STATE: test-node.js tensors 1919 +2021-12-15 09:28:53 STATE: test-node.js passed: load models +2021-12-15 09:28:53 STATE: test-node.js result: defined models: 22 loaded models: 12 +2021-12-15 09:28:53 STATE: test-node.js passed: warmup: none default +2021-12-15 09:28:53 DATA:  test-node.js result: face: 0 body: 0 hand: 0 gesture: 0 object: 0 person: 0 {} {} {} +2021-12-15 09:28:53 DATA:  test-node.js result: performance: load: null total: null +2021-12-15 09:28:53 STATE: test-node.js passed: warmup none result match +2021-12-15 09:28:53 STATE: test-node.js event: image +2021-12-15 09:28:54 STATE: test-node.js event: detect +2021-12-15 09:28:54 STATE: test-node.js event: warmup +2021-12-15 09:28:54 STATE: test-node.js passed: warmup: face default +2021-12-15 09:28:54 DATA:  test-node.js result: face: 1 body: 1 hand: 1 gesture: 10 object: 1 person: 1 {"score":1,"age":30.6,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.42,"keypoints":4} +2021-12-15 09:28:54 DATA:  test-node.js result: performance: load: null total: 913 +2021-12-15 09:28:54 STATE: test-node.js passed: warmup face result match +2021-12-15 09:28:54 STATE: test-node.js event: image +2021-12-15 09:28:55 STATE: test-node.js event: detect +2021-12-15 09:28:55 STATE: test-node.js event: warmup +2021-12-15 09:28:55 STATE: test-node.js passed: warmup: body default +2021-12-15 09:28:55 DATA:  test-node.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:28:55 DATA:  test-node.js result: performance: load: null total: 608 +2021-12-15 09:28:55 STATE: test-node.js passed: warmup body result match +2021-12-15 09:28:55 STATE: test-node.js details: {"face":{"boxScore":0.92,"faceScore":1,"age":23.6,"gender":"female","genderScore":0.95},"emotion":[{"score":0.55,"emotion":"neutral"},{"score":0.26,"emotion":"fear"},{"score":0.12,"emotion":"sad"}],"body":{"score":0.92,"keypoints":17},"hand":{"boxScore":0.52,"fingerScore":0.73,"keypoints":21},"gestures":[{"face":0,"gesture":"facing right"},{"hand":0,"gesture":"palm forward"},{"hand":0,"gesture":"palm up"},{"hand":0,"gesture":"open palm"},{"iris":0,"gesture":"looking right"},{"iris":0,"gesture":"looking up"}]} +2021-12-15 09:28:55 INFO:  test-node.js test: details verification +2021-12-15 09:28:55 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2021-12-15 09:28:55 STATE: test-node.js event: image +2021-12-15 09:28:56 STATE: test-node.js event: detect +2021-12-15 09:28:56 STATE: test-node.js passed: detect: samples/in/ai-body.jpg default +2021-12-15 09:28:56 DATA:  test-node.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:28:56 DATA:  test-node.js result: performance: load: null total: 696 +2021-12-15 09:28:56 STATE: test-node.js passed: details face length 1 +2021-12-15 09:28:56 STATE: test-node.js passed: details face score 1 0.93 1 +2021-12-15 09:28:56 STATE: test-node.js passed: details face age/gender 23.6 female 0.95 73.26 +2021-12-15 09:28:56 STATE: test-node.js passed: details face arrays 4 478 1024 +2021-12-15 09:28:56 STATE: test-node.js passed: details face emotion 3 {"score":0.58,"emotion":"neutral"} +2021-12-15 09:28:56 STATE: test-node.js passed: details face anti-spoofing 0.87 +2021-12-15 09:28:56 STATE: test-node.js passed: details face liveness 0.95 +2021-12-15 09:28:56 STATE: test-node.js passed: details body length 1 +2021-12-15 09:28:56 STATE: test-node.js passed: details body 0.92 17 6 +2021-12-15 09:28:56 STATE: test-node.js passed: details hand length 1 +2021-12-15 09:28:56 STATE: test-node.js passed: details hand 0.51 0.73 point +2021-12-15 09:28:56 STATE: test-node.js passed: details hand arrays 21 5 6 +2021-12-15 09:28:56 STATE: test-node.js passed: details gesture length 6 +2021-12-15 09:28:56 STATE: test-node.js passed: details gesture first {"face":0,"gesture":"facing right"} +2021-12-15 09:28:56 STATE: test-node.js passed: details object length 1 +2021-12-15 09:28:56 STATE: test-node.js passed: details object 0.72 person +2021-12-15 09:28:56 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,4] {"checksum":1371996800} +2021-12-15 09:28:57 STATE: test-node.js event: image +2021-12-15 09:28:57 STATE: test-node.js event: detect +2021-12-15 09:28:57 STATE: test-node.js passed: tensor shape: [1,1200,1200,4] dtype: float32 +2021-12-15 09:28:58 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1200,1200,4] {"checksum":1371996800} +2021-12-15 09:28:58 STATE: test-node.js event: image +2021-12-15 09:28:58 STATE: test-node.js event: detect +2021-12-15 09:28:58 STATE: test-node.js passed: tensor shape: [1200,1200,4] dtype: float32 +2021-12-15 09:28:59 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2021-12-15 09:28:59 STATE: test-node.js event: image +2021-12-15 09:28:59 STATE: test-node.js event: detect +2021-12-15 09:28:59 STATE: test-node.js passed: tensor shape: [1,1200,1200,3] dtype: float32 +2021-12-15 09:29:00 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1200,1200,3] {"checksum":1004796864} +2021-12-15 09:29:00 STATE: test-node.js event: image +2021-12-15 09:29:00 STATE: test-node.js event: detect +2021-12-15 09:29:00 STATE: test-node.js passed: tensor shape: [1200,1200,3] dtype: float32 +2021-12-15 09:29:01 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,4] {"checksum":1371996871} +2021-12-15 09:29:01 STATE: test-node.js event: image +2021-12-15 09:29:01 STATE: test-node.js event: detect +2021-12-15 09:29:01 STATE: test-node.js passed: tensor shape: [1,1200,1200,4] dtype: int32 +2021-12-15 09:29:01 INFO:  test-node.js test default +2021-12-15 09:29:02 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2021-12-15 09:29:02 STATE: test-node.js event: image +2021-12-15 09:29:02 STATE: test-node.js event: detect +2021-12-15 09:29:02 STATE: test-node.js passed: detect: samples/in/ai-body.jpg default +2021-12-15 09:29:02 DATA:  test-node.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:29:02 DATA:  test-node.js result: performance: load: null total: 574 +2021-12-15 09:29:02 STATE: test-node.js passed: default result face match 1 female 0.95 +2021-12-15 09:29:02 INFO:  test-node.js test sync +2021-12-15 09:29:03 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2021-12-15 09:29:03 STATE: test-node.js event: image +2021-12-15 09:29:03 STATE: test-node.js event: detect +2021-12-15 09:29:03 STATE: test-node.js passed: detect: samples/in/ai-body.jpg default +2021-12-15 09:29:03 DATA:  test-node.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:29:03 DATA:  test-node.js result: performance: load: null total: 591 +2021-12-15 09:29:03 STATE: test-node.js passed: default sync 1 female 0.95 +2021-12-15 09:29:03 INFO:  test-node.js test: image process +2021-12-15 09:29:03 STATE: test-node.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} +2021-12-15 09:29:03 STATE: test-node.js passed: image input null [1,256,256,3] +2021-12-15 09:29:03 INFO:  test-node.js test: image null +2021-12-15 09:29:03 STATE: test-node.js passed: invalid input could not convert input to tensor +2021-12-15 09:29:03 INFO:  test-node.js test face similarity +2021-12-15 09:29:03 STATE: test-node.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} +2021-12-15 09:29:03 STATE: test-node.js event: image +2021-12-15 09:29:04 STATE: test-node.js event: detect +2021-12-15 09:29:04 STATE: test-node.js passed: detect: samples/in/ai-face.jpg default +2021-12-15 09:29:04 DATA:  test-node.js result: face: 1 body: 1 hand: 1 gesture: 8 object: 1 person: 1 {"score":1,"age":30.6,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":3} +2021-12-15 09:29:04 DATA:  test-node.js result: performance: load: null total: 556 +2021-12-15 09:29:04 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2021-12-15 09:29:04 STATE: test-node.js event: image +2021-12-15 09:29:05 STATE: test-node.js event: detect +2021-12-15 09:29:05 STATE: test-node.js passed: detect: samples/in/ai-body.jpg default +2021-12-15 09:29:05 DATA:  test-node.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:29:05 DATA:  test-node.js result: performance: load: null total: 574 +2021-12-15 09:29:05 STATE: test-node.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289056} +2021-12-15 09:29:05 STATE: test-node.js event: image +2021-12-15 09:29:05 STATE: test-node.js event: detect +2021-12-15 09:29:05 STATE: test-node.js passed: detect: samples/in/ai-upper.jpg default +2021-12-15 09:29:05 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":7} +2021-12-15 09:29:05 DATA:  test-node.js result: performance: load: null total: 535 +2021-12-15 09:29:05 STATE: test-node.js passed: face descriptor +2021-12-15 09:29:05 STATE: test-node.js passed: face similarity {"similarity":[1,0.5204253812157617,0.5018512391128399],"descriptors":[1024,1024,1024]} +2021-12-15 09:29:05 INFO:  test-node.js test face matching +2021-12-15 09:29:05 STATE: test-node.js passed: face database 57 +2021-12-15 09:29:05 STATE: test-node.js passed: face match {"first":{"index":4,"similarity":0.9339157281721077}} {"second":{"index":4,"similarity":0.5272109558655983}} {"third":{"index":4,"similarity":0.47187667831692687}} +2021-12-15 09:29:05 INFO:  test-node.js test object +2021-12-15 09:29:06 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2021-12-15 09:29:06 STATE: test-node.js event: image +2021-12-15 09:29:06 STATE: test-node.js event: detect +2021-12-15 09:29:06 STATE: test-node.js passed: detect: samples/in/ai-body.jpg default +2021-12-15 09:29:06 DATA:  test-node.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:29:06 DATA:  test-node.js result: performance: load: null total: 593 +2021-12-15 09:29:06 STATE: test-node.js passed: object result match +2021-12-15 09:29:06 INFO:  test-node.js test sensitive +2021-12-15 09:29:07 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2021-12-15 09:29:07 STATE: test-node.js event: image +2021-12-15 09:29:07 STATE: test-node.js event: detect +2021-12-15 09:29:07 STATE: test-node.js passed: detect: samples/in/ai-body.jpg default +2021-12-15 09:29:07 DATA:  test-node.js result: face: 1 body: 1 hand: 2 gesture: 8 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:29:07 DATA:  test-node.js result: performance: load: null total: 607 +2021-12-15 09:29:07 STATE: test-node.js passed: sensitive result match +2021-12-15 09:29:07 STATE: test-node.js passed: sensitive face result match +2021-12-15 09:29:07 STATE: test-node.js passed: sensitive face emotion result [{"score":0.58,"emotion":"neutral"},{"score":0.24,"emotion":"fear"},{"score":0.11,"emotion":"sad"}] +2021-12-15 09:29:07 STATE: test-node.js passed: sensitive body result match +2021-12-15 09:29:07 STATE: test-node.js passed: sensitive hand result match +2021-12-15 09:29:07 INFO:  test-node.js test detectors +2021-12-15 09:29:08 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2021-12-15 09:29:08 STATE: test-node.js event: image +2021-12-15 09:29:08 STATE: test-node.js event: detect +2021-12-15 09:29:08 STATE: test-node.js passed: detect: samples/in/ai-body.jpg default +2021-12-15 09:29:08 DATA:  test-node.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 1 person: 1 {"score":0.93} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:29:08 DATA:  test-node.js result: performance: load: null total: 444 +2021-12-15 09:29:08 STATE: test-node.js passed: detector result face match +2021-12-15 09:29:08 STATE: test-node.js passed: detector result hand match +2021-12-15 09:29:08 INFO:  test-node.js test: multi-instance +2021-12-15 09:29:08 STATE: test-node.js event: image +2021-12-15 09:29:09 STATE: test-node.js event: detect +2021-12-15 09:29:09 STATE: test-node.js passed: detect: random default +2021-12-15 09:29:09 DATA:  test-node.js result: face: 0 body: 1 hand: 0 gesture: 0 object: 0 person: 0 {} {} {"score":0.07,"keypoints":15} +2021-12-15 09:29:09 DATA:  test-node.js result: performance: load: null total: 399 +2021-12-15 09:29:09 INFO:  test-node.js test: first instance +2021-12-15 09:29:09 STATE: test-node.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289056} +2021-12-15 09:29:09 STATE: test-node.js passed: detect: samples/in/ai-upper.jpg default +2021-12-15 09:29:09 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 1 person: 1 {"score":0.96} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":16} +2021-12-15 09:29:09 DATA:  test-node.js result: performance: load: null total: 387 +2021-12-15 09:29:09 INFO:  test-node.js test: second instance +2021-12-15 09:29:10 STATE: test-node.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289056} +2021-12-15 09:29:10 STATE: test-node.js passed: detect: samples/in/ai-upper.jpg default +2021-12-15 09:29:10 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 1 person: 1 {"score":0.96} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":16} +2021-12-15 09:29:10 DATA:  test-node.js result: performance: load: null total: 374 +2021-12-15 09:29:10 INFO:  test-node.js test: concurrent +2021-12-15 09:29:10 STATE: test-node.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} +2021-12-15 09:29:10 STATE: test-node.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} +2021-12-15 09:29:10 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2021-12-15 09:29:11 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2021-12-15 09:29:11 STATE: test-node.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289056} +2021-12-15 09:29:11 STATE: test-node.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289056} +2021-12-15 09:29:11 STATE: test-node.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} +2021-12-15 09:29:11 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2021-12-15 09:29:12 STATE: test-node.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289056} +2021-12-15 09:29:12 STATE: test-node.js event: image +2021-12-15 09:29:12 STATE: test-node.js event: image +2021-12-15 09:29:12 STATE: test-node.js event: image +2021-12-15 09:29:15 STATE: test-node.js passed: detect: samples/in/ai-upper.jpg default +2021-12-15 09:29:15 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 1 person: 1 {"score":0.96} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":16} +2021-12-15 09:29:15 DATA:  test-node.js result: performance: load: null total: 3724 +2021-12-15 09:29:15 STATE: test-node.js passed: detect: samples/in/ai-upper.jpg default +2021-12-15 09:29:15 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 1 person: 1 {"score":0.96} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":16} +2021-12-15 09:29:15 DATA:  test-node.js result: performance: load: null total: 3724 +2021-12-15 09:29:15 STATE: test-node.js passed: detect: samples/in/ai-face.jpg default +2021-12-15 09:29:15 DATA:  test-node.js result: face: 1 body: 1 hand: 1 gesture: 2 object: 1 person: 1 {"score":0.91} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":17} +2021-12-15 09:29:15 DATA:  test-node.js result: performance: load: null total: 4062 +2021-12-15 09:29:15 STATE: test-node.js passed: detect: samples/in/ai-face.jpg default +2021-12-15 09:29:15 DATA:  test-node.js result: face: 1 body: 1 hand: 1 gesture: 2 object: 1 person: 1 {"score":0.91} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":17} +2021-12-15 09:29:15 DATA:  test-node.js result: performance: load: null total: 4062 +2021-12-15 09:29:15 STATE: test-node.js passed: detect: samples/in/ai-body.jpg default +2021-12-15 09:29:15 DATA:  test-node.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 1 person: 1 {"score":0.93} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:29:15 DATA:  test-node.js result: performance: load: null total: 4062 +2021-12-15 09:29:15 STATE: test-node.js passed: detect: samples/in/ai-body.jpg default +2021-12-15 09:29:15 DATA:  test-node.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 1 person: 1 {"score":0.93} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:29:15 DATA:  test-node.js result: performance: load: null total: 4062 +2021-12-15 09:29:15 STATE: test-node.js event: detect +2021-12-15 09:29:15 STATE: test-node.js passed: detect: samples/in/ai-upper.jpg default +2021-12-15 09:29:15 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 1 person: 1 {"score":0.96} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":16} +2021-12-15 09:29:15 DATA:  test-node.js result: performance: load: null total: 3502 +2021-12-15 09:29:15 STATE: test-node.js event: detect +2021-12-15 09:29:15 STATE: test-node.js event: detect +2021-12-15 09:29:15 STATE: test-node.js passed: detect: samples/in/ai-face.jpg default +2021-12-15 09:29:15 DATA:  test-node.js result: face: 1 body: 1 hand: 1 gesture: 2 object: 1 person: 1 {"score":0.91} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":17} +2021-12-15 09:29:15 DATA:  test-node.js result: performance: load: null total: 3502 +2021-12-15 09:29:15 STATE: test-node.js passed: detect: samples/in/ai-body.jpg default +2021-12-15 09:29:15 DATA:  test-node.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 1 person: 1 {"score":0.93} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:29:15 DATA:  test-node.js result: performance: load: null total: 3502 +2021-12-15 09:29:15 INFO:  test-node.js test: monkey-patch +2021-12-15 09:29:15 STATE: test-node.js event: image +2021-12-15 09:29:15 STATE: test-node.js event: detect +2021-12-15 09:29:15 STATE: test-node.js passed: monkey patch +2021-12-15 09:29:16 STATE: test-node.js passed: segmentation [65536] +2021-12-15 09:29:16 STATE: test-node.js passeed: equal usage +2021-12-15 09:29:16 INFO:  test-node.js test: input compare +2021-12-15 09:29:16 STATE: test-node.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} +2021-12-15 09:29:16 STATE: test-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2021-12-15 09:29:16 STATE: test-node.js passed: image compare 0 23.275441687091504 +2021-12-15 09:29:16 INFO:  test-node.js events: {"image":21,"detect":21,"warmup":2} +2021-12-15 09:29:16 INFO:  test-node.js tensors 1925 +2021-12-15 09:29:16 INFO:  test-node.js test complete: 22987 ms +2021-12-15 09:29:16 INFO:  +2021-12-15 09:29:16 INFO:  test-node-gpu.js start +2021-12-15 09:29:18 INFO:  test-node-gpu.js test: configuration validation +2021-12-15 09:29:18 STATE: test-node-gpu.js passed: configuration default validation [] +2021-12-15 09:29:18 STATE: test-node-gpu.js passed: configuration invalid validation [{"reason":"unknown property","where":"config.invalid = true"}] +2021-12-15 09:29:18 INFO:  test-node-gpu.js test: model load +2021-12-15 09:29:18 STATE: test-node-gpu.js passed: models loaded 22 12 [{"name":"ssrnetage","loaded":false},{"name":"gear","loaded":false},{"name":"blazeposedetect","loaded":false},{"name":"blazepose","loaded":false},{"name":"centernet","loaded":true},{"name":"efficientpose","loaded":false},{"name":"mobilefacenet","loaded":false},{"name":"emotion","loaded":true},{"name":"facedetect","loaded":true},{"name":"faceiris","loaded":true},{"name":"facemesh","loaded":true},{"name":"faceres","loaded":true},{"name":"ssrnetgender","loaded":false},{"name":"handpose","loaded":false},{"name":"handskeleton","loaded":true},{"name":"handtrack","loaded":true},{"name":"liveness","loaded":true},{"name":"movenet","loaded":true},{"name":"nanodet","loaded":false},{"name":"posenet","loaded":false},{"name":"segmentation","loaded":true},{"name":"antispoof","loaded":true}] +2021-12-15 09:29:18 INFO:  test-node-gpu.js test: warmup +2021-12-15 09:29:18 STATE: test-node-gpu.js passed: create human +2021-12-15 09:29:18 INFO:  test-node-gpu.js human version: 2.5.6 +2021-12-15 09:29:18 INFO:  test-node-gpu.js platform: linux x64 agent: NodeJS v17.2.0 +2021-12-15 09:29:18 INFO:  test-node-gpu.js tfjs version: 3.12.0 +2021-12-15 09:29:18 INFO:  test-node-gpu.js tensorflow binding version: 2.7.0-dev20211101 +2021-12-15 09:29:18 STATE: test-node-gpu.js passed: set backend: tensorflow +2021-12-15 09:29:18 STATE: test-node-gpu.js tensors 1919 +2021-12-15 09:29:18 STATE: test-node-gpu.js passed: load models +2021-12-15 09:29:18 STATE: test-node-gpu.js result: defined models: 22 loaded models: 12 +2021-12-15 09:29:18 STATE: test-node-gpu.js passed: warmup: none default +2021-12-15 09:29:18 DATA:  test-node-gpu.js result: face: 0 body: 0 hand: 0 gesture: 0 object: 0 person: 0 {} {} {} +2021-12-15 09:29:18 DATA:  test-node-gpu.js result: performance: load: null total: null +2021-12-15 09:29:18 STATE: test-node-gpu.js passed: warmup none result match +2021-12-15 09:29:18 STATE: test-node-gpu.js event: image +2021-12-15 09:29:19 STATE: test-node-gpu.js event: detect +2021-12-15 09:29:19 STATE: test-node-gpu.js event: warmup +2021-12-15 09:29:19 STATE: test-node-gpu.js passed: warmup: face default +2021-12-15 09:29:19 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 10 object: 1 person: 1 {"score":1,"age":30.6,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.42,"keypoints":4} +2021-12-15 09:29:19 DATA:  test-node-gpu.js result: performance: load: null total: 932 +2021-12-15 09:29:19 STATE: test-node-gpu.js passed: warmup face result match +2021-12-15 09:29:19 STATE: test-node-gpu.js event: image +2021-12-15 09:29:20 STATE: test-node-gpu.js event: detect +2021-12-15 09:29:20 STATE: test-node-gpu.js event: warmup +2021-12-15 09:29:20 STATE: test-node-gpu.js passed: warmup: body default +2021-12-15 09:29:20 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:29:20 DATA:  test-node-gpu.js result: performance: load: null total: 669 +2021-12-15 09:29:20 STATE: test-node-gpu.js passed: warmup body result match +2021-12-15 09:29:20 STATE: test-node-gpu.js details: {"face":{"boxScore":0.92,"faceScore":1,"age":23.6,"gender":"female","genderScore":0.95},"emotion":[{"score":0.55,"emotion":"neutral"},{"score":0.26,"emotion":"fear"},{"score":0.12,"emotion":"sad"}],"body":{"score":0.92,"keypoints":17},"hand":{"boxScore":0.52,"fingerScore":0.73,"keypoints":21},"gestures":[{"face":0,"gesture":"facing right"},{"hand":0,"gesture":"palm forward"},{"hand":0,"gesture":"palm up"},{"hand":0,"gesture":"open palm"},{"iris":0,"gesture":"looking right"},{"iris":0,"gesture":"looking up"}]} +2021-12-15 09:29:20 INFO:  test-node-gpu.js test: details verification +2021-12-15 09:29:20 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2021-12-15 09:29:20 STATE: test-node-gpu.js event: image +2021-12-15 09:29:21 STATE: test-node-gpu.js event: detect +2021-12-15 09:29:21 STATE: test-node-gpu.js passed: detect: samples/in/ai-body.jpg default +2021-12-15 09:29:21 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:29:21 DATA:  test-node-gpu.js result: performance: load: null total: 673 +2021-12-15 09:29:21 STATE: test-node-gpu.js passed: details face length 1 +2021-12-15 09:29:21 STATE: test-node-gpu.js passed: details face score 1 0.93 1 +2021-12-15 09:29:21 STATE: test-node-gpu.js passed: details face age/gender 23.6 female 0.95 73.26 +2021-12-15 09:29:21 STATE: test-node-gpu.js passed: details face arrays 4 478 1024 +2021-12-15 09:29:21 STATE: test-node-gpu.js passed: details face emotion 3 {"score":0.58,"emotion":"neutral"} +2021-12-15 09:29:21 STATE: test-node-gpu.js passed: details face anti-spoofing 0.87 +2021-12-15 09:29:21 STATE: test-node-gpu.js passed: details face liveness 0.95 +2021-12-15 09:29:21 STATE: test-node-gpu.js passed: details body length 1 +2021-12-15 09:29:21 STATE: test-node-gpu.js passed: details body 0.92 17 6 +2021-12-15 09:29:21 STATE: test-node-gpu.js passed: details hand length 1 +2021-12-15 09:29:21 STATE: test-node-gpu.js passed: details hand 0.51 0.73 point +2021-12-15 09:29:21 STATE: test-node-gpu.js passed: details hand arrays 21 5 6 +2021-12-15 09:29:21 STATE: test-node-gpu.js passed: details gesture length 6 +2021-12-15 09:29:21 STATE: test-node-gpu.js passed: details gesture first {"face":0,"gesture":"facing right"} +2021-12-15 09:29:21 STATE: test-node-gpu.js passed: details object length 1 +2021-12-15 09:29:21 STATE: test-node-gpu.js passed: details object 0.72 person +2021-12-15 09:29:21 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,4] {"checksum":1371996800} +2021-12-15 09:29:21 STATE: test-node-gpu.js event: image +2021-12-15 09:29:22 STATE: test-node-gpu.js event: detect +2021-12-15 09:29:22 STATE: test-node-gpu.js passed: tensor shape: [1,1200,1200,4] dtype: float32 +2021-12-15 09:29:22 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1200,1200,4] {"checksum":1371996800} +2021-12-15 09:29:22 STATE: test-node-gpu.js event: image +2021-12-15 09:29:23 STATE: test-node-gpu.js event: detect +2021-12-15 09:29:23 STATE: test-node-gpu.js passed: tensor shape: [1200,1200,4] dtype: float32 +2021-12-15 09:29:23 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2021-12-15 09:29:23 STATE: test-node-gpu.js event: image +2021-12-15 09:29:24 STATE: test-node-gpu.js event: detect +2021-12-15 09:29:24 STATE: test-node-gpu.js passed: tensor shape: [1,1200,1200,3] dtype: float32 +2021-12-15 09:29:24 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1200,1200,3] {"checksum":1004796864} +2021-12-15 09:29:24 STATE: test-node-gpu.js event: image +2021-12-15 09:29:25 STATE: test-node-gpu.js event: detect +2021-12-15 09:29:25 STATE: test-node-gpu.js passed: tensor shape: [1200,1200,3] dtype: float32 +2021-12-15 09:29:25 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,4] {"checksum":1371996871} +2021-12-15 09:29:25 STATE: test-node-gpu.js event: image +2021-12-15 09:29:26 STATE: test-node-gpu.js event: detect +2021-12-15 09:29:26 STATE: test-node-gpu.js passed: tensor shape: [1,1200,1200,4] dtype: int32 +2021-12-15 09:29:26 INFO:  test-node-gpu.js test default +2021-12-15 09:29:26 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2021-12-15 09:29:26 STATE: test-node-gpu.js event: image +2021-12-15 09:29:27 STATE: test-node-gpu.js event: detect +2021-12-15 09:29:27 STATE: test-node-gpu.js passed: detect: samples/in/ai-body.jpg default +2021-12-15 09:29:27 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:29:27 DATA:  test-node-gpu.js result: performance: load: null total: 598 +2021-12-15 09:29:27 STATE: test-node-gpu.js passed: default result face match 1 female 0.95 +2021-12-15 09:29:27 INFO:  test-node-gpu.js test sync +2021-12-15 09:29:27 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2021-12-15 09:29:27 STATE: test-node-gpu.js event: image +2021-12-15 09:29:28 STATE: test-node-gpu.js event: detect +2021-12-15 09:29:28 STATE: test-node-gpu.js passed: detect: samples/in/ai-body.jpg default +2021-12-15 09:29:28 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:29:28 DATA:  test-node-gpu.js result: performance: load: null total: 583 +2021-12-15 09:29:28 STATE: test-node-gpu.js passed: default sync 1 female 0.95 +2021-12-15 09:29:28 INFO:  test-node-gpu.js test: image process +2021-12-15 09:29:28 STATE: test-node-gpu.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} +2021-12-15 09:29:28 STATE: test-node-gpu.js passed: image input null [1,256,256,3] +2021-12-15 09:29:28 INFO:  test-node-gpu.js test: image null +2021-12-15 09:29:28 STATE: test-node-gpu.js passed: invalid input could not convert input to tensor +2021-12-15 09:29:28 INFO:  test-node-gpu.js test face similarity +2021-12-15 09:29:28 STATE: test-node-gpu.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} +2021-12-15 09:29:28 STATE: test-node-gpu.js event: image +2021-12-15 09:29:29 STATE: test-node-gpu.js event: detect +2021-12-15 09:29:29 STATE: test-node-gpu.js passed: detect: samples/in/ai-face.jpg default +2021-12-15 09:29:29 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 8 object: 1 person: 1 {"score":1,"age":30.6,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":3} +2021-12-15 09:29:29 DATA:  test-node-gpu.js result: performance: load: null total: 551 +2021-12-15 09:29:29 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2021-12-15 09:29:29 STATE: test-node-gpu.js event: image +2021-12-15 09:29:30 STATE: test-node-gpu.js event: detect +2021-12-15 09:29:30 STATE: test-node-gpu.js passed: detect: samples/in/ai-body.jpg default +2021-12-15 09:29:30 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:29:30 DATA:  test-node-gpu.js result: performance: load: null total: 598 +2021-12-15 09:29:30 STATE: test-node-gpu.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289056} +2021-12-15 09:29:30 STATE: test-node-gpu.js event: image +2021-12-15 09:29:30 STATE: test-node-gpu.js event: detect +2021-12-15 09:29:30 STATE: test-node-gpu.js passed: detect: samples/in/ai-upper.jpg default +2021-12-15 09:29:30 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":7} +2021-12-15 09:29:30 DATA:  test-node-gpu.js result: performance: load: null total: 584 +2021-12-15 09:29:30 STATE: test-node-gpu.js passed: face descriptor +2021-12-15 09:29:30 STATE: test-node-gpu.js passed: face similarity {"similarity":[1,0.5204253812157617,0.5018512391128399],"descriptors":[1024,1024,1024]} +2021-12-15 09:29:30 INFO:  test-node-gpu.js test face matching +2021-12-15 09:29:30 STATE: test-node-gpu.js passed: face database 57 +2021-12-15 09:29:30 STATE: test-node-gpu.js passed: face match {"first":{"index":4,"similarity":0.9339157281721077}} {"second":{"index":4,"similarity":0.5272109558655983}} {"third":{"index":4,"similarity":0.47187667831692687}} +2021-12-15 09:29:30 INFO:  test-node-gpu.js test object +2021-12-15 09:29:31 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2021-12-15 09:29:31 STATE: test-node-gpu.js event: image +2021-12-15 09:29:31 STATE: test-node-gpu.js event: detect +2021-12-15 09:29:31 STATE: test-node-gpu.js passed: detect: samples/in/ai-body.jpg default +2021-12-15 09:29:31 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:29:31 DATA:  test-node-gpu.js result: performance: load: null total: 583 +2021-12-15 09:29:31 STATE: test-node-gpu.js passed: object result match +2021-12-15 09:29:31 INFO:  test-node-gpu.js test sensitive +2021-12-15 09:29:32 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2021-12-15 09:29:32 STATE: test-node-gpu.js event: image +2021-12-15 09:29:32 STATE: test-node-gpu.js event: detect +2021-12-15 09:29:32 STATE: test-node-gpu.js passed: detect: samples/in/ai-body.jpg default +2021-12-15 09:29:32 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 2 gesture: 8 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:29:32 DATA:  test-node-gpu.js result: performance: load: null total: 602 +2021-12-15 09:29:32 STATE: test-node-gpu.js passed: sensitive result match +2021-12-15 09:29:32 STATE: test-node-gpu.js passed: sensitive face result match +2021-12-15 09:29:32 STATE: test-node-gpu.js passed: sensitive face emotion result [{"score":0.58,"emotion":"neutral"},{"score":0.24,"emotion":"fear"},{"score":0.11,"emotion":"sad"}] +2021-12-15 09:29:32 STATE: test-node-gpu.js passed: sensitive body result match +2021-12-15 09:29:32 STATE: test-node-gpu.js passed: sensitive hand result match +2021-12-15 09:29:32 INFO:  test-node-gpu.js test detectors +2021-12-15 09:29:33 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2021-12-15 09:29:33 STATE: test-node-gpu.js event: image +2021-12-15 09:29:33 STATE: test-node-gpu.js event: detect +2021-12-15 09:29:33 STATE: test-node-gpu.js passed: detect: samples/in/ai-body.jpg default +2021-12-15 09:29:33 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 1 person: 1 {"score":0.93} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:29:33 DATA:  test-node-gpu.js result: performance: load: null total: 426 +2021-12-15 09:29:33 STATE: test-node-gpu.js passed: detector result face match +2021-12-15 09:29:33 STATE: test-node-gpu.js passed: detector result hand match +2021-12-15 09:29:33 INFO:  test-node-gpu.js test: multi-instance +2021-12-15 09:29:33 STATE: test-node-gpu.js event: image +2021-12-15 09:29:34 STATE: test-node-gpu.js event: detect +2021-12-15 09:29:34 STATE: test-node-gpu.js passed: detect: random default +2021-12-15 09:29:34 DATA:  test-node-gpu.js result: face: 0 body: 1 hand: 0 gesture: 0 object: 0 person: 0 {} {} {"score":0.07,"keypoints":15} +2021-12-15 09:29:34 DATA:  test-node-gpu.js result: performance: load: null total: 384 +2021-12-15 09:29:34 INFO:  test-node-gpu.js test: first instance +2021-12-15 09:29:34 STATE: test-node-gpu.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289056} +2021-12-15 09:29:34 STATE: test-node-gpu.js passed: detect: samples/in/ai-upper.jpg default +2021-12-15 09:29:34 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 1 person: 1 {"score":0.96} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":16} +2021-12-15 09:29:34 DATA:  test-node-gpu.js result: performance: load: null total: 421 +2021-12-15 09:29:34 INFO:  test-node-gpu.js test: second instance +2021-12-15 09:29:35 STATE: test-node-gpu.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289056} +2021-12-15 09:29:35 STATE: test-node-gpu.js passed: detect: samples/in/ai-upper.jpg default +2021-12-15 09:29:35 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 1 person: 1 {"score":0.96} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":16} +2021-12-15 09:29:35 DATA:  test-node-gpu.js result: performance: load: null total: 375 +2021-12-15 09:29:35 INFO:  test-node-gpu.js test: concurrent +2021-12-15 09:29:35 STATE: test-node-gpu.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} +2021-12-15 09:29:35 STATE: test-node-gpu.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} +2021-12-15 09:29:35 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2021-12-15 09:29:36 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2021-12-15 09:29:36 STATE: test-node-gpu.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289056} +2021-12-15 09:29:36 STATE: test-node-gpu.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289056} +2021-12-15 09:29:36 STATE: test-node-gpu.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} +2021-12-15 09:29:37 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2021-12-15 09:29:37 STATE: test-node-gpu.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289056} +2021-12-15 09:29:37 STATE: test-node-gpu.js event: image +2021-12-15 09:29:37 STATE: test-node-gpu.js event: image +2021-12-15 09:29:37 STATE: test-node-gpu.js event: image +2021-12-15 09:29:40 STATE: test-node-gpu.js passed: detect: samples/in/ai-upper.jpg default +2021-12-15 09:29:40 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 1 person: 1 {"score":0.96} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":16} +2021-12-15 09:29:40 DATA:  test-node-gpu.js result: performance: load: null total: 3665 +2021-12-15 09:29:40 STATE: test-node-gpu.js passed: detect: samples/in/ai-upper.jpg default +2021-12-15 09:29:40 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 1 person: 1 {"score":0.96} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":16} +2021-12-15 09:29:40 DATA:  test-node-gpu.js result: performance: load: null total: 3665 +2021-12-15 09:29:40 STATE: test-node-gpu.js passed: detect: samples/in/ai-face.jpg default +2021-12-15 09:29:40 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 2 object: 1 person: 1 {"score":0.91} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":17} +2021-12-15 09:29:40 DATA:  test-node-gpu.js result: performance: load: null total: 4008 +2021-12-15 09:29:40 STATE: test-node-gpu.js passed: detect: samples/in/ai-face.jpg default +2021-12-15 09:29:40 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 2 object: 1 person: 1 {"score":0.91} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":17} +2021-12-15 09:29:40 DATA:  test-node-gpu.js result: performance: load: null total: 4008 +2021-12-15 09:29:40 STATE: test-node-gpu.js passed: detect: samples/in/ai-body.jpg default +2021-12-15 09:29:40 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 1 person: 1 {"score":0.93} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:29:40 DATA:  test-node-gpu.js result: performance: load: null total: 4008 +2021-12-15 09:29:40 STATE: test-node-gpu.js passed: detect: samples/in/ai-body.jpg default +2021-12-15 09:29:40 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 1 person: 1 {"score":0.93} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:29:40 DATA:  test-node-gpu.js result: performance: load: null total: 4008 +2021-12-15 09:29:40 STATE: test-node-gpu.js event: detect +2021-12-15 09:29:40 STATE: test-node-gpu.js passed: detect: samples/in/ai-upper.jpg default +2021-12-15 09:29:40 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 1 person: 1 {"score":0.96} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":16} +2021-12-15 09:29:40 DATA:  test-node-gpu.js result: performance: load: null total: 3415 +2021-12-15 09:29:40 STATE: test-node-gpu.js event: detect +2021-12-15 09:29:40 STATE: test-node-gpu.js event: detect +2021-12-15 09:29:40 STATE: test-node-gpu.js passed: detect: samples/in/ai-face.jpg default +2021-12-15 09:29:40 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 2 object: 1 person: 1 {"score":0.91} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":17} +2021-12-15 09:29:40 DATA:  test-node-gpu.js result: performance: load: null total: 3415 +2021-12-15 09:29:40 STATE: test-node-gpu.js passed: detect: samples/in/ai-body.jpg default +2021-12-15 09:29:40 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 1 person: 1 {"score":0.93} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:29:40 DATA:  test-node-gpu.js result: performance: load: null total: 3415 +2021-12-15 09:29:40 INFO:  test-node-gpu.js test: monkey-patch +2021-12-15 09:29:40 STATE: test-node-gpu.js event: image +2021-12-15 09:29:40 STATE: test-node-gpu.js event: detect +2021-12-15 09:29:40 STATE: test-node-gpu.js passed: monkey patch +2021-12-15 09:29:41 STATE: test-node-gpu.js passed: segmentation [65536] +2021-12-15 09:29:41 STATE: test-node-gpu.js passeed: equal usage +2021-12-15 09:29:41 INFO:  test-node-gpu.js test: input compare +2021-12-15 09:29:41 STATE: test-node-gpu.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} +2021-12-15 09:29:41 STATE: test-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2021-12-15 09:29:41 STATE: test-node-gpu.js passed: image compare 0 23.275441687091504 +2021-12-15 09:29:41 INFO:  test-node-gpu.js events: {"image":21,"detect":21,"warmup":2} +2021-12-15 09:29:41 INFO:  test-node-gpu.js tensors 1925 +2021-12-15 09:29:41 INFO:  test-node-gpu.js test complete: 23428 ms +2021-12-15 09:29:41 INFO:  +2021-12-15 09:29:41 INFO:  test-node-wasm.js start +2021-12-15 09:29:42 STATE: test-node-wasm.js passed: model server: https://vladmandic.github.io/human/models/ +2021-12-15 09:29:42 INFO:  test-node-wasm.js test: configuration validation +2021-12-15 09:29:42 STATE: test-node-wasm.js passed: configuration default validation [] +2021-12-15 09:29:42 STATE: test-node-wasm.js passed: configuration invalid validation [{"reason":"unknown property","where":"config.invalid = true"}] +2021-12-15 09:29:42 INFO:  test-node-wasm.js test: model load +2021-12-15 09:29:43 STATE: test-node-wasm.js passed: models loaded 22 12 [{"name":"ssrnetage","loaded":false},{"name":"gear","loaded":false},{"name":"blazeposedetect","loaded":false},{"name":"blazepose","loaded":false},{"name":"centernet","loaded":true},{"name":"efficientpose","loaded":false},{"name":"mobilefacenet","loaded":false},{"name":"emotion","loaded":true},{"name":"facedetect","loaded":true},{"name":"faceiris","loaded":true},{"name":"facemesh","loaded":true},{"name":"faceres","loaded":true},{"name":"ssrnetgender","loaded":false},{"name":"handpose","loaded":false},{"name":"handskeleton","loaded":true},{"name":"handtrack","loaded":true},{"name":"liveness","loaded":true},{"name":"movenet","loaded":true},{"name":"nanodet","loaded":false},{"name":"posenet","loaded":false},{"name":"segmentation","loaded":true},{"name":"antispoof","loaded":true}] +2021-12-15 09:29:43 INFO:  test-node-wasm.js test: warmup +2021-12-15 09:29:43 STATE: test-node-wasm.js passed: create human +2021-12-15 09:29:43 INFO:  test-node-wasm.js human version: 2.5.6 +2021-12-15 09:29:43 INFO:  test-node-wasm.js platform: linux x64 agent: NodeJS v17.2.0 +2021-12-15 09:29:43 INFO:  test-node-wasm.js tfjs version: 3.12.0 +2021-12-15 09:29:43 STATE: test-node-wasm.js passed: set backend: wasm +2021-12-15 09:29:43 STATE: test-node-wasm.js tensors 1919 +2021-12-15 09:29:43 STATE: test-node-wasm.js passed: load models +2021-12-15 09:29:43 STATE: test-node-wasm.js result: defined models: 22 loaded models: 12 +2021-12-15 09:29:43 STATE: test-node-wasm.js passed: warmup: none default +2021-12-15 09:29:43 DATA:  test-node-wasm.js result: face: 0 body: 0 hand: 0 gesture: 0 object: 0 person: 0 {} {} {} +2021-12-15 09:29:43 DATA:  test-node-wasm.js result: performance: load: null total: null +2021-12-15 09:29:43 STATE: test-node-wasm.js passed: warmup none result match +2021-12-15 09:29:43 STATE: test-node-wasm.js event: image +2021-12-15 09:29:44 STATE: test-node-wasm.js event: detect +2021-12-15 09:29:44 STATE: test-node-wasm.js event: warmup +2021-12-15 09:29:44 STATE: test-node-wasm.js passed: warmup: face default +2021-12-15 09:29:44 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 8 object: 1 person: 1 {"score":1,"age":30.6,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":3} +2021-12-15 09:29:44 DATA:  test-node-wasm.js result: performance: load: null total: 1214 +2021-12-15 09:29:44 STATE: test-node-wasm.js passed: warmup face result match +2021-12-15 09:29:44 STATE: test-node-wasm.js event: image +2021-12-15 09:29:45 STATE: test-node-wasm.js event: detect +2021-12-15 09:29:45 STATE: test-node-wasm.js event: warmup +2021-12-15 09:29:45 STATE: test-node-wasm.js passed: warmup: body default +2021-12-15 09:29:45 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:29:45 DATA:  test-node-wasm.js result: performance: load: null total: 731 +2021-12-15 09:29:45 STATE: test-node-wasm.js passed: warmup body result match +2021-12-15 09:29:45 STATE: test-node-wasm.js details: {"face":{"boxScore":0.93,"faceScore":1,"age":23.6,"gender":"female","genderScore":0.95},"emotion":[{"score":0.58,"emotion":"neutral"},{"score":0.24,"emotion":"fear"},{"score":0.11,"emotion":"sad"}],"body":{"score":0.92,"keypoints":17},"hand":{"boxScore":0.51,"fingerScore":0.73,"keypoints":21},"gestures":[{"face":0,"gesture":"facing right"},{"hand":0,"gesture":"palm forward"},{"hand":0,"gesture":"palm up"},{"hand":0,"gesture":"open palm"},{"iris":0,"gesture":"looking right"},{"iris":0,"gesture":"looking up"}]} +2021-12-15 09:29:45 INFO:  test-node-wasm.js test: details verification +2021-12-15 09:29:46 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} +2021-12-15 09:29:46 STATE: test-node-wasm.js event: image +2021-12-15 09:29:47 STATE: test-node-wasm.js event: detect +2021-12-15 09:29:47 STATE: test-node-wasm.js passed: detect: samples/in/ai-body.jpg default +2021-12-15 09:29:47 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:29:47 DATA:  test-node-wasm.js result: performance: load: null total: 897 +2021-12-15 09:29:47 STATE: test-node-wasm.js passed: details face length 1 +2021-12-15 09:29:47 STATE: test-node-wasm.js passed: details face score 1 0.93 1 +2021-12-15 09:29:47 STATE: test-node-wasm.js passed: details face age/gender 23.6 female 0.95 73.26 +2021-12-15 09:29:47 STATE: test-node-wasm.js passed: details face arrays 4 478 1024 +2021-12-15 09:29:47 STATE: test-node-wasm.js passed: details face emotion 3 {"score":0.58,"emotion":"neutral"} +2021-12-15 09:29:47 STATE: test-node-wasm.js passed: details face anti-spoofing 0.87 +2021-12-15 09:29:47 STATE: test-node-wasm.js passed: details face liveness 0.95 +2021-12-15 09:29:47 STATE: test-node-wasm.js passed: details body length 1 +2021-12-15 09:29:47 STATE: test-node-wasm.js passed: details body 0.92 17 6 +2021-12-15 09:29:47 STATE: test-node-wasm.js passed: details hand length 1 +2021-12-15 09:29:47 STATE: test-node-wasm.js passed: details hand 0.51 0.73 point +2021-12-15 09:29:47 STATE: test-node-wasm.js passed: details hand arrays 21 5 6 +2021-12-15 09:29:47 STATE: test-node-wasm.js passed: details gesture length 6 +2021-12-15 09:29:47 STATE: test-node-wasm.js passed: details gesture first {"face":0,"gesture":"facing right"} +2021-12-15 09:29:47 STATE: test-node-wasm.js passed: details object length 1 +2021-12-15 09:29:47 STATE: test-node-wasm.js passed: details object 0.72 person +2021-12-15 09:29:47 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,4] {"checksum":1413675264} +2021-12-15 09:29:47 STATE: test-node-wasm.js event: image +2021-12-15 09:29:48 STATE: test-node-wasm.js event: detect +2021-12-15 09:29:48 STATE: test-node-wasm.js passed: tensor shape: [1,1200,1200,4] dtype: float32 +2021-12-15 09:29:49 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1200,1200,4] {"checksum":1413675264} +2021-12-15 09:29:49 STATE: test-node-wasm.js event: image +2021-12-15 09:29:50 STATE: test-node-wasm.js event: detect +2021-12-15 09:29:50 STATE: test-node-wasm.js passed: tensor shape: [1200,1200,4] dtype: float32 +2021-12-15 09:29:50 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} +2021-12-15 09:29:50 STATE: test-node-wasm.js event: image +2021-12-15 09:29:51 STATE: test-node-wasm.js event: detect +2021-12-15 09:29:51 STATE: test-node-wasm.js passed: tensor shape: [1,1200,1200,3] dtype: float32 +2021-12-15 09:29:52 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1200,1200,3] {"checksum":1038921856} +2021-12-15 09:29:52 STATE: test-node-wasm.js event: image +2021-12-15 09:29:53 STATE: test-node-wasm.js event: detect +2021-12-15 09:29:53 STATE: test-node-wasm.js passed: tensor shape: [1200,1200,3] dtype: float32 +2021-12-15 09:29:53 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,4] {"checksum":1371996871} +2021-12-15 09:29:53 STATE: test-node-wasm.js event: image +2021-12-15 09:29:54 STATE: test-node-wasm.js event: detect +2021-12-15 09:29:54 STATE: test-node-wasm.js passed: tensor shape: [1,1200,1200,4] dtype: int32 +2021-12-15 09:29:54 INFO:  test-node-wasm.js test default +2021-12-15 09:29:55 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} +2021-12-15 09:29:55 STATE: test-node-wasm.js event: image +2021-12-15 09:29:56 STATE: test-node-wasm.js event: detect +2021-12-15 09:29:56 STATE: test-node-wasm.js passed: detect: samples/in/ai-body.jpg default +2021-12-15 09:29:56 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:29:56 DATA:  test-node-wasm.js result: performance: load: null total: 969 +2021-12-15 09:29:56 STATE: test-node-wasm.js passed: default result face match 1 female 0.94 +2021-12-15 09:29:56 INFO:  test-node-wasm.js test sync +2021-12-15 09:29:56 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} +2021-12-15 09:29:56 STATE: test-node-wasm.js event: image +2021-12-15 09:29:57 STATE: test-node-wasm.js event: detect +2021-12-15 09:29:57 STATE: test-node-wasm.js passed: detect: samples/in/ai-body.jpg default +2021-12-15 09:29:57 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:29:57 DATA:  test-node-wasm.js result: performance: load: null total: 942 +2021-12-15 09:29:57 STATE: test-node-wasm.js passed: default sync 1 female 0.94 +2021-12-15 09:29:57 INFO:  test-node-wasm.js test: image process +2021-12-15 09:29:57 STATE: test-node-wasm.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34697856} +2021-12-15 09:29:57 STATE: test-node-wasm.js passed: image input null [1,256,256,3] +2021-12-15 09:29:57 INFO:  test-node-wasm.js test: image null +2021-12-15 09:29:57 STATE: test-node-wasm.js passed: invalid input could not convert input to tensor +2021-12-15 09:29:57 INFO:  test-node-wasm.js test face similarity +2021-12-15 09:29:57 STATE: test-node-wasm.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34697856} +2021-12-15 09:29:57 STATE: test-node-wasm.js event: image +2021-12-15 09:29:58 STATE: test-node-wasm.js event: detect +2021-12-15 09:29:58 STATE: test-node-wasm.js passed: detect: samples/in/ai-face.jpg default +2021-12-15 09:29:58 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 8 object: 1 person: 1 {"score":1,"age":30.6,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":3} +2021-12-15 09:29:58 DATA:  test-node-wasm.js result: performance: load: null total: 822 +2021-12-15 09:29:59 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} +2021-12-15 09:29:59 STATE: test-node-wasm.js event: image +2021-12-15 09:30:00 STATE: test-node-wasm.js event: detect +2021-12-15 09:30:00 STATE: test-node-wasm.js passed: detect: samples/in/ai-body.jpg default +2021-12-15 09:30:00 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:30:00 DATA:  test-node-wasm.js result: performance: load: null total: 884 +2021-12-15 09:30:00 STATE: test-node-wasm.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151155104} +2021-12-15 09:30:00 STATE: test-node-wasm.js event: image +2021-12-15 09:30:01 STATE: test-node-wasm.js event: detect +2021-12-15 09:30:01 STATE: test-node-wasm.js passed: detect: samples/in/ai-upper.jpg default +2021-12-15 09:30:01 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 1 person: 1 {"score":1,"age":23.5,"gender":"female"} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":7} +2021-12-15 09:30:01 DATA:  test-node-wasm.js result: performance: load: null total: 794 +2021-12-15 09:30:01 STATE: test-node-wasm.js passed: face descriptor +2021-12-15 09:30:01 STATE: test-node-wasm.js passed: face similarity {"similarity":[1,0.5502973648074503,0.49721702784432575],"descriptors":[1024,1024,1024]} +2021-12-15 09:30:01 INFO:  test-node-wasm.js test face matching +2021-12-15 09:30:01 STATE: test-node-wasm.js passed: face database 57 +2021-12-15 09:30:01 STATE: test-node-wasm.js passed: face match {"first":{"index":4,"similarity":0.933916055561213}} {"second":{"index":4,"similarity":0.5456802676954908}} {"third":{"index":4,"similarity":0.4681398205326839}} +2021-12-15 09:30:01 INFO:  test-node-wasm.js test object +2021-12-15 09:30:02 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} +2021-12-15 09:30:02 STATE: test-node-wasm.js event: image +2021-12-15 09:30:02 STATE: test-node-wasm.js event: detect +2021-12-15 09:30:02 STATE: test-node-wasm.js passed: detect: samples/in/ai-body.jpg default +2021-12-15 09:30:02 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:30:02 DATA:  test-node-wasm.js result: performance: load: null total: 908 +2021-12-15 09:30:02 STATE: test-node-wasm.js passed: object result match +2021-12-15 09:30:02 INFO:  test-node-wasm.js test sensitive +2021-12-15 09:30:03 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} +2021-12-15 09:30:03 STATE: test-node-wasm.js event: image +2021-12-15 09:30:04 STATE: test-node-wasm.js event: detect +2021-12-15 09:30:04 STATE: test-node-wasm.js passed: detect: samples/in/ai-body.jpg default +2021-12-15 09:30:04 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 2 gesture: 8 object: 1 person: 1 {"score":1,"age":23.6,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:30:04 DATA:  test-node-wasm.js result: performance: load: null total: 784 +2021-12-15 09:30:04 STATE: test-node-wasm.js passed: sensitive result match +2021-12-15 09:30:04 STATE: test-node-wasm.js passed: sensitive face result match +2021-12-15 09:30:04 STATE: test-node-wasm.js passed: sensitive face emotion result [{"score":0.92,"emotion":"neutral"}] +2021-12-15 09:30:04 STATE: test-node-wasm.js passed: sensitive body result match +2021-12-15 09:30:04 STATE: test-node-wasm.js passed: sensitive hand result match +2021-12-15 09:30:04 INFO:  test-node-wasm.js test detectors +2021-12-15 09:30:04 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} +2021-12-15 09:30:04 STATE: test-node-wasm.js event: image +2021-12-15 09:30:05 STATE: test-node-wasm.js event: detect +2021-12-15 09:30:05 STATE: test-node-wasm.js passed: detect: samples/in/ai-body.jpg default +2021-12-15 09:30:05 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 1 person: 1 {"score":0.93} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:30:05 DATA:  test-node-wasm.js result: performance: load: null total: 528 +2021-12-15 09:30:05 STATE: test-node-wasm.js passed: detector result face match +2021-12-15 09:30:05 STATE: test-node-wasm.js passed: detector result hand match +2021-12-15 09:30:05 INFO:  test-node-wasm.js test: multi-instance +2021-12-15 09:30:05 STATE: test-node-wasm.js event: image +2021-12-15 09:30:06 STATE: test-node-wasm.js event: detect +2021-12-15 09:30:06 STATE: test-node-wasm.js passed: detect: random default +2021-12-15 09:30:06 DATA:  test-node-wasm.js result: face: 0 body: 1 hand: 0 gesture: 0 object: 0 person: 0 {} {} {"score":0.06,"keypoints":15} +2021-12-15 09:30:06 DATA:  test-node-wasm.js result: performance: load: null total: 531 +2021-12-15 09:30:06 INFO:  test-node-wasm.js test: first instance +2021-12-15 09:30:06 STATE: test-node-wasm.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151155104} +2021-12-15 09:30:06 STATE: test-node-wasm.js passed: detect: samples/in/ai-upper.jpg default +2021-12-15 09:30:06 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 1 person: 1 {"score":0.96} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":16} +2021-12-15 09:30:06 DATA:  test-node-wasm.js result: performance: load: null total: 578 +2021-12-15 09:30:06 INFO:  test-node-wasm.js test: second instance +2021-12-15 09:30:07 STATE: test-node-wasm.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151155104} +2021-12-15 09:30:07 STATE: test-node-wasm.js passed: detect: samples/in/ai-upper.jpg default +2021-12-15 09:30:07 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 1 person: 1 {"score":0.96} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":16} +2021-12-15 09:30:07 DATA:  test-node-wasm.js result: performance: load: null total: 529 +2021-12-15 09:30:07 INFO:  test-node-wasm.js test: concurrent +2021-12-15 09:30:07 STATE: test-node-wasm.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34697856} +2021-12-15 09:30:07 STATE: test-node-wasm.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34697856} +2021-12-15 09:30:08 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} +2021-12-15 09:30:09 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} +2021-12-15 09:30:09 STATE: test-node-wasm.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151155104} +2021-12-15 09:30:09 STATE: test-node-wasm.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151155104} +2021-12-15 09:30:09 STATE: test-node-wasm.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34697856} +2021-12-15 09:30:10 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} +2021-12-15 09:30:10 STATE: test-node-wasm.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151155104} +2021-12-15 09:30:10 STATE: test-node-wasm.js event: image +2021-12-15 09:30:10 STATE: test-node-wasm.js event: image +2021-12-15 09:30:10 STATE: test-node-wasm.js event: image +2021-12-15 09:30:14 STATE: test-node-wasm.js passed: detect: samples/in/ai-upper.jpg default +2021-12-15 09:30:14 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 1 person: 1 {"score":0.96} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":16} +2021-12-15 09:30:14 DATA:  test-node-wasm.js result: performance: load: null total: 4975 +2021-12-15 09:30:14 STATE: test-node-wasm.js passed: detect: samples/in/ai-upper.jpg default +2021-12-15 09:30:14 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 1 person: 1 {"score":0.96} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":16} +2021-12-15 09:30:14 DATA:  test-node-wasm.js result: performance: load: null total: 4975 +2021-12-15 09:30:14 STATE: test-node-wasm.js passed: detect: samples/in/ai-face.jpg default +2021-12-15 09:30:14 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 2 object: 1 person: 1 {"score":0.91} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":17} +2021-12-15 09:30:14 DATA:  test-node-wasm.js result: performance: load: null total: 5506 +2021-12-15 09:30:14 STATE: test-node-wasm.js passed: detect: samples/in/ai-face.jpg default +2021-12-15 09:30:14 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 2 object: 1 person: 1 {"score":0.91} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":17} +2021-12-15 09:30:14 DATA:  test-node-wasm.js result: performance: load: null total: 5506 +2021-12-15 09:30:14 STATE: test-node-wasm.js passed: detect: samples/in/ai-body.jpg default +2021-12-15 09:30:14 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 1 person: 1 {"score":0.93} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:30:14 DATA:  test-node-wasm.js result: performance: load: null total: 5506 +2021-12-15 09:30:14 STATE: test-node-wasm.js passed: detect: samples/in/ai-body.jpg default +2021-12-15 09:30:14 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 1 person: 1 {"score":0.93} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:30:14 DATA:  test-node-wasm.js result: performance: load: null total: 5506 +2021-12-15 09:30:14 STATE: test-node-wasm.js event: detect +2021-12-15 09:30:14 STATE: test-node-wasm.js passed: detect: samples/in/ai-upper.jpg default +2021-12-15 09:30:14 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 1 person: 1 {"score":0.96} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":16} +2021-12-15 09:30:14 DATA:  test-node-wasm.js result: performance: load: null total: 4631 +2021-12-15 09:30:14 STATE: test-node-wasm.js event: detect +2021-12-15 09:30:14 STATE: test-node-wasm.js event: detect +2021-12-15 09:30:14 STATE: test-node-wasm.js passed: detect: samples/in/ai-face.jpg default +2021-12-15 09:30:14 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 2 object: 1 person: 1 {"score":0.91} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":17} +2021-12-15 09:30:14 DATA:  test-node-wasm.js result: performance: load: null total: 4631 +2021-12-15 09:30:14 STATE: test-node-wasm.js passed: detect: samples/in/ai-body.jpg default +2021-12-15 09:30:14 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 1 person: 1 {"score":0.93} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2021-12-15 09:30:14 DATA:  test-node-wasm.js result: performance: load: null total: 4631 +2021-12-15 09:30:14 INFO:  test-node-wasm.js test: monkey-patch +2021-12-15 09:30:14 STATE: test-node-wasm.js event: image +2021-12-15 09:30:15 STATE: test-node-wasm.js event: detect +2021-12-15 09:30:15 STATE: test-node-wasm.js passed: monkey patch +2021-12-15 09:30:15 STATE: test-node-wasm.js passed: segmentation [65536] +2021-12-15 09:30:15 STATE: test-node-wasm.js passeed: equal usage +2021-12-15 09:30:15 INFO:  test-node-wasm.js test: input compare +2021-12-15 09:30:15 STATE: test-node-wasm.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34697856} +2021-12-15 09:30:16 STATE: test-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} +2021-12-15 09:30:16 STATE: test-node-wasm.js passed: image compare 0 23.280073018790848 +2021-12-15 09:30:16 INFO:  test-node-wasm.js events: {"image":21,"detect":21,"warmup":2} +2021-12-15 09:30:16 INFO:  test-node-wasm.js tensors 1927 +2021-12-15 09:30:16 INFO:  test-node-wasm.js test complete: 34103 ms +2021-12-15 09:30:16 INFO:  all tests complete +2021-12-15 09:30:16 INFO:  failed: {"count":0,"messages":[]} +2021-12-15 09:30:16 INFO:  status: {"test":"test-node.js","passed":101,"failed":0} +2021-12-15 09:30:16 INFO:  status: {"test":"test-node-gpu.js","passed":101,"failed":0} +2021-12-15 09:30:16 INFO:  status: {"test":"test-node-wasm.js","passed":102,"failed":0} diff --git a/typedoc/classes/Env.html b/typedoc/classes/Env.html index 4ec31287..de9a937e 100644 --- a/typedoc/classes/Env.html +++ b/typedoc/classes/Env.html @@ -1,4 +1,4 @@ -Env | @vladmandic/human - v2.5.5
Options
All
  • Public
  • Public/Protected
  • All
Menu
+Env | @vladmandic/human - v2.5.6
Options
All
  • Public
  • Public/Protected
  • All
Menu

Env class that holds detected capabilities

Hierarchy

  • Env

Index

Constructors

constructor

Properties

Canvas

Canvas: undefined

MonkeyPatch for Canvas

diff --git a/typedoc/classes/GraphModel.html b/typedoc/classes/GraphModel.html index 8108b26d..66e3c6c8 100644 --- a/typedoc/classes/GraphModel.html +++ b/typedoc/classes/GraphModel.html @@ -1,4 +1,4 @@ -GraphModel | @vladmandic/human - v2.5.5
Options
All
  • Public
  • Public/Protected
  • All
Menu
+GraphModel | @vladmandic/human - v2.5.6
Options
All
  • Public
  • Public/Protected
  • All
Menu

A tf.GraphModel is a directed, acyclic graph built from a SavedModel GraphDef and allows inference execution.

A tf.GraphModel can only be created by loading from a model converted from diff --git a/typedoc/classes/Human.html b/typedoc/classes/Human.html index 61010428..76c98c89 100644 --- a/typedoc/classes/Human.html +++ b/typedoc/classes/Human.html @@ -1,4 +1,4 @@ -Human | @vladmandic/human - v2.5.5

Options
All
  • Public
  • Public/Protected
  • All
Menu
+Human | @vladmandic/human - v2.5.6
Options
All
  • Public
  • Public/Protected
  • All
Menu

Human* library main class

All methods and properties are available only as members of Human class