@mediapipe/hands
Advanced tools
Comparing version 0.0.1605040992 to 0.0.1605554581
@@ -6,39 +6,38 @@ (function(){/* | ||
*/ | ||
'use strict';function t(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:t(a)}}function w(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 x="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 A(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 B=A(this);function C(a,b){if(b)a:{var c=B;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&&x(c,a,{configurable:!0,writable:!0,value:b})}}var D; | ||
if("function"==typeof Object.setPrototypeOf)D=Object.setPrototypeOf;else{var E;a:{var aa={D:!0},G={};try{G.__proto__=aa;E=G.D;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 H=D;function I(){this.g=!1;this.b=null;this.f=void 0;this.a=1;this.j=this.h=0;this.c=null}function J(a){if(a.g)throw new TypeError("Generator is already running");a.g=!0}I.prototype.i=function(a){this.f=a}; | ||
function K(a,b){a.c={F:b,G:!0};a.a=a.h||a.j}I.prototype.return=function(a){this.c={return:a};this.a=this.j};function L(a,b,c){a.a=c;return{value:b}}function ba(a){this.a=new I;this.b=a}function ca(a,b){J(a.a);var c=a.a.b;if(c)return M(a,"return"in c?c["return"]:function(d){return{value:d,done:!0}},b,a.a.return);a.a.return(b);return N(a)} | ||
function M(a,b,c,d){try{var f=b.call(a.a.b,c);if(!(f instanceof Object))throw new TypeError("Iterator result "+f+" is not an object");if(!f.done)return a.a.g=!1,f;var l=f.value}catch(e){return a.a.b=null,K(a.a,e),N(a)}a.a.b=null;d.call(a.a,l);return N(a)}function N(a){for(;a.a.a;)try{var b=a.b(a.a);if(b)return a.a.g=!1,{value:b.value,done:!1}}catch(c){a.a.f=void 0,K(a.a,c)}a.a.g=!1;if(a.a.c){b=a.a.c;a.a.c=null;if(b.G)throw b.F;return{value:b.return,done:!0}}return{value:void 0,done:!0}} | ||
function da(a){this.next=function(b){J(a.a);a.a.b?b=M(a,a.a.b.next,b,a.a.i):(a.a.i(b),b=N(a));return b};this.throw=function(b){J(a.a);a.a.b?b=M(a,a.a.b["throw"],b,a.a.i):(K(a.a,b),b=N(a));return b};this.return=function(b){return ca(a,b)};this[Symbol.iterator]=function(){return this}}function P(a,b){b=new da(new ba(b));H&&a.prototype&&H(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,l){this.a=f;x(this,"description",{configurable:!0,writable:!0,value:l})}if(a)return a;c.prototype.toString=function(){return this.a};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=B[b[c]];"function"===typeof d&&"function"!=typeof d.prototype[a]&&x(d.prototype,a,{configurable:!0,writable:!0,value:function(){return ea(t(this))}})}return a});function ea(a){a={next:a};a[Symbol.iterator]=function(){return this};return a} | ||
var fa="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||fa}); | ||
C("Promise",function(a){function b(e){this.b=0;this.c=void 0;this.a=[];this.i=!1;var g=this.f();try{e(g.resolve,g.reject)}catch(h){g.reject(h)}}function c(){this.a=null}function d(e){return e instanceof b?e:new b(function(g){g(e)})}if(a)return a;c.prototype.b=function(e){if(null==this.a){this.a=[];var g=this;this.c(function(){g.g()})}this.a.push(e)};var f=B.setTimeout;c.prototype.c=function(e){f(e,0)};c.prototype.g=function(){for(;this.a&&this.a.length;){var e=this.a;this.a=[];for(var g=0;g<e.length;++g){var h= | ||
e[g];e[g]=null;try{h()}catch(k){this.f(k)}}}this.a=null};c.prototype.f=function(e){this.c(function(){throw e;})};b.prototype.f=function(){function e(k){return function(m){h||(h=!0,k.call(g,m))}}var g=this,h=!1;return{resolve:e(this.H),reject:e(this.g)}};b.prototype.H=function(e){if(e===this)this.g(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof b)this.B(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.h(e)}}; | ||
b.prototype.A=function(e){var g=void 0;try{g=e.then}catch(h){this.g(h);return}"function"==typeof g?this.C(g,e):this.h(e)};b.prototype.g=function(e){this.j(2,e)};b.prototype.h=function(e){this.j(1,e)};b.prototype.j=function(e,g){if(0!=this.b)throw Error("Cannot settle("+e+", "+g+"): Promise already settled in state"+this.b);this.b=e;this.c=g;2===this.b&&this.I();this.s()};b.prototype.I=function(){var e=this;f(function(){if(e.u()){var g=B.console;"undefined"!==typeof g&&g.error(e.c)}},1)};b.prototype.u= | ||
function(){if(this.i)return!1;var e=B.CustomEvent,g=B.Event,h=B.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=B.document.createEvent("CustomEvent"),e.initCustomEvent("unhandledrejection",!1,!0,e));e.promise=this;e.reason=this.c;return h(e)};b.prototype.s=function(){if(null!=this.a){for(var e=0;e<this.a.length;++e)l.b(this.a[e]);this.a=null}};var l=new c;b.prototype.B= | ||
function(e){var g=this.f();e.o(g.resolve,g.reject)};b.prototype.C=function(e,g){var h=this.f();try{e.call(g,h.resolve,h.reject)}catch(k){h.reject(k)}};b.prototype.then=function(e,g){function h(p,n){return"function"==typeof p?function(u){try{k(p(u))}catch(y){m(y)}}:n}var k,m,r=new b(function(p,n){k=p;m=n});this.o(h(e,k),h(g,m));return r};b.prototype.catch=function(e){return this.then(void 0,e)};b.prototype.o=function(e,g){function h(){switch(k.b){case 1:e(k.c);break;case 2:g(k.c);break;default:throw Error("Unexpected state: "+ | ||
k.b);}}var k=this;null==this.a?l.b(h):this.a.push(h);this.i=!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 k=v(e),m=k.next();!m.done;m=k.next())d(m.value).o(g,h)})};b.all=function(e){var g=v(e),h=g.next();return h.done?d([]):new b(function(k,m){function r(u){return function(y){p[u]=y;n--;0==n&&k(p)}}var p=[],n=0;do p.push(void 0),n++,d(h.value).o(r(p.length-1),m),h=g.next();while(!h.done)})};return b}); | ||
function ha(a,b){a instanceof String&&(a+="");var c=0,d=!1,f={next:function(){if(!d&&c<a.length){var l=c++;return{value:b(l,a[l]),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 ha(this,function(b){return b})}});var ia=this||self; | ||
function Q(a,b){a=a.split(".");var c=ia;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 R(a,b){var c=void 0;return new (c||(c=Promise))(function(d,f){function l(h){try{g(b.next(h))}catch(k){f(k)}}function e(h){try{g(b["throw"](h))}catch(k){f(k)}}function g(h){h.done?d(h.value):(new c(function(k){k(h.value)})).then(l,e)}g((b=b.apply(a,void 0)).next())})};function S(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 T(a,b){this.b=a;this.f=b;this.c=0};var ja=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 ka(a,b){return b+a}function U(a,b){window[a]=b}function la(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 V(a,b,c){this.graph=a;this.locateFile=b;this.v=c} | ||
V.prototype.toArrayBuffer=function(){return R(this,function b(){var c=this,d;return P(b,function(f){return 1==f.a?(c.graph.url?f=L(f,fetch(c.locateFile(c.graph.url,c.v)),3):(f.a=2,f=void 0),f):2!=f.a&&(d=f.f,d.body)?f.return(d.arrayBuffer()):f.return(new ArrayBuffer(0))})})}; | ||
function ma(){return R(this,function b(){return P(b,function(c){switch(c.a){case 1:return c.h=2,L(c,WebAssembly.instantiate(ja),4);case 4:c.a=3;c.h=0;break;case 2:return c.h=0,c.c=null,c.return(!1);case 3:return c.return(!0)}})})} | ||
function Y(a){this.b=a;this.listeners={};this.j={};this.A={};this.h=this.u=!0;this.f=Promise.resolve();this.locateFile=a&&a.locateFile||ka;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.v=a} | ||
'use strict';function u(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}function w(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:u(a)}}function x(a){if(!(a instanceof Array)){a=w(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 z(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 A=z(this);function C(a,b){if(b)a:{var c=A;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 F={D:!0},G={};try{G.__proto__=F;E=G.D;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 H=D;function I(){this.g=!1;this.b=null;this.f=void 0;this.a=1;this.j=this.h=0;this.c=null}function J(a){if(a.g)throw new TypeError("Generator is already running");a.g=!0}I.prototype.i=function(a){this.f=a}; | ||
function K(a,b){a.c={F:b,G:!0};a.a=a.h||a.j}I.prototype.return=function(a){this.c={return:a};this.a=this.j};function L(a,b,c){a.a=c;return{value:b}}function aa(a){this.a=new I;this.b=a}function ba(a,b){J(a.a);var c=a.a.b;if(c)return M(a,"return"in c?c["return"]:function(d){return{value:d,done:!0}},b,a.a.return);a.a.return(b);return N(a)} | ||
function M(a,b,c,d){try{var f=b.call(a.a.b,c);if(!(f instanceof Object))throw new TypeError("Iterator result "+f+" is not an object");if(!f.done)return a.a.g=!1,f;var k=f.value}catch(e){return a.a.b=null,K(a.a,e),N(a)}a.a.b=null;d.call(a.a,k);return N(a)}function N(a){for(;a.a.a;)try{var b=a.b(a.a);if(b)return a.a.g=!1,{value:b.value,done:!1}}catch(c){a.a.f=void 0,K(a.a,c)}a.a.g=!1;if(a.a.c){b=a.a.c;a.a.c=null;if(b.G)throw b.F;return{value:b.return,done:!0}}return{value:void 0,done:!0}} | ||
function ca(a){this.next=function(b){J(a.a);a.a.b?b=M(a,a.a.b.next,b,a.a.i):(a.a.i(b),b=N(a));return b};this.throw=function(b){J(a.a);a.a.b?b=M(a,a.a.b["throw"],b,a.a.i):(K(a.a,b),b=N(a));return b};this.return=function(b){return ba(a,b)};this[Symbol.iterator]=function(){return this}}function O(a,b){b=new ca(new aa(b));H&&a.prototype&&H(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.a=f;y(this,"description",{configurable:!0,writable:!0,value:k})}if(a)return a;c.prototype.toString=function(){return this.a};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=A[b[c]];"function"===typeof d&&"function"!=typeof d.prototype[a]&&y(d.prototype,a,{configurable:!0,writable:!0,value:function(){return da(u(this))}})}return a});function da(a){a={next:a};a[Symbol.iterator]=function(){return this};return a} | ||
var ea="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||ea}); | ||
C("Promise",function(a){function b(e){this.b=0;this.c=void 0;this.a=[];this.i=!1;var g=this.f();try{e(g.resolve,g.reject)}catch(h){g.reject(h)}}function c(){this.a=null}function d(e){return e instanceof b?e:new b(function(g){g(e)})}if(a)return a;c.prototype.b=function(e){if(null==this.a){this.a=[];var g=this;this.c(function(){g.g()})}this.a.push(e)};var f=A.setTimeout;c.prototype.c=function(e){f(e,0)};c.prototype.g=function(){for(;this.a&&this.a.length;){var e=this.a;this.a=[];for(var g=0;g<e.length;++g){var h= | ||
e[g];e[g]=null;try{h()}catch(l){this.f(l)}}}this.a=null};c.prototype.f=function(e){this.c(function(){throw e;})};b.prototype.f=function(){function e(l){return function(m){h||(h=!0,l.call(g,m))}}var g=this,h=!1;return{resolve:e(this.H),reject:e(this.g)}};b.prototype.H=function(e){if(e===this)this.g(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof b)this.B(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.h(e)}}; | ||
b.prototype.A=function(e){var g=void 0;try{g=e.then}catch(h){this.g(h);return}"function"==typeof g?this.C(g,e):this.h(e)};b.prototype.g=function(e){this.j(2,e)};b.prototype.h=function(e){this.j(1,e)};b.prototype.j=function(e,g){if(0!=this.b)throw Error("Cannot settle("+e+", "+g+"): Promise already settled in state"+this.b);this.b=e;this.c=g;2===this.b&&this.I();this.s()};b.prototype.I=function(){var e=this;f(function(){if(e.u()){var g=A.console;"undefined"!==typeof g&&g.error(e.c)}},1)};b.prototype.u= | ||
function(){if(this.i)return!1;var e=A.CustomEvent,g=A.Event,h=A.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=A.document.createEvent("CustomEvent"),e.initCustomEvent("unhandledrejection",!1,!0,e));e.promise=this;e.reason=this.c;return h(e)};b.prototype.s=function(){if(null!=this.a){for(var e=0;e<this.a.length;++e)k.b(this.a[e]);this.a=null}};var k=new c;b.prototype.B= | ||
function(e){var g=this.f();e.o(g.resolve,g.reject)};b.prototype.C=function(e,g){var h=this.f();try{e.call(g,h.resolve,h.reject)}catch(l){h.reject(l)}};b.prototype.then=function(e,g){function h(q,n){return"function"==typeof q?function(r){try{l(q(r))}catch(p){m(p)}}:n}var l,m,t=new b(function(q,n){l=q;m=n});this.o(h(e,l),h(g,m));return t};b.prototype.catch=function(e){return this.then(void 0,e)};b.prototype.o=function(e,g){function h(){switch(l.b){case 1:e(l.c);break;case 2:g(l.c);break;default:throw Error("Unexpected state: "+ | ||
l.b);}}var l=this;null==this.a?k.b(h):this.a.push(h);this.i=!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=w(e),m=l.next();!m.done;m=l.next())d(m.value).o(g,h)})};b.all=function(e){var g=w(e),h=g.next();return h.done?d([]):new b(function(l,m){function t(r){return function(p){q[r]=p;n--;0==n&&l(q)}}var q=[],n=0;do q.push(void 0),n++,d(h.value).o(t(q.length-1),m),h=g.next();while(!h.done)})};return b}); | ||
function fa(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 fa(this,function(b){return b})}});var ha=this||self; | ||
function P(a,b){a=a.split(".");var c=ha;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 Q(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 R(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 S(a,b){this.b=a;this.f=b;this.c=0};var ia=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 ja(a,b){return b+a}function T(a,b){window[a]=b}function ka(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 X(a,b,c){this.graph=a;this.locateFile=b;this.v=c} | ||
X.prototype.toArrayBuffer=function(){return Q(this,function b(){var c=this,d;return O(b,function(f){return 1==f.a?(c.graph.url?f=L(f,fetch(c.locateFile(c.graph.url,c.v)),3):(f.a=2,f=void 0),f):2!=f.a&&(d=f.f,d.body)?f.return(d.arrayBuffer()):f.return(new ArrayBuffer(0))})})}; | ||
function la(){return Q(this,function b(){return O(b,function(c){switch(c.a){case 1:return c.h=2,L(c,WebAssembly.instantiate(ia),4);case 4:c.a=3;c.h=0;break;case 2:return c.h=0,c.c=null,c.return(!1);case 3:return c.return(!0)}})})} | ||
function Y(a){this.b=a;this.listeners={};this.j={};this.A={};this.g=this.u=!0;this.i=Promise.resolve();this.locateFile=a&&a.locateFile||ja;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.v=a} | ||
Y.prototype.close=function(){this.c&&this.c.delete();return Promise.resolve()}; | ||
function na(a){return R(a,function c(){var d=this,f,l,e,g,h,k,m,r,p;return P(c,function(n){switch(n.a){case 1:f=d;if(!d.u)return n.return();U("createMediapipeSolutionsWasm",{locateFile:d.locateFile});U("createMediapipeSolutionsPackedAssets",{locateFile:d.locateFile});l=d.b.files||[];return L(n,ma(),2);case 2:return e=n.f,L(n,Promise.all(l.map(function(u){return void 0===u.simd||u.simd&&e||!u.simd&&!e?la(f.locateFile(u.url,f.v)):Promise.resolve()})),3);case 3:return g=window.createMediapipeSolutionsWasm, | ||
h=window.createMediapipeSolutionsPackedAssets,L(n,g(h),4);case 4:return d.a=n.f,d.g=document.createElement("canvas"),d.a.canvas=d.g,d.a.createContext(d.g,!0,!0,{}),d.c=new d.a.SolutionWasm,k=new V(d.b.graph,d.locateFile,d.v),L(n,d.loadGraph(k),5);case 5:if(d.b.listeners)for(m=v(d.b.listeners),r=m.next();!r.done;r=m.next())p=r.value,oa(d,p);d.u=!1;n.a=0}})})} | ||
Y.prototype.setOptions=function(a){if(this.b.options){for(var b=[],c=v(Object.keys(a)),d=c.next();!d.done;d=c.next()){var f=d.value;(d=this.b.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.h=!0,this.i=b)}}; | ||
function pa(a){return R(a,function c(){var d=this,f,l,e,g,h;return P(c,function(k){if(!d.h)return k.return();f=d.g.getContext("webgl2");if(!f)return alert("Failed to create WebGL canvas context when passing video frame."),k.return();d.s=f;if(d.i){l=new d.a.GraphOptionChangeRequestList;e=v(d.i);for(g=e.next();!g.done;g=e.next())h=g.value,l.push_back(h);d.c.changeOptions(l);l.delete();d.i=void 0}d.h=!1;k.a=0})})} | ||
Y.prototype.initialize=function(){return R(this,function b(){var c=this;return P(b,function(d){return 1==d.a?L(d,na(c),2):L(d,pa(c),0)})})};Y.prototype.loadGraph=function(a){return R(this,function c(){var d,f=this;return P(c,function(l){if(1==l.a)return L(l,a.toArrayBuffer(),2);d=l.f;f.c.loadGraph(d);l.a=0})})}; | ||
Y.prototype.send=function(a,b){return R(this,function d(){var f=this,l,e;return P(d,function(g){l=f;if(!f.b.inputs)return g.return();e=b||performance.now();f.f=f.f.then(function(){return R(l,function k(){var m=this,r,p,n,u,y,W,X;return P(k,function(O){if(1==O.a)return L(O,m.initialize(),2);r=new m.a.PacketDataList;p=v(Object.keys(a));for(n=p.next();!n.done;n=p.next())if(u=n.value,y=m.b.inputs[u]){a:{var F=a[u];switch(y.type){case "video":var q=m.j[y.stream];q||(q=new T(m.a,m.s),m.j[y.stream]=q);0=== | ||
q.c&&(q.c=q.b.createTexture());var z=q.f;z.canvas.width=F.videoWidth;z.canvas.height=F.videoHeight;z.activeTexture(z.TEXTURE0);q.b.bindTexture2d(q.c);z.texImage2D(z.TEXTURE_2D,0,z.RGBA,z.RGBA,z.UNSIGNED_BYTE,F);q.b.bindTexture2d(0);q={glName:q.c,width:F.videoWidth,height:F.videoHeight};break a;default:q={}}}W=q;X=y.stream;r.pushTexture2d(Object.assign(Object.assign({},W),{stream:X,timestamp:e}))}m.c.send(r);r.delete();O.a=0})})});g.a=0})})}; | ||
function qa(a,b){for(var c={},d=v(Object.keys(b)),f=d.next();!f.done;f=d.next())f=f.value,c[f]=a[b[f]];return c} | ||
function ra(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.isTexture2d()){var d=a.A[b];d||(d=new T(a.a,a.s),a.A[b]=d);a=d;c=c.getTexture2d();b=a.f;if(void 0===a.g){d=S(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=S(b,"\n precision highp float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }", | ||
1),l=b.createProgram();b.attachShader(l,d);b.attachShader(l,f);b.linkProgram(l);if(!b.getProgramParameter(l,b.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+b.getProgramInfoLog(l));d=a.g=l;b.useProgram(d);f=b.getUniformLocation(d,"sampler0");a.a={m:b.getAttribLocation(d,"aVertex"),l:b.getAttribLocation(d,"aTex"),J:f};a.i=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,a.i);b.enableVertexAttribArray(a.a.m);b.vertexAttribPointer(a.a.m,2,b.FLOAT,!1,0,0);b.bufferData(b.ARRAY_BUFFER,new Float32Array([-1, | ||
function ma(a){return Q(a,function c(){var d=this,f,k,e,g,h,l,m,t,q;return O(c,function(n){switch(n.a){case 1:f=d;if(!d.u)return n.return();T("createMediapipeSolutionsWasm",{locateFile:d.locateFile});T("createMediapipeSolutionsPackedAssets",{locateFile:d.locateFile});k=d.b.files||[];return L(n,la(),2);case 2:return e=n.f,L(n,Promise.all(k.map(function(r){return void 0===r.simd||r.simd&&e||!r.simd&&!e?ka(f.locateFile(r.url,f.v)):Promise.resolve()})),3);case 3:return g=window.createMediapipeSolutionsWasm, | ||
h=window.createMediapipeSolutionsPackedAssets,L(n,g(h),4);case 4:return d.a=n.f,d.f=document.createElement("canvas"),d.a.canvas=d.f,d.a.createContext(d.f,!0,!0,{}),d.c=new d.a.SolutionWasm,l=new X(d.b.graph,d.locateFile,d.v),L(n,d.loadGraph(l),5);case 5:if(d.b.listeners)for(m=w(d.b.listeners),t=m.next();!t.done;t=m.next())q=t.value,na(d,q);d.u=!1;n.a=0}})})} | ||
Y.prototype.setOptions=function(a){if(this.b.options){for(var b=[],c=w(Object.keys(a)),d=c.next();!d.done;d=c.next()){var f=d.value;(d=this.b.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.g=!0,this.h=b)}}; | ||
function oa(a){return Q(a,function c(){var d=this,f,k,e,g,h;return O(c,function(l){if(!d.g)return l.return();f=d.f.getContext("webgl2");if(!f)return alert("Failed to create WebGL canvas context when passing video frame."),l.return();d.s=f;if(d.h){k=new d.a.GraphOptionChangeRequestList;e=w(d.h);for(g=e.next();!g.done;g=e.next())h=g.value,k.push_back(h);d.c.changeOptions(k);k.delete();d.h=void 0}d.g=!1;l.a=0})})} | ||
Y.prototype.initialize=function(){return Q(this,function b(){var c=this;return O(b,function(d){return 1==d.a?L(d,ma(c),2):L(d,oa(c),0)})})};Y.prototype.loadGraph=function(a){return Q(this,function c(){var d,f=this;return O(c,function(k){if(1==k.a)return L(k,a.toArrayBuffer(),2);d=k.f;f.c.loadGraph(d);k.a=0})})}; | ||
Y.prototype.send=function(a,b){return Q(this,function d(){var f=this,k,e,g,h,l,m,t,q;return O(d,function(n){if(1==n.a){if(!f.b.inputs)return n.return();k=b||performance.now();return L(n,f.i,2)}if(3!=n.a)return L(n,f.initialize(),3);e=new f.a.PacketDataList;g=w(Object.keys(a));for(h=g.next();!h.done;h=g.next())if(l=h.value,m=f.b.inputs[l]){a:{var r=a[l];switch(m.type){case "video":var p=f.j[m.stream];p||(p=new S(f.a,f.s),f.j[m.stream]=p);0===p.c&&(p.c=p.b.createTexture());var v=p.f;v.canvas.width= | ||
r.videoWidth;v.canvas.height=r.videoHeight;v.activeTexture(v.TEXTURE0);p.b.bindTexture2d(p.c);v.texImage2D(v.TEXTURE_2D,0,v.RGBA,v.RGBA,v.UNSIGNED_BYTE,r);p.b.bindTexture2d(0);p={glName:p.c,width:r.videoWidth,height:r.videoHeight};break a;default:p={}}}t=p;q=m.stream;e.pushTexture2d(Object.assign(Object.assign({},t),{stream:q,timestamp:k}))}f.c.send(e);e.delete();n.a=0})})}; | ||
function pa(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.isTexture2d()){var d=a.A[b];d||(d=new S(a.a,a.s),a.A[b]=d);a=d;c=c.getTexture2d();b=a.f;if(void 0===a.g){d=R(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=R(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.g=k;b.useProgram(d);f=b.getUniformLocation(d,"sampler0");a.a={m:b.getAttribLocation(d,"aVertex"),l:b.getAttribLocation(d,"aTex"),J:f};a.i=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,a.i);b.enableVertexAttribArray(a.a.m);b.vertexAttribPointer(a.a.m,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.h=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,a.h);b.enableVertexAttribArray(a.a.l);b.vertexAttribPointer(a.a.l,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.a;b.useProgram(a.g);b.canvas.width=c.width;b.canvas.height=c.height;b.viewport(0,0,c.width,c.height);b.activeTexture(b.TEXTURE0);a.b.bindTexture2d(c.glName);b.enableVertexAttribArray(d.m); | ||
b.bindBuffer(b.ARRAY_BUFFER,a.i);b.vertexAttribPointer(d.m,2,b.FLOAT,!1,0,0);b.enableVertexAttribArray(d.l);b.bindBuffer(b.ARRAY_BUFFER,a.h);b.vertexAttribPointer(d.l,2,b.FLOAT,!1,0,0);b.bindFramebuffer(b.DRAW_FRAMEBUFFER,null);b.drawArrays(b.TRIANGLE_FAN,0,4);b.disableVertexAttribArray(d.m);b.disableVertexAttribArray(d.l);b.bindBuffer(b.ARRAY_BUFFER,null);a.b.bindTexture2d(0);return a.f.canvas}} | ||
function oa(a,b){for(var c=b.name||"$",d=[].concat(w(b.wants)),f=new a.a.StringList,l=v(b.wants),e=l.next();!e.done;e=l.next())f.push_back(e.value);l=a.a.PacketListener.implement({onResults:function(g){for(var h={},k=0;k<b.wants.length;++k)h[d[k]]=ra(a,b.wants[k],g.get(k));b.outs&&(h=qa(h,b.outs));var m=a.listeners[c];m&&(a.f=a.f.then(function(){m(h)}))}});a.c.attachMultiListener(f,l);f.delete()}Y.prototype.onResults=function(a,b){this.listeners[b||"$"]=a};Q("Solution",Y); | ||
Q("OptionType",{NUMBER:0,BOOL:1,0:"NUMBER",1:"BOOL"});function Z(a){a=a||{};this.a=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:["hand_landmarks","image_transformed"],outs:{image:"image_transformed",landmarks:"hand_landmarks"}}],options:{selfieMode:{type:1,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1, | ||
function na(a,b){for(var c=b.name||"$",d=[].concat(x(b.wants)),f=new a.a.StringList,k=w(b.wants),e=k.next();!e.done;e=k.next())f.push_back(e.value);k=a.a.PacketListener.implement({onResults:function(g){return Q(a,function l(){var m,t,q=this,n,r;return O(l,function(p){if(1==p.a){m={};for(t=0;t<b.wants.length;++t)m[d[t]]=pa(q,b.wants[t],g.get(t));if(b.outs){for(var v=m,U=b.outs,V={},W=w(Object.keys(U)),B=W.next();!B.done;B=W.next())B=B.value,V[B]=v[U[B]];m=V}(n=q.listeners[c])?p=L(p,q.i,3):(p.a=0,p= | ||
void 0);return p}if(r=n(m))return q.i=r,p.return(r);p.a=0})})}});a.c.attachMultiListener(f,k);f.delete()}Y.prototype.onResults=function(a,b){this.listeners[b||"$"]=a};P("Solution",Y);P("OptionType",{NUMBER:0,BOOL:1,0:"NUMBER",1:"BOOL"});function Z(a){a=a||{};this.a=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:["hand_landmarks","image_transformed"],outs:{image:"image_transformed",landmarks:"hand_landmarks"}}],options:{selfieMode:{type:1,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1, | ||
fieldName:"flip_horizontal"}},maxHands:{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.a.close();return Promise.resolve()};Z.prototype.onResults=function(a){this.a.onResults(a)};Z.prototype.initialize=function(){return R(this,function b(){var c=this;return P(b,function(d){return L(d,c.a.initialize(),0)})})};Z.prototype.send=function(a){return R(this,function c(){var d=this;return P(c,function(f){return L(f,d.a.send(a),0)})})};Z.prototype.setOptions=function(a){this.a.setOptions(a)}; | ||
Q("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]]);Q("Hands",Z);}).call(this); | ||
fieldName:"threshold"}}}})}Z.prototype.close=function(){this.a.close();return Promise.resolve()};Z.prototype.onResults=function(a){this.a.onResults(a)};Z.prototype.initialize=function(){return Q(this,function b(){var c=this;return O(b,function(d){return L(d,c.a.initialize(),0)})})};Z.prototype.send=function(a){return Q(this,function c(){var d=this;return O(c,function(f){return L(f,d.a.send(a),0)})})};Z.prototype.setOptions=function(a){this.a.setOptions(a)}; | ||
P("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]]);P("Hands",Z);}).call(this); |
@@ -184,5 +184,5 @@ | ||
} | ||
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": "380286b7-a862-4fbe-872d-e83b3dbdfc36"}); | ||
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": "cea163d6-f912-4aba-bd29-eb0be4760404"}); | ||
})(); | ||
{ | ||
"name": "@mediapipe/hands", | ||
"description": "Mediapipe Hands Solution", | ||
"version": "0.0.1605040992", | ||
"version": "0.0.1605554581", | ||
"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 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
20510472
12