mirror of https://github.com/vladmandic/human
enable canvas patching for nodejs
parent
29f049e0a2
commit
c5dc4ecaff
|
@ -8,6 +8,7 @@ var __defProp = Object.defineProperty;
|
|||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
||||
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
||||
var __require = typeof require !== "undefined" ? require : (x) => {
|
||||
throw new Error('Dynamic require of "' + x + '" is not supported');
|
||||
|
@ -25,6 +26,10 @@ var __reExport = (target, module, desc) => {
|
|||
}
|
||||
return target;
|
||||
};
|
||||
var __publicField = (obj, key, value) => {
|
||||
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
||||
return value;
|
||||
};
|
||||
var __accessCheck = (obj, member, msg) => {
|
||||
if (!member.has(obj))
|
||||
throw TypeError("Cannot " + msg);
|
||||
|
@ -382,6 +387,11 @@ function decodeBounds(boxOutputs, anchors3, inputSize) {
|
|||
}
|
||||
var BlazeFaceModel = class {
|
||||
constructor(model10, config3) {
|
||||
__publicField(this, "model");
|
||||
__publicField(this, "anchorsData");
|
||||
__publicField(this, "anchors");
|
||||
__publicField(this, "inputSize");
|
||||
__publicField(this, "config");
|
||||
this.model = model10;
|
||||
this.anchorsData = generateAnchors(model10.inputs[0].shape[1]);
|
||||
this.anchors = tfjs_esm_exports.tensor2d(this.anchorsData);
|
||||
|
@ -3741,7 +3751,9 @@ var env2 = {
|
|||
supported: void 0,
|
||||
adapter: void 0
|
||||
},
|
||||
kernels: []
|
||||
kernels: [],
|
||||
Canvas: void 0,
|
||||
Image: void 0
|
||||
};
|
||||
async function get() {
|
||||
var _a;
|
||||
|
@ -3828,6 +3840,16 @@ function replaceRawCoordinates(rawCoords, newCoords, prefix, keys) {
|
|||
}
|
||||
var Pipeline = class {
|
||||
constructor(boundingBoxDetector, meshDetector, irisModel) {
|
||||
__publicField(this, "storedBoxes");
|
||||
__publicField(this, "boundingBoxDetector");
|
||||
__publicField(this, "meshDetector");
|
||||
__publicField(this, "irisModel");
|
||||
__publicField(this, "boxSize");
|
||||
__publicField(this, "meshSize");
|
||||
__publicField(this, "irisSize");
|
||||
__publicField(this, "irisEnlarge");
|
||||
__publicField(this, "skipped");
|
||||
__publicField(this, "detectedFaces");
|
||||
var _a, _b;
|
||||
this.storedBoxes = [];
|
||||
this.boundingBoxDetector = boundingBoxDetector;
|
||||
|
@ -4394,6 +4416,9 @@ function scalePoses(poses2, [height, width], [inputResolutionHeight, inputResolu
|
|||
}
|
||||
var MaxHeap = class {
|
||||
constructor(maxSize2, getElementValue) {
|
||||
__publicField(this, "priorityQueue");
|
||||
__publicField(this, "numberOfElements");
|
||||
__publicField(this, "getElementValue");
|
||||
this.priorityQueue = new Array(maxSize2);
|
||||
this.numberOfElements = -1;
|
||||
this.getElementValue = getElementValue;
|
||||
|
@ -7643,6 +7668,12 @@ var anchors = [
|
|||
// src/handpose/handdetector.ts
|
||||
var HandDetector = class {
|
||||
constructor(model10) {
|
||||
__publicField(this, "model");
|
||||
__publicField(this, "anchors");
|
||||
__publicField(this, "anchorsTensor");
|
||||
__publicField(this, "inputSize");
|
||||
__publicField(this, "inputSizeTensor");
|
||||
__publicField(this, "doubleInputSizeTensor");
|
||||
this.model = model10;
|
||||
this.anchors = anchors.map((anchor) => [anchor.x, anchor.y]);
|
||||
this.anchorsTensor = tfjs_esm_exports.tensor2d(this.anchors);
|
||||
|
@ -7780,6 +7811,12 @@ var palmLandmarksPalmBase = 0;
|
|||
var palmLandmarksMiddleFingerBase = 2;
|
||||
var HandPipeline = class {
|
||||
constructor(handDetector, handPoseModel2) {
|
||||
__publicField(this, "handDetector");
|
||||
__publicField(this, "handPoseModel");
|
||||
__publicField(this, "inputSize");
|
||||
__publicField(this, "storedBoxes");
|
||||
__publicField(this, "skipped");
|
||||
__publicField(this, "detectedHands");
|
||||
var _a;
|
||||
this.handDetector = handDetector;
|
||||
this.handPoseModel = handPoseModel2;
|
||||
|
@ -8160,6 +8197,11 @@ function estimate(landmarks) {
|
|||
// src/fingerpose/gesture.ts
|
||||
var Gesture = class {
|
||||
constructor(name) {
|
||||
__publicField(this, "name");
|
||||
__publicField(this, "curls");
|
||||
__publicField(this, "directions");
|
||||
__publicField(this, "weights");
|
||||
__publicField(this, "weightsRelative");
|
||||
this.name = name;
|
||||
this.curls = {};
|
||||
this.directions = {};
|
||||
|
@ -12054,10 +12096,24 @@ async function warmup(instance, userConfig) {
|
|||
var _numTensors, _analyzeMemoryLeaks, _checkSanity, _sanity;
|
||||
var Human = class {
|
||||
constructor(userConfig) {
|
||||
__publicField(this, "version");
|
||||
__publicField(this, "config");
|
||||
__publicField(this, "result");
|
||||
__publicField(this, "state");
|
||||
__publicField(this, "process");
|
||||
__publicField(this, "tf");
|
||||
__publicField(this, "env");
|
||||
__publicField(this, "draw");
|
||||
__publicField(this, "models");
|
||||
__publicField(this, "events");
|
||||
__publicField(this, "faceTriangulation");
|
||||
__publicField(this, "faceUVMap");
|
||||
__publicField(this, "performance");
|
||||
__privateAdd(this, _numTensors, void 0);
|
||||
__privateAdd(this, _analyzeMemoryLeaks, void 0);
|
||||
__privateAdd(this, _checkSanity, void 0);
|
||||
this.analyze = (...msg) => {
|
||||
__publicField(this, "initial");
|
||||
__publicField(this, "analyze", (...msg) => {
|
||||
if (!__privateGet(this, _analyzeMemoryLeaks))
|
||||
return;
|
||||
const currentTensors = this.tf.engine().state.numTensors;
|
||||
|
@ -12066,7 +12122,7 @@ var Human = class {
|
|||
const leaked = currentTensors - previousTensors;
|
||||
if (leaked !== 0)
|
||||
log(...msg, leaked);
|
||||
};
|
||||
});
|
||||
__privateAdd(this, _sanity, (input) => {
|
||||
if (!__privateGet(this, _checkSanity))
|
||||
return null;
|
||||
|
@ -12081,13 +12137,13 @@ var Human = class {
|
|||
}
|
||||
return null;
|
||||
});
|
||||
this.image = (input) => process4(input, this.config);
|
||||
this.emit = (event) => {
|
||||
__publicField(this, "image", (input) => process4(input, this.config));
|
||||
__publicField(this, "emit", (event) => {
|
||||
var _a;
|
||||
return (_a = this.events) == null ? void 0 : _a.dispatchEvent(new Event(event));
|
||||
};
|
||||
this.next = (result) => calc(result || this.result);
|
||||
this.warmup = (userConfig) => warmup(this, userConfig);
|
||||
});
|
||||
__publicField(this, "next", (result) => calc(result || this.result));
|
||||
__publicField(this, "warmup", (userConfig) => warmup(this, userConfig));
|
||||
get();
|
||||
this.env = env2;
|
||||
config.wasmPath = `https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@${tfjs_esm_exports.version_core}/dist/`;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
var __defProp = Object.defineProperty;
|
||||
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
||||
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
||||
var __require = typeof require !== "undefined" ? require : (x) => {
|
||||
throw new Error('Dynamic require of "' + x + '" is not supported');
|
||||
|
@ -14,6 +15,10 @@ var __export = (target, all6) => {
|
|||
for (var name in all6)
|
||||
__defProp(target, name, { get: all6[name], enumerable: true });
|
||||
};
|
||||
var __publicField = (obj, key, value) => {
|
||||
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
||||
return value;
|
||||
};
|
||||
var __accessCheck = (obj, member, msg) => {
|
||||
if (!member.has(obj))
|
||||
throw TypeError("Cannot " + msg);
|
||||
|
@ -59890,6 +59895,11 @@ function decodeBounds(boxOutputs, anchors3, inputSize) {
|
|||
}
|
||||
var BlazeFaceModel = class {
|
||||
constructor(model11, config3) {
|
||||
__publicField(this, "model");
|
||||
__publicField(this, "anchorsData");
|
||||
__publicField(this, "anchors");
|
||||
__publicField(this, "inputSize");
|
||||
__publicField(this, "config");
|
||||
this.model = model11;
|
||||
this.anchorsData = generateAnchors(model11.inputs[0].shape[1]);
|
||||
this.anchors = tensor2d(this.anchorsData);
|
||||
|
@ -63249,7 +63259,9 @@ var env2 = {
|
|||
supported: void 0,
|
||||
adapter: void 0
|
||||
},
|
||||
kernels: []
|
||||
kernels: [],
|
||||
Canvas: void 0,
|
||||
Image: void 0
|
||||
};
|
||||
async function get3() {
|
||||
var _a;
|
||||
|
@ -63336,6 +63348,16 @@ function replaceRawCoordinates(rawCoords, newCoords, prefix, keys) {
|
|||
}
|
||||
var Pipeline = class {
|
||||
constructor(boundingBoxDetector, meshDetector, irisModel) {
|
||||
__publicField(this, "storedBoxes");
|
||||
__publicField(this, "boundingBoxDetector");
|
||||
__publicField(this, "meshDetector");
|
||||
__publicField(this, "irisModel");
|
||||
__publicField(this, "boxSize");
|
||||
__publicField(this, "meshSize");
|
||||
__publicField(this, "irisSize");
|
||||
__publicField(this, "irisEnlarge");
|
||||
__publicField(this, "skipped");
|
||||
__publicField(this, "detectedFaces");
|
||||
var _a, _b;
|
||||
this.storedBoxes = [];
|
||||
this.boundingBoxDetector = boundingBoxDetector;
|
||||
|
@ -63902,6 +63924,9 @@ function scalePoses(poses2, [height, width], [inputResolutionHeight, inputResolu
|
|||
}
|
||||
var MaxHeap = class {
|
||||
constructor(maxSize2, getElementValue) {
|
||||
__publicField(this, "priorityQueue");
|
||||
__publicField(this, "numberOfElements");
|
||||
__publicField(this, "getElementValue");
|
||||
this.priorityQueue = new Array(maxSize2);
|
||||
this.numberOfElements = -1;
|
||||
this.getElementValue = getElementValue;
|
||||
|
@ -67151,6 +67176,12 @@ var anchors = [
|
|||
// src/handpose/handdetector.ts
|
||||
var HandDetector = class {
|
||||
constructor(model11) {
|
||||
__publicField(this, "model");
|
||||
__publicField(this, "anchors");
|
||||
__publicField(this, "anchorsTensor");
|
||||
__publicField(this, "inputSize");
|
||||
__publicField(this, "inputSizeTensor");
|
||||
__publicField(this, "doubleInputSizeTensor");
|
||||
this.model = model11;
|
||||
this.anchors = anchors.map((anchor) => [anchor.x, anchor.y]);
|
||||
this.anchorsTensor = tensor2d(this.anchors);
|
||||
|
@ -67288,6 +67319,12 @@ var palmLandmarksPalmBase = 0;
|
|||
var palmLandmarksMiddleFingerBase = 2;
|
||||
var HandPipeline = class {
|
||||
constructor(handDetector, handPoseModel2) {
|
||||
__publicField(this, "handDetector");
|
||||
__publicField(this, "handPoseModel");
|
||||
__publicField(this, "inputSize");
|
||||
__publicField(this, "storedBoxes");
|
||||
__publicField(this, "skipped");
|
||||
__publicField(this, "detectedHands");
|
||||
var _a;
|
||||
this.handDetector = handDetector;
|
||||
this.handPoseModel = handPoseModel2;
|
||||
|
@ -67668,6 +67705,11 @@ function estimate(landmarks) {
|
|||
// src/fingerpose/gesture.ts
|
||||
var Gesture = class {
|
||||
constructor(name) {
|
||||
__publicField(this, "name");
|
||||
__publicField(this, "curls");
|
||||
__publicField(this, "directions");
|
||||
__publicField(this, "weights");
|
||||
__publicField(this, "weightsRelative");
|
||||
this.name = name;
|
||||
this.curls = {};
|
||||
this.directions = {};
|
||||
|
@ -71562,10 +71604,24 @@ async function warmup(instance, userConfig) {
|
|||
var _numTensors, _analyzeMemoryLeaks, _checkSanity, _sanity;
|
||||
var Human = class {
|
||||
constructor(userConfig) {
|
||||
__publicField(this, "version");
|
||||
__publicField(this, "config");
|
||||
__publicField(this, "result");
|
||||
__publicField(this, "state");
|
||||
__publicField(this, "process");
|
||||
__publicField(this, "tf");
|
||||
__publicField(this, "env");
|
||||
__publicField(this, "draw");
|
||||
__publicField(this, "models");
|
||||
__publicField(this, "events");
|
||||
__publicField(this, "faceTriangulation");
|
||||
__publicField(this, "faceUVMap");
|
||||
__publicField(this, "performance");
|
||||
__privateAdd(this, _numTensors, void 0);
|
||||
__privateAdd(this, _analyzeMemoryLeaks, void 0);
|
||||
__privateAdd(this, _checkSanity, void 0);
|
||||
this.analyze = (...msg) => {
|
||||
__publicField(this, "initial");
|
||||
__publicField(this, "analyze", (...msg) => {
|
||||
if (!__privateGet(this, _analyzeMemoryLeaks))
|
||||
return;
|
||||
const currentTensors = this.tf.engine().state.numTensors;
|
||||
|
@ -71574,7 +71630,7 @@ var Human = class {
|
|||
const leaked = currentTensors - previousTensors;
|
||||
if (leaked !== 0)
|
||||
log(...msg, leaked);
|
||||
};
|
||||
});
|
||||
__privateAdd(this, _sanity, (input2) => {
|
||||
if (!__privateGet(this, _checkSanity))
|
||||
return null;
|
||||
|
@ -71589,13 +71645,13 @@ var Human = class {
|
|||
}
|
||||
return null;
|
||||
});
|
||||
this.image = (input2) => process4(input2, this.config);
|
||||
this.emit = (event) => {
|
||||
__publicField(this, "image", (input2) => process4(input2, this.config));
|
||||
__publicField(this, "emit", (event) => {
|
||||
var _a;
|
||||
return (_a = this.events) == null ? void 0 : _a.dispatchEvent(new Event(event));
|
||||
};
|
||||
this.next = (result) => calc(result || this.result);
|
||||
this.warmup = (userConfig) => warmup(this, userConfig);
|
||||
});
|
||||
__publicField(this, "next", (result) => calc(result || this.result));
|
||||
__publicField(this, "warmup", (userConfig) => warmup(this, userConfig));
|
||||
get3();
|
||||
this.env = env2;
|
||||
config.wasmPath = `https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@${version9}/dist/`;
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -10,6 +10,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
||||
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
||||
var __require = typeof require !== "undefined" ? require : (x) => {
|
||||
throw new Error('Dynamic require of "' + x + '" is not supported');
|
||||
|
@ -33,6 +34,10 @@ var __reExport = (target, module2, desc) => {
|
|||
var __toModule = (module2) => {
|
||||
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
||||
};
|
||||
var __publicField = (obj, key, value) => {
|
||||
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
||||
return value;
|
||||
};
|
||||
var __accessCheck = (obj, member, msg) => {
|
||||
if (!member.has(obj))
|
||||
throw TypeError("Cannot " + msg);
|
||||
|
@ -399,6 +404,11 @@ function decodeBounds(boxOutputs, anchors3, inputSize) {
|
|||
}
|
||||
var BlazeFaceModel = class {
|
||||
constructor(model10, config3) {
|
||||
__publicField(this, "model");
|
||||
__publicField(this, "anchorsData");
|
||||
__publicField(this, "anchors");
|
||||
__publicField(this, "inputSize");
|
||||
__publicField(this, "config");
|
||||
this.model = model10;
|
||||
this.anchorsData = generateAnchors(model10.inputs[0].shape[1]);
|
||||
this.anchors = tf2.tensor2d(this.anchorsData);
|
||||
|
@ -3762,7 +3772,9 @@ var env2 = {
|
|||
supported: void 0,
|
||||
adapter: void 0
|
||||
},
|
||||
kernels: []
|
||||
kernels: [],
|
||||
Canvas: void 0,
|
||||
Image: void 0
|
||||
};
|
||||
async function get() {
|
||||
var _a;
|
||||
|
@ -3849,6 +3861,16 @@ function replaceRawCoordinates(rawCoords, newCoords, prefix, keys) {
|
|||
}
|
||||
var Pipeline = class {
|
||||
constructor(boundingBoxDetector, meshDetector, irisModel) {
|
||||
__publicField(this, "storedBoxes");
|
||||
__publicField(this, "boundingBoxDetector");
|
||||
__publicField(this, "meshDetector");
|
||||
__publicField(this, "irisModel");
|
||||
__publicField(this, "boxSize");
|
||||
__publicField(this, "meshSize");
|
||||
__publicField(this, "irisSize");
|
||||
__publicField(this, "irisEnlarge");
|
||||
__publicField(this, "skipped");
|
||||
__publicField(this, "detectedFaces");
|
||||
var _a, _b;
|
||||
this.storedBoxes = [];
|
||||
this.boundingBoxDetector = boundingBoxDetector;
|
||||
|
@ -4420,6 +4442,9 @@ function scalePoses(poses2, [height, width], [inputResolutionHeight, inputResolu
|
|||
}
|
||||
var MaxHeap = class {
|
||||
constructor(maxSize2, getElementValue) {
|
||||
__publicField(this, "priorityQueue");
|
||||
__publicField(this, "numberOfElements");
|
||||
__publicField(this, "getElementValue");
|
||||
this.priorityQueue = new Array(maxSize2);
|
||||
this.numberOfElements = -1;
|
||||
this.getElementValue = getElementValue;
|
||||
|
@ -7676,6 +7701,12 @@ var anchors = [
|
|||
// src/handpose/handdetector.ts
|
||||
var HandDetector = class {
|
||||
constructor(model10) {
|
||||
__publicField(this, "model");
|
||||
__publicField(this, "anchors");
|
||||
__publicField(this, "anchorsTensor");
|
||||
__publicField(this, "inputSize");
|
||||
__publicField(this, "inputSizeTensor");
|
||||
__publicField(this, "doubleInputSizeTensor");
|
||||
this.model = model10;
|
||||
this.anchors = anchors.map((anchor) => [anchor.x, anchor.y]);
|
||||
this.anchorsTensor = tf10.tensor2d(this.anchors);
|
||||
|
@ -7816,6 +7847,12 @@ var palmLandmarksPalmBase = 0;
|
|||
var palmLandmarksMiddleFingerBase = 2;
|
||||
var HandPipeline = class {
|
||||
constructor(handDetector, handPoseModel2) {
|
||||
__publicField(this, "handDetector");
|
||||
__publicField(this, "handPoseModel");
|
||||
__publicField(this, "inputSize");
|
||||
__publicField(this, "storedBoxes");
|
||||
__publicField(this, "skipped");
|
||||
__publicField(this, "detectedHands");
|
||||
var _a;
|
||||
this.handDetector = handDetector;
|
||||
this.handPoseModel = handPoseModel2;
|
||||
|
@ -8196,6 +8233,11 @@ function estimate(landmarks) {
|
|||
// src/fingerpose/gesture.ts
|
||||
var Gesture = class {
|
||||
constructor(name) {
|
||||
__publicField(this, "name");
|
||||
__publicField(this, "curls");
|
||||
__publicField(this, "directions");
|
||||
__publicField(this, "weights");
|
||||
__publicField(this, "weightsRelative");
|
||||
this.name = name;
|
||||
this.curls = {};
|
||||
this.directions = {};
|
||||
|
@ -12109,10 +12151,24 @@ async function warmup(instance, userConfig) {
|
|||
var _numTensors, _analyzeMemoryLeaks, _checkSanity, _sanity;
|
||||
var Human = class {
|
||||
constructor(userConfig) {
|
||||
__publicField(this, "version");
|
||||
__publicField(this, "config");
|
||||
__publicField(this, "result");
|
||||
__publicField(this, "state");
|
||||
__publicField(this, "process");
|
||||
__publicField(this, "tf");
|
||||
__publicField(this, "env");
|
||||
__publicField(this, "draw");
|
||||
__publicField(this, "models");
|
||||
__publicField(this, "events");
|
||||
__publicField(this, "faceTriangulation");
|
||||
__publicField(this, "faceUVMap");
|
||||
__publicField(this, "performance");
|
||||
__privateAdd(this, _numTensors, void 0);
|
||||
__privateAdd(this, _analyzeMemoryLeaks, void 0);
|
||||
__privateAdd(this, _checkSanity, void 0);
|
||||
this.analyze = (...msg) => {
|
||||
__publicField(this, "initial");
|
||||
__publicField(this, "analyze", (...msg) => {
|
||||
if (!__privateGet(this, _analyzeMemoryLeaks))
|
||||
return;
|
||||
const currentTensors = this.tf.engine().state.numTensors;
|
||||
|
@ -12121,7 +12177,7 @@ var Human = class {
|
|||
const leaked = currentTensors - previousTensors;
|
||||
if (leaked !== 0)
|
||||
log(...msg, leaked);
|
||||
};
|
||||
});
|
||||
__privateAdd(this, _sanity, (input) => {
|
||||
if (!__privateGet(this, _checkSanity))
|
||||
return null;
|
||||
|
@ -12136,13 +12192,13 @@ var Human = class {
|
|||
}
|
||||
return null;
|
||||
});
|
||||
this.image = (input) => process4(input, this.config);
|
||||
this.emit = (event) => {
|
||||
__publicField(this, "image", (input) => process4(input, this.config));
|
||||
__publicField(this, "emit", (event) => {
|
||||
var _a;
|
||||
return (_a = this.events) == null ? void 0 : _a.dispatchEvent(new Event(event));
|
||||
};
|
||||
this.next = (result) => calc(result || this.result);
|
||||
this.warmup = (userConfig) => warmup(this, userConfig);
|
||||
});
|
||||
__publicField(this, "next", (result) => calc(result || this.result));
|
||||
__publicField(this, "warmup", (userConfig) => warmup(this, userConfig));
|
||||
get();
|
||||
this.env = env2;
|
||||
config.wasmPath = `https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@${tf24.version_core}/dist/`;
|
||||
|
|
|
@ -10,6 +10,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
||||
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
||||
var __require = typeof require !== "undefined" ? require : (x) => {
|
||||
throw new Error('Dynamic require of "' + x + '" is not supported');
|
||||
|
@ -33,6 +34,10 @@ var __reExport = (target, module2, desc) => {
|
|||
var __toModule = (module2) => {
|
||||
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
||||
};
|
||||
var __publicField = (obj, key, value) => {
|
||||
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
||||
return value;
|
||||
};
|
||||
var __accessCheck = (obj, member, msg) => {
|
||||
if (!member.has(obj))
|
||||
throw TypeError("Cannot " + msg);
|
||||
|
@ -400,6 +405,11 @@ function decodeBounds(boxOutputs, anchors3, inputSize) {
|
|||
}
|
||||
var BlazeFaceModel = class {
|
||||
constructor(model10, config3) {
|
||||
__publicField(this, "model");
|
||||
__publicField(this, "anchorsData");
|
||||
__publicField(this, "anchors");
|
||||
__publicField(this, "inputSize");
|
||||
__publicField(this, "config");
|
||||
this.model = model10;
|
||||
this.anchorsData = generateAnchors(model10.inputs[0].shape[1]);
|
||||
this.anchors = tf2.tensor2d(this.anchorsData);
|
||||
|
@ -3763,7 +3773,9 @@ var env2 = {
|
|||
supported: void 0,
|
||||
adapter: void 0
|
||||
},
|
||||
kernels: []
|
||||
kernels: [],
|
||||
Canvas: void 0,
|
||||
Image: void 0
|
||||
};
|
||||
async function get() {
|
||||
var _a;
|
||||
|
@ -3850,6 +3862,16 @@ function replaceRawCoordinates(rawCoords, newCoords, prefix, keys) {
|
|||
}
|
||||
var Pipeline = class {
|
||||
constructor(boundingBoxDetector, meshDetector, irisModel) {
|
||||
__publicField(this, "storedBoxes");
|
||||
__publicField(this, "boundingBoxDetector");
|
||||
__publicField(this, "meshDetector");
|
||||
__publicField(this, "irisModel");
|
||||
__publicField(this, "boxSize");
|
||||
__publicField(this, "meshSize");
|
||||
__publicField(this, "irisSize");
|
||||
__publicField(this, "irisEnlarge");
|
||||
__publicField(this, "skipped");
|
||||
__publicField(this, "detectedFaces");
|
||||
var _a, _b;
|
||||
this.storedBoxes = [];
|
||||
this.boundingBoxDetector = boundingBoxDetector;
|
||||
|
@ -4421,6 +4443,9 @@ function scalePoses(poses2, [height, width], [inputResolutionHeight, inputResolu
|
|||
}
|
||||
var MaxHeap = class {
|
||||
constructor(maxSize2, getElementValue) {
|
||||
__publicField(this, "priorityQueue");
|
||||
__publicField(this, "numberOfElements");
|
||||
__publicField(this, "getElementValue");
|
||||
this.priorityQueue = new Array(maxSize2);
|
||||
this.numberOfElements = -1;
|
||||
this.getElementValue = getElementValue;
|
||||
|
@ -7677,6 +7702,12 @@ var anchors = [
|
|||
// src/handpose/handdetector.ts
|
||||
var HandDetector = class {
|
||||
constructor(model10) {
|
||||
__publicField(this, "model");
|
||||
__publicField(this, "anchors");
|
||||
__publicField(this, "anchorsTensor");
|
||||
__publicField(this, "inputSize");
|
||||
__publicField(this, "inputSizeTensor");
|
||||
__publicField(this, "doubleInputSizeTensor");
|
||||
this.model = model10;
|
||||
this.anchors = anchors.map((anchor) => [anchor.x, anchor.y]);
|
||||
this.anchorsTensor = tf10.tensor2d(this.anchors);
|
||||
|
@ -7817,6 +7848,12 @@ var palmLandmarksPalmBase = 0;
|
|||
var palmLandmarksMiddleFingerBase = 2;
|
||||
var HandPipeline = class {
|
||||
constructor(handDetector, handPoseModel2) {
|
||||
__publicField(this, "handDetector");
|
||||
__publicField(this, "handPoseModel");
|
||||
__publicField(this, "inputSize");
|
||||
__publicField(this, "storedBoxes");
|
||||
__publicField(this, "skipped");
|
||||
__publicField(this, "detectedHands");
|
||||
var _a;
|
||||
this.handDetector = handDetector;
|
||||
this.handPoseModel = handPoseModel2;
|
||||
|
@ -8197,6 +8234,11 @@ function estimate(landmarks) {
|
|||
// src/fingerpose/gesture.ts
|
||||
var Gesture = class {
|
||||
constructor(name) {
|
||||
__publicField(this, "name");
|
||||
__publicField(this, "curls");
|
||||
__publicField(this, "directions");
|
||||
__publicField(this, "weights");
|
||||
__publicField(this, "weightsRelative");
|
||||
this.name = name;
|
||||
this.curls = {};
|
||||
this.directions = {};
|
||||
|
@ -12110,10 +12152,24 @@ async function warmup(instance, userConfig) {
|
|||
var _numTensors, _analyzeMemoryLeaks, _checkSanity, _sanity;
|
||||
var Human = class {
|
||||
constructor(userConfig) {
|
||||
__publicField(this, "version");
|
||||
__publicField(this, "config");
|
||||
__publicField(this, "result");
|
||||
__publicField(this, "state");
|
||||
__publicField(this, "process");
|
||||
__publicField(this, "tf");
|
||||
__publicField(this, "env");
|
||||
__publicField(this, "draw");
|
||||
__publicField(this, "models");
|
||||
__publicField(this, "events");
|
||||
__publicField(this, "faceTriangulation");
|
||||
__publicField(this, "faceUVMap");
|
||||
__publicField(this, "performance");
|
||||
__privateAdd(this, _numTensors, void 0);
|
||||
__privateAdd(this, _analyzeMemoryLeaks, void 0);
|
||||
__privateAdd(this, _checkSanity, void 0);
|
||||
this.analyze = (...msg) => {
|
||||
__publicField(this, "initial");
|
||||
__publicField(this, "analyze", (...msg) => {
|
||||
if (!__privateGet(this, _analyzeMemoryLeaks))
|
||||
return;
|
||||
const currentTensors = this.tf.engine().state.numTensors;
|
||||
|
@ -12122,7 +12178,7 @@ var Human = class {
|
|||
const leaked = currentTensors - previousTensors;
|
||||
if (leaked !== 0)
|
||||
log(...msg, leaked);
|
||||
};
|
||||
});
|
||||
__privateAdd(this, _sanity, (input) => {
|
||||
if (!__privateGet(this, _checkSanity))
|
||||
return null;
|
||||
|
@ -12137,13 +12193,13 @@ var Human = class {
|
|||
}
|
||||
return null;
|
||||
});
|
||||
this.image = (input) => process4(input, this.config);
|
||||
this.emit = (event) => {
|
||||
__publicField(this, "image", (input) => process4(input, this.config));
|
||||
__publicField(this, "emit", (event) => {
|
||||
var _a;
|
||||
return (_a = this.events) == null ? void 0 : _a.dispatchEvent(new Event(event));
|
||||
};
|
||||
this.next = (result) => calc(result || this.result);
|
||||
this.warmup = (userConfig) => warmup(this, userConfig);
|
||||
});
|
||||
__publicField(this, "next", (result) => calc(result || this.result));
|
||||
__publicField(this, "warmup", (userConfig) => warmup(this, userConfig));
|
||||
get();
|
||||
this.env = env2;
|
||||
config.wasmPath = `https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@${tf24.version_core}/dist/`;
|
||||
|
|
|
@ -10,6 +10,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
||||
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
||||
var __require = typeof require !== "undefined" ? require : (x) => {
|
||||
throw new Error('Dynamic require of "' + x + '" is not supported');
|
||||
|
@ -33,6 +34,10 @@ var __reExport = (target, module2, desc) => {
|
|||
var __toModule = (module2) => {
|
||||
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
||||
};
|
||||
var __publicField = (obj, key, value) => {
|
||||
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
||||
return value;
|
||||
};
|
||||
var __accessCheck = (obj, member, msg) => {
|
||||
if (!member.has(obj))
|
||||
throw TypeError("Cannot " + msg);
|
||||
|
@ -399,6 +404,11 @@ function decodeBounds(boxOutputs, anchors3, inputSize) {
|
|||
}
|
||||
var BlazeFaceModel = class {
|
||||
constructor(model10, config3) {
|
||||
__publicField(this, "model");
|
||||
__publicField(this, "anchorsData");
|
||||
__publicField(this, "anchors");
|
||||
__publicField(this, "inputSize");
|
||||
__publicField(this, "config");
|
||||
this.model = model10;
|
||||
this.anchorsData = generateAnchors(model10.inputs[0].shape[1]);
|
||||
this.anchors = tf2.tensor2d(this.anchorsData);
|
||||
|
@ -3762,7 +3772,9 @@ var env2 = {
|
|||
supported: void 0,
|
||||
adapter: void 0
|
||||
},
|
||||
kernels: []
|
||||
kernels: [],
|
||||
Canvas: void 0,
|
||||
Image: void 0
|
||||
};
|
||||
async function get() {
|
||||
var _a;
|
||||
|
@ -3849,6 +3861,16 @@ function replaceRawCoordinates(rawCoords, newCoords, prefix, keys) {
|
|||
}
|
||||
var Pipeline = class {
|
||||
constructor(boundingBoxDetector, meshDetector, irisModel) {
|
||||
__publicField(this, "storedBoxes");
|
||||
__publicField(this, "boundingBoxDetector");
|
||||
__publicField(this, "meshDetector");
|
||||
__publicField(this, "irisModel");
|
||||
__publicField(this, "boxSize");
|
||||
__publicField(this, "meshSize");
|
||||
__publicField(this, "irisSize");
|
||||
__publicField(this, "irisEnlarge");
|
||||
__publicField(this, "skipped");
|
||||
__publicField(this, "detectedFaces");
|
||||
var _a, _b;
|
||||
this.storedBoxes = [];
|
||||
this.boundingBoxDetector = boundingBoxDetector;
|
||||
|
@ -4420,6 +4442,9 @@ function scalePoses(poses2, [height, width], [inputResolutionHeight, inputResolu
|
|||
}
|
||||
var MaxHeap = class {
|
||||
constructor(maxSize2, getElementValue) {
|
||||
__publicField(this, "priorityQueue");
|
||||
__publicField(this, "numberOfElements");
|
||||
__publicField(this, "getElementValue");
|
||||
this.priorityQueue = new Array(maxSize2);
|
||||
this.numberOfElements = -1;
|
||||
this.getElementValue = getElementValue;
|
||||
|
@ -7676,6 +7701,12 @@ var anchors = [
|
|||
// src/handpose/handdetector.ts
|
||||
var HandDetector = class {
|
||||
constructor(model10) {
|
||||
__publicField(this, "model");
|
||||
__publicField(this, "anchors");
|
||||
__publicField(this, "anchorsTensor");
|
||||
__publicField(this, "inputSize");
|
||||
__publicField(this, "inputSizeTensor");
|
||||
__publicField(this, "doubleInputSizeTensor");
|
||||
this.model = model10;
|
||||
this.anchors = anchors.map((anchor) => [anchor.x, anchor.y]);
|
||||
this.anchorsTensor = tf10.tensor2d(this.anchors);
|
||||
|
@ -7816,6 +7847,12 @@ var palmLandmarksPalmBase = 0;
|
|||
var palmLandmarksMiddleFingerBase = 2;
|
||||
var HandPipeline = class {
|
||||
constructor(handDetector, handPoseModel2) {
|
||||
__publicField(this, "handDetector");
|
||||
__publicField(this, "handPoseModel");
|
||||
__publicField(this, "inputSize");
|
||||
__publicField(this, "storedBoxes");
|
||||
__publicField(this, "skipped");
|
||||
__publicField(this, "detectedHands");
|
||||
var _a;
|
||||
this.handDetector = handDetector;
|
||||
this.handPoseModel = handPoseModel2;
|
||||
|
@ -8196,6 +8233,11 @@ function estimate(landmarks) {
|
|||
// src/fingerpose/gesture.ts
|
||||
var Gesture = class {
|
||||
constructor(name) {
|
||||
__publicField(this, "name");
|
||||
__publicField(this, "curls");
|
||||
__publicField(this, "directions");
|
||||
__publicField(this, "weights");
|
||||
__publicField(this, "weightsRelative");
|
||||
this.name = name;
|
||||
this.curls = {};
|
||||
this.directions = {};
|
||||
|
@ -12109,10 +12151,24 @@ async function warmup(instance, userConfig) {
|
|||
var _numTensors, _analyzeMemoryLeaks, _checkSanity, _sanity;
|
||||
var Human = class {
|
||||
constructor(userConfig) {
|
||||
__publicField(this, "version");
|
||||
__publicField(this, "config");
|
||||
__publicField(this, "result");
|
||||
__publicField(this, "state");
|
||||
__publicField(this, "process");
|
||||
__publicField(this, "tf");
|
||||
__publicField(this, "env");
|
||||
__publicField(this, "draw");
|
||||
__publicField(this, "models");
|
||||
__publicField(this, "events");
|
||||
__publicField(this, "faceTriangulation");
|
||||
__publicField(this, "faceUVMap");
|
||||
__publicField(this, "performance");
|
||||
__privateAdd(this, _numTensors, void 0);
|
||||
__privateAdd(this, _analyzeMemoryLeaks, void 0);
|
||||
__privateAdd(this, _checkSanity, void 0);
|
||||
this.analyze = (...msg) => {
|
||||
__publicField(this, "initial");
|
||||
__publicField(this, "analyze", (...msg) => {
|
||||
if (!__privateGet(this, _analyzeMemoryLeaks))
|
||||
return;
|
||||
const currentTensors = this.tf.engine().state.numTensors;
|
||||
|
@ -12121,7 +12177,7 @@ var Human = class {
|
|||
const leaked = currentTensors - previousTensors;
|
||||
if (leaked !== 0)
|
||||
log(...msg, leaked);
|
||||
};
|
||||
});
|
||||
__privateAdd(this, _sanity, (input) => {
|
||||
if (!__privateGet(this, _checkSanity))
|
||||
return null;
|
||||
|
@ -12136,13 +12192,13 @@ var Human = class {
|
|||
}
|
||||
return null;
|
||||
});
|
||||
this.image = (input) => process4(input, this.config);
|
||||
this.emit = (event) => {
|
||||
__publicField(this, "image", (input) => process4(input, this.config));
|
||||
__publicField(this, "emit", (event) => {
|
||||
var _a;
|
||||
return (_a = this.events) == null ? void 0 : _a.dispatchEvent(new Event(event));
|
||||
};
|
||||
this.next = (result) => calc(result || this.result);
|
||||
this.warmup = (userConfig) => warmup(this, userConfig);
|
||||
});
|
||||
__publicField(this, "next", (result) => calc(result || this.result));
|
||||
__publicField(this, "warmup", (userConfig) => warmup(this, userConfig));
|
||||
get();
|
||||
this.env = env2;
|
||||
config.wasmPath = `https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@${tf24.version_core}/dist/`;
|
||||
|
|
|
@ -26,6 +26,8 @@ export interface Env {
|
|||
adapter: undefined | string,
|
||||
},
|
||||
kernels: string[],
|
||||
Canvas: undefined,
|
||||
Image: undefined,
|
||||
}
|
||||
|
||||
export const env: Env = {
|
||||
|
@ -54,6 +56,8 @@ export const env: Env = {
|
|||
adapter: undefined,
|
||||
},
|
||||
kernels: [],
|
||||
Canvas: undefined,
|
||||
Image: undefined,
|
||||
};
|
||||
|
||||
export function cpuinfo() {
|
||||
|
|
|
@ -12218,3 +12218,16 @@
|
|||
2021-09-13 13:27:42 [35mSTATE:[39m Compile: {"name":"tfjs/browser/esm/bundle","format":"esm","platform":"browser","input":"tfjs/tf-browser.ts","output":"dist/tfjs.esm.js","files":7,"inputBytes":2168,"outputBytes":2343983}
|
||||
2021-09-13 13:27:42 [35mSTATE:[39m Compile: {"name":"human/browser/iife/bundle","format":"iife","platform":"browser","input":"src/human.ts","output":"dist/human.js","files":50,"inputBytes":2817071,"outputBytes":1394644}
|
||||
2021-09-13 13:27:43 [35mSTATE:[39m Compile: {"name":"human/browser/esm/bundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm.js","files":50,"inputBytes":2817071,"outputBytes":2588986}
|
||||
2021-09-13 13:29:40 [36mINFO: [39m Watch: {"event":"modify","input":"src/env.ts"}
|
||||
2021-09-13 13:29:40 [35mSTATE:[39m Compile: {"name":"tfjs/nodejs/cpu","format":"cjs","platform":"node","input":"tfjs/tf-node.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":102,"outputBytes":1416}
|
||||
2021-09-13 13:29:40 [35mSTATE:[39m Compile: {"name":"human/nodejs/cpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node.js","files":50,"inputBytes":474586,"outputBytes":403826}
|
||||
2021-09-13 13:29:40 [35mSTATE:[39m Compile: {"name":"tfjs/nodejs/gpu","format":"cjs","platform":"node","input":"tfjs/tf-node-gpu.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":110,"outputBytes":1424}
|
||||
2021-09-13 13:29:40 [35mSTATE:[39m Compile: {"name":"human/nodejs/gpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-gpu.js","files":50,"inputBytes":474594,"outputBytes":403830}
|
||||
2021-09-13 13:29:40 [35mSTATE:[39m Compile: {"name":"tfjs/nodejs/wasm","format":"cjs","platform":"node","input":"tfjs/tf-node-wasm.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":149,"outputBytes":1491}
|
||||
2021-09-13 13:29:40 [35mSTATE:[39m Compile: {"name":"human/nodejs/wasm","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-wasm.js","files":50,"inputBytes":474661,"outputBytes":403902}
|
||||
2021-09-13 13:29:40 [35mSTATE:[39m Compile: {"name":"tfjs/browser/esm/nobundle","format":"esm","platform":"browser","input":"tfjs/tf-browser.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":2168,"outputBytes":1590}
|
||||
2021-09-13 13:29:40 [35mSTATE:[39m Compile: {"name":"human/browser/esm/nobundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm-nobundle.js","files":50,"inputBytes":474760,"outputBytes":406054}
|
||||
2021-09-13 13:29:41 [35mSTATE:[39m Compile: {"name":"tfjs/browser/esm/bundle","format":"esm","platform":"browser","input":"tfjs/tf-browser.ts","output":"dist/tfjs.esm.js","files":7,"inputBytes":2168,"outputBytes":2343983}
|
||||
2021-09-13 13:29:41 [35mSTATE:[39m Compile: {"name":"human/browser/iife/bundle","format":"iife","platform":"browser","input":"src/human.ts","output":"dist/human.js","files":50,"inputBytes":2817153,"outputBytes":1395892}
|
||||
2021-09-13 13:29:41 [35mSTATE:[39m Compile: {"name":"human/browser/esm/bundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm.js","files":50,"inputBytes":2817153,"outputBytes":2591282}
|
||||
2021-09-13 13:29:51 [36mINFO: [39m Build exiting...
|
||||
|
|
Loading…
Reference in New Issue