tracky-mouse 2.1.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,199 +1,199 @@
1
-
2
- var Module = typeof createMediapipeSolutionsPackedAssets !== 'undefined' ? createMediapipeSolutionsPackedAssets : {};
3
-
4
- if (!Module.expectedDataFileDownloads) {
5
- Module.expectedDataFileDownloads = 0;
6
- }
7
- Module.expectedDataFileDownloads++;
8
- (function() {
9
- var loadPackage = function(metadata) {
10
-
11
- var PACKAGE_PATH = '';
12
- if (typeof window === 'object') {
13
- PACKAGE_PATH = window['encodeURIComponent'](window.location.pathname.toString().substring(0, window.location.pathname.toString().lastIndexOf('/')) + '/');
14
- } else if (typeof process === 'undefined' && typeof location !== 'undefined') {
15
- // web worker
16
- PACKAGE_PATH = encodeURIComponent(location.pathname.toString().substring(0, location.pathname.toString().lastIndexOf('/')) + '/');
17
- }
18
- var PACKAGE_NAME = 'blaze-out/k8-opt/genfiles/third_party/mediapipe/web/solutions/face_mesh/face_mesh_solution_packed_assets.data';
19
- var REMOTE_PACKAGE_BASE = 'face_mesh_solution_packed_assets.data';
20
- if (typeof Module['locateFilePackage'] === 'function' && !Module['locateFile']) {
21
- Module['locateFile'] = Module['locateFilePackage'];
22
- err('warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)');
23
- }
24
- var REMOTE_PACKAGE_NAME = Module['locateFile'] ? Module['locateFile'](REMOTE_PACKAGE_BASE, '') : REMOTE_PACKAGE_BASE;
25
-
26
- var REMOTE_PACKAGE_SIZE = metadata['remote_package_size'];
27
- var PACKAGE_UUID = metadata['package_uuid'];
28
-
29
- function fetchRemotePackage(packageName, packageSize, callback, errback) {
30
-
31
- if (typeof process === 'object' && typeof process.versions === 'object' && typeof process.versions.node === 'string') {
32
- require('fs').readFile(packageName, function(err, contents) {
33
- if (err) {
34
- errback(err);
35
- } else {
36
- callback(contents.buffer);
37
- }
38
- });
39
- return;
40
- }
41
-
42
- var xhr = new XMLHttpRequest();
43
- xhr.open('GET', packageName, true);
44
- xhr.responseType = 'arraybuffer';
45
- xhr.onprogress = function(event) {
46
- var url = packageName;
47
- var size = packageSize;
48
- if (event.total) size = event.total;
49
- if (event.loaded) {
50
- if (!xhr.addedTotal) {
51
- xhr.addedTotal = true;
52
- if (!Module.dataFileDownloads) Module.dataFileDownloads = {};
53
- Module.dataFileDownloads[url] = {
54
- loaded: event.loaded,
55
- total: size
56
- };
57
- } else {
58
- Module.dataFileDownloads[url].loaded = event.loaded;
59
- }
60
- var total = 0;
61
- var loaded = 0;
62
- var num = 0;
63
- for (var download in Module.dataFileDownloads) {
64
- var data = Module.dataFileDownloads[download];
65
- total += data.total;
66
- loaded += data.loaded;
67
- num++;
68
- }
69
- total = Math.ceil(total * Module.expectedDataFileDownloads/num);
70
- if (Module['setStatus']) Module['setStatus']('Downloading data... (' + loaded + '/' + total + ')');
71
- } else if (!Module.dataFileDownloads) {
72
- if (Module['setStatus']) Module['setStatus']('Downloading data...');
73
- }
74
- };
75
- xhr.onerror = function(event) {
76
- throw new Error("NetworkError for: " + packageName);
77
- }
78
- xhr.onload = function(event) {
79
- if (xhr.status == 200 || xhr.status == 304 || xhr.status == 206 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0
80
- var packageData = xhr.response;
81
- callback(packageData);
82
- } else {
83
- throw new Error(xhr.statusText + " : " + xhr.responseURL);
84
- }
85
- };
86
- xhr.send(null);
87
- };
88
-
89
- function handleError(error) {
90
- console.error('package error:', error);
91
- };
92
-
93
- var fetchedCallback = null;
94
- var fetched = Module['getPreloadedPackage'] ? Module['getPreloadedPackage'](REMOTE_PACKAGE_NAME, REMOTE_PACKAGE_SIZE) : null;
95
-
96
- if (!fetched) fetchRemotePackage(REMOTE_PACKAGE_NAME, REMOTE_PACKAGE_SIZE, function(data) {
97
- if (fetchedCallback) {
98
- fetchedCallback(data);
99
- fetchedCallback = null;
100
- } else {
101
- fetched = data;
102
- }
103
- }, handleError);
104
-
105
- function runWithFS() {
106
-
107
- function assert(check, msg) {
108
- if (!check) throw msg + new Error().stack;
109
- }
110
- Module['FS_createPath']("/", "third_party", true, true);
111
- Module['FS_createPath']("/third_party", "mediapipe", true, true);
112
- Module['FS_createPath']("/third_party/mediapipe", "modules", true, true);
113
- Module['FS_createPath']("/third_party/mediapipe/modules", "face_landmark", true, true);
114
- Module['FS_createPath']("/third_party/mediapipe/modules", "face_geometry", true, true);
115
- Module['FS_createPath']("/third_party/mediapipe/modules/face_geometry", "data", true, true);
116
- Module['FS_createPath']("/third_party/mediapipe/modules", "face_detection", true, true);
117
-
118
- /** @constructor */
119
- function DataRequest(start, end, audio) {
120
- this.start = start;
121
- this.end = end;
122
- this.audio = audio;
123
- }
124
- DataRequest.prototype = {
125
- requests: {},
126
- open: function(mode, name) {
127
- this.name = name;
128
- this.requests[name] = this;
129
- Module['addRunDependency']('fp ' + this.name);
130
- },
131
- send: function() {},
132
- onload: function() {
133
- var byteArray = this.byteArray.subarray(this.start, this.end);
134
- this.finish(byteArray);
135
- },
136
- finish: function(byteArray) {
137
- var that = this;
138
-
139
- Module['FS_createPreloadedFile'](this.name, null, byteArray, true, true, function() {
140
- Module['removeRunDependency']('fp ' + that.name);
141
- }, function() {
142
- if (that.audio) {
143
- Module['removeRunDependency']('fp ' + that.name); // workaround for chromium bug 124926 (still no audio with this, but at least we don't hang)
144
- } else {
145
- err('Preloading file ' + that.name + ' failed');
146
- }
147
- }, false, true); // canOwn this data in the filesystem, it is a slide into the heap that will never change
148
-
149
- this.requests[this.name] = null;
150
- }
151
- };
152
-
153
- var files = metadata['files'];
154
- for (var i = 0; i < files.length; ++i) {
155
- new DataRequest(files[i]['start'], files[i]['end'], files[i]['audio']).open('GET', files[i]['filename']);
156
- }
157
-
158
-
159
- function processPackageData(arrayBuffer) {
160
- assert(arrayBuffer, 'Loading data file failed.');
161
- assert(arrayBuffer instanceof ArrayBuffer, 'bad input to processPackageData');
162
- var byteArray = new Uint8Array(arrayBuffer);
163
- var curr;
164
-
165
- // Reuse the bytearray from the XHR as the source for file reads.
166
- DataRequest.prototype.byteArray = byteArray;
167
-
168
- var files = metadata['files'];
169
- for (var i = 0; i < files.length; ++i) {
170
- DataRequest.prototype.requests[files[i].filename].onload();
171
- }
172
- Module['removeRunDependency']('datafile_blaze-out/k8-opt/genfiles/third_party/mediapipe/web/solutions/face_mesh/face_mesh_solution_packed_assets.data');
173
-
174
- };
175
- Module['addRunDependency']('datafile_blaze-out/k8-opt/genfiles/third_party/mediapipe/web/solutions/face_mesh/face_mesh_solution_packed_assets.data');
176
-
177
- if (!Module.preloadResults) Module.preloadResults = {};
178
-
179
- Module.preloadResults[PACKAGE_NAME] = {fromCache: false};
180
- if (fetched) {
181
- processPackageData(fetched);
182
- fetched = null;
183
- } else {
184
- fetchedCallback = processPackageData;
185
- }
186
-
187
- }
188
- if (Module['calledRun']) {
189
- runWithFS();
190
- } else {
191
- if (!Module['preRun']) Module['preRun'] = [];
192
- Module["preRun"].push(runWithFS); // FS is not initialized yet, wait for it
193
- }
194
-
195
- }
196
- loadPackage({"files": [{"filename": "/third_party/mediapipe/modules/face_landmark/face_landmark_with_attention.tflite", "start": 0, "end": 2495952, "audio": 0}, {"filename": "/third_party/mediapipe/modules/face_landmark/face_landmark.tflite", "start": 2495952, "end": 3737848, "audio": 0}, {"filename": "/third_party/mediapipe/modules/face_geometry/data/geometry_pipeline_metadata_landmarks.binarypb", "start": 3737848, "end": 3757224, "audio": 0}, {"filename": "/third_party/mediapipe/modules/face_detection/face_detection_short_range.tflite", "start": 3757224, "end": 3986256, "audio": 0}], "remote_package_size": 3986256, "package_uuid": "f5f855ab-ba1b-4fdf-8b0a-77c2c611502f"});
197
-
198
- })();
1
+
2
+ var Module = typeof createMediapipeSolutionsPackedAssets !== 'undefined' ? createMediapipeSolutionsPackedAssets : {};
3
+
4
+ if (!Module.expectedDataFileDownloads) {
5
+ Module.expectedDataFileDownloads = 0;
6
+ }
7
+ Module.expectedDataFileDownloads++;
8
+ (function() {
9
+ var loadPackage = function(metadata) {
10
+
11
+ var PACKAGE_PATH = '';
12
+ if (typeof window === 'object') {
13
+ PACKAGE_PATH = window['encodeURIComponent'](window.location.pathname.toString().substring(0, window.location.pathname.toString().lastIndexOf('/')) + '/');
14
+ } else if (typeof process === 'undefined' && typeof location !== 'undefined') {
15
+ // web worker
16
+ PACKAGE_PATH = encodeURIComponent(location.pathname.toString().substring(0, location.pathname.toString().lastIndexOf('/')) + '/');
17
+ }
18
+ var PACKAGE_NAME = 'blaze-out/k8-opt/genfiles/third_party/mediapipe/web/solutions/face_mesh/face_mesh_solution_packed_assets.data';
19
+ var REMOTE_PACKAGE_BASE = 'face_mesh_solution_packed_assets.data';
20
+ if (typeof Module['locateFilePackage'] === 'function' && !Module['locateFile']) {
21
+ Module['locateFile'] = Module['locateFilePackage'];
22
+ err('warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)');
23
+ }
24
+ var REMOTE_PACKAGE_NAME = Module['locateFile'] ? Module['locateFile'](REMOTE_PACKAGE_BASE, '') : REMOTE_PACKAGE_BASE;
25
+
26
+ var REMOTE_PACKAGE_SIZE = metadata['remote_package_size'];
27
+ var PACKAGE_UUID = metadata['package_uuid'];
28
+
29
+ function fetchRemotePackage(packageName, packageSize, callback, errback) {
30
+
31
+ if (typeof process === 'object' && typeof process.versions === 'object' && typeof process.versions.node === 'string') {
32
+ require('fs').readFile(packageName, function(err, contents) {
33
+ if (err) {
34
+ errback(err);
35
+ } else {
36
+ callback(contents.buffer);
37
+ }
38
+ });
39
+ return;
40
+ }
41
+
42
+ var xhr = new XMLHttpRequest();
43
+ xhr.open('GET', packageName, true);
44
+ xhr.responseType = 'arraybuffer';
45
+ xhr.onprogress = function(event) {
46
+ var url = packageName;
47
+ var size = packageSize;
48
+ if (event.total) size = event.total;
49
+ if (event.loaded) {
50
+ if (!xhr.addedTotal) {
51
+ xhr.addedTotal = true;
52
+ if (!Module.dataFileDownloads) Module.dataFileDownloads = {};
53
+ Module.dataFileDownloads[url] = {
54
+ loaded: event.loaded,
55
+ total: size
56
+ };
57
+ } else {
58
+ Module.dataFileDownloads[url].loaded = event.loaded;
59
+ }
60
+ var total = 0;
61
+ var loaded = 0;
62
+ var num = 0;
63
+ for (var download in Module.dataFileDownloads) {
64
+ var data = Module.dataFileDownloads[download];
65
+ total += data.total;
66
+ loaded += data.loaded;
67
+ num++;
68
+ }
69
+ total = Math.ceil(total * Module.expectedDataFileDownloads/num);
70
+ if (Module['setStatus']) Module['setStatus']('Downloading data... (' + loaded + '/' + total + ')');
71
+ } else if (!Module.dataFileDownloads) {
72
+ if (Module['setStatus']) Module['setStatus']('Downloading data...');
73
+ }
74
+ };
75
+ xhr.onerror = function(event) {
76
+ throw new Error("NetworkError for: " + packageName);
77
+ }
78
+ xhr.onload = function(event) {
79
+ if (xhr.status == 200 || xhr.status == 304 || xhr.status == 206 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0
80
+ var packageData = xhr.response;
81
+ callback(packageData);
82
+ } else {
83
+ throw new Error(xhr.statusText + " : " + xhr.responseURL);
84
+ }
85
+ };
86
+ xhr.send(null);
87
+ };
88
+
89
+ function handleError(error) {
90
+ console.error('package error:', error);
91
+ };
92
+
93
+ var fetchedCallback = null;
94
+ var fetched = Module['getPreloadedPackage'] ? Module['getPreloadedPackage'](REMOTE_PACKAGE_NAME, REMOTE_PACKAGE_SIZE) : null;
95
+
96
+ if (!fetched) fetchRemotePackage(REMOTE_PACKAGE_NAME, REMOTE_PACKAGE_SIZE, function(data) {
97
+ if (fetchedCallback) {
98
+ fetchedCallback(data);
99
+ fetchedCallback = null;
100
+ } else {
101
+ fetched = data;
102
+ }
103
+ }, handleError);
104
+
105
+ function runWithFS() {
106
+
107
+ function assert(check, msg) {
108
+ if (!check) throw msg + new Error().stack;
109
+ }
110
+ Module['FS_createPath']("/", "third_party", true, true);
111
+ Module['FS_createPath']("/third_party", "mediapipe", true, true);
112
+ Module['FS_createPath']("/third_party/mediapipe", "modules", true, true);
113
+ Module['FS_createPath']("/third_party/mediapipe/modules", "face_landmark", true, true);
114
+ Module['FS_createPath']("/third_party/mediapipe/modules", "face_geometry", true, true);
115
+ Module['FS_createPath']("/third_party/mediapipe/modules/face_geometry", "data", true, true);
116
+ Module['FS_createPath']("/third_party/mediapipe/modules", "face_detection", true, true);
117
+
118
+ /** @constructor */
119
+ function DataRequest(start, end, audio) {
120
+ this.start = start;
121
+ this.end = end;
122
+ this.audio = audio;
123
+ }
124
+ DataRequest.prototype = {
125
+ requests: {},
126
+ open: function(mode, name) {
127
+ this.name = name;
128
+ this.requests[name] = this;
129
+ Module['addRunDependency']('fp ' + this.name);
130
+ },
131
+ send: function() {},
132
+ onload: function() {
133
+ var byteArray = this.byteArray.subarray(this.start, this.end);
134
+ this.finish(byteArray);
135
+ },
136
+ finish: function(byteArray) {
137
+ var that = this;
138
+
139
+ Module['FS_createPreloadedFile'](this.name, null, byteArray, true, true, function() {
140
+ Module['removeRunDependency']('fp ' + that.name);
141
+ }, function() {
142
+ if (that.audio) {
143
+ Module['removeRunDependency']('fp ' + that.name); // workaround for chromium bug 124926 (still no audio with this, but at least we don't hang)
144
+ } else {
145
+ err('Preloading file ' + that.name + ' failed');
146
+ }
147
+ }, false, true); // canOwn this data in the filesystem, it is a slide into the heap that will never change
148
+
149
+ this.requests[this.name] = null;
150
+ }
151
+ };
152
+
153
+ var files = metadata['files'];
154
+ for (var i = 0; i < files.length; ++i) {
155
+ new DataRequest(files[i]['start'], files[i]['end'], files[i]['audio']).open('GET', files[i]['filename']);
156
+ }
157
+
158
+
159
+ function processPackageData(arrayBuffer) {
160
+ assert(arrayBuffer, 'Loading data file failed.');
161
+ assert(arrayBuffer instanceof ArrayBuffer, 'bad input to processPackageData');
162
+ var byteArray = new Uint8Array(arrayBuffer);
163
+ var curr;
164
+
165
+ // Reuse the bytearray from the XHR as the source for file reads.
166
+ DataRequest.prototype.byteArray = byteArray;
167
+
168
+ var files = metadata['files'];
169
+ for (var i = 0; i < files.length; ++i) {
170
+ DataRequest.prototype.requests[files[i].filename].onload();
171
+ }
172
+ Module['removeRunDependency']('datafile_blaze-out/k8-opt/genfiles/third_party/mediapipe/web/solutions/face_mesh/face_mesh_solution_packed_assets.data');
173
+
174
+ };
175
+ Module['addRunDependency']('datafile_blaze-out/k8-opt/genfiles/third_party/mediapipe/web/solutions/face_mesh/face_mesh_solution_packed_assets.data');
176
+
177
+ if (!Module.preloadResults) Module.preloadResults = {};
178
+
179
+ Module.preloadResults[PACKAGE_NAME] = {fromCache: false};
180
+ if (fetched) {
181
+ processPackageData(fetched);
182
+ fetched = null;
183
+ } else {
184
+ fetchedCallback = processPackageData;
185
+ }
186
+
187
+ }
188
+ if (Module['calledRun']) {
189
+ runWithFS();
190
+ } else {
191
+ if (!Module['preRun']) Module['preRun'] = [];
192
+ Module["preRun"].push(runWithFS); // FS is not initialized yet, wait for it
193
+ }
194
+
195
+ }
196
+ loadPackage({"files": [{"filename": "/third_party/mediapipe/modules/face_landmark/face_landmark_with_attention.tflite", "start": 0, "end": 2495952, "audio": 0}, {"filename": "/third_party/mediapipe/modules/face_landmark/face_landmark.tflite", "start": 2495952, "end": 3737848, "audio": 0}, {"filename": "/third_party/mediapipe/modules/face_geometry/data/geometry_pipeline_metadata_landmarks.binarypb", "start": 3737848, "end": 3757224, "audio": 0}, {"filename": "/third_party/mediapipe/modules/face_detection/face_detection_short_range.tflite", "start": 3757224, "end": 3986256, "audio": 0}], "remote_package_size": 3986256, "package_uuid": "f5f855ab-ba1b-4fdf-8b0a-77c2c611502f"});
197
+
198
+ })();
199
199