@mediapipe/face_detection
Advanced tools
Comparing version 0.4.1624566703 to 0.4.1627346767
@@ -6,8 +6,8 @@ (function(){/* | ||
*/ | ||
'use strict';var B;function aa(a){var c=0;return function(){return c<a.length?{done:!1,value:a[c++]}:{done:!0}}}var C="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 ba(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 D=ba(this);function G(a,c){if(c)a:{var b=D;a=a.split(".");for(var d=0;d<a.length-1;d++){var g=a[d];if(!(g in b))break a;b=b[g]}a=a[a.length-1];d=b[a];c=c(d);c!=d&&null!=c&&C(b,a,{configurable:!0,writable:!0,value:c})}} | ||
G("Symbol",function(a){function c(k){if(this instanceof c)throw new TypeError("Symbol is not a constructor");return new b(d+(k||"")+"_"+g++,k)}function b(k,e){this.g=k;C(this,"description",{configurable:!0,writable:!0,value:e})}if(a)return a;b.prototype.toString=function(){return this.g};var d="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",g=0;return c}); | ||
G("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=D[c[b]];"function"===typeof d&&"function"!=typeof d.prototype[a]&&C(d.prototype,a,{configurable:!0,writable:!0,value:function(){return ca(aa(this))}})}return a});function ca(a){a={next:a};a[Symbol.iterator]=function(){return this};return a} | ||
function H(a){var c="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return c?c.call(a):{next:aa(a)}}function J(a){if(!(a instanceof Array)){a=H(a);for(var c,b=[];!(c=a.next()).done;)b.push(c.value);a=b}return a}var L;if("function"==typeof Object.setPrototypeOf)L=Object.setPrototypeOf;else{var M;a:{var da={a:!0},ha={};try{ha.__proto__=da;M=ha.a;break a}catch(a){}M=!1}L=M?function(a,c){a.__proto__=c;if(a.__proto__!==c)throw new TypeError(a+" is not extensible");return a}:null} | ||
var ia=L;function R(){this.l=!1;this.i=null;this.h=void 0;this.g=1;this.s=this.m=0;this.j=null}function S(a){if(a.l)throw new TypeError("Generator is already running");a.l=!0}R.prototype.o=function(a){this.h=a};function T(a,c){a.j={P:c,R:!0};a.g=a.m||a.s}R.prototype.return=function(a){this.j={return:a};this.g=this.s};function U(a,c,b){a.g=b;return{value:c}}function ja(a){this.g=new R;this.h=a} | ||
'use strict';var A;function aa(a){var c=0;return function(){return c<a.length?{done:!1,value:a[c++]}:{done:!0}}}var D="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 ba(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 E=ba(this);function G(a,c){if(c)a:{var b=E;a=a.split(".");for(var d=0;d<a.length-1;d++){var g=a[d];if(!(g in b))break a;b=b[g]}a=a[a.length-1];d=b[a];c=c(d);c!=d&&null!=c&&D(b,a,{configurable:!0,writable:!0,value:c})}} | ||
G("Symbol",function(a){function c(k){if(this instanceof c)throw new TypeError("Symbol is not a constructor");return new b(d+(k||"")+"_"+g++,k)}function b(k,e){this.g=k;D(this,"description",{configurable:!0,writable:!0,value:e})}if(a)return a;b.prototype.toString=function(){return this.g};var d="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",g=0;return c}); | ||
G("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=E[c[b]];"function"===typeof d&&"function"!=typeof d.prototype[a]&&D(d.prototype,a,{configurable:!0,writable:!0,value:function(){return ca(aa(this))}})}return a});function ca(a){a={next:a};a[Symbol.iterator]=function(){return this};return a} | ||
function I(a){var c="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return c?c.call(a):{next:aa(a)}}function K(a){if(!(a instanceof Array)){a=I(a);for(var c,b=[];!(c=a.next()).done;)b.push(c.value);a=b}return a}var M;if("function"==typeof Object.setPrototypeOf)M=Object.setPrototypeOf;else{var N;a:{var da={a:!0},ha={};try{ha.__proto__=da;N=ha.a;break a}catch(a){}N=!1}M=N?function(a,c){a.__proto__=c;if(a.__proto__!==c)throw new TypeError(a+" is not extensible");return a}:null} | ||
var ia=M;function O(){this.l=!1;this.i=null;this.h=void 0;this.g=1;this.s=this.m=0;this.j=null}function S(a){if(a.l)throw new TypeError("Generator is already running");a.l=!0}O.prototype.o=function(a){this.h=a};function T(a,c){a.j={P:c,R:!0};a.g=a.m||a.s}O.prototype.return=function(a){this.j={return:a};this.g=this.s};function U(a,c,b){a.g=b;return{value:c}}function ja(a){this.g=new O;this.h=a} | ||
function ka(a,c){S(a.g);var b=a.g.i;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 V(a)}function la(a,c,b,d){try{var g=c.call(a.g.i,b);if(!(g instanceof Object))throw new TypeError("Iterator result "+g+" is not an object");if(!g.done)return a.g.l=!1,g;var k=g.value}catch(e){return a.g.i=null,T(a.g,e),V(a)}a.g.i=null;d.call(a.g,k);return V(a)} | ||
@@ -17,46 +17,50 @@ function V(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.h=void 0,T(a.g,b)}a.g.l=!1;if(a.g.j){c=a.g.j;a.g.j=null;if(c.R)throw c.P;return{value:c.return,done:!0}}return{value:void 0,done:!0}} | ||
var na="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 g in d)Object.prototype.hasOwnProperty.call(d,g)&&(a[g]=d[g])}return a};G("Object.assign",function(a){return a||na}); | ||
G("Promise",function(a){function c(e){this.h=0;this.i=void 0;this.g=[];this.o=!1;var f=this.j();try{e(f.resolve,f.reject)}catch(h){f.reject(h)}}function b(){this.g=null}function d(e){return e instanceof c?e:new c(function(f){f(e)})}if(a)return a;b.prototype.h=function(e){if(null==this.g){this.g=[];var f=this;this.i(function(){f.l()})}this.g.push(e)};var g=D.setTimeout;b.prototype.i=function(e){g(e,0)};b.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var f=0;f<e.length;++f){var h= | ||
e[f];e[f]=null;try{h()}catch(m){this.j(m)}}}this.g=null};b.prototype.j=function(e){this.i(function(){throw e;})};c.prototype.j=function(){function e(m){return function(n){h||(h=!0,m.call(f,n))}}var f=this,h=!1;return{resolve:e(this.B),reject:e(this.l)}};c.prototype.B=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof c)this.D(e);else{a:switch(typeof e){case "object":var f=null!=e;break a;case "function":f=!0;break a;default:f=!1}f?this.A(e):this.m(e)}}; | ||
c.prototype.A=function(e){var f=void 0;try{f=e.then}catch(h){this.l(h);return}"function"==typeof f?this.F(f,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,f){if(0!=this.h)throw Error("Cannot settle("+e+", "+f+"): Promise already settled in state"+this.h);this.h=e;this.i=f;2===this.h&&this.C();this.u()};c.prototype.C=function(){var e=this;g(function(){if(e.v()){var f=D.console;"undefined"!==typeof f&&f.error(e.i)}},1)};c.prototype.v= | ||
function(){if(this.o)return!1;var e=D.CustomEvent,f=D.Event,h=D.dispatchEvent;if("undefined"===typeof h)return!0;"function"===typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"===typeof f?e=new f("unhandledrejection",{cancelable:!0}):(e=D.document.createEvent("CustomEvent"),e.initCustomEvent("unhandledrejection",!1,!0,e));e.promise=this;e.reason=this.i;return h(e)};c.prototype.u=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.D= | ||
function(e){var f=this.j();e.I(f.resolve,f.reject)};c.prototype.F=function(e,f){var h=this.j();try{e.call(f,h.resolve,h.reject)}catch(m){h.reject(m)}};c.prototype.then=function(e,f){function h(r,p){return"function"==typeof r?function(q){try{m(r(q))}catch(l){n(l)}}:p}var m,n,t=new c(function(r,p){m=r;n=p});this.I(h(e,m),h(f,n));return t};c.prototype.catch=function(e){return this.then(void 0,e)};c.prototype.I=function(e,f){function h(){switch(m.h){case 1:e(m.i);break;case 2:f(m.i);break;default:throw Error("Unexpected state: "+ | ||
m.h);}}var m=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(f,h){h(e)})};c.race=function(e){return new c(function(f,h){for(var m=H(e),n=m.next();!n.done;n=m.next())d(n.value).I(f,h)})};c.all=function(e){var f=H(e),h=f.next();return h.done?d([]):new c(function(m,n){function t(q){return function(l){r[q]=l;p--;0==p&&m(r)}}var r=[],p=0;do r.push(void 0),p++,d(h.value).I(t(r.length-1),n),h=f.next();while(!h.done)})};return c}); | ||
G("Promise",function(a){function c(e){this.h=0;this.i=void 0;this.g=[];this.o=!1;var f=this.j();try{e(f.resolve,f.reject)}catch(h){f.reject(h)}}function b(){this.g=null}function d(e){return e instanceof c?e:new c(function(f){f(e)})}if(a)return a;b.prototype.h=function(e){if(null==this.g){this.g=[];var f=this;this.i(function(){f.l()})}this.g.push(e)};var g=E.setTimeout;b.prototype.i=function(e){g(e,0)};b.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var f=0;f<e.length;++f){var h= | ||
e[f];e[f]=null;try{h()}catch(m){this.j(m)}}}this.g=null};b.prototype.j=function(e){this.i(function(){throw e;})};c.prototype.j=function(){function e(m){return function(p){h||(h=!0,m.call(f,p))}}var f=this,h=!1;return{resolve:e(this.B),reject:e(this.l)}};c.prototype.B=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof c)this.D(e);else{a:switch(typeof e){case "object":var f=null!=e;break a;case "function":f=!0;break a;default:f=!1}f?this.v(e):this.m(e)}}; | ||
c.prototype.v=function(e){var f=void 0;try{f=e.then}catch(h){this.l(h);return}"function"==typeof f?this.F(f,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,f){if(0!=this.h)throw Error("Cannot settle("+e+", "+f+"): Promise already settled in state"+this.h);this.h=e;this.i=f;2===this.h&&this.C();this.u()};c.prototype.C=function(){var e=this;g(function(){if(e.A()){var f=E.console;"undefined"!==typeof f&&f.error(e.i)}},1)};c.prototype.A= | ||
function(){if(this.o)return!1;var e=E.CustomEvent,f=E.Event,h=E.dispatchEvent;if("undefined"===typeof h)return!0;"function"===typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"===typeof f?e=new f("unhandledrejection",{cancelable:!0}):(e=E.document.createEvent("CustomEvent"),e.initCustomEvent("unhandledrejection",!1,!0,e));e.promise=this;e.reason=this.i;return h(e)};c.prototype.u=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.D= | ||
function(e){var f=this.j();e.I(f.resolve,f.reject)};c.prototype.F=function(e,f){var h=this.j();try{e.call(f,h.resolve,h.reject)}catch(m){h.reject(m)}};c.prototype.then=function(e,f){function h(t,q){return"function"==typeof t?function(n){try{m(t(n))}catch(l){p(l)}}:q}var m,p,v=new c(function(t,q){m=t;p=q});this.I(h(e,m),h(f,p));return v};c.prototype.catch=function(e){return this.then(void 0,e)};c.prototype.I=function(e,f){function h(){switch(m.h){case 1:e(m.i);break;case 2:f(m.i);break;default:throw Error("Unexpected state: "+ | ||
m.h);}}var m=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(f,h){h(e)})};c.race=function(e){return new c(function(f,h){for(var m=I(e),p=m.next();!p.done;p=m.next())d(p.value).I(f,h)})};c.all=function(e){var f=I(e),h=f.next();return h.done?d([]):new c(function(m,p){function v(n){return function(l){t[n]=l;q--;0==q&&m(t)}}var t=[],q=0;do t.push(void 0),q++,d(h.value).I(v(t.length-1),p),h=f.next();while(!h.done)})};return c}); | ||
G("Object.is",function(a){return a?a:function(c,b){return c===b?0!==c||1/c===1/b:c!==c&&b!==b}});G("Array.prototype.includes",function(a){return a?a:function(c,b){var d=this;d instanceof String&&(d=String(d));var g=d.length;b=b||0;for(0>b&&(b=Math.max(b+g,0));b<g;b++){var k=d[b];if(k===c||Object.is(k,c))return!0}return!1}}); | ||
G("String.prototype.includes",function(a){return a?a:function(c,b){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(c instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(c,b||0)}}); | ||
function oa(a,c){a instanceof String&&(a+="");var b=0,d=!1,g={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}}};g[Symbol.iterator]=function(){return g};return g}G("Array.prototype.keys",function(a){return a?a:function(){return oa(this,function(c){return c})}});var pa=this||self; | ||
function X(a,c){a=a.split(".");var b=pa;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 Y(a,c){var b=void 0;return new (b||(b=Promise))(function(d,g){function k(h){try{f(c.next(h))}catch(m){g(m)}}function e(h){try{f(c["throw"](h))}catch(m){g(m)}}function f(h){h.done?d(h.value):(new b(function(m){m(h.value)})).then(k,e)}f((c=c.apply(a,void 0)).next())})};var qa=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],ra=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386, | ||
385],[385,384],[384,398],[398,362]],sa=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],ta=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],ua=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],ya=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378], | ||
[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],za=[].concat(J(qa),J(ra),J(sa),J(ta),J(ua),J(ya));function Aa(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 Ba(a,c,b){this.h=a;this.g=c;this.u=b;this.l=0}function Ca(a){if("function"===typeof a.g.canvas.transferToImageBitmap)return Promise.resolve(a.g.canvas.transferToImageBitmap());if(a.u)return Promise.resolve(a.g.canvas);if("function"===typeof createImageBitmap)return createImageBitmap(a.g.canvas);void 0===a.j&&(a.j=document.createElement("img"));return new Promise(function(c){a.j.onload=function(){requestAnimationFrame(function(){c(a.j)})};a.j.src=a.g.canvas.toDataURL()})} | ||
function Da(a,c){var b=a.g;if(void 0===a.m){var d=Aa(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),g=Aa(b,"\n precision mediump 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,g);b.linkProgram(k);if(!b.getProgramParameter(k,b.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+ | ||
b.getProgramInfoLog(k));d=a.m=k;b.useProgram(d);g=b.getUniformLocation(d,"sampler0");a.i={H:b.getAttribLocation(d,"aVertex"),G:b.getAttribLocation(d,"aTex"),T:g};a.s=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,a.s);b.enableVertexAttribArray(a.i.H);b.vertexAttribPointer(a.i.H,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.o=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,a.o);b.enableVertexAttribArray(a.i.G);b.vertexAttribPointer(a.i.G, | ||
385],[385,384],[384,398],[398,362]],sa=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],ta=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],ua=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],za=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378], | ||
[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],Aa=[].concat(K(qa),K(ra),K(sa),K(ta),K(ua),K(za));function Ba(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 Ca(a,c,b){this.h=a;this.g=c;this.u=b;this.l=0}function Da(a){if("function"===typeof a.g.canvas.transferToImageBitmap)return Promise.resolve(a.g.canvas.transferToImageBitmap());if(a.u)return Promise.resolve(a.g.canvas);if("function"===typeof createImageBitmap)return createImageBitmap(a.g.canvas);void 0===a.j&&(a.j=document.createElement("img"));return new Promise(function(c){a.j.onload=function(){requestAnimationFrame(function(){c(a.j)})};a.j.src=a.g.canvas.toDataURL()})} | ||
function Ea(a,c){var b=a.g;if(void 0===a.m){var d=Ba(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),g=Ba(b,"\n precision mediump 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,g);b.linkProgram(k);if(!b.getProgramParameter(k,b.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+ | ||
b.getProgramInfoLog(k));d=a.m=k;b.useProgram(d);g=b.getUniformLocation(d,"sampler0");a.i={H:b.getAttribLocation(d,"aVertex"),G:b.getAttribLocation(d,"aTex"),U:g};a.s=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,a.s);b.enableVertexAttribArray(a.i.H);b.vertexAttribPointer(a.i.H,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.o=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,a.o);b.enableVertexAttribArray(a.i.G);b.vertexAttribPointer(a.i.G, | ||
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(g,0)}d=a.i;b.useProgram(a.m);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.H);b.bindBuffer(b.ARRAY_BUFFER,a.s);b.vertexAttribPointer(d.H,2,b.FLOAT,!1,0,0);b.enableVertexAttribArray(d.G);b.bindBuffer(b.ARRAY_BUFFER,a.o);b.vertexAttribPointer(d.G, | ||
2,b.FLOAT,!1,0,0);b.bindFramebuffer(b.DRAW_FRAMEBUFFER?b.DRAW_FRAMEBUFFER:b.FRAMEBUFFER,null);b.clearColor(0,0,0,0);b.clear(b.COLOR_BUFFER_BIT);b.colorMask(!0,!0,!0,!0);b.drawArrays(b.TRIANGLE_FAN,0,4);b.disableVertexAttribArray(d.H);b.disableVertexAttribArray(d.G);b.bindBuffer(b.ARRAY_BUFFER,null);a.h.bindTexture2d(0)}function Ea(a){this.g=a};var Fa=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 Ga(a,c){return c+a}function Ha(a,c){window[a]=c}function Ia(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 Ja(a){for(var c=[],b=a.size(),d=0;d<b;++d){var g=a.get(d);c.push({x:g.x,y:g.y,z:g.z,visibility:g.hasVisibility?g.visibility:void 0});g.delete()}return c}function Ka(a){for(var c=[],b=a.size(),d=0;d<b;++d){var g=a.get(d);c.push({index:g.index,score:g.score,label:g.hasLabel?g.label:void 0,displayName:g.hasDisplayName?g.displayName:void 0})}return c} | ||
function La(){return Y(this,function c(){return W(c,function(b){switch(b.g){case 1:return b.m=2,U(b,WebAssembly.instantiate(Fa),4);case 4:b.g=3;b.m=0;break;case 2:return b.m=0,b.j=null,b.return(!1);case 3:return b.return(!0)}})})} | ||
function Ma(a){this.g=a;this.listeners={};this.l={};this.B={};this.m={};this.s={};this.v=this.o=this.N=!0;this.F=Promise.resolve();this.M="";this.u={};this.locateFile=a&&a.locateFile||Ga;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.O=a}B=Ma.prototype;B.close=function(){this.i&&this.i.delete();return Promise.resolve()};function Na(a,c){return void 0===a.g.files?[]:"function"===typeof a.g.files?a.g.files(c):a.g.files} | ||
function Oa(a){return Y(a,function b(){var d=this,g,k,e,f,h,m,n,t,r,p,q;return W(b,function(l){switch(l.g){case 1:g=d;if(!d.N)return l.return();k=Na(d,d.l);return U(l,La(),2);case 2:e=l.h;if("object"===typeof window)return Ha("createMediapipeSolutionsWasm",{locateFile:d.locateFile}),Ha("createMediapipeSolutionsPackedAssets",{locateFile:d.locateFile}),m=k.filter(function(u){return void 0!==u.data}),n=k.filter(function(u){return void 0===u.data}),t=Promise.all(m.map(function(u){return Z(g,u.url)})), | ||
r=Promise.all(n.map(function(u){return void 0===u.simd||u.simd&&e||!u.simd&&!e?Ia(g.locateFile(u.url,g.O)):Promise.resolve()})).then(function(){return Y(g,function v(){var w,y,z=this;return W(v,function(A){if(1==A.g)return w=window.createMediapipeSolutionsWasm,y=window.createMediapipeSolutionsPackedAssets,U(A,w(y),2);z.h=A.h;A.g=0})})}),p=function(){return Y(g,function v(){var w=this;return W(v,function(y){w.g.graph&&w.g.graph.url?y=U(y,Z(w,w.g.graph.url),0):(y.g=0,y=void 0);return y})})}(),U(l,Promise.all([r, | ||
t,p]),7);if("function"!==typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");f=k.filter(function(u){return void 0===u.simd||u.simd&&e||!u.simd&&!e}).map(function(u){return g.locateFile(u.url,g.O)});importScripts.apply(null,J(f));return U(l,createMediapipeSolutionsWasm(Module),6);case 6:d.h=l.h;d.j=new OffscreenCanvas(1,1);d.h.canvas=d.j;h=d.h.GL.createContext(d.j,{antialias:!1,alpha:!1,S:"undefined"!==typeof WebGL2RenderingContext?2:1});d.h.GL.makeContextCurrent(h); | ||
l.g=4;break;case 7:d.j=document.createElement("canvas");q=d.j.getContext("webgl2",{});if(!q&&(q=d.j.getContext("webgl",{}),!q))return alert("Failed to create WebGL canvas context when passing video frame."),l.return();d.A=q;d.h.canvas=d.j;d.h.createContext(d.j,!0,!0,{});case 4:d.i=new d.h.SolutionWasm,d.N=!1,l.g=0}})})} | ||
function Pa(a){return Y(a,function b(){var d=this,g,k,e,f,h,m,n,t;return W(b,function(r){if(1==r.g){if(d.g.graph&&d.g.graph.url&&d.M===d.g.graph.url)return r.return();d.o=!0;if(!d.g.graph||!d.g.graph.url){r.g=2;return}d.M=d.g.graph.url;return U(r,Z(d,d.g.graph.url),3)}2!=r.g&&(g=r.h,d.i.loadGraph(g));k=H(Object.keys(d.u));for(e=k.next();!e.done;e=k.next())f=e.value,d.i.overrideFile(f,d.u[f]);d.u={};if(d.g.listeners)for(h=H(d.g.listeners),m=h.next();!m.done;m=h.next())n=m.value,Qa(d,n);t=d.l;d.l={}; | ||
d.setOptions(t);r.g=0})})}B.reset=function(){return Y(this,function c(){var b=this;return W(c,function(d){b.i&&(b.i.reset(),b.m={},b.s={});d.g=0})})}; | ||
B.setOptions=function(a){var c=this;if(this.g.options){for(var b=[],d=[],g={},k=H(Object.keys(a)),e=k.next();!e.done;g={J:g.J,K:g.K},e=k.next()){var f=e.value;!(f in this.l&&this.l[f]===a[f])&&(this.l[f]=a[f],e=this.g.options[f])&&(e.onChange&&(g.J=e.onChange,g.K=a[f],b.push(function(h){return function(){return Y(c,function n(){var t,r=this;return W(n,function(p){if(1==p.g)return U(p,h.J(h.K),2);t=p.h;!0===t&&(r.o=!0);p.g=0})})}}(g))),e.graphOptionXref&&(f={valueNumber:0===e.type?a[f]:0,valueBoolean:1=== | ||
e.type?a[f]:!1},e=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),e.graphOptionXref),f),d.push(e)))}if(0!==b.length||0!==d.length)this.o=!0,this.C=d,this.D=b}}; | ||
function Ra(a){return Y(a,function b(){var d=this,g,k,e,f,h,m,n;return W(b,function(t){switch(t.g){case 1:if(!d.o)return t.return();if(!d.D){t.g=2;break}g=H(d.D);k=g.next();case 3:if(k.done){t.g=5;break}e=k.value;return U(t,e(),4);case 4:k=g.next();t.g=3;break;case 5:d.D=void 0;case 2:if(d.C){f=new d.h.GraphOptionChangeRequestList;h=H(d.C);for(m=h.next();!m.done;m=h.next())n=m.value,f.push_back(n);d.i.changeOptions(f);f.delete();d.C=void 0}d.o=!1;t.g=0}})})} | ||
B.initialize=function(){return Y(this,function c(){var b=this;return W(c,function(d){return 1==d.g?U(d,Oa(b),2):3!=d.g?U(d,Pa(b),3):U(d,Ra(b),0)})})};function Z(a,c){return Y(a,function d(){var g=this,k,e;return W(d,function(f){if(c in g.B)return f.return(g.B[c]);k=g.locateFile(c,"");e=fetch(k).then(function(h){return h.arrayBuffer()});g.B[c]=e;return f.return(e)})})}B.overrideFile=function(a,c){this.i?this.i.overrideFile(a,c):this.u[a]=c};B.clearOverriddenFiles=function(){this.u={};this.i&&this.i.clearOverriddenFiles()}; | ||
B.send=function(a,c){return Y(this,function d(){var g=this,k,e,f,h,m,n,t,r,p;return W(d,function(q){if(1==q.g){if(!g.g.inputs)return q.return();k=1E3*(void 0===c||null===c?performance.now():c);return U(q,g.F,2)}if(3!=q.g)return U(q,g.initialize(),3);e=new g.h.PacketDataList;f=H(Object.keys(a));for(h=f.next();!h.done;h=f.next())if(m=h.value,n=g.g.inputs[m]){a:{var l=g;var u=a[m];switch(n.type){case "video":var v=l.m[n.stream];v||(v=new Ba(l.h,l.A,l.v),l.m[n.stream]=v);l=v;0===l.l&&(l.l=l.h.createTexture()); | ||
if("undefined"!==typeof HTMLVideoElement&&u instanceof HTMLVideoElement){var w=u.videoWidth;v=u.videoHeight}else"undefined"!==typeof HTMLImageElement&&u instanceof HTMLImageElement?(w=u.naturalWidth,v=u.naturalHeight):(w=u.width,v=u.height);v={glName:l.l,width:w,height:v};w=l.g;w.canvas.width=v.width;w.canvas.height=v.height;w.activeTexture(w.TEXTURE0);l.h.bindTexture2d(l.l);w.texImage2D(w.TEXTURE_2D,0,w.RGBA,w.RGBA,w.UNSIGNED_BYTE,u);l.h.bindTexture2d(0);l=v;break a;case "detections":v=l.m[n.stream]; | ||
v||(v=new Ea(l.h),l.m[n.stream]=v);l=v;l.data||(l.data=new l.g.DetectionListData);l.data.reset(u.length);for(v=0;v<u.length;++v){w=u[v];l.data.setBoundingBox(v,w.boundingBox);if(w.landmarks)for(var y=0;y<w.landmarks.length;++y){var z=w.landmarks[y],A=z.visibility?!0:!1;l.data.addNormalizedLandmark(v,Object.assign(Object.assign({},z),{hasVisibility:A,visibility:A?z.visibility:0}))}if(w.L)for(y=0;y<w.L.length;++y){z=w.L[y];A=z.index?!0:!1;var P=z.label?!0:!1,N=z.displayName?!0:!1;l.data.addClassification(v, | ||
{score:z.score,hasIndex:A,index:A?z.index:-1,hasLabel:P,label:P?z.label:"",hasDisplayName:N,displayName:N?z.displayName:""})}}l=l.data;break a;default:l={}}}t=l;r=n.stream;switch(n.type){case "video":e.pushTexture2d(Object.assign(Object.assign({},t),{stream:r,timestamp:k}));break;case "detections":p=t;p.stream=r;p.timestamp=k;e.pushDetectionList(p);break;default:throw Error("Unknown input config type: '"+n.type+"'");}}g.i.send(e);e.delete();q.g=0})})}; | ||
function Sa(a,c,b){return Y(a,function g(){var k,e,f,h,m,n,t=this,r,p,q,l,u,v,w,y,z,A,P,N,va;return W(g,function(E){switch(E.g){case 1:if(!b)return E.return(c);k={};e=0;f=H(Object.keys(b));for(h=f.next();!h.done;h=f.next())m=h.value,n=b[m],"string"!==typeof n&&"texture"===n.type&&++e;1<e&&(t.v=!1);r=H(Object.keys(b));h=r.next();case 2:if(h.done){E.g=4;break}p=h.value;q=b[p];if("string"===typeof q)return N=k,va=p,U(E,Ta(t,p,c[q]),15);l=c[q.stream];if(void 0===l){E.g=3;break}if("detection_list"===q.type){var x= | ||
l.getRectList(),K=l.getLandmarksList(),F=l.getClassificationsList(),I=[];if(x)for(var O=0;O<x.size();++O){var ea={boundingBox:x.get(O),landmarks:Ja(K.get(O)),L:Ka(F.get(O))};I.push(ea)}k[p]=I;E.g=7;break}if("landmarks"===q.type){u=l.getLandmarks();k[p]=u?Ja(u):void 0;E.g=7;break}if("landmarks_list"===q.type){if(v=l.getLandmarksList())for(x=[],K=v.size(),F=0;F<K;++F)I=v.get(F),x.push(Ja(I)),I.delete();else x=void 0;k[p]=x;E.g=7;break}if("rect_list"===q.type){if(w=l.getRectList())for(x=[],K=w.size(), | ||
F=0;F<K;++F)I=w.get(F),x.push(I);else x=void 0;k[p]=x;E.g=7;break}if("classifications_list"===q.type){if(y=l.getClassificationsList())for(x=[],K=y.size(),F=0;F<K;++F)I=y.get(F),x.push(Ka(I));else x=void 0;k[p]=x;E.g=7;break}if("object_detection_list"===q.type){if(z=l.getObjectDetectionList())for(x=[],K=z.size(),F=0;F<K;++F){I=z.get(F);O=x;ea=O.push;for(var Va=I.id,wa=I.keypoints,xa=[],Wa=wa.size(),fa=0;fa<Wa;++fa){var Q=wa.get(fa);xa.push({id:Q.id,point3d:{x:Q.point3d.x,y:Q.point3d.y,z:Q.point3d.z}, | ||
point2d:{x:Q.point2d.x,y:Q.point2d.y,depth:Q.point2d.depth}})}ea.call(O,{id:Va,keypoints:xa,visibility:I.visibility})}else x=void 0;k[p]=x;E.g=7;break}if("texture"!==q.type)throw Error("Unknown output config type: '"+q.type+"'");A=t.s[p];A||(A=new Ba(t.h,t.A,t.v),t.s[p]=A);x=A;K=l.getTexture2d();Da(x,K);x=Ca(x);return U(E,x,14);case 14:P=E.h,k[p]=P;case 7:q.transform&&k[p]&&(k[p]=q.transform(k[p]));E.g=3;break;case 15:N[va]=E.h;case 3:h=r.next();E.g=2;break;case 4:return E.return(k)}})})} | ||
function Ta(a,c,b){return Y(a,function g(){var k=this,e;return W(g,function(f){if(b.isNumber())return f.return(b.getNumber());if(b.isRect())return f.return(b.getRect());if(b.isLandmarks())return f.return(b.getLandmarks());if(b.isLandmarksList())return f.return(b.getLandmarksList());if(b.isClassificationsList())return f.return(b.getClassificationsList());if(b.isObjectDetectionList())return f.return(b.getObjectDetectionList());if(b.isTexture2d()){e=k.s[c];e||(e=new Ba(k.h,k.A,k.v),k.s[c]=e);var h=f.return; | ||
var m=e;var n=b.getTexture2d();Da(m,n);m=Ca(m);return h.call(f,m)}return f.return(void 0)})})} | ||
function Qa(a,c){for(var b=c.name||"$",d=[].concat(J(c.wants)),g=new a.h.StringList,k=H(c.wants),e=k.next();!e.done;e=k.next())g.push_back(e.value);k=a.h.PacketListener.implement({onResults:function(f){return Y(a,function m(){var n=this,t,r,p,q,l;return W(m,function(u){t=n;r={};for(p=0;p<c.wants.length;++p)r[d[p]]=f.get(p);q=Sa(n,r,c.outs);if(l=n.listeners[b])return u.return(n.F.then(function(){return q}).then(function(v){return Y(t,function y(){var z,A,P=this;return W(y,function(N){z=l(v);for(A= | ||
0;A<c.wants.length;++A)r[d[A]].delete();if(z)return P.F=z,N.return(z);N.g=0})})}));u.g=0})})}});a.i.attachMultiListener(g,k);g.delete()}B.onResults=function(a,c){this.listeners[c||"$"]=a};X("Solution",Ma);X("OptionType",{NUMBER:0,BOOL:1,0:"NUMBER",1:"BOOL"});function Ua(a){var c=this;a=a||{};var b={url:"face_detection_short.binarypb"},d={type:0,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"facedetectionshortrangegpu__facedetectionshortrangecommon__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}};this.g=new Ma({locateFile:a.locateFile,files:[{data:!0,url:"face_detection_short.binarypb"},{data:!0,url:"face_detection_short_range.tflite"},{simd:!0,url:"face_detection_solution_simd_wasm_bin.js"},{simd:!1,url:"face_detection_solution_wasm_bin.js"}], | ||
graph:b,listeners:[{wants:["detections","image_transformed"],outs:{image:"image_transformed",detections:{type:"detection_list",stream:"detections"}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{selfieMode:{type:1,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},model:{type:1,onChange:function(g){return Y(c,function e(){var f,h,m,n,t,r=this,p;return W(e,function(q){switch(q.g){case 1:f="short"===g?["face_detection_short_range.tflite"]: | ||
["face_detection_full_range_sparse.tflite"],h=H(f),m=h.next();case 2:if(m.done){q.g=4;break}n=m.value;t="third_party/mediapipe/modules/face_detection/"+n;return U(q,Z(r.g,n),5);case 5:p=q.h;r.g.overrideFile(t,p);m=h.next();q.g=2;break;case 4:return b.url="short"===g?"face_detection_short.binarypb":"face_detection_full.binarypb",d.graphOptionXref.calculatorName="short"===g?"facedetectionshortrangegpu__facedetectionshortrangecommon__TensorsToDetectionsCalculator":"facedetectionfullrangegpu__facedetectionfullrangecommon__TensorsToDetectionsCalculator", | ||
q.return(!0)}})})}},minDetectionConfidence:d}})}B=Ua.prototype;B.close=function(){this.g.close();return Promise.resolve()};B.onResults=function(a){this.g.onResults(a)};B.initialize=function(){return Y(this,function c(){var b=this;return W(c,function(d){return U(d,b.g.initialize(),0)})})};B.reset=function(){this.g.reset()};B.send=function(a){return Y(this,function b(){var d=this;return W(b,function(g){return U(g,d.g.send(a),0)})})};B.setOptions=function(a){this.g.setOptions(a)};X("FaceDetection",Ua); | ||
X("FACEDETECTION_LIPS",qa);X("FACEDETECTION_LEFT_EYE",ra);X("FACEDETECTION_LEFT_EYEBROW",sa);X("FACEDETECTION_RIGHT_EYE",ta);X("FACEDETECTION_RIGHT_EYEBROW",ua);X("FACEDETECTION_FACE_OVAL",ya);X("FACEDETECTION_CONTOURS",za); | ||
2,b.FLOAT,!1,0,0);b.bindFramebuffer(b.DRAW_FRAMEBUFFER?b.DRAW_FRAMEBUFFER:b.FRAMEBUFFER,null);b.clearColor(0,0,0,0);b.clear(b.COLOR_BUFFER_BIT);b.colorMask(!0,!0,!0,!0);b.drawArrays(b.TRIANGLE_FAN,0,4);b.disableVertexAttribArray(d.H);b.disableVertexAttribArray(d.G);b.bindBuffer(b.ARRAY_BUFFER,null);a.h.bindTexture2d(0)}function Fa(a){this.g=a};var Ga=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 Ha(a,c){return c+a}function Ia(a,c){window[a]=c}function Ja(a){var c=document.createElement("script");c.setAttribute("src",a);c.setAttribute("crossorigin","anonymous");return new Promise(function(b){c.addEventListener("load",function(){b()},!1);c.addEventListener("error",function(){b()},!1);document.body.appendChild(c)})} | ||
function Ka(a){for(var c=[],b=a.size(),d=0;d<b;++d){var g=a.get(d);c.push({x:g.x,y:g.y,z:g.z,visibility:g.hasVisibility?g.visibility:void 0});g.delete()}return c}function La(a){for(var c=[],b=a.size(),d=0;d<b;++d){var g=a.get(d);c.push({index:g.index,score:g.score,label:g.hasLabel?g.label:void 0,displayName:g.hasDisplayName?g.displayName:void 0})}return c} | ||
function Ma(){return Y(this,function c(){return W(c,function(b){switch(b.g){case 1:return b.m=2,U(b,WebAssembly.instantiate(Ga),4);case 4:b.g=3;b.m=0;break;case 2:return b.m=0,b.j=null,b.return(!1);case 3:return b.return(!0)}})})} | ||
function Na(a){this.g=a;this.listeners={};this.j={};this.D={};this.m={};this.s={};this.B=this.o=this.N=!0;this.F=Promise.resolve();this.M="";this.A={};this.locateFile=a&&a.locateFile||Ha;if("object"===typeof window)var c=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else if("undefined"!==typeof location)c=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.O=c;if(a.options){c=I(Object.keys(a.options));for(var b=c.next();!b.done;b=c.next()){b=b.value;var d=a.options[b].default;void 0!==d&&(this.j[b]="function"===typeof d?d():d)}}}A=Na.prototype;A.close=function(){this.i&&this.i.delete();return Promise.resolve()};function Oa(a,c){return void 0===a.g.files?[]:"function"===typeof a.g.files?a.g.files(c):a.g.files} | ||
function Pa(a){return Y(a,function b(){var d=this,g,k,e,f,h,m,p,v,t,q,n;return W(b,function(l){switch(l.g){case 1:g=d;if(!d.N)return l.return();k=Oa(d,d.j);return U(l,Ma(),2);case 2:e=l.h;if("object"===typeof window)return Ia("createMediapipeSolutionsWasm",{locateFile:d.locateFile}),Ia("createMediapipeSolutionsPackedAssets",{locateFile:d.locateFile}),m=k.filter(function(r){return void 0!==r.data}),p=k.filter(function(r){return void 0===r.data}),v=Promise.all(m.map(function(r){var u=Z(g,r.url);if(void 0!== | ||
r.path){var w=r.path;u=u.then(function(y){g.overrideFile(w,y);return Promise.resolve(y)})}return u})),t=Promise.all(p.map(function(r){return void 0===r.simd||r.simd&&e||!r.simd&&!e?Ja(g.locateFile(r.url,g.O)):Promise.resolve()})).then(function(){return Y(g,function u(){var w,y,z=this;return W(u,function(B){if(1==B.g)return w=window.createMediapipeSolutionsWasm,y=window.createMediapipeSolutionsPackedAssets,U(B,w(y),2);z.h=B.h;B.g=0})})}),q=function(){return Y(g,function u(){var w=this;return W(u,function(y){w.g.graph&& | ||
w.g.graph.url?y=U(y,Z(w,w.g.graph.url),0):(y.g=0,y=void 0);return y})})}(),U(l,Promise.all([t,v,q]),7);if("function"!==typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");f=k.filter(function(r){return void 0===r.simd||r.simd&&e||!r.simd&&!e}).map(function(r){return g.locateFile(r.url,g.O)});importScripts.apply(null,K(f));return U(l,createMediapipeSolutionsWasm(Module),6);case 6:d.h=l.h;d.l=new OffscreenCanvas(1,1);d.h.canvas=d.l;h=d.h.GL.createContext(d.l, | ||
{antialias:!1,alpha:!1,T:"undefined"!==typeof WebGL2RenderingContext?2:1});d.h.GL.makeContextCurrent(h);l.g=4;break;case 7:d.l=document.createElement("canvas");n=d.l.getContext("webgl2",{});if(!n&&(n=d.l.getContext("webgl",{}),!n))return alert("Failed to create WebGL canvas context when passing video frame."),l.return();d.C=n;d.h.canvas=d.l;d.h.createContext(d.l,!0,!0,{});case 4:d.i=new d.h.SolutionWasm,d.N=!1,l.g=0}})})} | ||
function Qa(a){return Y(a,function b(){var d=this,g,k,e,f,h,m,p,v;return W(b,function(t){if(1==t.g){if(d.g.graph&&d.g.graph.url&&d.M===d.g.graph.url)return t.return();d.o=!0;if(!d.g.graph||!d.g.graph.url){t.g=2;return}d.M=d.g.graph.url;return U(t,Z(d,d.g.graph.url),3)}2!=t.g&&(g=t.h,d.i.loadGraph(g));k=I(Object.keys(d.A));for(e=k.next();!e.done;e=k.next())f=e.value,d.i.overrideFile(f,d.A[f]);d.A={};if(d.g.listeners)for(h=I(d.g.listeners),m=h.next();!m.done;m=h.next())p=m.value,Ra(d,p);v=d.j;d.j={}; | ||
d.setOptions(v);t.g=0})})}A.reset=function(){return Y(this,function c(){var b=this;return W(c,function(d){b.i&&(b.i.reset(),b.m={},b.s={});d.g=0})})}; | ||
A.setOptions=function(a,c){var b=this;if(c=c||this.g.options){for(var d=[],g=[],k={},e=I(Object.keys(a)),f=e.next();!f.done;k={J:k.J,K:k.K},f=e.next()){var h=f.value;h in this.j&&this.j[h]===a[h]||(this.j[h]=a[h],f=c[h],void 0!==f&&(f.onChange&&(k.J=f.onChange,k.K=a[h],d.push(function(m){return function(){return Y(b,function v(){var t,q=this;return W(v,function(n){if(1==n.g)return U(n,m.J(m.K),2);t=n.h;!0===t&&(q.o=!0);n.g=0})})}}(k))),f.graphOptionXref&&(h={valueNumber:1===f.type?a[h]:0,valueBoolean:0=== | ||
f.type?a[h]:!1,valueString:2===f.type?a[h]:""},f=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),f.graphOptionXref),h),g.push(f))))}if(0!==d.length||0!==g.length)this.o=!0,this.u=(void 0===this.u?[]:this.u).concat(g),this.v=(void 0===this.v?[]:this.v).concat(d)}}; | ||
function Sa(a){return Y(a,function b(){var d=this,g,k,e,f,h,m,p;return W(b,function(v){switch(v.g){case 1:if(!d.o)return v.return();if(!d.v){v.g=2;break}g=I(d.v);k=g.next();case 3:if(k.done){v.g=5;break}e=k.value;return U(v,e(),4);case 4:k=g.next();v.g=3;break;case 5:d.v=void 0;case 2:if(d.u){f=new d.h.GraphOptionChangeRequestList;h=I(d.u);for(m=h.next();!m.done;m=h.next())p=m.value,f.push_back(p);d.i.changeOptions(f);f.delete();d.u=void 0}d.o=!1;v.g=0}})})} | ||
A.initialize=function(){return Y(this,function c(){var b=this;return W(c,function(d){return 1==d.g?U(d,Pa(b),2):3!=d.g?U(d,Qa(b),3):U(d,Sa(b),0)})})};function Z(a,c){return Y(a,function d(){var g=this,k,e;return W(d,function(f){if(c in g.D)return f.return(g.D[c]);k=g.locateFile(c,"");e=fetch(k).then(function(h){return h.arrayBuffer()});g.D[c]=e;return f.return(e)})})}A.overrideFile=function(a,c){this.i?this.i.overrideFile(a,c):this.A[a]=c};A.clearOverriddenFiles=function(){this.A={};this.i&&this.i.clearOverriddenFiles()}; | ||
A.send=function(a,c){return Y(this,function d(){var g=this,k,e,f,h,m,p,v,t,q;return W(d,function(n){if(1==n.g){if(!g.g.inputs)return n.return();k=1E3*(void 0===c||null===c?performance.now():c);return U(n,g.F,2)}if(3!=n.g)return U(n,g.initialize(),3);e=new g.h.PacketDataList;f=I(Object.keys(a));for(h=f.next();!h.done;h=f.next())if(m=h.value,p=g.g.inputs[m]){a:{var l=g;var r=a[m];switch(p.type){case "video":var u=l.m[p.stream];u||(u=new Ca(l.h,l.C,l.B),l.m[p.stream]=u);l=u;0===l.l&&(l.l=l.h.createTexture()); | ||
if("undefined"!==typeof HTMLVideoElement&&r instanceof HTMLVideoElement){var w=r.videoWidth;u=r.videoHeight}else"undefined"!==typeof HTMLImageElement&&r instanceof HTMLImageElement?(w=r.naturalWidth,u=r.naturalHeight):(w=r.width,u=r.height);u={glName:l.l,width:w,height:u};w=l.g;w.canvas.width=u.width;w.canvas.height=u.height;w.activeTexture(w.TEXTURE0);l.h.bindTexture2d(l.l);w.texImage2D(w.TEXTURE_2D,0,w.RGBA,w.RGBA,w.UNSIGNED_BYTE,r);l.h.bindTexture2d(0);l=u;break a;case "detections":u=l.m[p.stream]; | ||
u||(u=new Fa(l.h),l.m[p.stream]=u);l=u;l.data||(l.data=new l.g.DetectionListData);l.data.reset(r.length);for(u=0;u<r.length;++u){w=r[u];l.data.setBoundingBox(u,w.boundingBox);if(w.landmarks)for(var y=0;y<w.landmarks.length;++y){var z=w.landmarks[y],B=z.visibility?!0:!1;l.data.addNormalizedLandmark(u,Object.assign(Object.assign({},z),{hasVisibility:B,visibility:B?z.visibility:0}))}if(w.L)for(y=0;y<w.L.length;++y){z=w.L[y];B=z.index?!0:!1;var L=z.label?!0:!1,P=z.displayName?!0:!1;l.data.addClassification(u, | ||
{score:z.score,hasIndex:B,index:B?z.index:-1,hasLabel:L,label:L?z.label:"",hasDisplayName:P,displayName:P?z.displayName:""})}}l=l.data;break a;default:l={}}}v=l;t=p.stream;switch(p.type){case "video":e.pushTexture2d(Object.assign(Object.assign({},v),{stream:t,timestamp:k}));break;case "detections":q=v;q.stream=t;q.timestamp=k;e.pushDetectionList(q);break;default:throw Error("Unknown input config type: '"+p.type+"'");}}g.i.send(e);e.delete();n.g=0})})}; | ||
function Ta(a,c,b){return Y(a,function g(){var k,e,f,h,m,p,v=this,t,q,n,l,r,u,w,y,z,B,L,P,va,wa;return W(g,function(C){switch(C.g){case 1:if(!b)return C.return(c);k={};e=0;f=I(Object.keys(b));for(h=f.next();!h.done;h=f.next())m=h.value,p=b[m],"string"!==typeof p&&"texture"===p.type&&++e;1<e&&(v.B=!1);t=I(Object.keys(b));h=t.next();case 2:if(h.done){C.g=4;break}q=h.value;n=b[q];if("string"===typeof n)return va=k,wa=q,U(C,Ua(v,q,c[n]),17);l=c[n.stream];if(void 0===l){C.g=3;break}if("detection_list"=== | ||
n.type){var x=l.getRectList(),H=l.getLandmarksList(),F=l.getClassificationsList(),J=[];if(x)for(var Q=0;Q<x.size();++Q){var ea={boundingBox:x.get(Q),landmarks:Ka(H.get(Q)),L:La(F.get(Q))};J.push(ea)}k[q]=J;C.g=7;break}if("proto"===n.type){k[q]=l.isProto()?l.getProto():void 0;C.g=7;break}if("proto_list"===n.type){if(r=l.getProtoList()){x=Array(r.size());for(H=0;H<r.size();H++)x[H]=r.get(H);r.delete()}else x=void 0;k[q]=x;C.g=7;break}if("landmarks"===n.type){u=l.getLandmarks();k[q]=u?Ka(u):void 0;C.g= | ||
7;break}if("landmarks_list"===n.type){if(w=l.getLandmarksList())for(x=[],H=w.size(),F=0;F<H;++F)J=w.get(F),x.push(Ka(J)),J.delete();else x=void 0;k[q]=x;C.g=7;break}if("rect_list"===n.type){if(y=l.getRectList())for(x=[],H=y.size(),F=0;F<H;++F)J=y.get(F),x.push(J);else x=void 0;k[q]=x;C.g=7;break}if("classifications_list"===n.type){if(z=l.getClassificationsList())for(x=[],H=z.size(),F=0;F<H;++F)J=z.get(F),x.push(La(J));else x=void 0;k[q]=x;C.g=7;break}if("object_detection_list"===n.type){if(B=l.getObjectDetectionList())for(x= | ||
[],H=B.size(),F=0;F<H;++F){J=B.get(F);Q=x;ea=Q.push;for(var Wa=J.id,xa=J.keypoints,ya=[],Xa=xa.size(),fa=0;fa<Xa;++fa){var R=xa.get(fa);ya.push({id:R.id,point3d:{x:R.point3d.x,y:R.point3d.y,z:R.point3d.z},point2d:{x:R.point2d.x,y:R.point2d.y,depth:R.point2d.depth}})}ea.call(Q,{id:Wa,keypoints:ya,visibility:J.visibility})}else x=void 0;k[q]=x;C.g=7;break}if("texture"!==n.type)throw Error("Unknown output config type: '"+n.type+"'");L=v.s[q];L||(L=new Ca(v.h,v.C,v.B),v.s[q]=L);x=L;H=l.getTexture2d(); | ||
Ea(x,H);x=Da(x);return U(C,x,16);case 16:P=C.h,k[q]=P;case 7:n.transform&&k[q]&&(k[q]=n.transform(k[q]));C.g=3;break;case 17:va[wa]=C.h;case 3:h=t.next();C.g=2;break;case 4:return C.return(k)}})})} | ||
function Ua(a,c,b){return Y(a,function g(){var k=this,e;return W(g,function(f){if(b.isProto())return f.return(b.getProto());if(b.isProtoList())return f.return(b.getProtoList());if(b.isNumber())return f.return(b.getNumber());if(b.isRect())return f.return(b.getRect());if(b.isLandmarks())return f.return(b.getLandmarks());if(b.isLandmarksList())return f.return(b.getLandmarksList());if(b.isClassificationsList())return f.return(b.getClassificationsList());if(b.isObjectDetectionList())return f.return(b.getObjectDetectionList()); | ||
if(b.isTexture2d()){e=k.s[c];e||(e=new Ca(k.h,k.C,k.B),k.s[c]=e);var h=f.return;var m=e;var p=b.getTexture2d();Ea(m,p);m=Da(m);return h.call(f,m)}return f.return(void 0)})})} | ||
function Ra(a,c){for(var b=c.name||"$",d=[].concat(K(c.wants)),g=new a.h.StringList,k=I(c.wants),e=k.next();!e.done;e=k.next())g.push_back(e.value);k=a.h.PacketListener.implement({onResults:function(f){return Y(a,function m(){var p=this,v,t,q,n,l;return W(m,function(r){v=p;t={};for(q=0;q<c.wants.length;++q)t[d[q]]=f.get(q);n=Ta(p,t,c.outs);if(l=p.listeners[b])return r.return(p.F.then(function(){return n}).then(function(u){return Y(v,function y(){var z,B,L=this;return W(y,function(P){z=l(u);for(B= | ||
0;B<c.wants.length;++B)t[d[B]].delete();if(z)return L.F=z,P.return(z);P.g=0})})}));r.g=0})})}});a.i.attachMultiListener(g,k);g.delete()}A.onResults=function(a,c){this.listeners[c||"$"]=a};X("Solution",Na);X("OptionType",{BOOL:0,NUMBER:1,S:2,0:"BOOL",1:"NUMBER",2:"STRING"});function Va(a){var c=this;a=a||{};var b={url:"face_detection_short.binarypb"},d={type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"facedetectionshortrangegpu__facedetectionshortrangecommon__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}};this.g=new Na({locateFile:a.locateFile,files:[{data:!0,url:"face_detection_short.binarypb"},{data:!0,url:"face_detection_short_range.tflite"},{simd:!0,url:"face_detection_solution_simd_wasm_bin.js"},{simd:!1,url:"face_detection_solution_wasm_bin.js"}], | ||
graph:b,listeners:[{wants:["detections","image_transformed"],outs:{image:"image_transformed",detections:{type:"detection_list",stream:"detections"}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}, | ||
selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},model:{type:0,onChange:function(g){return Y(c,function e(){var f,h,m,p,v,t=this,q;return W(e,function(n){switch(n.g){case 1:f="short"===g?["face_detection_short_range.tflite"]:["face_detection_full_range_sparse.tflite"],h=I(f),m=h.next();case 2:if(m.done){n.g=4;break}p=m.value;v="third_party/mediapipe/modules/face_detection/"+p;return U(n,Z(t.g,p),5);case 5:q=n.h;t.g.overrideFile(v, | ||
q);m=h.next();n.g=2;break;case 4:return b.url="short"===g?"face_detection_short.binarypb":"face_detection_full.binarypb",d.graphOptionXref.calculatorName="short"===g?"facedetectionshortrangegpu__facedetectionshortrangecommon__TensorsToDetectionsCalculator":"facedetectionfullrangegpu__facedetectionfullrangecommon__TensorsToDetectionsCalculator",n.return(!0)}})})}},minDetectionConfidence:d}})}A=Va.prototype;A.close=function(){this.g.close();return Promise.resolve()};A.onResults=function(a){this.g.onResults(a)}; | ||
A.initialize=function(){return Y(this,function c(){var b=this;return W(c,function(d){return U(d,b.g.initialize(),0)})})};A.reset=function(){this.g.reset()};A.send=function(a){return Y(this,function b(){var d=this;return W(b,function(g){return U(g,d.g.send(a),0)})})};A.setOptions=function(a){this.g.setOptions(a)};X("FaceDetection",Va);X("FACEDETECTION_LIPS",qa);X("FACEDETECTION_LEFT_EYE",ra);X("FACEDETECTION_LEFT_EYEBROW",sa);X("FACEDETECTION_RIGHT_EYE",ta);X("FACEDETECTION_RIGHT_EYEBROW",ua); | ||
X("FACEDETECTION_FACE_OVAL",za);X("FACEDETECTION_CONTOURS",Aa); | ||
X("FACEDETECTION_TESSELATION",[[127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212], | ||
@@ -63,0 +67,0 @@ [212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148], |
{ | ||
"name": "@mediapipe/face_detection", | ||
"version": "0.4.1624566703", | ||
"version": "0.4.1627346767", | ||
"description": "Mediapipe Face Detection Solution", | ||
@@ -5,0 +5,0 @@ "main": "face_detection.js", |
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
13802354
2882