@mediapipe/hands
Advanced tools
Comparing version 0.1.1612238212 to 0.1.1613506466
@@ -100,29 +100,29 @@ | ||
} | ||
Module['FS_createPath']('/', 'third_party', true, true); | ||
Module['FS_createPath']('/third_party', 'mediapipe', true, true); | ||
Module['FS_createPath']('/third_party/mediapipe', 'modules', true, true); | ||
Module['FS_createPath']('/third_party/mediapipe/modules', 'palm_detection', true, true); | ||
Module['FS_createPath']('/third_party/mediapipe/modules', 'hand_landmark', true, true); | ||
Module['FS_createPath']("/", "third_party", true, true); | ||
Module['FS_createPath']("/third_party", "mediapipe", true, true); | ||
Module['FS_createPath']("/third_party/mediapipe", "modules", true, true); | ||
Module['FS_createPath']("/third_party/mediapipe/modules", "palm_detection", true, true); | ||
Module['FS_createPath']("/third_party/mediapipe/modules", "hand_landmark", true, true); | ||
/** @constructor */ | ||
function DataRequest(start, end, audio) { | ||
this.start = start; | ||
this.end = end; | ||
this.audio = audio; | ||
} | ||
DataRequest.prototype = { | ||
requests: {}, | ||
open: function(mode, name) { | ||
this.name = name; | ||
this.requests[name] = this; | ||
Module['addRunDependency']('fp ' + this.name); | ||
}, | ||
send: function() {}, | ||
onload: function() { | ||
var byteArray = this.byteArray.subarray(this.start, this.end); | ||
this.finish(byteArray); | ||
}, | ||
finish: function(byteArray) { | ||
var that = this; | ||
/** @constructor */ | ||
function DataRequest(start, end, audio) { | ||
this.start = start; | ||
this.end = end; | ||
this.audio = audio; | ||
} | ||
DataRequest.prototype = { | ||
requests: {}, | ||
open: function(mode, name) { | ||
this.name = name; | ||
this.requests[name] = this; | ||
Module['addRunDependency']('fp ' + this.name); | ||
}, | ||
send: function() {}, | ||
onload: function() { | ||
var byteArray = this.byteArray.subarray(this.start, this.end); | ||
this.finish(byteArray); | ||
}, | ||
finish: function(byteArray) { | ||
var that = this; | ||
Module['FS_createPreloadedFile'](this.name, null, byteArray, true, true, function() { | ||
@@ -138,12 +138,12 @@ Module['removeRunDependency']('fp ' + that.name); | ||
this.requests[this.name] = null; | ||
} | ||
}; | ||
var files = metadata['files']; | ||
for (var i = 0; i < files.length; ++i) { | ||
new DataRequest(files[i]['start'], files[i]['end'], files[i]['audio']).open('GET', files[i]['filename']); | ||
} | ||
this.requests[this.name] = null; | ||
} | ||
}; | ||
var files = metadata['files']; | ||
for (var i = 0; i < files.length; ++i) { | ||
new DataRequest(files[i]['start'], files[i]['end'], files[i]['audio']).open('GET', files[i]['filename']); | ||
} | ||
function processPackageData(arrayBuffer) { | ||
@@ -186,5 +186,5 @@ assert(arrayBuffer, 'Loading data file failed.'); | ||
} | ||
loadPackage({"files": [{"filename": "/third_party/mediapipe/modules/palm_detection/palm_detection.tflite", "start": 0, "end": 3877888, "audio": 0}, {"filename": "/third_party/mediapipe/modules/hand_landmark/handedness.txt", "start": 3877888, "end": 3877899, "audio": 0}, {"filename": "/third_party/mediapipe/modules/hand_landmark/hand_landmark.tflite", "start": 3877899, "end": 7670519, "audio": 0}], "remote_package_size": 7670519, "package_uuid": "2d60bcdd-560f-4574-a0df-bfd94a860e0e"}); | ||
loadPackage({"files": [{"filename": "/third_party/mediapipe/modules/palm_detection/palm_detection.tflite", "start": 0, "end": 3877888, "audio": 0}, {"filename": "/third_party/mediapipe/modules/hand_landmark/handedness.txt", "start": 3877888, "end": 3877899, "audio": 0}, {"filename": "/third_party/mediapipe/modules/hand_landmark/hand_landmark.tflite", "start": 3877899, "end": 7670519, "audio": 0}], "remote_package_size": 7670519, "package_uuid": "faed2421-d250-4ede-884f-625b381c9627"}); | ||
})(); | ||
79
hands.js
@@ -6,41 +6,42 @@ (function(){/* | ||
*/ | ||
'use strict';function aa(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}function v(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:aa(a)}}function da(a){if(!(a instanceof Array)){a=v(a);for(var b,c=[];!(b=a.next()).done;)c.push(b.value);a=c}return a}var y="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a}; | ||
function ea(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");}var z=ea(this);function C(a,b){if(b)a:{var c=z;a=a.split(".");for(var d=0;d<a.length-1;d++){var f=a[d];if(!(f in c))break a;c=c[f]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&y(c,a,{configurable:!0,writable:!0,value:b})}}var D; | ||
if("function"==typeof Object.setPrototypeOf)D=Object.setPrototypeOf;else{var E;a:{var fa={a:!0},ha={};try{ha.__proto__=fa;E=ha.a;break a}catch(a){}E=!1}D=E?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var ia=D;function M(){this.l=!1;this.h=null;this.j=void 0;this.g=1;this.s=this.m=0;this.i=null}function N(a){if(a.l)throw new TypeError("Generator is already running");a.l=!0}M.prototype.o=function(a){this.j=a}; | ||
function O(a,b){a.i={J:b,K:!0};a.g=a.m||a.s}M.prototype.return=function(a){this.i={return:a};this.g=this.s};function R(a,b,c){a.g=c;return{value:b}}function ja(a){this.g=new M;this.h=a}function ka(a,b){N(a.g);var c=a.g.h;if(c)return la(a,"return"in c?c["return"]:function(d){return{value:d,done:!0}},b,a.g.return);a.g.return(b);return U(a)} | ||
function la(a,b,c,d){try{var f=b.call(a.g.h,c);if(!(f instanceof Object))throw new TypeError("Iterator result "+f+" is not an object");if(!f.done)return a.g.l=!1,f;var k=f.value}catch(e){return a.g.h=null,O(a.g,e),U(a)}a.g.h=null;d.call(a.g,k);return U(a)}function U(a){for(;a.g.g;)try{var b=a.h(a.g);if(b)return a.g.l=!1,{value:b.value,done:!1}}catch(c){a.g.j=void 0,O(a.g,c)}a.g.l=!1;if(a.g.i){b=a.g.i;a.g.i=null;if(b.K)throw b.J;return{value:b.return,done:!0}}return{value:void 0,done:!0}} | ||
function na(a){this.next=function(b){N(a.g);a.g.h?b=la(a,a.g.h.next,b,a.g.o):(a.g.o(b),b=U(a));return b};this.throw=function(b){N(a.g);a.g.h?b=la(a,a.g.h["throw"],b,a.g.o):(O(a.g,b),b=U(a));return b};this.return=function(b){return ka(a,b)};this[Symbol.iterator]=function(){return this}}function V(a,b){b=new na(new ja(b));ia&&a.prototype&&ia(b,a.prototype);return b} | ||
C("Symbol",function(a){function b(f){if(this instanceof b)throw new TypeError("Symbol is not a constructor");return new c("jscomp_symbol_"+(f||"")+"_"+d++,f)}function c(f,k){this.g=f;y(this,"description",{configurable:!0,writable:!0,value:k})}if(a)return a;c.prototype.toString=function(){return this.g};var d=0;return b}); | ||
C("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");for(var b="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),c=0;c<b.length;c++){var d=z[b[c]];"function"===typeof d&&"function"!=typeof d.prototype[a]&&y(d.prototype,a,{configurable:!0,writable:!0,value:function(){return oa(aa(this))}})}return a});function oa(a){a={next:a};a[Symbol.iterator]=function(){return this};return a} | ||
var pa="function"==typeof Object.assign?Object.assign:function(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c];if(d)for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(a[f]=d[f])}return a};C("Object.assign",function(a){return a||pa}); | ||
C("Promise",function(a){function b(e){this.h=0;this.i=void 0;this.g=[];this.o=!1;var g=this.j();try{e(g.resolve,g.reject)}catch(h){g.reject(h)}}function c(){this.g=null}function d(e){return e instanceof b?e:new b(function(g){g(e)})}if(a)return a;c.prototype.h=function(e){if(null==this.g){this.g=[];var g=this;this.i(function(){g.l()})}this.g.push(e)};var f=z.setTimeout;c.prototype.i=function(e){f(e,0)};c.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var g=0;g<e.length;++g){var h= | ||
e[g];e[g]=null;try{h()}catch(l){this.j(l)}}}this.g=null};c.prototype.j=function(e){this.i(function(){throw e;})};b.prototype.j=function(){function e(l){return function(m){h||(h=!0,l.call(g,m))}}var g=this,h=!1;return{resolve:e(this.B),reject:e(this.l)}};b.prototype.B=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof b)this.H(e);else{a:switch(typeof e){case "object":var g=null!=e;break a;case "function":g=!0;break a;default:g=!1}g?this.A(e):this.m(e)}}; | ||
b.prototype.A=function(e){var g=void 0;try{g=e.then}catch(h){this.l(h);return}"function"==typeof g?this.I(g,e):this.m(e)};b.prototype.l=function(e){this.s(2,e)};b.prototype.m=function(e){this.s(1,e)};b.prototype.s=function(e,g){if(0!=this.h)throw Error("Cannot settle("+e+", "+g+"): Promise already settled in state"+this.h);this.h=e;this.i=g;2===this.h&&this.G();this.D()};b.prototype.G=function(){var e=this;f(function(){if(e.F()){var g=z.console;"undefined"!==typeof g&&g.error(e.i)}},1)};b.prototype.F= | ||
function(){if(this.o)return!1;var e=z.CustomEvent,g=z.Event,h=z.dispatchEvent;if("undefined"===typeof h)return!0;"function"===typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"===typeof g?e=new g("unhandledrejection",{cancelable:!0}):(e=z.document.createEvent("CustomEvent"),e.initCustomEvent("unhandledrejection",!1,!0,e));e.promise=this;e.reason=this.i;return h(e)};b.prototype.D=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)k.h(this.g[e]);this.g=null}};var k=new c;b.prototype.H= | ||
function(e){var g=this.j();e.C(g.resolve,g.reject)};b.prototype.I=function(e,g){var h=this.j();try{e.call(g,h.resolve,h.reject)}catch(l){h.reject(l)}};b.prototype.then=function(e,g){function h(r,n){return"function"==typeof r?function(q){try{l(r(q))}catch(p){m(p)}}:n}var l,m,t=new b(function(r,n){l=r;m=n});this.C(h(e,l),h(g,m));return t};b.prototype.catch=function(e){return this.then(void 0,e)};b.prototype.C=function(e,g){function h(){switch(l.h){case 1:e(l.i);break;case 2:g(l.i);break;default:throw Error("Unexpected state: "+ | ||
l.h);}}var l=this;null==this.g?k.h(h):this.g.push(h);this.o=!0};b.resolve=d;b.reject=function(e){return new b(function(g,h){h(e)})};b.race=function(e){return new b(function(g,h){for(var l=v(e),m=l.next();!m.done;m=l.next())d(m.value).C(g,h)})};b.all=function(e){var g=v(e),h=g.next();return h.done?d([]):new b(function(l,m){function t(q){return function(p){r[q]=p;n--;0==n&&l(r)}}var r=[],n=0;do r.push(void 0),n++,d(h.value).C(t(r.length-1),m),h=g.next();while(!h.done)})};return b}); | ||
function qa(a,b){a instanceof String&&(a+="");var c=0,d=!1,f={next:function(){if(!d&&c<a.length){var k=c++;return{value:b(k,a[k]),done:!1}}d=!0;return{done:!0,value:void 0}}};f[Symbol.iterator]=function(){return f};return f}C("Array.prototype.keys",function(a){return a?a:function(){return qa(this,function(b){return b})}});var ra=this||self; | ||
function W(a,b){a=a.split(".");var c=ra;a[0]in c||"undefined"==typeof c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||void 0===b?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b};function X(a,b){var c=void 0;return new (c||(c=Promise))(function(d,f){function k(h){try{g(b.next(h))}catch(l){f(l)}}function e(h){try{g(b["throw"](h))}catch(l){f(l)}}function g(h){h.done?d(h.value):(new c(function(l){l(h.value)})).then(k,e)}g((b=b.apply(a,void 0)).next())})};function sa(a,b,c){c=a.createShader(0===c?a.VERTEX_SHADER:a.FRAGMENT_SHADER);a.shaderSource(c,b);a.compileShader(c);if(!a.getShaderParameter(c,a.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+a.getShaderInfoLog(c));return c};function ta(a,b){this.h=a;this.j=b;this.i=0};var ua=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function va(a,b){return b+a}function wa(a,b){window[a]=b}function xa(a){var b=document.createElement("script");b.setAttribute("src",a);b.setAttribute("crossorigin","anonymous");document.body.appendChild(b);return new Promise(function(c){b.addEventListener("load",function(){c()},!1)})} | ||
function ya(a){for(var b=[],c=a.size(),d=0;d<c;++d){var f=a.get(d);b.push({x:f.x,y:f.y,visibility:f.hasVisibility?f.visibility:void 0})}return b}function za(a,b,c){this.graph=a;this.locateFile=b;this.g=c}za.prototype.toArrayBuffer=function(){return X(this,function b(){var c=this,d;return V(b,function(f){return 1==f.g?(c.graph.url?f=R(f,fetch(c.locateFile(c.graph.url,c.g)),3):(f.g=2,f=void 0),f):2!=f.g&&(d=f.j,d.body)?f.return(d.arrayBuffer()):f.return(new ArrayBuffer(0))})})}; | ||
function Aa(){return X(this,function b(){return V(b,function(c){switch(c.g){case 1:return c.m=2,R(c,WebAssembly.instantiate(ua),4);case 4:c.g=3;c.m=0;break;case 2:return c.m=0,c.i=null,c.return(!1);case 3:return c.return(!0)}})})} | ||
function Y(a){this.h=a;this.listeners={};this.s={};this.B={};this.l=this.A=!0;this.o=Promise.resolve();this.locateFile=a&&a.locateFile||va;if("object"===typeof window)a=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else if("undefined"!==typeof location)a=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/";else throw Error("solutions can only be loaded on a web page or in a web worker");this.F=a} | ||
'use strict';function aa(a){var c=0;return function(){return c<a.length?{done:!1,value:a[c++]}:{done:!0}}}function A(a){var c="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return c?c.call(a):{next:aa(a)}}function ba(a){if(!(a instanceof Array)){a=A(a);for(var c,b=[];!(c=a.next()).done;)b.push(c.value);a=b}return a}var F="function"==typeof Object.defineProperties?Object.defineProperty:function(a,c,b){if(a==Array.prototype||a==Object.prototype)return a;a[c]=b.value;return a}; | ||
function ca(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var c=0;c<a.length;++c){var b=a[c];if(b&&b.Math==Math)return b}throw Error("Cannot find global object");}var G=ca(this);function H(a,c){if(c)a:{var b=G;a=a.split(".");for(var d=0;d<a.length-1;d++){var f=a[d];if(!(f in b))break a;b=b[f]}a=a[a.length-1];d=b[a];c=c(d);c!=d&&null!=c&&F(b,a,{configurable:!0,writable:!0,value:c})}}var I; | ||
if("function"==typeof Object.setPrototypeOf)I=Object.setPrototypeOf;else{var J;a:{var fa={a:!0},ha={};try{ha.__proto__=fa;J=ha.a;break a}catch(a){}J=!1}I=J?function(a,c){a.__proto__=c;if(a.__proto__!==c)throw new TypeError(a+" is not extensible");return a}:null}var ia=I;function N(){this.l=!1;this.h=null;this.j=void 0;this.g=1;this.s=this.m=0;this.i=null}function O(a){if(a.l)throw new TypeError("Generator is already running");a.l=!0}N.prototype.o=function(a){this.j=a}; | ||
function P(a,c){a.i={J:c,K:!0};a.g=a.m||a.s}N.prototype.return=function(a){this.i={return:a};this.g=this.s};function R(a,c,b){a.g=b;return{value:c}}function ja(a){this.g=new N;this.h=a}function ka(a,c){O(a.g);var b=a.g.h;if(b)return la(a,"return"in b?b["return"]:function(d){return{value:d,done:!0}},c,a.g.return);a.g.return(c);return U(a)} | ||
function la(a,c,b,d){try{var f=c.call(a.g.h,b);if(!(f instanceof Object))throw new TypeError("Iterator result "+f+" is not an object");if(!f.done)return a.g.l=!1,f;var k=f.value}catch(e){return a.g.h=null,P(a.g,e),U(a)}a.g.h=null;d.call(a.g,k);return U(a)}function U(a){for(;a.g.g;)try{var c=a.h(a.g);if(c)return a.g.l=!1,{value:c.value,done:!1}}catch(b){a.g.j=void 0,P(a.g,b)}a.g.l=!1;if(a.g.i){c=a.g.i;a.g.i=null;if(c.K)throw c.J;return{value:c.return,done:!0}}return{value:void 0,done:!0}} | ||
function ma(a){this.next=function(c){O(a.g);a.g.h?c=la(a,a.g.h.next,c,a.g.o):(a.g.o(c),c=U(a));return c};this.throw=function(c){O(a.g);a.g.h?c=la(a,a.g.h["throw"],c,a.g.o):(P(a.g,c),c=U(a));return c};this.return=function(c){return ka(a,c)};this[Symbol.iterator]=function(){return this}}function V(a,c){c=new ma(new ja(c));ia&&a.prototype&&ia(c,a.prototype);return c} | ||
H("Symbol",function(a){function c(f){if(this instanceof c)throw new TypeError("Symbol is not a constructor");return new b("jscomp_symbol_"+(f||"")+"_"+d++,f)}function b(f,k){this.g=f;F(this,"description",{configurable:!0,writable:!0,value:k})}if(a)return a;b.prototype.toString=function(){return this.g};var d=0;return c}); | ||
H("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");for(var c="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),b=0;b<c.length;b++){var d=G[c[b]];"function"===typeof d&&"function"!=typeof d.prototype[a]&&F(d.prototype,a,{configurable:!0,writable:!0,value:function(){return oa(aa(this))}})}return a});function oa(a){a={next:a};a[Symbol.iterator]=function(){return this};return a} | ||
var pa="function"==typeof Object.assign?Object.assign:function(a,c){for(var b=1;b<arguments.length;b++){var d=arguments[b];if(d)for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(a[f]=d[f])}return a};H("Object.assign",function(a){return a||pa}); | ||
H("Promise",function(a){function c(e){this.h=0;this.i=void 0;this.g=[];this.o=!1;var g=this.j();try{e(g.resolve,g.reject)}catch(h){g.reject(h)}}function b(){this.g=null}function d(e){return e instanceof c?e:new c(function(g){g(e)})}if(a)return a;b.prototype.h=function(e){if(null==this.g){this.g=[];var g=this;this.i(function(){g.l()})}this.g.push(e)};var f=G.setTimeout;b.prototype.i=function(e){f(e,0)};b.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var g=0;g<e.length;++g){var h= | ||
e[g];e[g]=null;try{h()}catch(l){this.j(l)}}}this.g=null};b.prototype.j=function(e){this.i(function(){throw e;})};c.prototype.j=function(){function e(l){return function(n){h||(h=!0,l.call(g,n))}}var g=this,h=!1;return{resolve:e(this.C),reject:e(this.l)}};c.prototype.C=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof c)this.H(e);else{a:switch(typeof e){case "object":var g=null!=e;break a;case "function":g=!0;break a;default:g=!1}g?this.B(e):this.m(e)}}; | ||
c.prototype.B=function(e){var g=void 0;try{g=e.then}catch(h){this.l(h);return}"function"==typeof g?this.I(g,e):this.m(e)};c.prototype.l=function(e){this.s(2,e)};c.prototype.m=function(e){this.s(1,e)};c.prototype.s=function(e,g){if(0!=this.h)throw Error("Cannot settle("+e+", "+g+"): Promise already settled in state"+this.h);this.h=e;this.i=g;2===this.h&&this.G();this.A()};c.prototype.G=function(){var e=this;f(function(){if(e.F()){var g=G.console;"undefined"!==typeof g&&g.error(e.i)}},1)};c.prototype.F= | ||
function(){if(this.o)return!1;var e=G.CustomEvent,g=G.Event,h=G.dispatchEvent;if("undefined"===typeof h)return!0;"function"===typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"===typeof g?e=new g("unhandledrejection",{cancelable:!0}):(e=G.document.createEvent("CustomEvent"),e.initCustomEvent("unhandledrejection",!1,!0,e));e.promise=this;e.reason=this.i;return h(e)};c.prototype.A=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)k.h(this.g[e]);this.g=null}};var k=new b;c.prototype.H= | ||
function(e){var g=this.j();e.D(g.resolve,g.reject)};c.prototype.I=function(e,g){var h=this.j();try{e.call(g,h.resolve,h.reject)}catch(l){h.reject(l)}};c.prototype.then=function(e,g){function h(q,p){return"function"==typeof q?function(u){try{l(q(u))}catch(r){n(r)}}:p}var l,n,y=new c(function(q,p){l=q;n=p});this.D(h(e,l),h(g,n));return y};c.prototype.catch=function(e){return this.then(void 0,e)};c.prototype.D=function(e,g){function h(){switch(l.h){case 1:e(l.i);break;case 2:g(l.i);break;default:throw Error("Unexpected state: "+ | ||
l.h);}}var l=this;null==this.g?k.h(h):this.g.push(h);this.o=!0};c.resolve=d;c.reject=function(e){return new c(function(g,h){h(e)})};c.race=function(e){return new c(function(g,h){for(var l=A(e),n=l.next();!n.done;n=l.next())d(n.value).D(g,h)})};c.all=function(e){var g=A(e),h=g.next();return h.done?d([]):new c(function(l,n){function y(u){return function(r){q[u]=r;p--;0==p&&l(q)}}var q=[],p=0;do q.push(void 0),p++,d(h.value).D(y(q.length-1),n),h=g.next();while(!h.done)})};return c}); | ||
function qa(a,c){a instanceof String&&(a+="");var b=0,d=!1,f={next:function(){if(!d&&b<a.length){var k=b++;return{value:c(k,a[k]),done:!1}}d=!0;return{done:!0,value:void 0}}};f[Symbol.iterator]=function(){return f};return f}H("Array.prototype.keys",function(a){return a?a:function(){return qa(this,function(c){return c})}});var ra=this||self; | ||
function W(a,c){a=a.split(".");var b=ra;a[0]in b||"undefined"==typeof b.execScript||b.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||void 0===c?b[d]&&b[d]!==Object.prototype[d]?b=b[d]:b=b[d]={}:b[d]=c};function X(a,c){var b=void 0;return new (b||(b=Promise))(function(d,f){function k(h){try{g(c.next(h))}catch(l){f(l)}}function e(h){try{g(c["throw"](h))}catch(l){f(l)}}function g(h){h.done?d(h.value):(new b(function(l){l(h.value)})).then(k,e)}g((c=c.apply(a,void 0)).next())})};function sa(a,c,b){b=a.createShader(0===b?a.VERTEX_SHADER:a.FRAGMENT_SHADER);a.shaderSource(b,c);a.compileShader(b);if(!a.getShaderParameter(b,a.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+a.getShaderInfoLog(b));return b};function ta(a,c){this.g=a;this.i=c;this.j=0} | ||
function ua(a,c){var b=a.i;if(void 0===a.l){var d=sa(b,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),f=sa(b,"\n precision highp float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),k=b.createProgram();b.attachShader(k,d);b.attachShader(k,f);b.linkProgram(k);if(!b.getProgramParameter(k,b.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+ | ||
b.getProgramInfoLog(k));d=a.l=k;b.useProgram(d);f=b.getUniformLocation(d,"sampler0");a.h={v:b.getAttribLocation(d,"aVertex"),u:b.getAttribLocation(d,"aTex"),N:f};a.o=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,a.o);b.enableVertexAttribArray(a.h.v);b.vertexAttribPointer(a.h.v,2,b.FLOAT,!1,0,0);b.bufferData(b.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),b.STATIC_DRAW);b.bindBuffer(b.ARRAY_BUFFER,null);a.m=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,a.m);b.enableVertexAttribArray(a.h.u);b.vertexAttribPointer(a.h.u, | ||
2,b.FLOAT,!1,0,0);b.bufferData(b.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),b.STATIC_DRAW);b.bindBuffer(b.ARRAY_BUFFER,null);b.uniform1i(f,0)}d=a.h;b.useProgram(a.l);b.canvas.width=c.width;b.canvas.height=c.height;b.viewport(0,0,c.width,c.height);b.activeTexture(b.TEXTURE0);a.g.bindTexture2d(c.glName);b.enableVertexAttribArray(d.v);b.bindBuffer(b.ARRAY_BUFFER,a.o);b.vertexAttribPointer(d.v,2,b.FLOAT,!1,0,0);b.enableVertexAttribArray(d.u);b.bindBuffer(b.ARRAY_BUFFER,a.m);b.vertexAttribPointer(d.u, | ||
2,b.FLOAT,!1,0,0);b.bindFramebuffer(b.DRAW_FRAMEBUFFER,null);b.drawArrays(b.TRIANGLE_FAN,0,4);b.disableVertexAttribArray(d.v);b.disableVertexAttribArray(d.u);b.bindBuffer(b.ARRAY_BUFFER,null);a.g.bindTexture2d(0)};var va=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function wa(a,c){return c+a}function xa(a,c){window[a]=c}function ya(a){var c=document.createElement("script");c.setAttribute("src",a);c.setAttribute("crossorigin","anonymous");document.body.appendChild(c);return new Promise(function(b){c.addEventListener("load",function(){b()},!1)})} | ||
function za(a){for(var c=[],b=a.size(),d=0;d<b;++d){var f=a.get(d);c.push({x:f.x,y:f.y,z:f.z,visibility:f.hasVisibility?f.visibility:void 0})}return c}function Aa(a,c,b){this.graph=a;this.locateFile=c;this.g=b}Aa.prototype.toArrayBuffer=function(){return X(this,function c(){var b=this,d;return V(c,function(f){return 1==f.g?(b.graph.url?f=R(f,fetch(b.locateFile(b.graph.url,b.g)),3):(f.g=2,f=void 0),f):2!=f.g&&(d=f.j,d.body)?f.return(d.arrayBuffer()):f.return(new ArrayBuffer(0))})})}; | ||
function Ba(){return X(this,function c(){return V(c,function(b){switch(b.g){case 1:return b.m=2,R(b,WebAssembly.instantiate(va),4);case 4:b.g=3;b.m=0;break;case 2:return b.m=0,b.i=null,b.return(!1);case 3:return b.return(!0)}})})} | ||
function Y(a){this.h=a;this.listeners={};this.B={};this.j={};this.o=this.C=!0;this.A=Promise.resolve();this.locateFile=a&&a.locateFile||wa;if("object"===typeof window)a=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else if("undefined"!==typeof location)a=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/";else throw Error("solutions can only be loaded on a web page or in a web worker");this.F=a} | ||
Y.prototype.close=function(){this.i&&this.i.delete();return Promise.resolve()}; | ||
function Ba(a){return X(a,function c(){var d=this,f,k,e,g,h,l,m,t,r;return V(c,function(n){switch(n.g){case 1:f=d;if(!d.A)return n.return();wa("createMediapipeSolutionsWasm",{locateFile:d.locateFile});wa("createMediapipeSolutionsPackedAssets",{locateFile:d.locateFile});k=d.h.files||[];return R(n,Aa(),2);case 2:return e=n.j,R(n,Promise.all(k.map(function(q){return void 0===q.simd||q.simd&&e||!q.simd&&!e?xa(f.locateFile(q.url,f.F)):Promise.resolve()})),3);case 3:return g=window.createMediapipeSolutionsWasm, | ||
h=window.createMediapipeSolutionsPackedAssets,R(n,g(h),4);case 4:return d.g=n.j,d.j=document.createElement("canvas"),d.g.canvas=d.j,d.g.createContext(d.j,!0,!0,{}),d.i=new d.g.SolutionWasm,l=new za(d.h.graph,d.locateFile,d.F),R(n,d.loadGraph(l),5);case 5:if(d.h.listeners)for(m=v(d.h.listeners),t=m.next();!t.done;t=m.next())r=t.value,Ca(d,r);d.A=!1;n.g=0}})})} | ||
Y.prototype.setOptions=function(a){if(this.h.options){for(var b=[],c=v(Object.keys(a)),d=c.next();!d.done;d=c.next()){var f=d.value;(d=this.h.options[f])&&d.graphOptionXref&&(f={valueNumber:0===d.type?a[f]:0,valueBoolean:1===d.type?a[f]:!1},d=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),d.graphOptionXref),f),b.push(d))}0!==b.length&&(this.l=!0,this.m=b)}}; | ||
function Da(a){return X(a,function c(){var d=this,f,k,e,g,h;return V(c,function(l){if(!d.l)return l.return();f=d.j.getContext("webgl2");if(!f)return alert("Failed to create WebGL canvas context when passing video frame."),l.return();d.D=f;if(d.m){k=new d.g.GraphOptionChangeRequestList;e=v(d.m);for(g=e.next();!g.done;g=e.next())h=g.value,k.push_back(h);d.i.changeOptions(k);k.delete();d.m=void 0}d.l=!1;l.g=0})})} | ||
Y.prototype.initialize=function(){return X(this,function b(){var c=this;return V(b,function(d){return 1==d.g?R(d,Ba(c),2):R(d,Da(c),0)})})};Y.prototype.loadGraph=function(a){return X(this,function c(){var d,f=this;return V(c,function(k){if(1==k.g)return R(k,a.toArrayBuffer(),2);d=k.j;f.i.loadGraph(d);k.g=0})})}; | ||
Y.prototype.send=function(a,b){return X(this,function d(){var f=this,k,e,g,h,l,m,t,r;return V(d,function(n){if(1==n.g){if(!f.h.inputs)return n.return();k=1E3*(b||performance.now());return R(n,f.o,2)}if(3!=n.g)return R(n,f.initialize(),3);e=new f.g.PacketDataList;g=v(Object.keys(a));for(h=g.next();!h.done;h=g.next())if(l=h.value,m=f.h.inputs[l]){a:{var q=a[l];switch(m.type){case "video":var p=f.s[m.stream];p||(p=new ta(f.g,f.D),f.s[m.stream]=p);0===p.i&&(p.i=p.h.createTexture());if(q instanceof HTMLVideoElement){var u= | ||
q.videoWidth;var A=q.videoHeight}else q instanceof HTMLImageElement?(u=q.naturalWidth,A=q.naturalHeight):(u=q.width,A=q.height);A={glName:p.i,width:u,height:A};u=p.j;u.canvas.width=A.width;u.canvas.height=A.height;u.activeTexture(u.TEXTURE0);p.h.bindTexture2d(p.i);u.texImage2D(u.TEXTURE_2D,0,u.RGBA,u.RGBA,u.UNSIGNED_BYTE,q);p.h.bindTexture2d(0);p=A;break a;default:p={}}}t=p;r=m.stream;e.pushTexture2d(Object.assign(Object.assign({},t),{stream:r,timestamp:k}))}f.i.send(e);e.delete();n.g=0})})}; | ||
function Ea(a,b,c){if(c.isNumber())return c.getNumber();if(c.isRect())return c.getRect();if(c.isLandmarks())return c.getLandmarks();if(c.isLandmarksList())return c.getLandmarksList();if(c.isClassificationsList())return c.getClassificationsList();if(c.isObjectDetectionList())return c.getObjectDetectionList();if(c.isTexture2d()){var d=a.B[b];d||(d=new ta(a.g,a.D),a.B[b]=d);a=d;c=c.getTexture2d();b=a.j;if(void 0===a.l){d=sa(b,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }", | ||
0);var f=sa(b,"\n precision highp float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),k=b.createProgram();b.attachShader(k,d);b.attachShader(k,f);b.linkProgram(k);if(!b.getProgramParameter(k,b.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+b.getProgramInfoLog(k));d=a.l=k;b.useProgram(d);f=b.getUniformLocation(d,"sampler0");a.g={v:b.getAttribLocation(d,"aVertex"),u:b.getAttribLocation(d,"aTex"),L:f};a.o= | ||
b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,a.o);b.enableVertexAttribArray(a.g.v);b.vertexAttribPointer(a.g.v,2,b.FLOAT,!1,0,0);b.bufferData(b.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),b.STATIC_DRAW);b.bindBuffer(b.ARRAY_BUFFER,null);a.m=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,a.m);b.enableVertexAttribArray(a.g.u);b.vertexAttribPointer(a.g.u,2,b.FLOAT,!1,0,0);b.bufferData(b.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),b.STATIC_DRAW);b.bindBuffer(b.ARRAY_BUFFER,null);b.uniform1i(f, | ||
0)}d=a.g;b.useProgram(a.l);b.canvas.width=c.width;b.canvas.height=c.height;b.viewport(0,0,c.width,c.height);b.activeTexture(b.TEXTURE0);a.h.bindTexture2d(c.glName);b.enableVertexAttribArray(d.v);b.bindBuffer(b.ARRAY_BUFFER,a.o);b.vertexAttribPointer(d.v,2,b.FLOAT,!1,0,0);b.enableVertexAttribArray(d.u);b.bindBuffer(b.ARRAY_BUFFER,a.m);b.vertexAttribPointer(d.u,2,b.FLOAT,!1,0,0);b.bindFramebuffer(b.DRAW_FRAMEBUFFER,null);b.drawArrays(b.TRIANGLE_FAN,0,4);b.disableVertexAttribArray(d.v);b.disableVertexAttribArray(d.u); | ||
b.bindBuffer(b.ARRAY_BUFFER,null);a.h.bindTexture2d(0);return a.j.canvas}} | ||
function Ca(a,b){for(var c=b.name||"$",d=[].concat(da(b.wants)),f=new a.g.StringList,k=v(b.wants),e=k.next();!e.done;e=k.next())f.push_back(e.value);k=a.g.PacketListener.implement({onResults:function(g){return X(a,function l(){var m,t,r=this,n,q;return V(l,function(p){if(1==p.g){m={};for(t=0;t<b.wants.length;++t)m[d[t]]=Ea(r,b.wants[t],g.get(t));if(b.outs){for(var u=m,A=b.outs,F={},ma=v(Object.keys(A)),w=ma.next();!w.done;w=ma.next()){w=w.value;var B=A[w];if("string"===typeof B)F[w]=u[B];else{var G= | ||
u[B.stream];if(void 0!==G){if("landmarks"===B.type)F[w]=ya(G);else if("landmarks_list"===B.type){for(var H=[],P=G.size(),x=0;x<P;++x){var I=G.get(x);H.push(ya(I))}F[w]=H}else if("classifications_list"===B.type){H=[];P=G.size();for(x=0;x<P;++x){var K=G.get(x);I=H;for(var ba=I.push,S=[],T=K.size(),L=0;L<T;++L){var Q=K.get(L);S.push({index:Q.index,score:Q.score,label:Q.label})}ba.call(I,S)}F[w]=H}else if("object_detection_list"===B.type){H=[];P=G.size();for(x=0;x<P;++x){K=G.get(x);I=H;ba=I.push;S=K.id; | ||
T=K.keypoints;L=[];Q=T.size();for(var ca=0;ca<Q;++ca){var J=T.get(ca);L.push({id:J.id,point3d:{x:J.point3d.x,y:J.point3d.y,z:J.point3d.z},point2d:{x:J.point2d.x,y:J.point2d.y,depth:J.point2d.depth}})}ba.call(I,{id:S,keypoints:L,visibility:K.visibility})}F[w]=H}else throw Error("Unknown output config type: '"+B.type+"'");B.transform&&(F[w]=B.transform(F[w]))}}}m=F}(n=r.listeners[c])?p=R(p,r.o,3):(p.g=0,p=void 0);return p}if(q=n(m))return r.o=q,p.return(q);p.g=0})})}});a.i.attachMultiListener(f,k); | ||
f.delete()}Y.prototype.onResults=function(a,b){this.listeners[b||"$"]=a};W("Solution",Y);W("OptionType",{NUMBER:0,BOOL:1,0:"NUMBER",1:"BOOL"});function Z(a){a=a||{};this.g=new Y({locateFile:a.locateFile,files:[{url:"hands_solution_packed_assets_loader.js"},{simd:!1,url:"hands_solution_wasm_bin.js"},{simd:!0,url:"hands_solution_simd_wasm_bin.js"}],graph:{url:"hands.binarypb"},inputs:{image:{type:"video",stream:"input_frames_gpu"}},listeners:[{wants:["multi_hand_landmarks","image_transformed","multi_handedness"],outs:{image:"image_transformed",multiHandLandmarks:{type:"landmarks_list",stream:"multi_hand_landmarks"},multiHandedness:{type:"classifications_list", | ||
stream:"multi_handedness",transform:function(b){return b.map(function(c){return c[0]})}}}}],options:{selfieMode:{type:1,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},maxNumHands:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculator",fieldName:"int_value"}},minDetectionConfidence:{type:0,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"handlandmarktrackinggpu__palmdetectiongpu__TensorsToDetectionsCalculator", | ||
fieldName:"min_score_thresh"}},minTrackingConfidence:{type:0,graphOptionXref:{calculatorType:"ThresholdingCalculator",calculatorName:"handlandmarktrackinggpu__handlandmarkgpu__ThresholdingCalculator",fieldName:"threshold"}}}})}Z.prototype.close=function(){this.g.close();return Promise.resolve()};Z.prototype.onResults=function(a){this.g.onResults(a)};Z.prototype.initialize=function(){return X(this,function b(){var c=this;return V(b,function(d){return R(d,c.g.initialize(),0)})})}; | ||
Z.prototype.send=function(a){return X(this,function c(){var d=this;return V(c,function(f){return R(f,d.g.send(a),0)})})};Z.prototype.setOptions=function(a){this.g.setOptions(a)};W("Hands",Z);W("HAND_CONNECTIONS",[[0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]]);}).call(this); | ||
function Ca(a){return X(a,function b(){var d=this,f,k,e,g,h,l,n,y,q;return V(b,function(p){switch(p.g){case 1:f=d;if(!d.C)return p.return();xa("createMediapipeSolutionsWasm",{locateFile:d.locateFile});xa("createMediapipeSolutionsPackedAssets",{locateFile:d.locateFile});k=d.h.files||[];return R(p,Ba(),2);case 2:return e=p.j,R(p,Promise.all(k.map(function(u){return void 0===u.simd||u.simd&&e||!u.simd&&!e?ya(f.locateFile(u.url,f.F)):Promise.resolve()})),3);case 3:return g=window.createMediapipeSolutionsWasm, | ||
h=window.createMediapipeSolutionsPackedAssets,R(p,g(h),4);case 4:return d.g=p.j,d.m=document.createElement("canvas"),d.g.canvas=d.m,d.g.createContext(d.m,!0,!0,{}),d.i=new d.g.SolutionWasm,l=new Aa(d.h.graph,d.locateFile,d.F),R(p,d.loadGraph(l),5);case 5:if(d.h.listeners)for(n=A(d.h.listeners),y=n.next();!y.done;y=n.next())q=y.value,Da(d,q);d.C=!1;p.g=0}})})} | ||
Y.prototype.setOptions=function(a){if(this.h.options){for(var c=[],b=A(Object.keys(a)),d=b.next();!d.done;d=b.next()){var f=d.value;(d=this.h.options[f])&&d.graphOptionXref&&(f={valueNumber:0===d.type?a[f]:0,valueBoolean:1===d.type?a[f]:!1},d=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),d.graphOptionXref),f),c.push(d))}0!==c.length&&(this.o=!0,this.s=c)}}; | ||
function Ea(a){return X(a,function b(){var d=this,f,k,e,g,h;return V(b,function(l){if(!d.o)return l.return();f=d.m.getContext("webgl2");if(!f)return alert("Failed to create WebGL canvas context when passing video frame."),l.return();d.l=f;if(d.s){k=new d.g.GraphOptionChangeRequestList;e=A(d.s);for(g=e.next();!g.done;g=e.next())h=g.value,k.push_back(h);d.i.changeOptions(k);k.delete();d.s=void 0}d.o=!1;l.g=0})})} | ||
Y.prototype.initialize=function(){return X(this,function c(){var b=this;return V(c,function(d){return 1==d.g?R(d,Ca(b),2):R(d,Ea(b),0)})})};Y.prototype.loadGraph=function(a){return X(this,function b(){var d,f=this;return V(b,function(k){if(1==k.g)return R(k,a.toArrayBuffer(),2);d=k.j;f.i.loadGraph(d);k.g=0})})}; | ||
Y.prototype.send=function(a,c){return X(this,function d(){var f=this,k,e,g,h,l,n,y,q;return V(d,function(p){if(1==p.g){if(!f.h.inputs)return p.return();k=1E3*(c||performance.now());return R(p,f.A,2)}if(3!=p.g)return R(p,f.initialize(),3);e=new f.g.PacketDataList;g=A(Object.keys(a));for(h=g.next();!h.done;h=g.next())if(l=h.value,n=f.h.inputs[l]){a:{var u=a[l];switch(n.type){case "video":var r=f.B[n.stream];r||(r=new ta(f.g,f.l),f.B[n.stream]=r);0===r.j&&(r.j=r.g.createTexture());if(u instanceof HTMLVideoElement){var t= | ||
u.videoWidth;var B=u.videoHeight}else u instanceof HTMLImageElement?(t=u.naturalWidth,B=u.naturalHeight):(t=u.width,B=u.height);B={glName:r.j,width:t,height:B};t=r.i;t.canvas.width=B.width;t.canvas.height=B.height;t.activeTexture(t.TEXTURE0);r.g.bindTexture2d(r.j);t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,u);r.g.bindTexture2d(0);r=B;break a;default:r={}}}y=r;q=n.stream;e.pushTexture2d(Object.assign(Object.assign({},y),{stream:q,timestamp:k}))}f.i.send(e);e.delete();p.g=0})})}; | ||
function Fa(a,c,b){if(b.isNumber())return b.getNumber();if(b.isRect())return b.getRect();if(b.isLandmarks())return b.getLandmarks();if(b.isLandmarksList())return b.getLandmarksList();if(b.isClassificationsList())return b.getClassificationsList();if(b.isObjectDetectionList())return b.getObjectDetectionList();if(b.isTexture2d()){var d=a.j[c];d||(d=new ta(a.g,a.l),a.j[c]=d);a=d;b=b.getTexture2d();ua(a,b);return a.i.canvas}} | ||
function Da(a,c){for(var b=c.name||"$",d=[].concat(ba(c.wants)),f=new a.g.StringList,k=A(c.wants),e=k.next();!e.done;e=k.next())f.push_back(e.value);k=a.g.PacketListener.implement({onResults:function(g){return X(a,function l(){var n,y,q=this,p,u,r;return V(l,function(t){if(1==t.g){n={};for(y=0;y<c.wants.length;++y)n[d[y]]=g.get(y);var B;if(B=c.outs){for(var E={},na=A(Object.keys(B)),x=na.next();!x.done;x=na.next()){x=x.value;var C=B[x];if("string"===typeof C)E[x]=Fa(q,x,n[C]);else{var v=n[C.stream]; | ||
if(void 0!==v){if("detection_list"===C.type){var m=v.getRectList(),z=v.getLandmarksList();console.log(v,m,z);v=[];if(m)for(var w=0;w<m.size();++w){var D={L:m.get(w),M:za(z.get(w))};console.log(D);v.push(D)}E[x]=v}else if("landmarks"===C.type)m=v.getLandmarks(),E[x]=m?za(m):void 0;else if("landmarks_list"===C.type){if(m=v.getLandmarksList()){z=[];v=m.size();for(w=0;w<v;++w)D=m.get(w),z.push(za(D));m=z}else m=void 0;E[x]=m}else if("rect_list"===C.type){if(m=v.getRectList()){z=[];v=m.size();for(w=0;w< | ||
v;++w)D=m.get(w),z.push(D);m=z}else m=void 0;E[x]=m}else if("classifications_list"===C.type){if(m=v.getClassificationsList()){z=[];v=m.size();for(w=0;w<v;++w){var L=m.get(w);D=z;for(var da=D.push,S=[],T=L.size(),M=0;M<T;++M){var Q=L.get(M);S.push({index:Q.index,score:Q.score,label:Q.label})}da.call(D,S)}m=z}else m=void 0;E[x]=m}else if("object_detection_list"===C.type){if(m=v.getObjectDetectionList()){z=[];console.log(m);v=m.size();for(w=0;w<v;++w){L=m.get(w);D=z;da=D.push;S=L.id;T=L.keypoints;M= | ||
[];Q=T.size();for(var ea=0;ea<Q;++ea){var K=T.get(ea);M.push({id:K.id,point3d:{x:K.point3d.x,y:K.point3d.y,z:K.point3d.z},point2d:{x:K.point2d.x,y:K.point2d.y,depth:K.point2d.depth}})}da.call(D,{id:S,keypoints:M,visibility:L.visibility})}m=z}else m=void 0;E[x]=m}else if("texture"===C.type)m=q.j[x],m||(m=new ta(q.g,q.l),q.j[x]=m),z=v.getTexture2d(),ua(m,z),E[x]=m.i.canvas;else throw Error("Unknown output config type: '"+C.type+"'");C.transform&&(E[x]=C.transform(E[x]))}}}B=E}else B=n;p=B;(u=q.listeners[b])? | ||
t=R(t,q.A,3):(t.g=0,t=void 0);return t}if(r=u(p))return q.A=r,t.return(r);t.g=0})})}});a.i.attachMultiListener(f,k);f.delete()}Y.prototype.onResults=function(a,c){this.listeners[c||"$"]=a};W("Solution",Y);W("OptionType",{NUMBER:0,BOOL:1,0:"NUMBER",1:"BOOL"});function Z(a){a=a||{};this.g=new Y({locateFile:a.locateFile,files:[{url:"hands_solution_packed_assets_loader.js"},{simd:!1,url:"hands_solution_wasm_bin.js"},{simd:!0,url:"hands_solution_simd_wasm_bin.js"}],graph:{url:"hands.binarypb"},inputs:{image:{type:"video",stream:"input_frames_gpu"}},listeners:[{wants:["multi_hand_landmarks","image_transformed","multi_handedness"],outs:{image:"image_transformed",multiHandLandmarks:{type:"landmarks_list",stream:"multi_hand_landmarks"},multiHandedness:{type:"classifications_list", | ||
stream:"multi_handedness",transform:function(c){return c.map(function(b){return b[0]})}}}}],options:{selfieMode:{type:1,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},maxNumHands:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculator",fieldName:"int_value"}},minDetectionConfidence:{type:0,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"handlandmarktrackinggpu__palmdetectiongpu__TensorsToDetectionsCalculator", | ||
fieldName:"min_score_thresh"}},minTrackingConfidence:{type:0,graphOptionXref:{calculatorType:"ThresholdingCalculator",calculatorName:"handlandmarktrackinggpu__handlandmarkgpu__ThresholdingCalculator",fieldName:"threshold"}}}})}Z.prototype.close=function(){this.g.close();return Promise.resolve()};Z.prototype.onResults=function(a){this.g.onResults(a)};Z.prototype.initialize=function(){return X(this,function c(){var b=this;return V(c,function(d){return R(d,b.g.initialize(),0)})})}; | ||
Z.prototype.send=function(a){return X(this,function b(){var d=this;return V(b,function(f){return R(f,d.g.send(a),0)})})};Z.prototype.setOptions=function(a){this.g.setOptions(a)};W("Hands",Z);W("HAND_CONNECTIONS",[[0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]]);}).call(this); |
{ | ||
"name": "@mediapipe/hands", | ||
"description": "Mediapipe Hands Solution", | ||
"version": "0.1.1612238212", | ||
"version": "0.1.1613506466", | ||
"author": "mhays@google.com", | ||
@@ -6,0 +6,0 @@ "license": "Apache-2.0", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3245
18931358