@mediapipe/hands
Advanced tools
Comparing version 0.1.1613506466 to 0.1.1614621970
@@ -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": "faed2421-d250-4ede-884f-625b381c9627"}); | ||
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": "0fa353c9-31a9-45c7-b825-f82f616c5ed7"}); | ||
})(); | ||
10
hands.js
@@ -39,9 +39,9 @@ (function(){/* | ||
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", | ||
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 D={},na=A(Object.keys(B)),x=na.next();!x.done;x=na.next()){x=x.value;var C=B[x];if("string"===typeof C)D[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 E={L:m.get(w),M:za(z.get(w))};console.log(E);v.push(E)}D[x]=v}else if("landmarks"===C.type)m=v.getLandmarks(),D[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)E=m.get(w),z.push(za(E));m=z}else m=void 0;D[x]=m}else if("rect_list"===C.type){if(m=v.getRectList()){z=[];v=m.size();for(w=0;w< | ||
v;++w)E=m.get(w),z.push(E);m=z}else m=void 0;D[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);E=z;for(var da=E.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(E,S)}m=z}else m=void 0;D[x]=m}else if("object_detection_list"===C.type){if(m=v.getObjectDetectionList()){z=[];v=m.size();for(w=0;w<v;++w){L=m.get(w);E=z;da=E.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(E,{id:S,keypoints:M,visibility:L.visibility})}m=z}else m=void 0;D[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),D[x]=m.i.canvas;else throw Error("Unknown output config type: '"+C.type+"'");C.transform&&D[x]&&(D[x]=C.transform(D[x]))}}}B=D}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.1613506466", | ||
"version": "0.1.1614621970", | ||
"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
19947549
3270