From 92d3333e525009a3a61c2922ed6bfeb2f9f72cf7 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Fri, 21 May 2021 06:54:02 -0400 Subject: [PATCH] update dependencies --- CHANGELOG.md | 7 +- dist/human.esm-nobundle.js | 2 +- dist/human.esm.js | 2 +- dist/human.js | 2 +- dist/human.node-gpu.js | 2 +- dist/human.node-wasm.js | 2 +- dist/human.node.js | 2 +- server/build.log | 85 ++----- test/test.log | 507 +++++++++++++------------------------ 9 files changed, 197 insertions(+), 414 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f87daaee..78f74ea0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # @vladmandic/human -Version: **1.9.0** +Version: **1.9.1** Description: **Human: AI-powered 3D Face Detection & Rotation Tracking, Face Description & Recognition, Body Pose Tracking, 3D Hand & Finger Tracking, Iris Analysis, Age & Gender & Emotion Prediction, Gesture Recognition** Author: **Vladimir Mandic ** @@ -9,7 +9,10 @@ Repository: **** ## Changelog -### **HEAD -> main** 2021/05/19 mandic00@live.com +### **1.9.1** 2021/05/21 mandic00@live.com + + +### **origin/main** 2021/05/20 mandic00@live.com - sanitize server input - remove nanodet weights from default distribution diff --git a/dist/human.esm-nobundle.js b/dist/human.esm-nobundle.js index ef8ffc09..f8cb577a 100644 --- a/dist/human.esm-nobundle.js +++ b/dist/human.esm-nobundle.js @@ -731,5 +731,5 @@ AAAAAAJAAAAAAAAAAAAAABAJEAAAAAAAAAAAAAAAIEoBKAAAAAAAAAAAAAAABAlAAAAAAAIAAAAA BAkBAkBAkBAlACEgMZjdjbFW8bWrEx8YWANb6Fp+bfwab+vLDKMFK9qxH5L0bAr8OPRPKz2AY7J2 SbAjYZAI2E7AIEgIEgIEgMdkSy2NgY7MdlmyNoBXsxmFuyNgVTVjNV3KjlBRNTlXTVHKCrlIqt5T lBhEMohlFerLlBjEMohMVTEARDKCITsAk2AEgAAAkAAAAAAAAAAAAAAAAAAAAAAAASAAAAAAAAD/ -2Q==`;var $A="1.9.0";var f0,P0,M0,r0,i0,m0,C0,z0,Y0,J0,K0,D0,L2=class{constructor(e={}){q(this,f0,void 0);q(this,P0,void 0);q(this,M0,void 0);q(this,r0,void 0);q(this,i0,void 0);q(this,m0,void 0);this.analyze=(...e)=>{if(!Z(this,P0))return;let t=this.tf.engine().state.numTensors,o=Z(this,f0);Y(this,f0,t);let s=t-o;s!==0&&u(...e,s)};q(this,C0,e=>{if(!Z(this,M0))return null;if(!e)return"input is not defined";if(this.tf.ENV.flags.IS_NODE&&!(e instanceof i.Tensor))return"input must be a tensor";try{this.tf.getBackend()}catch(t){return"backend not loaded"}return null});q(this,z0,async(e=!1)=>{var t;if(this.config.backend&&this.config.backend.length>0&&e||this.tf.getBackend()!==this.config.backend){let o=S();if(this.state="backend",this.config.backend&&this.config.backend.length>0){if(typeof window=="undefined"&&typeof WorkerGlobalScope!="undefined"&&this.config.debug&&u("running inside web worker"),this.tf.ENV.flags.IS_BROWSER&&this.config.backend==="tensorflow"&&(this.config.backend="webgl"),this.tf.ENV.flags.IS_NODE&&(this.config.backend==="webgl"||this.config.backend==="humangl")&&(this.config.backend="tensorflow"),this.config.debug&&u("setting backend:",this.config.backend),this.config.backend==="wasm"){if(this.config.debug&&u("wasm path:",this.config.wasmPath),typeof((t=this.tf)==null?void 0:t.setWasmPaths)!="undefined")this.tf.setWasmPaths(this.config.wasmPath);else throw new Error("Human: WASM backend is not loaded");let s=await this.tf.env().getAsync("WASM_HAS_SIMD_SUPPORT"),r=await this.tf.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT");this.config.debug&&u(`wasm execution: ${s?"SIMD":"no SIMD"} ${r?"multithreaded":"singlethreaded"}`),this.config.debug&&!s&&u("warning: wasm simd support is not enabled")}this.config.backend==="humangl"&&sA();try{await this.tf.setBackend(this.config.backend)}catch(s){u("error: cannot set backend:",this.config.backend,s)}}if(this.tf.enableProdMode(),this.tf.getBackend()==="webgl"||this.tf.getBackend()==="humangl"){this.tf.ENV.set("CHECK_COMPUTATION_FOR_ERRORS",!1),this.tf.ENV.set("WEBGL_CPU_FORWARD",!0),i.ENV.set("WEBGL_FORCE_F16_TEXTURES",!0),this.tf.ENV.set("WEBGL_PACK_DEPTHWISECONV",!0),typeof this.config.deallocate!="undefined"&&(u("changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:",!0),this.tf.ENV.set("WEBGL_DELETE_TEXTURE_THRESHOLD",0));let s=await this.tf.backend().getGPGPUContext().gl;this.config.debug&&u(`gl version:${s.getParameter(s.VERSION)} renderer:${s.getParameter(s.RENDERER)}`)}await this.tf.ready(),this.perf.backend=Math.trunc(S()-o)}});q(this,Y0,async e=>{if(this.config.cacheSensitivity===0)return!1;let t=40,o=e.resizeBilinear([Math.trunc(e.shape[1]/t),Math.trunc(e.shape[2]/t)]),s=this.tf.sum(o),r=s.dataSync()[0];s.dispose(),o.dispose();let n=Math.max(r,Z(this,i0))/Math.min(r,Z(this,i0))-1;Y(this,i0,r);let a=n4*this.config.cacheSensitivity?0:n),a});q(this,J0,async()=>{let e=(s,r="application/octet-stream")=>fetch(`data:${r};base64,${s}`).then(n=>n.blob()),t,o;switch(this.config.warmup){case"face":t=await e(B0);break;case"full":t=await e(U0);break;default:t=null}if(t){let s=await createImageBitmap(t);o=await this.detect(s,this.config),s.close()}return o});q(this,K0,async()=>new Promise(e=>{let t,o=0;switch(this.config.warmup){case"face":o=256,t="data:image/jpeg;base64,"+B0;break;case"full":case"body":o=1200,t="data:image/jpeg;base64,"+U0;break;default:t=null}let s=new Image;s.onload=async()=>{let r=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(o,o):document.createElement("canvas");r.width=s.naturalWidth,r.height=s.naturalHeight;let n=r.getContext("2d");n==null||n.drawImage(s,0,0);let a=await this.detect(r,this.config);e(a)},t?s.src=t:e(null)}));q(this,D0,async()=>{let e=s=>Buffer.from(s,"base64"),t;if(this.config.warmup==="face"&&(t=e(B0)),(this.config.warmup==="body"||this.config.warmup==="full")&&(t=e(U0)),!t)return null;let o;if(typeof i.node!="undefined"){let s=i.node.decodeJpeg(t),r=s.expandDims(0);this.tf.dispose(s),o=await this.detect(r,this.config),this.tf.dispose(r)}else this.config.debug&&u("Warmup tfjs-node not loaded");return o});this.tf=i,this.draw=J5,this.version=$A,this.config=B(_5,e),this.state="idle",Y(this,f0,0),Y(this,P0,!1),Y(this,M0,!1),Y(this,r0,!0),Y(this,m0,0),this.perf={},this.models={face:null,posenet:null,blazepose:null,efficientpose:null,handpose:null,iris:null,age:null,gender:null,emotion:null,embedding:null,nanodet:null,centernet:null,faceres:null},this.image=t=>C5(t,this.config),this.classes={facemesh:r5,emotion:y5,faceres:m5,body:this.config.body.modelPath.includes("posenet")?z5:I5,hand:W5,nanodet:H5,centernet:U5},this.faceTriangulation=uA,this.faceUVMap=pA,this.sysinfo=$5(),Y(this,i0,1)}similarity(e,t){return d5(e,t)}enhance(e){return f5(e)}match(e,t,o=0){return TA(e,t,o)}async load(e={}){this.state="load";let t=S();e&&(this.config=B(this.config,e)),Z(this,r0)&&(this.config.debug&&u(`version: ${this.version}`),this.config.debug&&u(`tfjs version: ${this.tf.version_core}`),this.config.debug&&u("platform:",this.sysinfo.platform),this.config.debug&&u("agent:",this.sysinfo.agent),await Z(this,z0).call(this,!0),this.tf.ENV.flags.IS_BROWSER&&(this.config.debug&&u("configuration:",this.config),this.config.debug&&u("tf flags:",this.tf.ENV.flags))),this.config.async?[this.models.face,this.models.emotion,this.models.handpose,this.models.posenet,this.models.blazepose,this.models.nanodet,this.models.centernet,this.models.faceres]=await Promise.all([this.models.face||(this.config.face.enabled?s5(this.config):null),this.models.emotion||(this.config.face.enabled&&this.config.face.emotion.enabled?x5(this.config):null),this.models.handpose||(this.config.hand.enabled?w5(this.config):null),this.models.posenet||(this.config.body.enabled&&this.config.body.modelPath.includes("posenet")?M5(this.config):null),this.models.blazepose||(this.config.body.enabled&&this.config.body.modelPath.includes("blazepose")?k5(this.config):null),this.models.nanodet||(this.config.object.enabled&&this.config.object.modelPath.includes("nanodet")?V5(this.config):null),this.models.centernet||(this.config.object.enabled&&this.config.object.modelPath.includes("centernet")?q5(this.config):null),this.models.faceres||(this.config.face.enabled&&this.config.face.description.enabled?c5(this.config):null)]):(this.config.face.enabled&&!this.models.face&&(this.models.face=await s5(this.config)),this.config.face.enabled&&this.config.face.emotion.enabled&&!this.models.emotion&&(this.models.emotion=await x5(this.config)),this.config.hand.enabled&&!this.models.handpose&&(this.models.handpose=await w5(this.config)),this.config.body.enabled&&!this.models.posenet&&this.config.body.modelPath.includes("posenet")&&(this.models.posenet=await M5(this.config)),this.config.body.enabled&&!this.models.blazepose&&this.config.body.modelPath.includes("blazepose")&&(this.models.blazepose=await k5(this.config)),this.config.object.enabled&&!this.models.nanodet&&this.config.object.modelPath.includes("nanodet")&&(this.models.nanodet=await V5(this.config)),this.config.object.enabled&&!this.models.centernet&&this.config.object.modelPath.includes("centernet")&&(this.models.centernet=await q5(this.config)),this.config.face.enabled&&this.config.face.description.enabled&&!this.models.faceres&&(this.models.faceres=await c5(this.config))),Z(this,r0)&&(this.config.debug&&u("tf engine state:",this.tf.engine().state.numBytes,"bytes",this.tf.engine().state.numTensors,"tensors"),Y(this,r0,!1));let o=Math.trunc(S()-t);o>(this.perf.load||0)&&(this.perf.load=o)}async detect(e,t={}){return new Promise(async o=>{this.state="config";let s;this.config=B(this.config,t),this.state="check";let r=Z(this,C0).call(this,e);r&&(u(r,e),o({error:r}));let n=S();await Z(this,z0).call(this),await this.load(),s=S();let a=C5(e,this.config);if(!a||!a.tensor){u("could not convert input to tensor"),o({error:"could not convert input to tensor"});return}this.perf.image=Math.trunc(S()-s),this.analyze("Get Image:"),s=S(),this.config.skipFrame=await Z(this,Y0).call(this,a.tensor),this.perf.frames||(this.perf.frames=0),this.perf.cached||(this.perf.cached=0),this.perf.frames++,this.config.skipFrame&&this.perf.cached++,this.perf.changed=Math.trunc(S()-s),this.analyze("Check Changed:");let x,y,d,l,f;this.config.async?(d=this.config.face.enabled?h5(this,a.tensor):[],this.perf.face&&delete this.perf.face):(this.state="run:face",s=S(),d=this.config.face.enabled?await h5(this,a.tensor):[],f=Math.trunc(S()-s),f>0&&(this.perf.face=f)),this.analyze("Start Body:"),this.config.async?(this.config.body.modelPath.includes("posenet")?x=this.config.body.enabled?P5(a.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")&&(x=this.config.body.enabled?N5(a.tensor,this.config):[]),this.perf.body&&delete this.perf.body):(this.state="run:body",s=S(),this.config.body.modelPath.includes("posenet")?x=this.config.body.enabled?await P5(a.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")&&(x=this.config.body.enabled?await N5(a.tensor,this.config):[]),f=Math.trunc(S()-s),f>0&&(this.perf.body=f)),this.analyze("End Body:"),this.analyze("Start Hand:"),this.config.async?(y=this.config.hand.enabled?S5(a.tensor,this.config):[],this.perf.hand&&delete this.perf.hand):(this.state="run:hand",s=S(),y=this.config.hand.enabled?await S5(a.tensor,this.config):[],f=Math.trunc(S()-s),f>0&&(this.perf.hand=f)),this.analyze("End Hand:"),this.analyze("Start Object:"),this.config.async?(this.config.object.modelPath.includes("nanodet")?l=this.config.object.enabled?L5(a.tensor,this.config):[]:this.config.object.modelPath.includes("centernet")&&(l=this.config.object.enabled?B5(a.tensor,this.config):[]),this.perf.object&&delete this.perf.object):(this.state="run:object",s=S(),this.config.object.modelPath.includes("nanodet")?l=this.config.object.enabled?await L5(a.tensor,this.config):[]:this.config.object.modelPath.includes("centernet")&&(l=this.config.object.enabled?await B5(a.tensor,this.config):[]),f=Math.trunc(S()-s),f>0&&(this.perf.object=f)),this.analyze("End Object:"),this.config.async&&([d,x,y,l]=await Promise.all([d,x,y,l])),i.dispose(a.tensor);let p=[];this.config.gesture.enabled&&(s=S(),p=[...UA(d),...BA(x),...YA(y),...CA(d)],this.config.async?this.perf.gesture&&delete this.perf.gesture:this.perf.gesture=Math.trunc(S()-s)),this.perf.total=Math.trunc(S()-n),this.state="idle";let z={face:d,body:x,hand:y,gesture:p,object:l,performance:this.perf,canvas:a.canvas};o(z)})}async warmup(e={}){let t=S();if(e&&(this.config=B(this.config,e)),!this.config.warmup||this.config.warmup==="none")return{error:"null"};let o;typeof createImageBitmap=="function"?o=await Z(this,J0).call(this):typeof Image!="undefined"?o=await Z(this,K0).call(this):o=await Z(this,D0).call(this);let s=S();return this.config.debug&&u("Warmup",this.config.warmup,Math.round(s-t),"ms",o),o}};f0=new WeakMap,P0=new WeakMap,M0=new WeakMap,r0=new WeakMap,i0=new WeakMap,m0=new WeakMap,C0=new WeakMap,z0=new WeakMap,Y0=new WeakMap,J0=new WeakMap,K0=new WeakMap,D0=new WeakMap;export{L2 as Human,L2 as default}; +2Q==`;var $A="1.9.1";var f0,P0,M0,r0,i0,m0,C0,z0,Y0,J0,K0,D0,L2=class{constructor(e={}){q(this,f0,void 0);q(this,P0,void 0);q(this,M0,void 0);q(this,r0,void 0);q(this,i0,void 0);q(this,m0,void 0);this.analyze=(...e)=>{if(!Z(this,P0))return;let t=this.tf.engine().state.numTensors,o=Z(this,f0);Y(this,f0,t);let s=t-o;s!==0&&u(...e,s)};q(this,C0,e=>{if(!Z(this,M0))return null;if(!e)return"input is not defined";if(this.tf.ENV.flags.IS_NODE&&!(e instanceof i.Tensor))return"input must be a tensor";try{this.tf.getBackend()}catch(t){return"backend not loaded"}return null});q(this,z0,async(e=!1)=>{var t;if(this.config.backend&&this.config.backend.length>0&&e||this.tf.getBackend()!==this.config.backend){let o=S();if(this.state="backend",this.config.backend&&this.config.backend.length>0){if(typeof window=="undefined"&&typeof WorkerGlobalScope!="undefined"&&this.config.debug&&u("running inside web worker"),this.tf.ENV.flags.IS_BROWSER&&this.config.backend==="tensorflow"&&(this.config.backend="webgl"),this.tf.ENV.flags.IS_NODE&&(this.config.backend==="webgl"||this.config.backend==="humangl")&&(this.config.backend="tensorflow"),this.config.debug&&u("setting backend:",this.config.backend),this.config.backend==="wasm"){if(this.config.debug&&u("wasm path:",this.config.wasmPath),typeof((t=this.tf)==null?void 0:t.setWasmPaths)!="undefined")this.tf.setWasmPaths(this.config.wasmPath);else throw new Error("Human: WASM backend is not loaded");let s=await this.tf.env().getAsync("WASM_HAS_SIMD_SUPPORT"),r=await this.tf.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT");this.config.debug&&u(`wasm execution: ${s?"SIMD":"no SIMD"} ${r?"multithreaded":"singlethreaded"}`),this.config.debug&&!s&&u("warning: wasm simd support is not enabled")}this.config.backend==="humangl"&&sA();try{await this.tf.setBackend(this.config.backend)}catch(s){u("error: cannot set backend:",this.config.backend,s)}}if(this.tf.enableProdMode(),this.tf.getBackend()==="webgl"||this.tf.getBackend()==="humangl"){this.tf.ENV.set("CHECK_COMPUTATION_FOR_ERRORS",!1),this.tf.ENV.set("WEBGL_CPU_FORWARD",!0),i.ENV.set("WEBGL_FORCE_F16_TEXTURES",!0),this.tf.ENV.set("WEBGL_PACK_DEPTHWISECONV",!0),typeof this.config.deallocate!="undefined"&&(u("changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:",!0),this.tf.ENV.set("WEBGL_DELETE_TEXTURE_THRESHOLD",0));let s=await this.tf.backend().getGPGPUContext().gl;this.config.debug&&u(`gl version:${s.getParameter(s.VERSION)} renderer:${s.getParameter(s.RENDERER)}`)}await this.tf.ready(),this.perf.backend=Math.trunc(S()-o)}});q(this,Y0,async e=>{if(this.config.cacheSensitivity===0)return!1;let t=40,o=e.resizeBilinear([Math.trunc(e.shape[1]/t),Math.trunc(e.shape[2]/t)]),s=this.tf.sum(o),r=s.dataSync()[0];s.dispose(),o.dispose();let n=Math.max(r,Z(this,i0))/Math.min(r,Z(this,i0))-1;Y(this,i0,r);let a=n4*this.config.cacheSensitivity?0:n),a});q(this,J0,async()=>{let e=(s,r="application/octet-stream")=>fetch(`data:${r};base64,${s}`).then(n=>n.blob()),t,o;switch(this.config.warmup){case"face":t=await e(B0);break;case"full":t=await e(U0);break;default:t=null}if(t){let s=await createImageBitmap(t);o=await this.detect(s,this.config),s.close()}return o});q(this,K0,async()=>new Promise(e=>{let t,o=0;switch(this.config.warmup){case"face":o=256,t="data:image/jpeg;base64,"+B0;break;case"full":case"body":o=1200,t="data:image/jpeg;base64,"+U0;break;default:t=null}let s=new Image;s.onload=async()=>{let r=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(o,o):document.createElement("canvas");r.width=s.naturalWidth,r.height=s.naturalHeight;let n=r.getContext("2d");n==null||n.drawImage(s,0,0);let a=await this.detect(r,this.config);e(a)},t?s.src=t:e(null)}));q(this,D0,async()=>{let e=s=>Buffer.from(s,"base64"),t;if(this.config.warmup==="face"&&(t=e(B0)),(this.config.warmup==="body"||this.config.warmup==="full")&&(t=e(U0)),!t)return null;let o;if(typeof i.node!="undefined"){let s=i.node.decodeJpeg(t),r=s.expandDims(0);this.tf.dispose(s),o=await this.detect(r,this.config),this.tf.dispose(r)}else this.config.debug&&u("Warmup tfjs-node not loaded");return o});this.tf=i,this.draw=J5,this.version=$A,this.config=B(_5,e),this.state="idle",Y(this,f0,0),Y(this,P0,!1),Y(this,M0,!1),Y(this,r0,!0),Y(this,m0,0),this.perf={},this.models={face:null,posenet:null,blazepose:null,efficientpose:null,handpose:null,iris:null,age:null,gender:null,emotion:null,embedding:null,nanodet:null,centernet:null,faceres:null},this.image=t=>C5(t,this.config),this.classes={facemesh:r5,emotion:y5,faceres:m5,body:this.config.body.modelPath.includes("posenet")?z5:I5,hand:W5,nanodet:H5,centernet:U5},this.faceTriangulation=uA,this.faceUVMap=pA,this.sysinfo=$5(),Y(this,i0,1)}similarity(e,t){return d5(e,t)}enhance(e){return f5(e)}match(e,t,o=0){return TA(e,t,o)}async load(e={}){this.state="load";let t=S();e&&(this.config=B(this.config,e)),Z(this,r0)&&(this.config.debug&&u(`version: ${this.version}`),this.config.debug&&u(`tfjs version: ${this.tf.version_core}`),this.config.debug&&u("platform:",this.sysinfo.platform),this.config.debug&&u("agent:",this.sysinfo.agent),await Z(this,z0).call(this,!0),this.tf.ENV.flags.IS_BROWSER&&(this.config.debug&&u("configuration:",this.config),this.config.debug&&u("tf flags:",this.tf.ENV.flags))),this.config.async?[this.models.face,this.models.emotion,this.models.handpose,this.models.posenet,this.models.blazepose,this.models.nanodet,this.models.centernet,this.models.faceres]=await Promise.all([this.models.face||(this.config.face.enabled?s5(this.config):null),this.models.emotion||(this.config.face.enabled&&this.config.face.emotion.enabled?x5(this.config):null),this.models.handpose||(this.config.hand.enabled?w5(this.config):null),this.models.posenet||(this.config.body.enabled&&this.config.body.modelPath.includes("posenet")?M5(this.config):null),this.models.blazepose||(this.config.body.enabled&&this.config.body.modelPath.includes("blazepose")?k5(this.config):null),this.models.nanodet||(this.config.object.enabled&&this.config.object.modelPath.includes("nanodet")?V5(this.config):null),this.models.centernet||(this.config.object.enabled&&this.config.object.modelPath.includes("centernet")?q5(this.config):null),this.models.faceres||(this.config.face.enabled&&this.config.face.description.enabled?c5(this.config):null)]):(this.config.face.enabled&&!this.models.face&&(this.models.face=await s5(this.config)),this.config.face.enabled&&this.config.face.emotion.enabled&&!this.models.emotion&&(this.models.emotion=await x5(this.config)),this.config.hand.enabled&&!this.models.handpose&&(this.models.handpose=await w5(this.config)),this.config.body.enabled&&!this.models.posenet&&this.config.body.modelPath.includes("posenet")&&(this.models.posenet=await M5(this.config)),this.config.body.enabled&&!this.models.blazepose&&this.config.body.modelPath.includes("blazepose")&&(this.models.blazepose=await k5(this.config)),this.config.object.enabled&&!this.models.nanodet&&this.config.object.modelPath.includes("nanodet")&&(this.models.nanodet=await V5(this.config)),this.config.object.enabled&&!this.models.centernet&&this.config.object.modelPath.includes("centernet")&&(this.models.centernet=await q5(this.config)),this.config.face.enabled&&this.config.face.description.enabled&&!this.models.faceres&&(this.models.faceres=await c5(this.config))),Z(this,r0)&&(this.config.debug&&u("tf engine state:",this.tf.engine().state.numBytes,"bytes",this.tf.engine().state.numTensors,"tensors"),Y(this,r0,!1));let o=Math.trunc(S()-t);o>(this.perf.load||0)&&(this.perf.load=o)}async detect(e,t={}){return new Promise(async o=>{this.state="config";let s;this.config=B(this.config,t),this.state="check";let r=Z(this,C0).call(this,e);r&&(u(r,e),o({error:r}));let n=S();await Z(this,z0).call(this),await this.load(),s=S();let a=C5(e,this.config);if(!a||!a.tensor){u("could not convert input to tensor"),o({error:"could not convert input to tensor"});return}this.perf.image=Math.trunc(S()-s),this.analyze("Get Image:"),s=S(),this.config.skipFrame=await Z(this,Y0).call(this,a.tensor),this.perf.frames||(this.perf.frames=0),this.perf.cached||(this.perf.cached=0),this.perf.frames++,this.config.skipFrame&&this.perf.cached++,this.perf.changed=Math.trunc(S()-s),this.analyze("Check Changed:");let x,y,d,l,f;this.config.async?(d=this.config.face.enabled?h5(this,a.tensor):[],this.perf.face&&delete this.perf.face):(this.state="run:face",s=S(),d=this.config.face.enabled?await h5(this,a.tensor):[],f=Math.trunc(S()-s),f>0&&(this.perf.face=f)),this.analyze("Start Body:"),this.config.async?(this.config.body.modelPath.includes("posenet")?x=this.config.body.enabled?P5(a.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")&&(x=this.config.body.enabled?N5(a.tensor,this.config):[]),this.perf.body&&delete this.perf.body):(this.state="run:body",s=S(),this.config.body.modelPath.includes("posenet")?x=this.config.body.enabled?await P5(a.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")&&(x=this.config.body.enabled?await N5(a.tensor,this.config):[]),f=Math.trunc(S()-s),f>0&&(this.perf.body=f)),this.analyze("End Body:"),this.analyze("Start Hand:"),this.config.async?(y=this.config.hand.enabled?S5(a.tensor,this.config):[],this.perf.hand&&delete this.perf.hand):(this.state="run:hand",s=S(),y=this.config.hand.enabled?await S5(a.tensor,this.config):[],f=Math.trunc(S()-s),f>0&&(this.perf.hand=f)),this.analyze("End Hand:"),this.analyze("Start Object:"),this.config.async?(this.config.object.modelPath.includes("nanodet")?l=this.config.object.enabled?L5(a.tensor,this.config):[]:this.config.object.modelPath.includes("centernet")&&(l=this.config.object.enabled?B5(a.tensor,this.config):[]),this.perf.object&&delete this.perf.object):(this.state="run:object",s=S(),this.config.object.modelPath.includes("nanodet")?l=this.config.object.enabled?await L5(a.tensor,this.config):[]:this.config.object.modelPath.includes("centernet")&&(l=this.config.object.enabled?await B5(a.tensor,this.config):[]),f=Math.trunc(S()-s),f>0&&(this.perf.object=f)),this.analyze("End Object:"),this.config.async&&([d,x,y,l]=await Promise.all([d,x,y,l])),i.dispose(a.tensor);let p=[];this.config.gesture.enabled&&(s=S(),p=[...UA(d),...BA(x),...YA(y),...CA(d)],this.config.async?this.perf.gesture&&delete this.perf.gesture:this.perf.gesture=Math.trunc(S()-s)),this.perf.total=Math.trunc(S()-n),this.state="idle";let z={face:d,body:x,hand:y,gesture:p,object:l,performance:this.perf,canvas:a.canvas};o(z)})}async warmup(e={}){let t=S();if(e&&(this.config=B(this.config,e)),!this.config.warmup||this.config.warmup==="none")return{error:"null"};let o;typeof createImageBitmap=="function"?o=await Z(this,J0).call(this):typeof Image!="undefined"?o=await Z(this,K0).call(this):o=await Z(this,D0).call(this);let s=S();return this.config.debug&&u("Warmup",this.config.warmup,Math.round(s-t),"ms",o),o}};f0=new WeakMap,P0=new WeakMap,M0=new WeakMap,r0=new WeakMap,i0=new WeakMap,m0=new WeakMap,C0=new WeakMap,z0=new WeakMap,Y0=new WeakMap,J0=new WeakMap,K0=new WeakMap,D0=new WeakMap;export{L2 as Human,L2 as default}; //# sourceMappingURL=human.esm-nobundle.js.map diff --git a/dist/human.esm.js b/dist/human.esm.js index 3b9fba57..3fa895c8 100644 --- a/dist/human.esm.js +++ b/dist/human.esm.js @@ -4974,7 +4974,7 @@ AAAAAAJAAAAAAAAAAAAAABAJEAAAAAAAAAAAAAAAIEoBKAAAAAAAAAAAAAAABAlAAAAAAAIAAAAA BAkBAkBAkBAlACEgMZjdjbFW8bWrEx8YWANb6Fp+bfwab+vLDKMFK9qxH5L0bAr8OPRPKz2AY7J2 SbAjYZAI2E7AIEgIEgIEgMdkSy2NgY7MdlmyNoBXsxmFuyNgVTVjNV3KjlBRNTlXTVHKCrlIqt5T lBhEMohlFerLlBjEMohMVTEARDKCITsAk2AEgAAAkAAAAAAAAAAAAAAAAAAAAAAAASAAAAAAAAD/ -2Q==`;var l9="1.9.0";var ru,rp,sp,Wi,Bi,su,P0,ip,L0,W0,B0,V0,doe=class{constructor(t={}){qn(this,ru,void 0);qn(this,rp,void 0);qn(this,sp,void 0);qn(this,Wi,void 0);qn(this,Bi,void 0);qn(this,su,void 0);this.analyze=(...t)=>{if(!sn(this,rp))return;let n=this.tf.engine().state.numTensors,a=sn(this,ru);ya(this,ru,n);let r=n-a;r!==0&&ce(...t,r)};qn(this,P0,t=>{if(!sn(this,sp))return null;if(!t)return"input is not defined";if(this.tf.ENV.flags.IS_NODE&&!(t instanceof Le))return"input must be a tensor";try{this.tf.getBackend()}catch(n){return"backend not loaded"}return null});qn(this,ip,async(t=!1)=>{var n;if(this.config.backend&&this.config.backend.length>0&&t||this.tf.getBackend()!==this.config.backend){let a=nt();if(this.state="backend",this.config.backend&&this.config.backend.length>0){if(typeof window=="undefined"&&typeof WorkerGlobalScope!="undefined"&&this.config.debug&&ce("running inside web worker"),this.tf.ENV.flags.IS_BROWSER&&this.config.backend==="tensorflow"&&(this.config.backend="webgl"),this.tf.ENV.flags.IS_NODE&&(this.config.backend==="webgl"||this.config.backend==="humangl")&&(this.config.backend="tensorflow"),this.config.debug&&ce("setting backend:",this.config.backend),this.config.backend==="wasm"){if(this.config.debug&&ce("wasm path:",this.config.wasmPath),typeof((n=this.tf)==null?void 0:n.setWasmPaths)!="undefined")this.tf.setWasmPaths(this.config.wasmPath);else throw new Error("Human: WASM backend is not loaded");let r=await this.tf.env().getAsync("WASM_HAS_SIMD_SUPPORT"),s=await this.tf.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT");this.config.debug&&ce(`wasm execution: ${r?"SIMD":"no SIMD"} ${s?"multithreaded":"singlethreaded"}`),this.config.debug&&!r&&ce("warning: wasm simd support is not enabled")}this.config.backend==="humangl"&&fk();try{await this.tf.setBackend(this.config.backend)}catch(r){ce("error: cannot set backend:",this.config.backend,r)}}if(this.tf.enableProdMode(),this.tf.getBackend()==="webgl"||this.tf.getBackend()==="humangl"){this.tf.ENV.set("CHECK_COMPUTATION_FOR_ERRORS",!1),this.tf.ENV.set("WEBGL_CPU_FORWARD",!0),oa.set("WEBGL_FORCE_F16_TEXTURES",!0),this.tf.ENV.set("WEBGL_PACK_DEPTHWISECONV",!0),typeof this.config.deallocate!="undefined"&&(ce("changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:",!0),this.tf.ENV.set("WEBGL_DELETE_TEXTURE_THRESHOLD",0));let r=await this.tf.backend().getGPGPUContext().gl;this.config.debug&&ce(`gl version:${r.getParameter(r.VERSION)} renderer:${r.getParameter(r.RENDERER)}`)}await this.tf.ready(),this.perf.backend=Math.trunc(nt()-a)}});qn(this,L0,async t=>{if(this.config.cacheSensitivity===0)return!1;let n=40,a=t.resizeBilinear([Math.trunc(t.shape[1]/n),Math.trunc(t.shape[2]/n)]),r=this.tf.sum(a),s=r.dataSync()[0];r.dispose(),a.dispose();let i=Math.max(s,sn(this,Bi))/Math.min(s,sn(this,Bi))-1;ya(this,Bi,s);let o=i4*this.config.cacheSensitivity?0:i),o});qn(this,W0,async()=>{let t=(r,s="application/octet-stream")=>fetch(`data:${s};base64,${r}`).then(i=>i.blob()),n,a;switch(this.config.warmup){case"face":n=await t(O0);break;case"full":n=await t(_0);break;default:n=null}if(n){let r=await createImageBitmap(n);a=await this.detect(r,this.config),r.close()}return a});qn(this,B0,async()=>new Promise(t=>{let n,a=0;switch(this.config.warmup){case"face":a=256,n="data:image/jpeg;base64,"+O0;break;case"full":case"body":a=1200,n="data:image/jpeg;base64,"+_0;break;default:n=null}let r=new Image;r.onload=async()=>{let s=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(a,a):document.createElement("canvas");s.width=r.naturalWidth,s.height=r.naturalHeight;let i=s.getContext("2d");i==null||i.drawImage(r,0,0);let o=await this.detect(s,this.config);t(o)},n?r.src=n:t(null)}));qn(this,V0,async()=>{let t=r=>Buffer.from(r,"base64"),n;if(this.config.warmup==="face"&&(n=t(O0)),(this.config.warmup==="body"||this.config.warmup==="full")&&(n=t(_0)),!n)return null;let a;if(typeof void 0!="undefined"){let r=(void 0).decodeJpeg(n),s=r.expandDims(0);this.tf.dispose(r),a=await this.detect(s,this.config),this.tf.dispose(s)}else this.config.debug&&ce("Warmup tfjs-node not loaded");return a});this.tf=Yd,this.draw=zg,this.version=l9,this.config=Xn(Kg,t),this.state="idle",ya(this,ru,0),ya(this,rp,!1),ya(this,sp,!1),ya(this,Wi,!0),ya(this,su,0),this.perf={},this.models={face:null,posenet:null,blazepose:null,efficientpose:null,handpose:null,iris:null,age:null,gender:null,emotion:null,embedding:null,nanodet:null,centernet:null,faceres:null},this.image=n=>$g(n,this.config),this.classes={facemesh:X2,emotion:J2,faceres:ag,body:this.config.body.modelPath.includes("posenet")?cg:wg,hand:xg,nanodet:Tg,centernet:Fg},this.faceTriangulation=Nk,this.faceUVMap=Tk,this.sysinfo=Zg(),ya(this,Bi,1)}similarity(t,n){return tg(t,n)}enhance(t){return ng(t)}match(t,n,a=0){return Rk(t,n,a)}async load(t={}){this.state="load";let n=nt();t&&(this.config=Xn(this.config,t)),sn(this,Wi)&&(this.config.debug&&ce(`version: ${this.version}`),this.config.debug&&ce(`tfjs version: ${this.tf.version_core}`),this.config.debug&&ce("platform:",this.sysinfo.platform),this.config.debug&&ce("agent:",this.sysinfo.agent),await sn(this,ip).call(this,!0),this.tf.ENV.flags.IS_BROWSER&&(this.config.debug&&ce("configuration:",this.config),this.config.debug&&ce("tf flags:",this.tf.ENV.flags))),this.config.async?[this.models.face,this.models.emotion,this.models.handpose,this.models.posenet,this.models.blazepose,this.models.nanodet,this.models.centernet,this.models.faceres]=await Promise.all([this.models.face||(this.config.face.enabled?q2(this.config):null),this.models.emotion||(this.config.face.enabled&&this.config.face.emotion.enabled?Y2(this.config):null),this.models.handpose||(this.config.hand.enabled?gg(this.config):null),this.models.posenet||(this.config.body.enabled&&this.config.body.modelPath.includes("posenet")?pg(this.config):null),this.models.blazepose||(this.config.body.enabled&&this.config.body.modelPath.includes("blazepose")?bg(this.config):null),this.models.nanodet||(this.config.object.enabled&&this.config.object.modelPath.includes("nanodet")?Sg(this.config):null),this.models.centernet||(this.config.object.enabled&&this.config.object.modelPath.includes("centernet")?Rg(this.config):null),this.models.faceres||(this.config.face.enabled&&this.config.face.description.enabled?eg(this.config):null)]):(this.config.face.enabled&&!this.models.face&&(this.models.face=await q2(this.config)),this.config.face.enabled&&this.config.face.emotion.enabled&&!this.models.emotion&&(this.models.emotion=await Y2(this.config)),this.config.hand.enabled&&!this.models.handpose&&(this.models.handpose=await gg(this.config)),this.config.body.enabled&&!this.models.posenet&&this.config.body.modelPath.includes("posenet")&&(this.models.posenet=await pg(this.config)),this.config.body.enabled&&!this.models.blazepose&&this.config.body.modelPath.includes("blazepose")&&(this.models.blazepose=await bg(this.config)),this.config.object.enabled&&!this.models.nanodet&&this.config.object.modelPath.includes("nanodet")&&(this.models.nanodet=await Sg(this.config)),this.config.object.enabled&&!this.models.centernet&&this.config.object.modelPath.includes("centernet")&&(this.models.centernet=await Rg(this.config)),this.config.face.enabled&&this.config.face.description.enabled&&!this.models.faceres&&(this.models.faceres=await eg(this.config))),sn(this,Wi)&&(this.config.debug&&ce("tf engine state:",this.tf.engine().state.numBytes,"bytes",this.tf.engine().state.numTensors,"tensors"),ya(this,Wi,!1));let a=Math.trunc(nt()-n);a>(this.perf.load||0)&&(this.perf.load=a)}async detect(t,n={}){return new Promise(async a=>{this.state="config";let r;this.config=Xn(this.config,n),this.state="check";let s=sn(this,P0).call(this,t);s&&(ce(s,t),a({error:s}));let i=nt();await sn(this,ip).call(this),await this.load(),r=nt();let o=$g(t,this.config);if(!o||!o.tensor){ce("could not convert input to tensor"),a({error:"could not convert input to tensor"});return}this.perf.image=Math.trunc(nt()-r),this.analyze("Get Image:"),r=nt(),this.config.skipFrame=await sn(this,L0).call(this,o.tensor),this.perf.frames||(this.perf.frames=0),this.perf.cached||(this.perf.cached=0),this.perf.frames++,this.config.skipFrame&&this.perf.cached++,this.perf.changed=Math.trunc(nt()-r),this.analyze("Check Changed:");let l,u,d,p,c;this.config.async?(d=this.config.face.enabled?rg(this,o.tensor):[],this.perf.face&&delete this.perf.face):(this.state="run:face",r=nt(),d=this.config.face.enabled?await rg(this,o.tensor):[],c=Math.trunc(nt()-r),c>0&&(this.perf.face=c)),this.analyze("Start Body:"),this.config.async?(this.config.body.modelPath.includes("posenet")?l=this.config.body.enabled?dg(o.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")&&(l=this.config.body.enabled?vg(o.tensor,this.config):[]),this.perf.body&&delete this.perf.body):(this.state="run:body",r=nt(),this.config.body.modelPath.includes("posenet")?l=this.config.body.enabled?await dg(o.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")&&(l=this.config.body.enabled?await vg(o.tensor,this.config):[]),c=Math.trunc(nt()-r),c>0&&(this.perf.body=c)),this.analyze("End Body:"),this.analyze("Start Hand:"),this.config.async?(u=this.config.hand.enabled?yg(o.tensor,this.config):[],this.perf.hand&&delete this.perf.hand):(this.state="run:hand",r=nt(),u=this.config.hand.enabled?await yg(o.tensor,this.config):[],c=Math.trunc(nt()-r),c>0&&(this.perf.hand=c)),this.analyze("End Hand:"),this.analyze("Start Object:"),this.config.async?(this.config.object.modelPath.includes("nanodet")?p=this.config.object.enabled?Ng(o.tensor,this.config):[]:this.config.object.modelPath.includes("centernet")&&(p=this.config.object.enabled?Mg(o.tensor,this.config):[]),this.perf.object&&delete this.perf.object):(this.state="run:object",r=nt(),this.config.object.modelPath.includes("nanodet")?p=this.config.object.enabled?await Ng(o.tensor,this.config):[]:this.config.object.modelPath.includes("centernet")&&(p=this.config.object.enabled?await Mg(o.tensor,this.config):[]),c=Math.trunc(nt()-r),c>0&&(this.perf.object=c)),this.analyze("End Object:"),this.config.async&&([d,l,u,p]=await Promise.all([d,l,u,p])),Ee(o.tensor);let h=[];this.config.gesture.enabled&&(r=nt(),h=[...Qk(d),...Jk(l),...t9(u),...e9(d)],this.config.async?this.perf.gesture&&delete this.perf.gesture:this.perf.gesture=Math.trunc(nt()-r)),this.perf.total=Math.trunc(nt()-i),this.state="idle";let m={face:d,body:l,hand:u,gesture:h,object:p,performance:this.perf,canvas:o.canvas};a(m)})}async warmup(t={}){let n=nt();if(t&&(this.config=Xn(this.config,t)),!this.config.warmup||this.config.warmup==="none")return{error:"null"};let a;typeof createImageBitmap=="function"?a=await sn(this,W0).call(this):typeof Image!="undefined"?a=await sn(this,B0).call(this):a=await sn(this,V0).call(this);let r=nt();return this.config.debug&&ce("Warmup",this.config.warmup,Math.round(r-n),"ms",a),a}};ru=new WeakMap,rp=new WeakMap,sp=new WeakMap,Wi=new WeakMap,Bi=new WeakMap,su=new WeakMap,P0=new WeakMap,ip=new WeakMap,L0=new WeakMap,W0=new WeakMap,B0=new WeakMap,V0=new WeakMap;export{doe as Human,doe as default}; +2Q==`;var l9="1.9.1";var ru,rp,sp,Wi,Bi,su,P0,ip,L0,W0,B0,V0,doe=class{constructor(t={}){qn(this,ru,void 0);qn(this,rp,void 0);qn(this,sp,void 0);qn(this,Wi,void 0);qn(this,Bi,void 0);qn(this,su,void 0);this.analyze=(...t)=>{if(!sn(this,rp))return;let n=this.tf.engine().state.numTensors,a=sn(this,ru);ya(this,ru,n);let r=n-a;r!==0&&ce(...t,r)};qn(this,P0,t=>{if(!sn(this,sp))return null;if(!t)return"input is not defined";if(this.tf.ENV.flags.IS_NODE&&!(t instanceof Le))return"input must be a tensor";try{this.tf.getBackend()}catch(n){return"backend not loaded"}return null});qn(this,ip,async(t=!1)=>{var n;if(this.config.backend&&this.config.backend.length>0&&t||this.tf.getBackend()!==this.config.backend){let a=nt();if(this.state="backend",this.config.backend&&this.config.backend.length>0){if(typeof window=="undefined"&&typeof WorkerGlobalScope!="undefined"&&this.config.debug&&ce("running inside web worker"),this.tf.ENV.flags.IS_BROWSER&&this.config.backend==="tensorflow"&&(this.config.backend="webgl"),this.tf.ENV.flags.IS_NODE&&(this.config.backend==="webgl"||this.config.backend==="humangl")&&(this.config.backend="tensorflow"),this.config.debug&&ce("setting backend:",this.config.backend),this.config.backend==="wasm"){if(this.config.debug&&ce("wasm path:",this.config.wasmPath),typeof((n=this.tf)==null?void 0:n.setWasmPaths)!="undefined")this.tf.setWasmPaths(this.config.wasmPath);else throw new Error("Human: WASM backend is not loaded");let r=await this.tf.env().getAsync("WASM_HAS_SIMD_SUPPORT"),s=await this.tf.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT");this.config.debug&&ce(`wasm execution: ${r?"SIMD":"no SIMD"} ${s?"multithreaded":"singlethreaded"}`),this.config.debug&&!r&&ce("warning: wasm simd support is not enabled")}this.config.backend==="humangl"&&fk();try{await this.tf.setBackend(this.config.backend)}catch(r){ce("error: cannot set backend:",this.config.backend,r)}}if(this.tf.enableProdMode(),this.tf.getBackend()==="webgl"||this.tf.getBackend()==="humangl"){this.tf.ENV.set("CHECK_COMPUTATION_FOR_ERRORS",!1),this.tf.ENV.set("WEBGL_CPU_FORWARD",!0),oa.set("WEBGL_FORCE_F16_TEXTURES",!0),this.tf.ENV.set("WEBGL_PACK_DEPTHWISECONV",!0),typeof this.config.deallocate!="undefined"&&(ce("changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:",!0),this.tf.ENV.set("WEBGL_DELETE_TEXTURE_THRESHOLD",0));let r=await this.tf.backend().getGPGPUContext().gl;this.config.debug&&ce(`gl version:${r.getParameter(r.VERSION)} renderer:${r.getParameter(r.RENDERER)}`)}await this.tf.ready(),this.perf.backend=Math.trunc(nt()-a)}});qn(this,L0,async t=>{if(this.config.cacheSensitivity===0)return!1;let n=40,a=t.resizeBilinear([Math.trunc(t.shape[1]/n),Math.trunc(t.shape[2]/n)]),r=this.tf.sum(a),s=r.dataSync()[0];r.dispose(),a.dispose();let i=Math.max(s,sn(this,Bi))/Math.min(s,sn(this,Bi))-1;ya(this,Bi,s);let o=i4*this.config.cacheSensitivity?0:i),o});qn(this,W0,async()=>{let t=(r,s="application/octet-stream")=>fetch(`data:${s};base64,${r}`).then(i=>i.blob()),n,a;switch(this.config.warmup){case"face":n=await t(O0);break;case"full":n=await t(_0);break;default:n=null}if(n){let r=await createImageBitmap(n);a=await this.detect(r,this.config),r.close()}return a});qn(this,B0,async()=>new Promise(t=>{let n,a=0;switch(this.config.warmup){case"face":a=256,n="data:image/jpeg;base64,"+O0;break;case"full":case"body":a=1200,n="data:image/jpeg;base64,"+_0;break;default:n=null}let r=new Image;r.onload=async()=>{let s=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(a,a):document.createElement("canvas");s.width=r.naturalWidth,s.height=r.naturalHeight;let i=s.getContext("2d");i==null||i.drawImage(r,0,0);let o=await this.detect(s,this.config);t(o)},n?r.src=n:t(null)}));qn(this,V0,async()=>{let t=r=>Buffer.from(r,"base64"),n;if(this.config.warmup==="face"&&(n=t(O0)),(this.config.warmup==="body"||this.config.warmup==="full")&&(n=t(_0)),!n)return null;let a;if(typeof void 0!="undefined"){let r=(void 0).decodeJpeg(n),s=r.expandDims(0);this.tf.dispose(r),a=await this.detect(s,this.config),this.tf.dispose(s)}else this.config.debug&&ce("Warmup tfjs-node not loaded");return a});this.tf=Yd,this.draw=zg,this.version=l9,this.config=Xn(Kg,t),this.state="idle",ya(this,ru,0),ya(this,rp,!1),ya(this,sp,!1),ya(this,Wi,!0),ya(this,su,0),this.perf={},this.models={face:null,posenet:null,blazepose:null,efficientpose:null,handpose:null,iris:null,age:null,gender:null,emotion:null,embedding:null,nanodet:null,centernet:null,faceres:null},this.image=n=>$g(n,this.config),this.classes={facemesh:X2,emotion:J2,faceres:ag,body:this.config.body.modelPath.includes("posenet")?cg:wg,hand:xg,nanodet:Tg,centernet:Fg},this.faceTriangulation=Nk,this.faceUVMap=Tk,this.sysinfo=Zg(),ya(this,Bi,1)}similarity(t,n){return tg(t,n)}enhance(t){return ng(t)}match(t,n,a=0){return Rk(t,n,a)}async load(t={}){this.state="load";let n=nt();t&&(this.config=Xn(this.config,t)),sn(this,Wi)&&(this.config.debug&&ce(`version: ${this.version}`),this.config.debug&&ce(`tfjs version: ${this.tf.version_core}`),this.config.debug&&ce("platform:",this.sysinfo.platform),this.config.debug&&ce("agent:",this.sysinfo.agent),await sn(this,ip).call(this,!0),this.tf.ENV.flags.IS_BROWSER&&(this.config.debug&&ce("configuration:",this.config),this.config.debug&&ce("tf flags:",this.tf.ENV.flags))),this.config.async?[this.models.face,this.models.emotion,this.models.handpose,this.models.posenet,this.models.blazepose,this.models.nanodet,this.models.centernet,this.models.faceres]=await Promise.all([this.models.face||(this.config.face.enabled?q2(this.config):null),this.models.emotion||(this.config.face.enabled&&this.config.face.emotion.enabled?Y2(this.config):null),this.models.handpose||(this.config.hand.enabled?gg(this.config):null),this.models.posenet||(this.config.body.enabled&&this.config.body.modelPath.includes("posenet")?pg(this.config):null),this.models.blazepose||(this.config.body.enabled&&this.config.body.modelPath.includes("blazepose")?bg(this.config):null),this.models.nanodet||(this.config.object.enabled&&this.config.object.modelPath.includes("nanodet")?Sg(this.config):null),this.models.centernet||(this.config.object.enabled&&this.config.object.modelPath.includes("centernet")?Rg(this.config):null),this.models.faceres||(this.config.face.enabled&&this.config.face.description.enabled?eg(this.config):null)]):(this.config.face.enabled&&!this.models.face&&(this.models.face=await q2(this.config)),this.config.face.enabled&&this.config.face.emotion.enabled&&!this.models.emotion&&(this.models.emotion=await Y2(this.config)),this.config.hand.enabled&&!this.models.handpose&&(this.models.handpose=await gg(this.config)),this.config.body.enabled&&!this.models.posenet&&this.config.body.modelPath.includes("posenet")&&(this.models.posenet=await pg(this.config)),this.config.body.enabled&&!this.models.blazepose&&this.config.body.modelPath.includes("blazepose")&&(this.models.blazepose=await bg(this.config)),this.config.object.enabled&&!this.models.nanodet&&this.config.object.modelPath.includes("nanodet")&&(this.models.nanodet=await Sg(this.config)),this.config.object.enabled&&!this.models.centernet&&this.config.object.modelPath.includes("centernet")&&(this.models.centernet=await Rg(this.config)),this.config.face.enabled&&this.config.face.description.enabled&&!this.models.faceres&&(this.models.faceres=await eg(this.config))),sn(this,Wi)&&(this.config.debug&&ce("tf engine state:",this.tf.engine().state.numBytes,"bytes",this.tf.engine().state.numTensors,"tensors"),ya(this,Wi,!1));let a=Math.trunc(nt()-n);a>(this.perf.load||0)&&(this.perf.load=a)}async detect(t,n={}){return new Promise(async a=>{this.state="config";let r;this.config=Xn(this.config,n),this.state="check";let s=sn(this,P0).call(this,t);s&&(ce(s,t),a({error:s}));let i=nt();await sn(this,ip).call(this),await this.load(),r=nt();let o=$g(t,this.config);if(!o||!o.tensor){ce("could not convert input to tensor"),a({error:"could not convert input to tensor"});return}this.perf.image=Math.trunc(nt()-r),this.analyze("Get Image:"),r=nt(),this.config.skipFrame=await sn(this,L0).call(this,o.tensor),this.perf.frames||(this.perf.frames=0),this.perf.cached||(this.perf.cached=0),this.perf.frames++,this.config.skipFrame&&this.perf.cached++,this.perf.changed=Math.trunc(nt()-r),this.analyze("Check Changed:");let l,u,d,p,c;this.config.async?(d=this.config.face.enabled?rg(this,o.tensor):[],this.perf.face&&delete this.perf.face):(this.state="run:face",r=nt(),d=this.config.face.enabled?await rg(this,o.tensor):[],c=Math.trunc(nt()-r),c>0&&(this.perf.face=c)),this.analyze("Start Body:"),this.config.async?(this.config.body.modelPath.includes("posenet")?l=this.config.body.enabled?dg(o.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")&&(l=this.config.body.enabled?vg(o.tensor,this.config):[]),this.perf.body&&delete this.perf.body):(this.state="run:body",r=nt(),this.config.body.modelPath.includes("posenet")?l=this.config.body.enabled?await dg(o.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")&&(l=this.config.body.enabled?await vg(o.tensor,this.config):[]),c=Math.trunc(nt()-r),c>0&&(this.perf.body=c)),this.analyze("End Body:"),this.analyze("Start Hand:"),this.config.async?(u=this.config.hand.enabled?yg(o.tensor,this.config):[],this.perf.hand&&delete this.perf.hand):(this.state="run:hand",r=nt(),u=this.config.hand.enabled?await yg(o.tensor,this.config):[],c=Math.trunc(nt()-r),c>0&&(this.perf.hand=c)),this.analyze("End Hand:"),this.analyze("Start Object:"),this.config.async?(this.config.object.modelPath.includes("nanodet")?p=this.config.object.enabled?Ng(o.tensor,this.config):[]:this.config.object.modelPath.includes("centernet")&&(p=this.config.object.enabled?Mg(o.tensor,this.config):[]),this.perf.object&&delete this.perf.object):(this.state="run:object",r=nt(),this.config.object.modelPath.includes("nanodet")?p=this.config.object.enabled?await Ng(o.tensor,this.config):[]:this.config.object.modelPath.includes("centernet")&&(p=this.config.object.enabled?await Mg(o.tensor,this.config):[]),c=Math.trunc(nt()-r),c>0&&(this.perf.object=c)),this.analyze("End Object:"),this.config.async&&([d,l,u,p]=await Promise.all([d,l,u,p])),Ee(o.tensor);let h=[];this.config.gesture.enabled&&(r=nt(),h=[...Qk(d),...Jk(l),...t9(u),...e9(d)],this.config.async?this.perf.gesture&&delete this.perf.gesture:this.perf.gesture=Math.trunc(nt()-r)),this.perf.total=Math.trunc(nt()-i),this.state="idle";let m={face:d,body:l,hand:u,gesture:h,object:p,performance:this.perf,canvas:o.canvas};a(m)})}async warmup(t={}){let n=nt();if(t&&(this.config=Xn(this.config,t)),!this.config.warmup||this.config.warmup==="none")return{error:"null"};let a;typeof createImageBitmap=="function"?a=await sn(this,W0).call(this):typeof Image!="undefined"?a=await sn(this,B0).call(this):a=await sn(this,V0).call(this);let r=nt();return this.config.debug&&ce("Warmup",this.config.warmup,Math.round(r-n),"ms",a),a}};ru=new WeakMap,rp=new WeakMap,sp=new WeakMap,Wi=new WeakMap,Bi=new WeakMap,su=new WeakMap,P0=new WeakMap,ip=new WeakMap,L0=new WeakMap,W0=new WeakMap,B0=new WeakMap,V0=new WeakMap;export{doe as Human,doe as default}; /** * @license * Copyright 2017 Google LLC. All Rights Reserved. diff --git a/dist/human.js b/dist/human.js index 61d4413b..8090ae28 100644 --- a/dist/human.js +++ b/dist/human.js @@ -4974,7 +4974,7 @@ AAAAAAJAAAAAAAAAAAAAABAJEAAAAAAAAAAAAAAAIEoBKAAAAAAAAAAAAAAABAlAAAAAAAIAAAAA BAkBAkBAkBAlACEgMZjdjbFW8bWrEx8YWANb6Fp+bfwab+vLDKMFK9qxH5L0bAr8OPRPKz2AY7J2 SbAjYZAI2E7AIEgIEgIEgMdkSy2NgY7MdlmyNoBXsxmFuyNgVTVjNV3KjlBRNTlXTVHKCrlIqt5T lBhEMohlFerLlBjEMohMVTEARDKCITsAk2AEgAAAkAAAAAAAAAAAAAAAAAAAAAAAASAAAAAAAAD/ -2Q==`;var l9="1.9.0";var ru,rp,sp,Wi,Bi,su,P0,ip,L0,W0,B0,V0,u9=class{constructor(t={}){qn(this,ru,void 0);qn(this,rp,void 0);qn(this,sp,void 0);qn(this,Wi,void 0);qn(this,Bi,void 0);qn(this,su,void 0);this.analyze=(...t)=>{if(!sn(this,rp))return;let n=this.tf.engine().state.numTensors,a=sn(this,ru);ga(this,ru,n);let r=n-a;r!==0&&ce(...t,r)};qn(this,P0,t=>{if(!sn(this,sp))return null;if(!t)return"input is not defined";if(this.tf.ENV.flags.IS_NODE&&!(t instanceof Le))return"input must be a tensor";try{this.tf.getBackend()}catch(n){return"backend not loaded"}return null});qn(this,ip,async(t=!1)=>{var n;if(this.config.backend&&this.config.backend.length>0&&t||this.tf.getBackend()!==this.config.backend){let a=nt();if(this.state="backend",this.config.backend&&this.config.backend.length>0){if(typeof window=="undefined"&&typeof WorkerGlobalScope!="undefined"&&this.config.debug&&ce("running inside web worker"),this.tf.ENV.flags.IS_BROWSER&&this.config.backend==="tensorflow"&&(this.config.backend="webgl"),this.tf.ENV.flags.IS_NODE&&(this.config.backend==="webgl"||this.config.backend==="humangl")&&(this.config.backend="tensorflow"),this.config.debug&&ce("setting backend:",this.config.backend),this.config.backend==="wasm"){if(this.config.debug&&ce("wasm path:",this.config.wasmPath),typeof((n=this.tf)==null?void 0:n.setWasmPaths)!="undefined")this.tf.setWasmPaths(this.config.wasmPath);else throw new Error("Human: WASM backend is not loaded");let r=await this.tf.env().getAsync("WASM_HAS_SIMD_SUPPORT"),s=await this.tf.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT");this.config.debug&&ce(`wasm execution: ${r?"SIMD":"no SIMD"} ${s?"multithreaded":"singlethreaded"}`),this.config.debug&&!r&&ce("warning: wasm simd support is not enabled")}this.config.backend==="humangl"&&fk();try{await this.tf.setBackend(this.config.backend)}catch(r){ce("error: cannot set backend:",this.config.backend,r)}}if(this.tf.enableProdMode(),this.tf.getBackend()==="webgl"||this.tf.getBackend()==="humangl"){this.tf.ENV.set("CHECK_COMPUTATION_FOR_ERRORS",!1),this.tf.ENV.set("WEBGL_CPU_FORWARD",!0),oa.set("WEBGL_FORCE_F16_TEXTURES",!0),this.tf.ENV.set("WEBGL_PACK_DEPTHWISECONV",!0),typeof this.config.deallocate!="undefined"&&(ce("changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:",!0),this.tf.ENV.set("WEBGL_DELETE_TEXTURE_THRESHOLD",0));let r=await this.tf.backend().getGPGPUContext().gl;this.config.debug&&ce(`gl version:${r.getParameter(r.VERSION)} renderer:${r.getParameter(r.RENDERER)}`)}await this.tf.ready(),this.perf.backend=Math.trunc(nt()-a)}});qn(this,L0,async t=>{if(this.config.cacheSensitivity===0)return!1;let n=40,a=t.resizeBilinear([Math.trunc(t.shape[1]/n),Math.trunc(t.shape[2]/n)]),r=this.tf.sum(a),s=r.dataSync()[0];r.dispose(),a.dispose();let i=Math.max(s,sn(this,Bi))/Math.min(s,sn(this,Bi))-1;ga(this,Bi,s);let o=i4*this.config.cacheSensitivity?0:i),o});qn(this,W0,async()=>{let t=(r,s="application/octet-stream")=>fetch(`data:${s};base64,${r}`).then(i=>i.blob()),n,a;switch(this.config.warmup){case"face":n=await t(O0);break;case"full":n=await t(_0);break;default:n=null}if(n){let r=await createImageBitmap(n);a=await this.detect(r,this.config),r.close()}return a});qn(this,B0,async()=>new Promise(t=>{let n,a=0;switch(this.config.warmup){case"face":a=256,n="data:image/jpeg;base64,"+O0;break;case"full":case"body":a=1200,n="data:image/jpeg;base64,"+_0;break;default:n=null}let r=new Image;r.onload=async()=>{let s=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(a,a):document.createElement("canvas");s.width=r.naturalWidth,s.height=r.naturalHeight;let i=s.getContext("2d");i==null||i.drawImage(r,0,0);let o=await this.detect(s,this.config);t(o)},n?r.src=n:t(null)}));qn(this,V0,async()=>{let t=r=>Buffer.from(r,"base64"),n;if(this.config.warmup==="face"&&(n=t(O0)),(this.config.warmup==="body"||this.config.warmup==="full")&&(n=t(_0)),!n)return null;let a;if(typeof void 0!="undefined"){let r=(void 0).decodeJpeg(n),s=r.expandDims(0);this.tf.dispose(r),a=await this.detect(s,this.config),this.tf.dispose(s)}else this.config.debug&&ce("Warmup tfjs-node not loaded");return a});this.tf=Yd,this.draw=zg,this.version=l9,this.config=Xn(Kg,t),this.state="idle",ga(this,ru,0),ga(this,rp,!1),ga(this,sp,!1),ga(this,Wi,!0),ga(this,su,0),this.perf={},this.models={face:null,posenet:null,blazepose:null,efficientpose:null,handpose:null,iris:null,age:null,gender:null,emotion:null,embedding:null,nanodet:null,centernet:null,faceres:null},this.image=n=>$g(n,this.config),this.classes={facemesh:X2,emotion:J2,faceres:ag,body:this.config.body.modelPath.includes("posenet")?cg:wg,hand:xg,nanodet:Tg,centernet:Fg},this.faceTriangulation=Nk,this.faceUVMap=Tk,this.sysinfo=Zg(),ga(this,Bi,1)}similarity(t,n){return tg(t,n)}enhance(t){return ng(t)}match(t,n,a=0){return Rk(t,n,a)}async load(t={}){this.state="load";let n=nt();t&&(this.config=Xn(this.config,t)),sn(this,Wi)&&(this.config.debug&&ce(`version: ${this.version}`),this.config.debug&&ce(`tfjs version: ${this.tf.version_core}`),this.config.debug&&ce("platform:",this.sysinfo.platform),this.config.debug&&ce("agent:",this.sysinfo.agent),await sn(this,ip).call(this,!0),this.tf.ENV.flags.IS_BROWSER&&(this.config.debug&&ce("configuration:",this.config),this.config.debug&&ce("tf flags:",this.tf.ENV.flags))),this.config.async?[this.models.face,this.models.emotion,this.models.handpose,this.models.posenet,this.models.blazepose,this.models.nanodet,this.models.centernet,this.models.faceres]=await Promise.all([this.models.face||(this.config.face.enabled?q2(this.config):null),this.models.emotion||(this.config.face.enabled&&this.config.face.emotion.enabled?Y2(this.config):null),this.models.handpose||(this.config.hand.enabled?gg(this.config):null),this.models.posenet||(this.config.body.enabled&&this.config.body.modelPath.includes("posenet")?pg(this.config):null),this.models.blazepose||(this.config.body.enabled&&this.config.body.modelPath.includes("blazepose")?bg(this.config):null),this.models.nanodet||(this.config.object.enabled&&this.config.object.modelPath.includes("nanodet")?Sg(this.config):null),this.models.centernet||(this.config.object.enabled&&this.config.object.modelPath.includes("centernet")?Rg(this.config):null),this.models.faceres||(this.config.face.enabled&&this.config.face.description.enabled?eg(this.config):null)]):(this.config.face.enabled&&!this.models.face&&(this.models.face=await q2(this.config)),this.config.face.enabled&&this.config.face.emotion.enabled&&!this.models.emotion&&(this.models.emotion=await Y2(this.config)),this.config.hand.enabled&&!this.models.handpose&&(this.models.handpose=await gg(this.config)),this.config.body.enabled&&!this.models.posenet&&this.config.body.modelPath.includes("posenet")&&(this.models.posenet=await pg(this.config)),this.config.body.enabled&&!this.models.blazepose&&this.config.body.modelPath.includes("blazepose")&&(this.models.blazepose=await bg(this.config)),this.config.object.enabled&&!this.models.nanodet&&this.config.object.modelPath.includes("nanodet")&&(this.models.nanodet=await Sg(this.config)),this.config.object.enabled&&!this.models.centernet&&this.config.object.modelPath.includes("centernet")&&(this.models.centernet=await Rg(this.config)),this.config.face.enabled&&this.config.face.description.enabled&&!this.models.faceres&&(this.models.faceres=await eg(this.config))),sn(this,Wi)&&(this.config.debug&&ce("tf engine state:",this.tf.engine().state.numBytes,"bytes",this.tf.engine().state.numTensors,"tensors"),ga(this,Wi,!1));let a=Math.trunc(nt()-n);a>(this.perf.load||0)&&(this.perf.load=a)}async detect(t,n={}){return new Promise(async a=>{this.state="config";let r;this.config=Xn(this.config,n),this.state="check";let s=sn(this,P0).call(this,t);s&&(ce(s,t),a({error:s}));let i=nt();await sn(this,ip).call(this),await this.load(),r=nt();let o=$g(t,this.config);if(!o||!o.tensor){ce("could not convert input to tensor"),a({error:"could not convert input to tensor"});return}this.perf.image=Math.trunc(nt()-r),this.analyze("Get Image:"),r=nt(),this.config.skipFrame=await sn(this,L0).call(this,o.tensor),this.perf.frames||(this.perf.frames=0),this.perf.cached||(this.perf.cached=0),this.perf.frames++,this.config.skipFrame&&this.perf.cached++,this.perf.changed=Math.trunc(nt()-r),this.analyze("Check Changed:");let l,u,d,p,c;this.config.async?(d=this.config.face.enabled?rg(this,o.tensor):[],this.perf.face&&delete this.perf.face):(this.state="run:face",r=nt(),d=this.config.face.enabled?await rg(this,o.tensor):[],c=Math.trunc(nt()-r),c>0&&(this.perf.face=c)),this.analyze("Start Body:"),this.config.async?(this.config.body.modelPath.includes("posenet")?l=this.config.body.enabled?dg(o.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")&&(l=this.config.body.enabled?vg(o.tensor,this.config):[]),this.perf.body&&delete this.perf.body):(this.state="run:body",r=nt(),this.config.body.modelPath.includes("posenet")?l=this.config.body.enabled?await dg(o.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")&&(l=this.config.body.enabled?await vg(o.tensor,this.config):[]),c=Math.trunc(nt()-r),c>0&&(this.perf.body=c)),this.analyze("End Body:"),this.analyze("Start Hand:"),this.config.async?(u=this.config.hand.enabled?yg(o.tensor,this.config):[],this.perf.hand&&delete this.perf.hand):(this.state="run:hand",r=nt(),u=this.config.hand.enabled?await yg(o.tensor,this.config):[],c=Math.trunc(nt()-r),c>0&&(this.perf.hand=c)),this.analyze("End Hand:"),this.analyze("Start Object:"),this.config.async?(this.config.object.modelPath.includes("nanodet")?p=this.config.object.enabled?Ng(o.tensor,this.config):[]:this.config.object.modelPath.includes("centernet")&&(p=this.config.object.enabled?Mg(o.tensor,this.config):[]),this.perf.object&&delete this.perf.object):(this.state="run:object",r=nt(),this.config.object.modelPath.includes("nanodet")?p=this.config.object.enabled?await Ng(o.tensor,this.config):[]:this.config.object.modelPath.includes("centernet")&&(p=this.config.object.enabled?await Mg(o.tensor,this.config):[]),c=Math.trunc(nt()-r),c>0&&(this.perf.object=c)),this.analyze("End Object:"),this.config.async&&([d,l,u,p]=await Promise.all([d,l,u,p])),Ee(o.tensor);let h=[];this.config.gesture.enabled&&(r=nt(),h=[...Qk(d),...Jk(l),...t9(u),...e9(d)],this.config.async?this.perf.gesture&&delete this.perf.gesture:this.perf.gesture=Math.trunc(nt()-r)),this.perf.total=Math.trunc(nt()-i),this.state="idle";let m={face:d,body:l,hand:u,gesture:h,object:p,performance:this.perf,canvas:o.canvas};a(m)})}async warmup(t={}){let n=nt();if(t&&(this.config=Xn(this.config,t)),!this.config.warmup||this.config.warmup==="none")return{error:"null"};let a;typeof createImageBitmap=="function"?a=await sn(this,W0).call(this):typeof Image!="undefined"?a=await sn(this,B0).call(this):a=await sn(this,V0).call(this);let r=nt();return this.config.debug&&ce("Warmup",this.config.warmup,Math.round(r-n),"ms",a),a}};ru=new WeakMap,rp=new WeakMap,sp=new WeakMap,Wi=new WeakMap,Bi=new WeakMap,su=new WeakMap,P0=new WeakMap,ip=new WeakMap,L0=new WeakMap,W0=new WeakMap,B0=new WeakMap,V0=new WeakMap;return poe;})(); +2Q==`;var l9="1.9.1";var ru,rp,sp,Wi,Bi,su,P0,ip,L0,W0,B0,V0,u9=class{constructor(t={}){qn(this,ru,void 0);qn(this,rp,void 0);qn(this,sp,void 0);qn(this,Wi,void 0);qn(this,Bi,void 0);qn(this,su,void 0);this.analyze=(...t)=>{if(!sn(this,rp))return;let n=this.tf.engine().state.numTensors,a=sn(this,ru);ga(this,ru,n);let r=n-a;r!==0&&ce(...t,r)};qn(this,P0,t=>{if(!sn(this,sp))return null;if(!t)return"input is not defined";if(this.tf.ENV.flags.IS_NODE&&!(t instanceof Le))return"input must be a tensor";try{this.tf.getBackend()}catch(n){return"backend not loaded"}return null});qn(this,ip,async(t=!1)=>{var n;if(this.config.backend&&this.config.backend.length>0&&t||this.tf.getBackend()!==this.config.backend){let a=nt();if(this.state="backend",this.config.backend&&this.config.backend.length>0){if(typeof window=="undefined"&&typeof WorkerGlobalScope!="undefined"&&this.config.debug&&ce("running inside web worker"),this.tf.ENV.flags.IS_BROWSER&&this.config.backend==="tensorflow"&&(this.config.backend="webgl"),this.tf.ENV.flags.IS_NODE&&(this.config.backend==="webgl"||this.config.backend==="humangl")&&(this.config.backend="tensorflow"),this.config.debug&&ce("setting backend:",this.config.backend),this.config.backend==="wasm"){if(this.config.debug&&ce("wasm path:",this.config.wasmPath),typeof((n=this.tf)==null?void 0:n.setWasmPaths)!="undefined")this.tf.setWasmPaths(this.config.wasmPath);else throw new Error("Human: WASM backend is not loaded");let r=await this.tf.env().getAsync("WASM_HAS_SIMD_SUPPORT"),s=await this.tf.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT");this.config.debug&&ce(`wasm execution: ${r?"SIMD":"no SIMD"} ${s?"multithreaded":"singlethreaded"}`),this.config.debug&&!r&&ce("warning: wasm simd support is not enabled")}this.config.backend==="humangl"&&fk();try{await this.tf.setBackend(this.config.backend)}catch(r){ce("error: cannot set backend:",this.config.backend,r)}}if(this.tf.enableProdMode(),this.tf.getBackend()==="webgl"||this.tf.getBackend()==="humangl"){this.tf.ENV.set("CHECK_COMPUTATION_FOR_ERRORS",!1),this.tf.ENV.set("WEBGL_CPU_FORWARD",!0),oa.set("WEBGL_FORCE_F16_TEXTURES",!0),this.tf.ENV.set("WEBGL_PACK_DEPTHWISECONV",!0),typeof this.config.deallocate!="undefined"&&(ce("changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:",!0),this.tf.ENV.set("WEBGL_DELETE_TEXTURE_THRESHOLD",0));let r=await this.tf.backend().getGPGPUContext().gl;this.config.debug&&ce(`gl version:${r.getParameter(r.VERSION)} renderer:${r.getParameter(r.RENDERER)}`)}await this.tf.ready(),this.perf.backend=Math.trunc(nt()-a)}});qn(this,L0,async t=>{if(this.config.cacheSensitivity===0)return!1;let n=40,a=t.resizeBilinear([Math.trunc(t.shape[1]/n),Math.trunc(t.shape[2]/n)]),r=this.tf.sum(a),s=r.dataSync()[0];r.dispose(),a.dispose();let i=Math.max(s,sn(this,Bi))/Math.min(s,sn(this,Bi))-1;ga(this,Bi,s);let o=i4*this.config.cacheSensitivity?0:i),o});qn(this,W0,async()=>{let t=(r,s="application/octet-stream")=>fetch(`data:${s};base64,${r}`).then(i=>i.blob()),n,a;switch(this.config.warmup){case"face":n=await t(O0);break;case"full":n=await t(_0);break;default:n=null}if(n){let r=await createImageBitmap(n);a=await this.detect(r,this.config),r.close()}return a});qn(this,B0,async()=>new Promise(t=>{let n,a=0;switch(this.config.warmup){case"face":a=256,n="data:image/jpeg;base64,"+O0;break;case"full":case"body":a=1200,n="data:image/jpeg;base64,"+_0;break;default:n=null}let r=new Image;r.onload=async()=>{let s=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(a,a):document.createElement("canvas");s.width=r.naturalWidth,s.height=r.naturalHeight;let i=s.getContext("2d");i==null||i.drawImage(r,0,0);let o=await this.detect(s,this.config);t(o)},n?r.src=n:t(null)}));qn(this,V0,async()=>{let t=r=>Buffer.from(r,"base64"),n;if(this.config.warmup==="face"&&(n=t(O0)),(this.config.warmup==="body"||this.config.warmup==="full")&&(n=t(_0)),!n)return null;let a;if(typeof void 0!="undefined"){let r=(void 0).decodeJpeg(n),s=r.expandDims(0);this.tf.dispose(r),a=await this.detect(s,this.config),this.tf.dispose(s)}else this.config.debug&&ce("Warmup tfjs-node not loaded");return a});this.tf=Yd,this.draw=zg,this.version=l9,this.config=Xn(Kg,t),this.state="idle",ga(this,ru,0),ga(this,rp,!1),ga(this,sp,!1),ga(this,Wi,!0),ga(this,su,0),this.perf={},this.models={face:null,posenet:null,blazepose:null,efficientpose:null,handpose:null,iris:null,age:null,gender:null,emotion:null,embedding:null,nanodet:null,centernet:null,faceres:null},this.image=n=>$g(n,this.config),this.classes={facemesh:X2,emotion:J2,faceres:ag,body:this.config.body.modelPath.includes("posenet")?cg:wg,hand:xg,nanodet:Tg,centernet:Fg},this.faceTriangulation=Nk,this.faceUVMap=Tk,this.sysinfo=Zg(),ga(this,Bi,1)}similarity(t,n){return tg(t,n)}enhance(t){return ng(t)}match(t,n,a=0){return Rk(t,n,a)}async load(t={}){this.state="load";let n=nt();t&&(this.config=Xn(this.config,t)),sn(this,Wi)&&(this.config.debug&&ce(`version: ${this.version}`),this.config.debug&&ce(`tfjs version: ${this.tf.version_core}`),this.config.debug&&ce("platform:",this.sysinfo.platform),this.config.debug&&ce("agent:",this.sysinfo.agent),await sn(this,ip).call(this,!0),this.tf.ENV.flags.IS_BROWSER&&(this.config.debug&&ce("configuration:",this.config),this.config.debug&&ce("tf flags:",this.tf.ENV.flags))),this.config.async?[this.models.face,this.models.emotion,this.models.handpose,this.models.posenet,this.models.blazepose,this.models.nanodet,this.models.centernet,this.models.faceres]=await Promise.all([this.models.face||(this.config.face.enabled?q2(this.config):null),this.models.emotion||(this.config.face.enabled&&this.config.face.emotion.enabled?Y2(this.config):null),this.models.handpose||(this.config.hand.enabled?gg(this.config):null),this.models.posenet||(this.config.body.enabled&&this.config.body.modelPath.includes("posenet")?pg(this.config):null),this.models.blazepose||(this.config.body.enabled&&this.config.body.modelPath.includes("blazepose")?bg(this.config):null),this.models.nanodet||(this.config.object.enabled&&this.config.object.modelPath.includes("nanodet")?Sg(this.config):null),this.models.centernet||(this.config.object.enabled&&this.config.object.modelPath.includes("centernet")?Rg(this.config):null),this.models.faceres||(this.config.face.enabled&&this.config.face.description.enabled?eg(this.config):null)]):(this.config.face.enabled&&!this.models.face&&(this.models.face=await q2(this.config)),this.config.face.enabled&&this.config.face.emotion.enabled&&!this.models.emotion&&(this.models.emotion=await Y2(this.config)),this.config.hand.enabled&&!this.models.handpose&&(this.models.handpose=await gg(this.config)),this.config.body.enabled&&!this.models.posenet&&this.config.body.modelPath.includes("posenet")&&(this.models.posenet=await pg(this.config)),this.config.body.enabled&&!this.models.blazepose&&this.config.body.modelPath.includes("blazepose")&&(this.models.blazepose=await bg(this.config)),this.config.object.enabled&&!this.models.nanodet&&this.config.object.modelPath.includes("nanodet")&&(this.models.nanodet=await Sg(this.config)),this.config.object.enabled&&!this.models.centernet&&this.config.object.modelPath.includes("centernet")&&(this.models.centernet=await Rg(this.config)),this.config.face.enabled&&this.config.face.description.enabled&&!this.models.faceres&&(this.models.faceres=await eg(this.config))),sn(this,Wi)&&(this.config.debug&&ce("tf engine state:",this.tf.engine().state.numBytes,"bytes",this.tf.engine().state.numTensors,"tensors"),ga(this,Wi,!1));let a=Math.trunc(nt()-n);a>(this.perf.load||0)&&(this.perf.load=a)}async detect(t,n={}){return new Promise(async a=>{this.state="config";let r;this.config=Xn(this.config,n),this.state="check";let s=sn(this,P0).call(this,t);s&&(ce(s,t),a({error:s}));let i=nt();await sn(this,ip).call(this),await this.load(),r=nt();let o=$g(t,this.config);if(!o||!o.tensor){ce("could not convert input to tensor"),a({error:"could not convert input to tensor"});return}this.perf.image=Math.trunc(nt()-r),this.analyze("Get Image:"),r=nt(),this.config.skipFrame=await sn(this,L0).call(this,o.tensor),this.perf.frames||(this.perf.frames=0),this.perf.cached||(this.perf.cached=0),this.perf.frames++,this.config.skipFrame&&this.perf.cached++,this.perf.changed=Math.trunc(nt()-r),this.analyze("Check Changed:");let l,u,d,p,c;this.config.async?(d=this.config.face.enabled?rg(this,o.tensor):[],this.perf.face&&delete this.perf.face):(this.state="run:face",r=nt(),d=this.config.face.enabled?await rg(this,o.tensor):[],c=Math.trunc(nt()-r),c>0&&(this.perf.face=c)),this.analyze("Start Body:"),this.config.async?(this.config.body.modelPath.includes("posenet")?l=this.config.body.enabled?dg(o.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")&&(l=this.config.body.enabled?vg(o.tensor,this.config):[]),this.perf.body&&delete this.perf.body):(this.state="run:body",r=nt(),this.config.body.modelPath.includes("posenet")?l=this.config.body.enabled?await dg(o.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")&&(l=this.config.body.enabled?await vg(o.tensor,this.config):[]),c=Math.trunc(nt()-r),c>0&&(this.perf.body=c)),this.analyze("End Body:"),this.analyze("Start Hand:"),this.config.async?(u=this.config.hand.enabled?yg(o.tensor,this.config):[],this.perf.hand&&delete this.perf.hand):(this.state="run:hand",r=nt(),u=this.config.hand.enabled?await yg(o.tensor,this.config):[],c=Math.trunc(nt()-r),c>0&&(this.perf.hand=c)),this.analyze("End Hand:"),this.analyze("Start Object:"),this.config.async?(this.config.object.modelPath.includes("nanodet")?p=this.config.object.enabled?Ng(o.tensor,this.config):[]:this.config.object.modelPath.includes("centernet")&&(p=this.config.object.enabled?Mg(o.tensor,this.config):[]),this.perf.object&&delete this.perf.object):(this.state="run:object",r=nt(),this.config.object.modelPath.includes("nanodet")?p=this.config.object.enabled?await Ng(o.tensor,this.config):[]:this.config.object.modelPath.includes("centernet")&&(p=this.config.object.enabled?await Mg(o.tensor,this.config):[]),c=Math.trunc(nt()-r),c>0&&(this.perf.object=c)),this.analyze("End Object:"),this.config.async&&([d,l,u,p]=await Promise.all([d,l,u,p])),Ee(o.tensor);let h=[];this.config.gesture.enabled&&(r=nt(),h=[...Qk(d),...Jk(l),...t9(u),...e9(d)],this.config.async?this.perf.gesture&&delete this.perf.gesture:this.perf.gesture=Math.trunc(nt()-r)),this.perf.total=Math.trunc(nt()-i),this.state="idle";let m={face:d,body:l,hand:u,gesture:h,object:p,performance:this.perf,canvas:o.canvas};a(m)})}async warmup(t={}){let n=nt();if(t&&(this.config=Xn(this.config,t)),!this.config.warmup||this.config.warmup==="none")return{error:"null"};let a;typeof createImageBitmap=="function"?a=await sn(this,W0).call(this):typeof Image!="undefined"?a=await sn(this,B0).call(this):a=await sn(this,V0).call(this);let r=nt();return this.config.debug&&ce("Warmup",this.config.warmup,Math.round(r-n),"ms",a),a}};ru=new WeakMap,rp=new WeakMap,sp=new WeakMap,Wi=new WeakMap,Bi=new WeakMap,su=new WeakMap,P0=new WeakMap,ip=new WeakMap,L0=new WeakMap,W0=new WeakMap,B0=new WeakMap,V0=new WeakMap;return poe;})(); /** * @license * Copyright 2017 Google LLC. All Rights Reserved. diff --git a/dist/human.node-gpu.js b/dist/human.node-gpu.js index b0ad189d..8a1c0fb2 100644 --- a/dist/human.node-gpu.js +++ b/dist/human.node-gpu.js @@ -19595,7 +19595,7 @@ lBhEMohlFerLlBjEMohMVTEARDKCITsAk2AEgAAAkAAAAAAAAAAAAAAAAAAAAAAAASAAAAAAAAD/ 2Q==`; // package.json -var version = "1.9.0"; +var version = "1.9.1"; // src/human.ts var _numTensors, _analyzeMemoryLeaks, _checkSanity, _firstRun, _lastInputSum, _lastCacheDiff, _sanity, _checkBackend, _skipFrame, _warmupBitmap, _warmupCanvas, _warmupNode; diff --git a/dist/human.node-wasm.js b/dist/human.node-wasm.js index f1fae4eb..166136e6 100644 --- a/dist/human.node-wasm.js +++ b/dist/human.node-wasm.js @@ -19596,7 +19596,7 @@ lBhEMohlFerLlBjEMohMVTEARDKCITsAk2AEgAAAkAAAAAAAAAAAAAAAAAAAAAAAASAAAAAAAAD/ 2Q==`; // package.json -var version = "1.9.0"; +var version = "1.9.1"; // src/human.ts var _numTensors, _analyzeMemoryLeaks, _checkSanity, _firstRun, _lastInputSum, _lastCacheDiff, _sanity, _checkBackend, _skipFrame, _warmupBitmap, _warmupCanvas, _warmupNode; diff --git a/dist/human.node.js b/dist/human.node.js index e520a22b..b2065595 100644 --- a/dist/human.node.js +++ b/dist/human.node.js @@ -19595,7 +19595,7 @@ lBhEMohlFerLlBjEMohMVTEARDKCITsAk2AEgAAAkAAAAAAAAAAAAAAAAAAAAAAAASAAAAAAAAD/ 2Q==`; // package.json -var version = "1.9.0"; +var version = "1.9.1"; // src/human.ts var _numTensors, _analyzeMemoryLeaks, _checkSanity, _firstRun, _lastInputSum, _lastCacheDiff, _sanity, _checkBackend, _skipFrame, _warmupBitmap, _warmupCanvas, _warmupNode; diff --git a/server/build.log b/server/build.log index 534f5057..d383c954 100644 --- a/server/build.log +++ b/server/build.log @@ -1,68 +1,17 @@ -2021-05-18 08:16:58 INFO:  @vladmandic/human version 1.8.5 -2021-05-18 08:16:58 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.0.0 -2021-05-18 08:16:58 INFO:  Build: file startup all type: production config: {"minifyWhitespace":true,"minifyIdentifiers":true,"minifySyntax":true} -2021-05-18 08:16:58 STATE: Build for: node type: tfjs: {"imports":1,"importBytes":39,"outputBytes":1284,"outputFiles":"dist/tfjs.esm.js"} -2021-05-18 08:16:58 STATE: Build for: node type: node: {"imports":35,"importBytes":413593,"outputBytes":372832,"outputFiles":"dist/human.node.js"} -2021-05-18 08:16:58 STATE: Build for: nodeGPU type: tfjs: {"imports":1,"importBytes":43,"outputBytes":1292,"outputFiles":"dist/tfjs.esm.js"} -2021-05-18 08:16:58 STATE: Build for: nodeGPU type: node: {"imports":35,"importBytes":413601,"outputBytes":372836,"outputFiles":"dist/human.node-gpu.js"} -2021-05-18 08:16:58 STATE: Build for: nodeWASM type: tfjs: {"imports":1,"importBytes":81,"outputBytes":1359,"outputFiles":"dist/tfjs.esm.js"} -2021-05-18 08:16:58 STATE: Build for: nodeWASM type: node: {"imports":35,"importBytes":413668,"outputBytes":372908,"outputFiles":"dist/human.node-wasm.js"} -2021-05-18 08:16:58 STATE: Build for: browserNoBundle type: tfjs: {"imports":1,"importBytes":2488,"outputBytes":1394,"outputFiles":"dist/tfjs.esm.js"} -2021-05-18 08:16:58 STATE: Build for: browserNoBundle type: esm: {"imports":35,"importBytes":413703,"outputBytes":229716,"outputFiles":"dist/human.esm-nobundle.js"} -2021-05-18 08:16:59 STATE: Build for: browserBundle type: tfjs: {"modules":1274,"moduleBytes":4114813,"imports":7,"importBytes":2488,"outputBytes":1111414,"outputFiles":"dist/tfjs.esm.js"} -2021-05-18 08:16:59 STATE: Build for: browserBundle type: iife: {"imports":35,"importBytes":1523723,"outputBytes":1337578,"outputFiles":"dist/human.js"} -2021-05-18 08:17:00 STATE: Build for: browserBundle type: esm: {"imports":35,"importBytes":1523723,"outputBytes":1337570,"outputFiles":"dist/human.esm.js"} -2021-05-18 08:17:00 INFO:  Generate types: ["src/human.ts"] -2021-05-18 08:17:05 INFO:  Update Change log: ["/home/vlado/dev/human/CHANGELOG.md"] -2021-05-18 08:17:05 INFO:  Generate TypeDocs: ["src/human.ts"] -2021-05-18 11:33:54 INFO:  @vladmandic/human version 1.9.0 -2021-05-18 11:33:54 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.0.0 -2021-05-18 11:33:54 INFO:  Build: file startup all type: production config: {"minifyWhitespace":true,"minifyIdentifiers":true,"minifySyntax":true} -2021-05-18 11:33:54 STATE: Build for: node type: tfjs: {"imports":1,"importBytes":39,"outputBytes":1284,"outputFiles":"dist/tfjs.esm.js"} -2021-05-18 11:33:54 STATE: Build for: node type: node: {"imports":35,"importBytes":413201,"outputBytes":373086,"outputFiles":"dist/human.node.js"} -2021-05-18 11:33:54 STATE: Build for: nodeGPU type: tfjs: {"imports":1,"importBytes":43,"outputBytes":1292,"outputFiles":"dist/tfjs.esm.js"} -2021-05-18 11:33:54 STATE: Build for: nodeGPU type: node: {"imports":35,"importBytes":413209,"outputBytes":373090,"outputFiles":"dist/human.node-gpu.js"} -2021-05-18 11:33:54 STATE: Build for: nodeWASM type: tfjs: {"imports":1,"importBytes":81,"outputBytes":1359,"outputFiles":"dist/tfjs.esm.js"} -2021-05-18 11:33:54 STATE: Build for: nodeWASM type: node: {"imports":35,"importBytes":413276,"outputBytes":373162,"outputFiles":"dist/human.node-wasm.js"} -2021-05-18 11:33:54 STATE: Build for: browserNoBundle type: tfjs: {"imports":1,"importBytes":2488,"outputBytes":1394,"outputFiles":"dist/tfjs.esm.js"} -2021-05-18 11:33:54 STATE: Build for: browserNoBundle type: esm: {"imports":35,"importBytes":413311,"outputBytes":229697,"outputFiles":"dist/human.esm-nobundle.js"} -2021-05-18 11:33:55 STATE: Build for: browserBundle type: tfjs: {"modules":1274,"moduleBytes":4114813,"imports":7,"importBytes":2488,"outputBytes":1111414,"outputFiles":"dist/tfjs.esm.js"} -2021-05-18 11:33:55 STATE: Build for: browserBundle type: iife: {"imports":35,"importBytes":1523331,"outputBytes":1337570,"outputFiles":"dist/human.js"} -2021-05-18 11:33:56 STATE: Build for: browserBundle type: esm: {"imports":35,"importBytes":1523331,"outputBytes":1337562,"outputFiles":"dist/human.esm.js"} -2021-05-18 11:33:56 INFO:  Generate types: ["src/human.ts"] -2021-05-18 11:34:00 INFO:  Update Change log: ["/home/vlado/dev/human/CHANGELOG.md"] -2021-05-18 11:34:00 INFO:  Generate TypeDocs: ["src/human.ts"] -2021-05-18 11:35:32 INFO:  @vladmandic/human version 1.9.0 -2021-05-18 11:35:32 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.0.0 -2021-05-18 11:35:32 INFO:  Build: file startup all type: production config: {"minifyWhitespace":true,"minifyIdentifiers":true,"minifySyntax":true} -2021-05-18 11:35:32 STATE: Build for: node type: tfjs: {"imports":1,"importBytes":39,"outputBytes":1284,"outputFiles":"dist/tfjs.esm.js"} -2021-05-18 11:35:32 STATE: Build for: node type: node: {"imports":35,"importBytes":413201,"outputBytes":373086,"outputFiles":"dist/human.node.js"} -2021-05-18 11:35:32 STATE: Build for: nodeGPU type: tfjs: {"imports":1,"importBytes":43,"outputBytes":1292,"outputFiles":"dist/tfjs.esm.js"} -2021-05-18 11:35:32 STATE: Build for: nodeGPU type: node: {"imports":35,"importBytes":413209,"outputBytes":373090,"outputFiles":"dist/human.node-gpu.js"} -2021-05-18 11:35:32 STATE: Build for: nodeWASM type: tfjs: {"imports":1,"importBytes":81,"outputBytes":1359,"outputFiles":"dist/tfjs.esm.js"} -2021-05-18 11:35:32 STATE: Build for: nodeWASM type: node: {"imports":35,"importBytes":413276,"outputBytes":373162,"outputFiles":"dist/human.node-wasm.js"} -2021-05-18 11:35:32 STATE: Build for: browserNoBundle type: tfjs: {"imports":1,"importBytes":2488,"outputBytes":1394,"outputFiles":"dist/tfjs.esm.js"} -2021-05-18 11:35:32 STATE: Build for: browserNoBundle type: esm: {"imports":35,"importBytes":413311,"outputBytes":229697,"outputFiles":"dist/human.esm-nobundle.js"} -2021-05-18 11:35:32 STATE: Build for: browserBundle type: tfjs: {"modules":1274,"moduleBytes":4114813,"imports":7,"importBytes":2488,"outputBytes":1111414,"outputFiles":"dist/tfjs.esm.js"} -2021-05-18 11:35:33 STATE: Build for: browserBundle type: iife: {"imports":35,"importBytes":1523331,"outputBytes":1337570,"outputFiles":"dist/human.js"} -2021-05-18 11:35:33 STATE: Build for: browserBundle type: esm: {"imports":35,"importBytes":1523331,"outputBytes":1337562,"outputFiles":"dist/human.esm.js"} -2021-05-18 11:35:33 INFO:  Generate types: ["src/human.ts"] -2021-05-18 11:35:37 INFO:  Update Change log: ["/home/vlado/dev/human/CHANGELOG.md"] -2021-05-18 11:35:37 INFO:  Generate TypeDocs: ["src/human.ts"] -2021-05-20 19:13:20 INFO:  @vladmandic/human version 1.9.0 -2021-05-20 19:13:20 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.0.0 -2021-05-20 19:13:20 INFO:  Build: file startup all type: production config: {"minifyWhitespace":true,"minifyIdentifiers":true,"minifySyntax":true} -2021-05-20 19:13:21 STATE: Build for: node type: tfjs: {"imports":1,"importBytes":39,"outputBytes":1292,"outputFiles":"dist/tfjs.esm.js"} -2021-05-20 19:13:21 STATE: Build for: node type: node: {"imports":36,"importBytes":418558,"outputBytes":377904,"outputFiles":"dist/human.node.js"} -2021-05-20 19:13:21 STATE: Build for: nodeGPU type: tfjs: {"imports":1,"importBytes":43,"outputBytes":1300,"outputFiles":"dist/tfjs.esm.js"} -2021-05-20 19:13:21 STATE: Build for: nodeGPU type: node: {"imports":36,"importBytes":418566,"outputBytes":377908,"outputFiles":"dist/human.node-gpu.js"} -2021-05-20 19:13:21 STATE: Build for: nodeWASM type: tfjs: {"imports":1,"importBytes":81,"outputBytes":1367,"outputFiles":"dist/tfjs.esm.js"} -2021-05-20 19:13:21 STATE: Build for: nodeWASM type: node: {"imports":36,"importBytes":418633,"outputBytes":377980,"outputFiles":"dist/human.node-wasm.js"} -2021-05-20 19:13:21 STATE: Build for: browserNoBundle type: tfjs: {"imports":1,"importBytes":2488,"outputBytes":1394,"outputFiles":"dist/tfjs.esm.js"} -2021-05-20 19:13:21 STATE: Build for: browserNoBundle type: esm: {"imports":36,"importBytes":418660,"outputBytes":232241,"outputFiles":"dist/human.esm-nobundle.js"} -2021-05-20 19:13:22 STATE: Build for: browserBundle type: tfjs: {"modules":1274,"moduleBytes":4114813,"imports":7,"importBytes":2488,"outputBytes":1111414,"outputFiles":"dist/tfjs.esm.js"} -2021-05-20 19:13:22 STATE: Build for: browserBundle type: iife: {"imports":36,"importBytes":1528680,"outputBytes":1340102,"outputFiles":"dist/human.js"} -2021-05-20 19:13:23 STATE: Build for: browserBundle type: esm: {"imports":36,"importBytes":1528680,"outputBytes":1340094,"outputFiles":"dist/human.esm.js"} -2021-05-20 19:13:23 INFO:  Generate types: ["src/human.ts"] -2021-05-20 19:13:28 INFO:  Update Change log: ["/home/vlado/dev/human/CHANGELOG.md"] -2021-05-20 19:13:28 INFO:  Generate TypeDocs: ["src/human.ts"] +2021-05-21 06:52:07 INFO:  @vladmandic/human version 1.9.1 +2021-05-21 06:52:07 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.0.0 +2021-05-21 06:52:07 INFO:  Build: file startup all type: production config: {"minifyWhitespace":true,"minifyIdentifiers":true,"minifySyntax":true} +2021-05-21 06:52:07 STATE: Build for: node type: tfjs: {"imports":1,"importBytes":39,"outputBytes":1292,"outputFiles":"dist/tfjs.esm.js"} +2021-05-21 06:52:07 STATE: Build for: node type: node: {"imports":36,"importBytes":418558,"outputBytes":377904,"outputFiles":"dist/human.node.js"} +2021-05-21 06:52:07 STATE: Build for: nodeGPU type: tfjs: {"imports":1,"importBytes":43,"outputBytes":1300,"outputFiles":"dist/tfjs.esm.js"} +2021-05-21 06:52:07 STATE: Build for: nodeGPU type: node: {"imports":36,"importBytes":418566,"outputBytes":377908,"outputFiles":"dist/human.node-gpu.js"} +2021-05-21 06:52:07 STATE: Build for: nodeWASM type: tfjs: {"imports":1,"importBytes":81,"outputBytes":1367,"outputFiles":"dist/tfjs.esm.js"} +2021-05-21 06:52:07 STATE: Build for: nodeWASM type: node: {"imports":36,"importBytes":418633,"outputBytes":377980,"outputFiles":"dist/human.node-wasm.js"} +2021-05-21 06:52:07 STATE: Build for: browserNoBundle type: tfjs: {"imports":1,"importBytes":2488,"outputBytes":1394,"outputFiles":"dist/tfjs.esm.js"} +2021-05-21 06:52:07 STATE: Build for: browserNoBundle type: esm: {"imports":36,"importBytes":418660,"outputBytes":232241,"outputFiles":"dist/human.esm-nobundle.js"} +2021-05-21 06:52:08 STATE: Build for: browserBundle type: tfjs: {"modules":1274,"moduleBytes":4114813,"imports":7,"importBytes":2488,"outputBytes":1111414,"outputFiles":"dist/tfjs.esm.js"} +2021-05-21 06:52:08 STATE: Build for: browserBundle type: iife: {"imports":36,"importBytes":1528680,"outputBytes":1340102,"outputFiles":"dist/human.js"} +2021-05-21 06:52:08 STATE: Build for: browserBundle type: esm: {"imports":36,"importBytes":1528680,"outputBytes":1340094,"outputFiles":"dist/human.esm.js"} +2021-05-21 06:52:08 INFO:  Generate types: ["src/human.ts"] +2021-05-21 06:52:13 INFO:  Update Change log: ["/home/vlado/dev/human/CHANGELOG.md"] +2021-05-21 06:52:13 INFO:  Generate TypeDocs: ["src/human.ts"] diff --git a/test/test.log b/test/test.log index 14c602c1..010524d2 100644 --- a/test/test.log +++ b/test/test.log @@ -1,338 +1,169 @@ -2021-05-18 08:19:42 INFO:  @vladmandic/human version 1.8.5 -2021-05-18 08:19:42 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.0.0 -2021-05-18 08:19:42 INFO:  tests: ["test-node.js","test-node-gpu.js","test-node-wasm.js"] -2021-05-18 08:19:42 INFO:  test-node.js start -2021-05-18 08:19:43 STATE: test-node.js passed: create human -2021-05-18 08:19:43 INFO:  test-node.js human version: 1.8.5 -2021-05-18 08:19:43 INFO:  test-node.js platform: linux x64 agent: NodeJS v16.0.0 -2021-05-18 08:19:43 INFO:  test-node.js tfjs version: 3.6.0 -2021-05-18 08:19:43 STATE: test-node.js passed: set backend: tensorflow -2021-05-18 08:19:43 STATE: test-node.js passed: load models -2021-05-18 08:19:43 STATE: test-node.js result: defined models: 12 loaded models: 6 -2021-05-18 08:19:43 STATE: test-node.js passed: warmup: none default -2021-05-18 08:19:45 STATE: test-node.js passed: warmup: face default -2021-05-18 08:19:45 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 5 object: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.52,"class":"person"} {"score":0.96,"keypoints":5} -2021-05-18 08:19:45 DATA:  test-node.js result: performance: load: 327 total: 1415 -2021-05-18 08:19:46 STATE: test-node.js passed: warmup: body default -2021-05-18 08:19:46 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 3 {"confidence":1,"age":29.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":0.92,"keypoints":17} -2021-05-18 08:19:46 DATA:  test-node.js result: performance: load: 327 total: 1454 -2021-05-18 08:19:46 INFO:  test-node.js test body variants -2021-05-18 08:19:47 STATE: test-node.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] -2021-05-18 08:19:49 STATE: test-node.js passed: detect: assets/human-sample-body.jpg posenet -2021-05-18 08:19:49 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 3 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":0.91,"keypoints":17} -2021-05-18 08:19:49 DATA:  test-node.js result: performance: load: 327 total: 1575 -2021-05-18 08:19:50 STATE: test-node.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] -2021-05-18 08:19:51 STATE: test-node.js passed: detect: assets/human-sample-body.jpg blazepose -2021-05-18 08:19:51 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 3 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":1,"keypoints":39} -2021-05-18 08:19:51 DATA:  test-node.js result: performance: load: 327 total: 1499 -2021-05-18 08:19:52 STATE: test-node.js passed: detect: random default -2021-05-18 08:19:52 DATA:  test-node.js result: face: 0 body: 1 hand: 0 gesture: 1 object: 0 {} {} {"score":1,"keypoints":39} -2021-05-18 08:19:52 DATA:  test-node.js result: performance: load: 327 total: 660 -2021-05-18 08:19:52 INFO:  test-node.js test: first instance -2021-05-18 08:19:53 STATE: test-node.js passed: load image: assets/sample-me.jpg [1,700,700,3] -2021-05-18 08:19:54 STATE: test-node.js passed: detect: assets/sample-me.jpg default -2021-05-18 08:19:54 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 2 {"confidence":1,"age":39.2,"gender":"male"} {"score":0.7,"class":"person"} {"score":1,"keypoints":39} -2021-05-18 08:19:54 DATA:  test-node.js result: performance: load: 327 total: 1481 -2021-05-18 08:19:54 INFO:  test-node.js test: second instance -2021-05-18 08:19:54 STATE: test-node.js passed: load image: assets/sample-me.jpg [1,700,700,3] -2021-05-18 08:19:56 STATE: test-node.js passed: detect: assets/sample-me.jpg default -2021-05-18 08:19:56 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 2 {"confidence":1,"age":39.2,"gender":"male"} {"score":0.7,"class":"person"} {"score":1,"keypoints":39} -2021-05-18 08:19:56 DATA:  test-node.js result: performance: load: 2 total: 1340 -2021-05-18 08:19:56 INFO:  test-node.js test: concurrent -2021-05-18 08:19:56 STATE: test-node.js passed: load image: assets/human-sample-face.jpg [1,256,256,3] -2021-05-18 08:19:56 STATE: test-node.js passed: load image: assets/human-sample-face.jpg [1,256,256,3] -2021-05-18 08:19:57 STATE: test-node.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] -2021-05-18 08:19:58 STATE: test-node.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] -2021-05-18 08:20:03 STATE: test-node.js passed: detect: assets/human-sample-face.jpg default -2021-05-18 08:20:03 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.53,"class":"person"} {"score":1,"keypoints":39} -2021-05-18 08:20:03 DATA:  test-node.js result: performance: load: 327 total: 5127 -2021-05-18 08:20:03 STATE: test-node.js passed: detect: assets/human-sample-face.jpg default -2021-05-18 08:20:03 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.53,"class":"person"} {"score":1,"keypoints":39} -2021-05-18 08:20:03 DATA:  test-node.js result: performance: load: 2 total: 5127 -2021-05-18 08:20:03 STATE: test-node.js passed: detect: assets/human-sample-body.jpg default -2021-05-18 08:20:03 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 3 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":1,"keypoints":39} -2021-05-18 08:20:03 DATA:  test-node.js result: performance: load: 327 total: 5127 -2021-05-18 08:20:03 STATE: test-node.js passed: detect: assets/human-sample-body.jpg default -2021-05-18 08:20:03 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 3 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":1,"keypoints":39} -2021-05-18 08:20:03 DATA:  test-node.js result: performance: load: 2 total: 5127 -2021-05-18 08:20:03 INFO:  test-node.js test complete: 20012 ms -2021-05-18 08:20:03 INFO:  test-node-gpu.js start -2021-05-18 08:20:03 WARN:  test-node-gpu.js stderr: 2021-05-18 08:20:03.952463: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory -2021-05-18 08:20:04 WARN:  test-node-gpu.js stderr: 2021-05-18 08:20:04.007907: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory -2021-05-18 08:20:04 WARN:  test-node-gpu.js stderr: 2021-05-18 08:20:04.007951: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (wyse): /proc/driver/nvidia/version does not exist -2021-05-18 08:20:04 STATE: test-node-gpu.js passed: create human -2021-05-18 08:20:04 INFO:  test-node-gpu.js human version: 1.8.5 -2021-05-18 08:20:04 INFO:  test-node-gpu.js platform: linux x64 agent: NodeJS v16.0.0 -2021-05-18 08:20:04 INFO:  test-node-gpu.js tfjs version: 3.6.0 -2021-05-18 08:20:04 STATE: test-node-gpu.js passed: set backend: tensorflow -2021-05-18 08:20:04 STATE: test-node-gpu.js passed: load models -2021-05-18 08:20:04 STATE: test-node-gpu.js result: defined models: 12 loaded models: 6 -2021-05-18 08:20:04 STATE: test-node-gpu.js passed: warmup: none default -2021-05-18 08:20:05 STATE: test-node-gpu.js passed: warmup: face default -2021-05-18 08:20:05 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 5 object: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.52,"class":"person"} {"score":0.96,"keypoints":5} -2021-05-18 08:20:05 DATA:  test-node-gpu.js result: performance: load: 331 total: 1444 -2021-05-18 08:20:07 STATE: test-node-gpu.js passed: warmup: body default -2021-05-18 08:20:07 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 3 {"confidence":1,"age":29.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":0.92,"keypoints":17} -2021-05-18 08:20:07 DATA:  test-node-gpu.js result: performance: load: 331 total: 1425 -2021-05-18 08:20:07 INFO:  test-node-gpu.js test body variants -2021-05-18 08:20:08 STATE: test-node-gpu.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] -2021-05-18 08:20:09 STATE: test-node-gpu.js passed: detect: assets/human-sample-body.jpg posenet -2021-05-18 08:20:09 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 3 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":0.91,"keypoints":17} -2021-05-18 08:20:09 DATA:  test-node-gpu.js result: performance: load: 331 total: 1577 -2021-05-18 08:20:10 STATE: test-node-gpu.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] -2021-05-18 08:20:12 STATE: test-node-gpu.js passed: detect: assets/human-sample-body.jpg blazepose -2021-05-18 08:20:12 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 3 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":1,"keypoints":39} -2021-05-18 08:20:12 DATA:  test-node-gpu.js result: performance: load: 331 total: 1615 -2021-05-18 08:20:13 STATE: test-node-gpu.js passed: detect: random default -2021-05-18 08:20:13 DATA:  test-node-gpu.js result: face: 0 body: 1 hand: 0 gesture: 1 object: 0 {} {} {"score":1,"keypoints":39} -2021-05-18 08:20:13 DATA:  test-node-gpu.js result: performance: load: 331 total: 680 -2021-05-18 08:20:13 INFO:  test-node-gpu.js test: first instance -2021-05-18 08:20:13 STATE: test-node-gpu.js passed: load image: assets/sample-me.jpg [1,700,700,3] -2021-05-18 08:20:15 STATE: test-node-gpu.js passed: detect: assets/sample-me.jpg default -2021-05-18 08:20:15 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 2 {"confidence":1,"age":39.2,"gender":"male"} {"score":0.7,"class":"person"} {"score":1,"keypoints":39} -2021-05-18 08:20:15 DATA:  test-node-gpu.js result: performance: load: 331 total: 1415 -2021-05-18 08:20:15 INFO:  test-node-gpu.js test: second instance -2021-05-18 08:20:15 STATE: test-node-gpu.js passed: load image: assets/sample-me.jpg [1,700,700,3] -2021-05-18 08:20:16 STATE: test-node-gpu.js passed: detect: assets/sample-me.jpg default -2021-05-18 08:20:16 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 2 {"confidence":1,"age":39.2,"gender":"male"} {"score":0.7,"class":"person"} {"score":1,"keypoints":39} -2021-05-18 08:20:16 DATA:  test-node-gpu.js result: performance: load: 2 total: 1283 -2021-05-18 08:20:16 INFO:  test-node-gpu.js test: concurrent -2021-05-18 08:20:16 STATE: test-node-gpu.js passed: load image: assets/human-sample-face.jpg [1,256,256,3] -2021-05-18 08:20:16 STATE: test-node-gpu.js passed: load image: assets/human-sample-face.jpg [1,256,256,3] -2021-05-18 08:20:17 STATE: test-node-gpu.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] -2021-05-18 08:20:18 STATE: test-node-gpu.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] -2021-05-18 08:20:24 STATE: test-node-gpu.js passed: detect: assets/human-sample-face.jpg default -2021-05-18 08:20:24 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.53,"class":"person"} {"score":1,"keypoints":39} -2021-05-18 08:20:24 DATA:  test-node-gpu.js result: performance: load: 331 total: 5072 -2021-05-18 08:20:24 STATE: test-node-gpu.js passed: detect: assets/human-sample-face.jpg default -2021-05-18 08:20:24 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.53,"class":"person"} {"score":1,"keypoints":39} -2021-05-18 08:20:24 DATA:  test-node-gpu.js result: performance: load: 2 total: 5072 -2021-05-18 08:20:24 STATE: test-node-gpu.js passed: detect: assets/human-sample-body.jpg default -2021-05-18 08:20:24 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 3 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":1,"keypoints":39} -2021-05-18 08:20:24 DATA:  test-node-gpu.js result: performance: load: 331 total: 5072 -2021-05-18 08:20:24 STATE: test-node-gpu.js passed: detect: assets/human-sample-body.jpg default -2021-05-18 08:20:24 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 3 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":1,"keypoints":39} -2021-05-18 08:20:24 DATA:  test-node-gpu.js result: performance: load: 2 total: 5072 -2021-05-18 08:20:24 INFO:  test-node-gpu.js test complete: 19964 ms -2021-05-18 08:20:24 INFO:  test-node-wasm.js start -2021-05-18 08:20:24 STATE: test-node-wasm.js passed: model server: http://localhost:10030/models/ -2021-05-18 08:20:24 STATE: test-node-wasm.js passed: create human -2021-05-18 08:20:24 INFO:  test-node-wasm.js human version: 1.8.5 -2021-05-18 08:20:24 INFO:  test-node-wasm.js platform: linux x64 agent: NodeJS v16.0.0 -2021-05-18 08:20:24 INFO:  test-node-wasm.js tfjs version: 3.6.0 -2021-05-18 08:20:25 STATE: test-node-wasm.js passed: set backend: wasm -2021-05-18 08:20:25 STATE: test-node-wasm.js passed: load models -2021-05-18 08:20:25 STATE: test-node-wasm.js result: defined models: 12 loaded models: 5 -2021-05-18 08:20:25 STATE: test-node-wasm.js passed: warmup: none default -2021-05-18 08:20:25 ERROR: test-node-wasm.js failed: warmup: face default -2021-05-18 08:20:25 ERROR: test-node-wasm.js failed: warmup: body default -2021-05-18 08:20:25 INFO:  test-node-wasm.js test body variants -2021-05-18 08:20:27 STATE: test-node-wasm.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] -2021-05-18 08:20:30 STATE: test-node-wasm.js passed: detect: assets/human-sample-body.jpg posenet -2021-05-18 08:20:30 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 0 {"confidence":1,"age":28.5,"gender":"female"} {} {"score":0.91,"keypoints":17} -2021-05-18 08:20:30 DATA:  test-node-wasm.js result: performance: load: 652 total: 3246 -2021-05-18 08:20:32 STATE: test-node-wasm.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] -2021-05-18 08:20:34 STATE: test-node-wasm.js passed: detect: assets/human-sample-body.jpg blazepose -2021-05-18 08:20:34 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 0 {"confidence":1,"age":28.5,"gender":"female"} {} {"score":1,"keypoints":39} -2021-05-18 08:20:34 DATA:  test-node-wasm.js result: performance: load: 652 total: 2765 -2021-05-18 08:20:36 STATE: test-node-wasm.js passed: detect: random default -2021-05-18 08:20:36 DATA:  test-node-wasm.js result: face: 0 body: 1 hand: 0 gesture: 1 object: 0 {} {} {"score":1,"keypoints":39} -2021-05-18 08:20:36 DATA:  test-node-wasm.js result: performance: load: 652 total: 1704 -2021-05-18 08:20:36 INFO:  test-node-wasm.js test: first instance -2021-05-18 08:20:37 STATE: test-node-wasm.js passed: load image: assets/sample-me.jpg [1,700,700,3] -2021-05-18 08:20:39 STATE: test-node-wasm.js passed: detect: assets/sample-me.jpg default -2021-05-18 08:20:39 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 0 {"confidence":1,"age":39.2,"gender":"male"} {} {"score":1,"keypoints":39} -2021-05-18 08:20:39 DATA:  test-node-wasm.js result: performance: load: 652 total: 2393 -2021-05-18 08:20:39 INFO:  test-node-wasm.js test: second instance -2021-05-18 08:20:40 STATE: test-node-wasm.js passed: load image: assets/sample-me.jpg [1,700,700,3] -2021-05-18 08:20:42 STATE: test-node-wasm.js passed: detect: assets/sample-me.jpg default -2021-05-18 08:20:42 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 0 {"confidence":1,"age":39.2,"gender":"male"} {} {"score":1,"keypoints":39} -2021-05-18 08:20:42 DATA:  test-node-wasm.js result: performance: load: 4 total: 2320 -2021-05-18 08:20:42 INFO:  test-node-wasm.js test: concurrent -2021-05-18 08:20:42 STATE: test-node-wasm.js passed: load image: assets/human-sample-face.jpg [1,256,256,3] -2021-05-18 08:20:42 STATE: test-node-wasm.js passed: load image: assets/human-sample-face.jpg [1,256,256,3] -2021-05-18 08:20:44 STATE: test-node-wasm.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] -2021-05-18 08:20:46 STATE: test-node-wasm.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] -2021-05-18 08:20:55 STATE: test-node-wasm.js passed: detect: assets/human-sample-face.jpg default -2021-05-18 08:20:55 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 0 {"confidence":1,"age":23.6,"gender":"female"} {} {"score":1,"keypoints":39} -2021-05-18 08:20:55 DATA:  test-node-wasm.js result: performance: load: 652 total: 9157 -2021-05-18 08:20:55 STATE: test-node-wasm.js passed: detect: assets/human-sample-face.jpg default -2021-05-18 08:20:55 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 0 {"confidence":1,"age":23.6,"gender":"female"} {} {"score":1,"keypoints":39} -2021-05-18 08:20:55 DATA:  test-node-wasm.js result: performance: load: 4 total: 9157 -2021-05-18 08:20:55 STATE: test-node-wasm.js passed: detect: assets/human-sample-body.jpg default -2021-05-18 08:20:55 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 0 {"confidence":1,"age":28.5,"gender":"female"} {} {"score":1,"keypoints":39} -2021-05-18 08:20:55 DATA:  test-node-wasm.js result: performance: load: 652 total: 9157 -2021-05-18 08:20:55 STATE: test-node-wasm.js passed: detect: assets/human-sample-body.jpg default -2021-05-18 08:20:55 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 0 {"confidence":1,"age":28.5,"gender":"female"} {} {"score":1,"keypoints":39} -2021-05-18 08:20:55 DATA:  test-node-wasm.js result: performance: load: 4 total: 9157 -2021-05-18 08:20:55 INFO:  test-node-wasm.js test complete: 31472 ms -2021-05-18 08:20:55 INFO:  status: {"passed":68,"failed":2} -2021-05-18 11:27:34 INFO:  @vladmandic/human version 1.9.0 -2021-05-18 11:27:34 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.0.0 -2021-05-18 11:27:34 INFO:  tests: ["test-node.js","test-node-gpu.js","test-node-wasm.js"] -2021-05-18 11:27:34 INFO:  test-node.js start -2021-05-18 11:27:36 STATE: test-node.js passed: create human -2021-05-18 11:27:36 INFO:  test-node.js human version: 1.9.0 -2021-05-18 11:27:36 INFO:  test-node.js platform: linux x64 agent: NodeJS v16.0.0 -2021-05-18 11:27:36 INFO:  test-node.js tfjs version: 3.6.0 -2021-05-18 11:27:36 STATE: test-node.js passed: set backend: tensorflow -2021-05-18 11:27:36 STATE: test-node.js passed: load models -2021-05-18 11:27:36 STATE: test-node.js result: defined models: 12 loaded models: 6 -2021-05-18 11:27:36 STATE: test-node.js passed: warmup: none default -2021-05-18 11:27:38 STATE: test-node.js passed: warmup: face default -2021-05-18 11:27:38 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 5 object: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.52,"class":"person"} {"score":0.96,"keypoints":5} -2021-05-18 11:27:38 DATA:  test-node.js result: performance: load: 429 total: 1858 -2021-05-18 11:27:39 STATE: test-node.js passed: warmup: body default -2021-05-18 11:27:39 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 3 {"confidence":1,"age":29.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":0.92,"keypoints":17} -2021-05-18 11:27:39 DATA:  test-node.js result: performance: load: 429 total: 1458 -2021-05-18 11:27:39 INFO:  test-node.js test body variants -2021-05-18 11:27:41 STATE: test-node.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] -2021-05-18 11:27:42 STATE: test-node.js passed: detect: assets/human-sample-body.jpg posenet -2021-05-18 11:27:42 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 3 {"confidence":1} {"score":0.86,"class":"person"} {"score":0.91,"keypoints":17} -2021-05-18 11:27:42 DATA:  test-node.js result: performance: load: 429 total: 1053 -2021-05-18 11:27:43 STATE: test-node.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] -2021-05-18 11:27:43 STATE: test-node.js passed: detect: assets/human-sample-body.jpg blazepose -2021-05-18 11:27:43 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 3 {"confidence":1} {"score":0.86,"class":"person"} {"score":1,"keypoints":39} -2021-05-18 11:27:43 DATA:  test-node.js result: performance: load: 429 total: 455 -2021-05-18 11:27:43 STATE: test-node.js passed: detect: random default -2021-05-18 11:27:43 DATA:  test-node.js result: face: 0 body: 1 hand: 0 gesture: 1 object: 3 {} {"score":0.86,"class":"person"} {"score":1,"keypoints":39} -2021-05-18 11:27:43 DATA:  test-node.js result: performance: load: 429 total: 221 -2021-05-18 11:27:43 INFO:  test-node.js test: first instance -2021-05-18 11:27:44 STATE: test-node.js passed: load image: assets/sample-me.jpg [1,700,700,3] -2021-05-18 11:27:44 STATE: test-node.js passed: detect: assets/sample-me.jpg default -2021-05-18 11:27:44 DATA:  test-node.js result: face: 0 body: 1 hand: 0 gesture: 1 object: 3 {} {"score":0.86,"class":"person"} {"score":1,"keypoints":39} -2021-05-18 11:27:44 DATA:  test-node.js result: performance: load: 429 total: 175 -2021-05-18 11:27:44 INFO:  test-node.js test: second instance -2021-05-18 11:27:44 STATE: test-node.js passed: load image: assets/sample-me.jpg [1,700,700,3] -2021-05-18 11:27:46 STATE: test-node.js passed: detect: assets/sample-me.jpg default -2021-05-18 11:27:46 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 2 {"confidence":1,"age":39.2,"gender":"male"} {"score":0.7,"class":"person"} {"score":1,"keypoints":39} -2021-05-18 11:27:46 DATA:  test-node.js result: performance: load: 5 total: 1516 -2021-05-18 11:27:46 INFO:  test-node.js test: concurrent -2021-05-18 11:27:46 STATE: test-node.js passed: load image: assets/human-sample-face.jpg [1,256,256,3] -2021-05-18 11:27:46 STATE: test-node.js passed: load image: assets/human-sample-face.jpg [1,256,256,3] -2021-05-18 11:27:47 STATE: test-node.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] -2021-05-18 11:27:48 STATE: test-node.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] -2021-05-18 11:27:53 STATE: test-node.js passed: detect: assets/human-sample-face.jpg default -2021-05-18 11:27:53 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.53,"class":"person"} {"score":1,"keypoints":39} -2021-05-18 11:27:53 DATA:  test-node.js result: performance: load: 429 total: 5258 -2021-05-18 11:27:53 STATE: test-node.js passed: detect: assets/human-sample-face.jpg default -2021-05-18 11:27:53 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.53,"class":"person"} {"score":1,"keypoints":39} -2021-05-18 11:27:53 DATA:  test-node.js result: performance: load: 5 total: 5258 -2021-05-18 11:27:53 STATE: test-node.js passed: detect: assets/human-sample-body.jpg default -2021-05-18 11:27:53 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 3 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":1,"keypoints":39} -2021-05-18 11:27:53 DATA:  test-node.js result: performance: load: 429 total: 5258 -2021-05-18 11:27:53 STATE: test-node.js passed: detect: assets/human-sample-body.jpg default -2021-05-18 11:27:53 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 3 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":1,"keypoints":39} -2021-05-18 11:27:53 DATA:  test-node.js result: performance: load: 5 total: 5258 -2021-05-18 11:27:53 INFO:  test-node.js test complete: 17450 ms -2021-05-18 11:27:53 INFO:  test-node-gpu.js start -2021-05-18 11:27:54 WARN:  test-node-gpu.js stderr: 2021-05-18 11:27:54.617537: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory -2021-05-18 11:27:54 WARN:  test-node-gpu.js stderr: 2021-05-18 11:27:54.792377: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory -2021-05-18 11:27:54 WARN:  test-node-gpu.js stderr: 2021-05-18 11:27:54.792495: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (wyse): /proc/driver/nvidia/version does not exist -2021-05-18 11:27:54 STATE: test-node-gpu.js passed: create human -2021-05-18 11:27:54 INFO:  test-node-gpu.js human version: 1.9.0 -2021-05-18 11:27:54 INFO:  test-node-gpu.js platform: linux x64 agent: NodeJS v16.0.0 -2021-05-18 11:27:54 INFO:  test-node-gpu.js tfjs version: 3.6.0 -2021-05-18 11:27:55 STATE: test-node-gpu.js passed: set backend: tensorflow -2021-05-18 11:27:55 STATE: test-node-gpu.js passed: load models -2021-05-18 11:27:55 STATE: test-node-gpu.js result: defined models: 12 loaded models: 6 -2021-05-18 11:27:55 STATE: test-node-gpu.js passed: warmup: none default -2021-05-18 11:27:56 STATE: test-node-gpu.js passed: warmup: face default -2021-05-18 11:27:56 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 5 object: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.52,"class":"person"} {"score":0.96,"keypoints":5} -2021-05-18 11:27:56 DATA:  test-node-gpu.js result: performance: load: 329 total: 1695 -2021-05-18 11:27:58 STATE: test-node-gpu.js passed: warmup: body default -2021-05-18 11:27:58 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 3 {"confidence":1,"age":29.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":0.92,"keypoints":17} -2021-05-18 11:27:58 DATA:  test-node-gpu.js result: performance: load: 329 total: 1466 -2021-05-18 11:27:58 INFO:  test-node-gpu.js test body variants -2021-05-18 11:27:59 STATE: test-node-gpu.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] -2021-05-18 11:28:00 STATE: test-node-gpu.js passed: detect: assets/human-sample-body.jpg posenet -2021-05-18 11:28:00 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 3 {"confidence":1} {"score":0.86,"class":"person"} {"score":0.91,"keypoints":17} -2021-05-18 11:28:00 DATA:  test-node-gpu.js result: performance: load: 329 total: 1143 -2021-05-18 11:28:01 STATE: test-node-gpu.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] -2021-05-18 11:28:02 STATE: test-node-gpu.js passed: detect: assets/human-sample-body.jpg blazepose -2021-05-18 11:28:02 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 3 {"confidence":1} {"score":0.86,"class":"person"} {"score":1,"keypoints":39} -2021-05-18 11:28:02 DATA:  test-node-gpu.js result: performance: load: 329 total: 462 -2021-05-18 11:28:03 STATE: test-node-gpu.js passed: detect: random default -2021-05-18 11:28:03 DATA:  test-node-gpu.js result: face: 0 body: 1 hand: 0 gesture: 1 object: 0 {} {} {"score":1,"keypoints":39} -2021-05-18 11:28:03 DATA:  test-node-gpu.js result: performance: load: 329 total: 830 -2021-05-18 11:28:03 INFO:  test-node-gpu.js test: first instance -2021-05-18 11:28:03 STATE: test-node-gpu.js passed: load image: assets/sample-me.jpg [1,700,700,3] -2021-05-18 11:28:05 STATE: test-node-gpu.js passed: detect: assets/sample-me.jpg default -2021-05-18 11:28:05 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 2 {"confidence":1,"age":39.2,"gender":"male"} {"score":0.7,"class":"person"} {"score":1,"keypoints":39} -2021-05-18 11:28:05 DATA:  test-node-gpu.js result: performance: load: 329 total: 1490 -2021-05-18 11:28:05 INFO:  test-node-gpu.js test: second instance -2021-05-18 11:28:05 STATE: test-node-gpu.js passed: load image: assets/sample-me.jpg [1,700,700,3] -2021-05-18 11:28:06 STATE: test-node-gpu.js passed: detect: assets/sample-me.jpg default -2021-05-18 11:28:06 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 2 {"confidence":1,"age":39.2,"gender":"male"} {"score":0.7,"class":"person"} {"score":1,"keypoints":39} -2021-05-18 11:28:06 DATA:  test-node-gpu.js result: performance: load: 4 total: 1422 -2021-05-18 11:28:06 INFO:  test-node-gpu.js test: concurrent -2021-05-18 11:28:06 STATE: test-node-gpu.js passed: load image: assets/human-sample-face.jpg [1,256,256,3] -2021-05-18 11:28:06 STATE: test-node-gpu.js passed: load image: assets/human-sample-face.jpg [1,256,256,3] -2021-05-18 11:28:07 STATE: test-node-gpu.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] -2021-05-18 11:28:09 STATE: test-node-gpu.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] -2021-05-18 11:28:14 STATE: test-node-gpu.js passed: detect: assets/human-sample-face.jpg default -2021-05-18 11:28:14 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.53,"class":"person"} {"score":1,"keypoints":39} -2021-05-18 11:28:14 DATA:  test-node-gpu.js result: performance: load: 329 total: 5168 -2021-05-18 11:28:14 STATE: test-node-gpu.js passed: detect: assets/human-sample-face.jpg default -2021-05-18 11:28:14 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.53,"class":"person"} {"score":1,"keypoints":39} -2021-05-18 11:28:14 DATA:  test-node-gpu.js result: performance: load: 4 total: 5168 -2021-05-18 11:28:14 STATE: test-node-gpu.js passed: detect: assets/human-sample-body.jpg default -2021-05-18 11:28:14 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 3 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":1,"keypoints":39} -2021-05-18 11:28:14 DATA:  test-node-gpu.js result: performance: load: 329 total: 5168 -2021-05-18 11:28:14 STATE: test-node-gpu.js passed: detect: assets/human-sample-body.jpg default -2021-05-18 11:28:14 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 3 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":1,"keypoints":39} -2021-05-18 11:28:14 DATA:  test-node-gpu.js result: performance: load: 4 total: 5168 -2021-05-18 11:28:14 INFO:  test-node-gpu.js test complete: 19316 ms -2021-05-18 11:28:14 INFO:  test-node-wasm.js start -2021-05-18 11:28:14 STATE: test-node-wasm.js passed: model server: http://localhost:10030/models/ -2021-05-18 11:28:14 STATE: test-node-wasm.js passed: create human -2021-05-18 11:28:14 INFO:  test-node-wasm.js human version: 1.9.0 -2021-05-18 11:28:14 INFO:  test-node-wasm.js platform: linux x64 agent: NodeJS v16.0.0 -2021-05-18 11:28:14 INFO:  test-node-wasm.js tfjs version: 3.6.0 -2021-05-18 11:28:15 STATE: test-node-wasm.js passed: set backend: wasm -2021-05-18 11:28:15 STATE: test-node-wasm.js passed: load models -2021-05-18 11:28:15 STATE: test-node-wasm.js result: defined models: 12 loaded models: 5 -2021-05-18 11:28:15 STATE: test-node-wasm.js passed: warmup: none default -2021-05-18 11:28:15 ERROR: test-node-wasm.js failed: warmup: face default -2021-05-18 11:28:15 ERROR: test-node-wasm.js failed: warmup: body default -2021-05-18 11:28:15 INFO:  test-node-wasm.js test body variants -2021-05-18 11:28:17 STATE: test-node-wasm.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] -2021-05-18 11:28:20 STATE: test-node-wasm.js passed: detect: assets/human-sample-body.jpg posenet -2021-05-18 11:28:20 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 0 {"confidence":1,"age":28.5,"gender":"female"} {} {"score":0.91,"keypoints":17} -2021-05-18 11:28:20 DATA:  test-node-wasm.js result: performance: load: 645 total: 3253 -2021-05-18 11:28:22 STATE: test-node-wasm.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] -2021-05-18 11:28:24 STATE: test-node-wasm.js passed: detect: assets/human-sample-body.jpg blazepose -2021-05-18 11:28:24 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 0 {"confidence":1} {} {"score":1,"keypoints":39} -2021-05-18 11:28:24 DATA:  test-node-wasm.js result: performance: load: 645 total: 2351 -2021-05-18 11:28:26 STATE: test-node-wasm.js passed: detect: random default -2021-05-18 11:28:26 DATA:  test-node-wasm.js result: face: 0 body: 1 hand: 0 gesture: 1 object: 0 {} {} {"score":1,"keypoints":39} -2021-05-18 11:28:26 DATA:  test-node-wasm.js result: performance: load: 645 total: 1749 -2021-05-18 11:28:26 INFO:  test-node-wasm.js test: first instance -2021-05-18 11:28:27 STATE: test-node-wasm.js passed: load image: assets/sample-me.jpg [1,700,700,3] -2021-05-18 11:28:29 STATE: test-node-wasm.js passed: detect: assets/sample-me.jpg default -2021-05-18 11:28:29 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 0 {"confidence":1,"age":39.2,"gender":"male"} {} {"score":1,"keypoints":39} -2021-05-18 11:28:29 DATA:  test-node-wasm.js result: performance: load: 645 total: 2446 -2021-05-18 11:28:29 INFO:  test-node-wasm.js test: second instance -2021-05-18 11:28:30 STATE: test-node-wasm.js passed: load image: assets/sample-me.jpg [1,700,700,3] -2021-05-18 11:28:33 STATE: test-node-wasm.js passed: detect: assets/sample-me.jpg default -2021-05-18 11:28:33 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 0 {"confidence":1,"age":39.2,"gender":"male"} {} {"score":1,"keypoints":39} -2021-05-18 11:28:33 DATA:  test-node-wasm.js result: performance: load: 5 total: 2416 -2021-05-18 11:28:33 INFO:  test-node-wasm.js test: concurrent -2021-05-18 11:28:33 STATE: test-node-wasm.js passed: load image: assets/human-sample-face.jpg [1,256,256,3] -2021-05-18 11:28:33 STATE: test-node-wasm.js passed: load image: assets/human-sample-face.jpg [1,256,256,3] -2021-05-18 11:28:35 STATE: test-node-wasm.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] -2021-05-18 11:28:37 STATE: test-node-wasm.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] -2021-05-18 11:28:46 STATE: test-node-wasm.js passed: detect: assets/human-sample-face.jpg default -2021-05-18 11:28:46 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 0 {"confidence":1,"age":23.6,"gender":"female"} {} {"score":1,"keypoints":39} -2021-05-18 11:28:46 DATA:  test-node-wasm.js result: performance: load: 645 total: 9564 -2021-05-18 11:28:46 STATE: test-node-wasm.js passed: detect: assets/human-sample-face.jpg default -2021-05-18 11:28:46 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 0 {"confidence":1,"age":23.6,"gender":"female"} {} {"score":1,"keypoints":39} -2021-05-18 11:28:46 DATA:  test-node-wasm.js result: performance: load: 5 total: 9564 -2021-05-18 11:28:46 STATE: test-node-wasm.js passed: detect: assets/human-sample-body.jpg default -2021-05-18 11:28:46 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 0 {"confidence":1,"age":28.5,"gender":"female"} {} {"score":1,"keypoints":39} -2021-05-18 11:28:46 DATA:  test-node-wasm.js result: performance: load: 645 total: 9564 -2021-05-18 11:28:46 STATE: test-node-wasm.js passed: detect: assets/human-sample-body.jpg default -2021-05-18 11:28:46 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 0 {"confidence":1,"age":28.5,"gender":"female"} {} {"score":1,"keypoints":39} -2021-05-18 11:28:46 DATA:  test-node-wasm.js result: performance: load: 5 total: 9564 -2021-05-18 11:28:46 INFO:  test-node-wasm.js test complete: 31985 ms -2021-05-18 11:28:46 INFO:  status: {"passed":68,"failed":2} +2021-05-21 06:52:36 INFO:  @vladmandic/human version 1.9.1 +2021-05-21 06:52:36 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.0.0 +2021-05-21 06:52:36 INFO:  tests: ["test-node.js","test-node-gpu.js","test-node-wasm.js"] +2021-05-21 06:52:36 INFO:  test-node.js start +2021-05-21 06:52:37 STATE: test-node.js passed: create human +2021-05-21 06:52:37 INFO:  test-node.js human version: 1.9.1 +2021-05-21 06:52:37 INFO:  test-node.js platform: linux x64 agent: NodeJS v16.0.0 +2021-05-21 06:52:37 INFO:  test-node.js tfjs version: 3.6.0 +2021-05-21 06:52:38 STATE: test-node.js passed: set backend: tensorflow +2021-05-21 06:52:38 STATE: test-node.js passed: load models +2021-05-21 06:52:38 STATE: test-node.js result: defined models: 13 loaded models: 6 +2021-05-21 06:52:38 STATE: test-node.js passed: warmup: none default +2021-05-21 06:52:39 STATE: test-node.js passed: warmup: face default +2021-05-21 06:52:39 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 5 object: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.8246909379959106,"class":"person"} {"score":0.96,"keypoints":5} +2021-05-21 06:52:39 DATA:  test-node.js result: performance: load: 376 total: 1674 +2021-05-21 06:52:41 STATE: test-node.js passed: warmup: body default +2021-05-21 06:52:41 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 {"confidence":1,"age":29.5,"gender":"female"} {"score":0.7261000871658325,"class":"person"} {"score":0.92,"keypoints":17} +2021-05-21 06:52:41 DATA:  test-node.js result: performance: load: 376 total: 1566 +2021-05-21 06:52:41 INFO:  test-node.js test body variants +2021-05-21 06:52:42 STATE: test-node.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] +2021-05-21 06:52:43 STATE: test-node.js passed: detect: assets/human-sample-body.jpg posenet +2021-05-21 06:52:43 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 {"confidence":1} {"score":0.7261000871658325,"class":"person"} {"score":0.91,"keypoints":17} +2021-05-21 06:52:43 DATA:  test-node.js result: performance: load: 376 total: 1053 +2021-05-21 06:52:44 STATE: test-node.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] +2021-05-21 06:52:45 STATE: test-node.js passed: detect: assets/human-sample-body.jpg blazepose +2021-05-21 06:52:45 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 {"confidence":1} {"score":0.7261000871658325,"class":"person"} {"score":1,"keypoints":39} +2021-05-21 06:52:45 DATA:  test-node.js result: performance: load: 376 total: 480 +2021-05-21 06:52:46 STATE: test-node.js passed: detect: random default +2021-05-21 06:52:46 DATA:  test-node.js result: face: 0 body: 1 hand: 0 gesture: 1 object: 0 {} {} {"score":1,"keypoints":39} +2021-05-21 06:52:46 DATA:  test-node.js result: performance: load: 376 total: 844 +2021-05-21 06:52:46 INFO:  test-node.js test: first instance +2021-05-21 06:52:46 STATE: test-node.js passed: load image: assets/sample-me.jpg [1,700,700,3] +2021-05-21 06:52:47 STATE: test-node.js passed: detect: assets/sample-me.jpg default +2021-05-21 06:52:47 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 2 {"confidence":1,"age":39.2,"gender":"male"} {"score":0.6820425987243652,"class":"person"} {"score":1,"keypoints":39} +2021-05-21 06:52:47 DATA:  test-node.js result: performance: load: 376 total: 1560 +2021-05-21 06:52:47 INFO:  test-node.js test: second instance +2021-05-21 06:52:48 STATE: test-node.js passed: load image: assets/sample-me.jpg [1,700,700,3] +2021-05-21 06:52:49 STATE: test-node.js passed: detect: assets/sample-me.jpg default +2021-05-21 06:52:49 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 2 {"confidence":1,"age":39.2,"gender":"male"} {"score":0.6820425987243652,"class":"person"} {"score":1,"keypoints":39} +2021-05-21 06:52:49 DATA:  test-node.js result: performance: load: 4 total: 1398 +2021-05-21 06:52:49 INFO:  test-node.js test: concurrent +2021-05-21 06:52:49 STATE: test-node.js passed: load image: assets/human-sample-face.jpg [1,256,256,3] +2021-05-21 06:52:49 STATE: test-node.js passed: load image: assets/human-sample-face.jpg [1,256,256,3] +2021-05-21 06:52:50 STATE: test-node.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] +2021-05-21 06:52:51 STATE: test-node.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] +2021-05-21 06:52:57 STATE: test-node.js passed: detect: assets/human-sample-face.jpg default +2021-05-21 06:52:57 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.8257162570953369,"class":"person"} {"score":1,"keypoints":39} +2021-05-21 06:52:57 DATA:  test-node.js result: performance: load: 376 total: 5549 +2021-05-21 06:52:57 STATE: test-node.js passed: detect: assets/human-sample-face.jpg default +2021-05-21 06:52:57 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.8257162570953369,"class":"person"} {"score":1,"keypoints":39} +2021-05-21 06:52:57 DATA:  test-node.js result: performance: load: 4 total: 5549 +2021-05-21 06:52:57 STATE: test-node.js passed: detect: assets/human-sample-body.jpg default +2021-05-21 06:52:57 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.7273815870285034,"class":"person"} {"score":1,"keypoints":39} +2021-05-21 06:52:57 DATA:  test-node.js result: performance: load: 376 total: 5549 +2021-05-21 06:52:57 STATE: test-node.js passed: detect: assets/human-sample-body.jpg default +2021-05-21 06:52:57 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.7273815870285034,"class":"person"} {"score":1,"keypoints":39} +2021-05-21 06:52:57 DATA:  test-node.js result: performance: load: 4 total: 5549 +2021-05-21 06:52:57 INFO:  test-node.js test complete: 19666 ms +2021-05-21 06:52:57 INFO:  test-node-gpu.js start +2021-05-21 06:52:58 WARN:  test-node-gpu.js stderr: 2021-05-21 06:52:58.204048: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory +2021-05-21 06:52:58 WARN:  test-node-gpu.js stderr: 2021-05-21 06:52:58.352815: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory +2021-05-21 06:52:58 WARN:  test-node-gpu.js stderr: 2021-05-21 06:52:58.352845: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (wyse): /proc/driver/nvidia/version does not exist +2021-05-21 06:52:58 STATE: test-node-gpu.js passed: create human +2021-05-21 06:52:58 INFO:  test-node-gpu.js human version: 1.9.1 +2021-05-21 06:52:58 INFO:  test-node-gpu.js platform: linux x64 agent: NodeJS v16.0.0 +2021-05-21 06:52:58 INFO:  test-node-gpu.js tfjs version: 3.6.0 +2021-05-21 06:52:58 STATE: test-node-gpu.js passed: set backend: tensorflow +2021-05-21 06:52:58 STATE: test-node-gpu.js passed: load models +2021-05-21 06:52:58 STATE: test-node-gpu.js result: defined models: 13 loaded models: 6 +2021-05-21 06:52:58 STATE: test-node-gpu.js passed: warmup: none default +2021-05-21 06:53:00 STATE: test-node-gpu.js passed: warmup: face default +2021-05-21 06:53:00 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 5 object: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.8246909379959106,"class":"person"} {"score":0.96,"keypoints":5} +2021-05-21 06:53:00 DATA:  test-node-gpu.js result: performance: load: 312 total: 1787 +2021-05-21 06:53:02 STATE: test-node-gpu.js passed: warmup: body default +2021-05-21 06:53:02 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 {"confidence":1,"age":29.5,"gender":"female"} {"score":0.7261000871658325,"class":"person"} {"score":0.92,"keypoints":17} +2021-05-21 06:53:02 DATA:  test-node-gpu.js result: performance: load: 312 total: 1600 +2021-05-21 06:53:02 INFO:  test-node-gpu.js test body variants +2021-05-21 06:53:03 STATE: test-node-gpu.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] +2021-05-21 06:53:04 STATE: test-node-gpu.js passed: detect: assets/human-sample-body.jpg posenet +2021-05-21 06:53:04 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 {"confidence":1} {"score":0.7261000871658325,"class":"person"} {"score":0.91,"keypoints":17} +2021-05-21 06:53:04 DATA:  test-node-gpu.js result: performance: load: 312 total: 1012 +2021-05-21 06:53:05 STATE: test-node-gpu.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] +2021-05-21 06:53:05 STATE: test-node-gpu.js passed: detect: assets/human-sample-body.jpg blazepose +2021-05-21 06:53:05 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 {"confidence":1} {"score":0.7261000871658325,"class":"person"} {"score":1,"keypoints":39} +2021-05-21 06:53:05 DATA:  test-node-gpu.js result: performance: load: 312 total: 469 +2021-05-21 06:53:06 STATE: test-node-gpu.js passed: detect: random default +2021-05-21 06:53:06 DATA:  test-node-gpu.js result: face: 0 body: 1 hand: 0 gesture: 1 object: 1 {} {"score":0.7261000871658325,"class":"person"} {"score":1,"keypoints":39} +2021-05-21 06:53:06 DATA:  test-node-gpu.js result: performance: load: 312 total: 198 +2021-05-21 06:53:06 INFO:  test-node-gpu.js test: first instance +2021-05-21 06:53:06 STATE: test-node-gpu.js passed: load image: assets/sample-me.jpg [1,700,700,3] +2021-05-21 06:53:06 STATE: test-node-gpu.js passed: detect: assets/sample-me.jpg default +2021-05-21 06:53:06 DATA:  test-node-gpu.js result: face: 0 body: 1 hand: 0 gesture: 1 object: 1 {} {"score":0.7261000871658325,"class":"person"} {"score":1,"keypoints":39} +2021-05-21 06:53:06 DATA:  test-node-gpu.js result: performance: load: 312 total: 184 +2021-05-21 06:53:06 INFO:  test-node-gpu.js test: second instance +2021-05-21 06:53:07 STATE: test-node-gpu.js passed: load image: assets/sample-me.jpg [1,700,700,3] +2021-05-21 06:53:08 STATE: test-node-gpu.js passed: detect: assets/sample-me.jpg default +2021-05-21 06:53:08 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 2 {"confidence":1,"age":39.2,"gender":"male"} {"score":0.6820425987243652,"class":"person"} {"score":1,"keypoints":39} +2021-05-21 06:53:08 DATA:  test-node-gpu.js result: performance: load: 2 total: 1498 +2021-05-21 06:53:08 INFO:  test-node-gpu.js test: concurrent +2021-05-21 06:53:08 STATE: test-node-gpu.js passed: load image: assets/human-sample-face.jpg [1,256,256,3] +2021-05-21 06:53:08 STATE: test-node-gpu.js passed: load image: assets/human-sample-face.jpg [1,256,256,3] +2021-05-21 06:53:09 STATE: test-node-gpu.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] +2021-05-21 06:53:10 STATE: test-node-gpu.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] +2021-05-21 06:53:16 STATE: test-node-gpu.js passed: detect: assets/human-sample-face.jpg default +2021-05-21 06:53:16 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.8257162570953369,"class":"person"} {"score":1,"keypoints":39} +2021-05-21 06:53:16 DATA:  test-node-gpu.js result: performance: load: 312 total: 5825 +2021-05-21 06:53:16 STATE: test-node-gpu.js passed: detect: assets/human-sample-face.jpg default +2021-05-21 06:53:16 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.8257162570953369,"class":"person"} {"score":1,"keypoints":39} +2021-05-21 06:53:16 DATA:  test-node-gpu.js result: performance: load: 2 total: 5825 +2021-05-21 06:53:16 STATE: test-node-gpu.js passed: detect: assets/human-sample-body.jpg default +2021-05-21 06:53:16 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.7273815870285034,"class":"person"} {"score":1,"keypoints":39} +2021-05-21 06:53:16 DATA:  test-node-gpu.js result: performance: load: 312 total: 5825 +2021-05-21 06:53:16 STATE: test-node-gpu.js passed: detect: assets/human-sample-body.jpg default +2021-05-21 06:53:16 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.7273815870285034,"class":"person"} {"score":1,"keypoints":39} +2021-05-21 06:53:16 DATA:  test-node-gpu.js result: performance: load: 2 total: 5825 +2021-05-21 06:53:16 INFO:  test-node-gpu.js test complete: 18032 ms +2021-05-21 06:53:16 INFO:  test-node-wasm.js start +2021-05-21 06:53:16 STATE: test-node-wasm.js passed: model server: http://localhost:10030/models/ +2021-05-21 06:53:16 STATE: test-node-wasm.js passed: create human +2021-05-21 06:53:16 INFO:  test-node-wasm.js human version: 1.9.1 +2021-05-21 06:53:16 INFO:  test-node-wasm.js platform: linux x64 agent: NodeJS v16.0.0 +2021-05-21 06:53:16 INFO:  test-node-wasm.js tfjs version: 3.6.0 +2021-05-21 06:53:17 STATE: test-node-wasm.js passed: set backend: wasm +2021-05-21 06:53:17 STATE: test-node-wasm.js passed: load models +2021-05-21 06:53:17 STATE: test-node-wasm.js result: defined models: 13 loaded models: 5 +2021-05-21 06:53:17 STATE: test-node-wasm.js passed: warmup: none default +2021-05-21 06:53:17 ERROR: test-node-wasm.js failed: warmup: face default +2021-05-21 06:53:17 ERROR: test-node-wasm.js failed: warmup: body default +2021-05-21 06:53:17 INFO:  test-node-wasm.js test body variants +2021-05-21 06:53:19 STATE: test-node-wasm.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] +2021-05-21 06:53:23 STATE: test-node-wasm.js passed: detect: assets/human-sample-body.jpg posenet +2021-05-21 06:53:23 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 0 {"confidence":1,"age":28.5,"gender":"female"} {} {"score":0.91,"keypoints":17} +2021-05-21 06:53:23 DATA:  test-node-wasm.js result: performance: load: 859 total: 3195 +2021-05-21 06:53:25 STATE: test-node-wasm.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] +2021-05-21 06:53:27 STATE: test-node-wasm.js passed: detect: assets/human-sample-body.jpg blazepose +2021-05-21 06:53:27 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 0 {"confidence":1} {} {"score":1,"keypoints":39} +2021-05-21 06:53:27 DATA:  test-node-wasm.js result: performance: load: 859 total: 2390 +2021-05-21 06:53:28 STATE: test-node-wasm.js passed: detect: random default +2021-05-21 06:53:28 DATA:  test-node-wasm.js result: face: 0 body: 1 hand: 0 gesture: 1 object: 0 {} {} {"score":1,"keypoints":39} +2021-05-21 06:53:28 DATA:  test-node-wasm.js result: performance: load: 859 total: 385 +2021-05-21 06:53:28 INFO:  test-node-wasm.js test: first instance +2021-05-21 06:53:28 STATE: test-node-wasm.js passed: load image: assets/sample-me.jpg [1,700,700,3] +2021-05-21 06:53:29 STATE: test-node-wasm.js passed: detect: assets/sample-me.jpg default +2021-05-21 06:53:29 DATA:  test-node-wasm.js result: face: 0 body: 1 hand: 0 gesture: 1 object: 0 {} {} {"score":1,"keypoints":39} +2021-05-21 06:53:29 DATA:  test-node-wasm.js result: performance: load: 859 total: 308 +2021-05-21 06:53:29 INFO:  test-node-wasm.js test: second instance +2021-05-21 06:53:29 STATE: test-node-wasm.js passed: load image: assets/sample-me.jpg [1,700,700,3] +2021-05-21 06:53:32 STATE: test-node-wasm.js passed: detect: assets/sample-me.jpg default +2021-05-21 06:53:32 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 0 {"confidence":1,"age":39.2,"gender":"male"} {} {"score":1,"keypoints":39} +2021-05-21 06:53:32 DATA:  test-node-wasm.js result: performance: load: 3 total: 2456 +2021-05-21 06:53:32 INFO:  test-node-wasm.js test: concurrent +2021-05-21 06:53:32 STATE: test-node-wasm.js passed: load image: assets/human-sample-face.jpg [1,256,256,3] +2021-05-21 06:53:32 STATE: test-node-wasm.js passed: load image: assets/human-sample-face.jpg [1,256,256,3] +2021-05-21 06:53:34 STATE: test-node-wasm.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] +2021-05-21 06:53:36 STATE: test-node-wasm.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] +2021-05-21 06:53:45 STATE: test-node-wasm.js passed: detect: assets/human-sample-face.jpg default +2021-05-21 06:53:45 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 0 {"confidence":1,"age":23.6,"gender":"female"} {} {"score":1,"keypoints":39} +2021-05-21 06:53:45 DATA:  test-node-wasm.js result: performance: load: 859 total: 9357 +2021-05-21 06:53:45 STATE: test-node-wasm.js passed: detect: assets/human-sample-face.jpg default +2021-05-21 06:53:45 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 0 {"confidence":1,"age":23.6,"gender":"female"} {} {"score":1,"keypoints":39} +2021-05-21 06:53:45 DATA:  test-node-wasm.js result: performance: load: 3 total: 9357 +2021-05-21 06:53:45 STATE: test-node-wasm.js passed: detect: assets/human-sample-body.jpg default +2021-05-21 06:53:45 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 0 {"confidence":1,"age":28.5,"gender":"female"} {} {"score":1,"keypoints":39} +2021-05-21 06:53:45 DATA:  test-node-wasm.js result: performance: load: 859 total: 9357 +2021-05-21 06:53:45 STATE: test-node-wasm.js passed: detect: assets/human-sample-body.jpg default +2021-05-21 06:53:45 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 0 {"confidence":1,"age":28.5,"gender":"female"} {} {"score":1,"keypoints":39} +2021-05-21 06:53:45 DATA:  test-node-wasm.js result: performance: load: 3 total: 9357 +2021-05-21 06:53:45 INFO:  test-node-wasm.js test complete: 28592 ms +2021-05-21 06:53:45 INFO:  status: {"passed":68,"failed":2}