redefine config and result interfaces

pull/193/head
Vladimir Mandic 2021-09-11 23:54:35 -04:00
parent 9e237346a9
commit 1a21a0229c
66 changed files with 4740 additions and 1724 deletions

View File

@ -11,6 +11,7 @@
### **HEAD -> main** 2021/09/11 mandic00@live.com
- start using partial definitions
- implement event emitters
- fix iife loader
- simplify dependencies

View File

@ -484,6 +484,7 @@ var BlazeFaceModel = class {
this.config = config3;
}
async getBoundingBoxes(inputImage, userConfig) {
var _a, _b, _c, _d;
if (!inputImage || inputImage["isDisposedInternal"] || inputImage.shape.length !== 4 || inputImage.shape[1] < 1 || inputImage.shape[2] < 1)
return null;
const [batch, boxes, scores] = tfjs_esm_exports.tidy(() => {
@ -506,14 +507,14 @@ var BlazeFaceModel = class {
return [batchOut, boxesOut, scoresOut];
});
this.config = mergeDeep(this.config, userConfig);
const nmsTensor = await tfjs_esm_exports.image.nonMaxSuppressionAsync(boxes, scores, this.config.face.detector.maxDetected, this.config.face.detector.iouThreshold, this.config.face.detector.minConfidence);
const nmsTensor = await tfjs_esm_exports.image.nonMaxSuppressionAsync(boxes, scores, ((_a = this.config.face.detector) == null ? void 0 : _a.maxDetected) || 0, ((_b = this.config.face.detector) == null ? void 0 : _b.iouThreshold) || 0, ((_c = this.config.face.detector) == null ? void 0 : _c.minConfidence) || 0);
const nms = await nmsTensor.array();
tfjs_esm_exports.dispose(nmsTensor);
const annotatedBoxes = [];
const scoresData = await scores.data();
for (let i = 0; i < nms.length; i++) {
const confidence = scoresData[nms[i]];
if (confidence > this.config.face.detector.minConfidence) {
if (confidence > (((_d = this.config.face.detector) == null ? void 0 : _d.minConfidence) || 0)) {
const boundingBox = tfjs_esm_exports.slice(boxes, [nms[i], 0], [1, -1]);
const localBox = createBox(boundingBox);
tfjs_esm_exports.dispose(boundingBox);
@ -532,10 +533,11 @@ var BlazeFaceModel = class {
}
};
async function load(config3) {
const model10 = await tfjs_esm_exports.loadGraphModel(join(config3.modelBasePath, config3.face.detector.modelPath), { fromTFHub: config3.face.detector.modelPath.includes("tfhub.dev") });
var _a, _b, _c;
const model10 = await tfjs_esm_exports.loadGraphModel(join(config3.modelBasePath, ((_a = config3.face.detector) == null ? void 0 : _a.modelPath) || ""), { fromTFHub: (((_b = config3.face.detector) == null ? void 0 : _b.modelPath) || "").includes("tfhub.dev") });
const blazeFace = new BlazeFaceModel(model10, config3);
if (!model10 || !model10.modelUrl)
log("load model failed:", config3.face.detector.modelPath);
log("load model failed:", ((_c = config3.face.detector) == null ? void 0 : _c.modelPath) || "");
else if (config3.debug)
log("load model:", model10.modelUrl);
return blazeFace;
@ -4170,11 +4172,12 @@ var last = [];
var lastCount = 0;
var skipped = Number.MAX_SAFE_INTEGER;
async function load3(config3) {
const modelUrl = join(config3.modelBasePath, config3.face.description.modelPath);
var _a, _b;
const modelUrl = join(config3.modelBasePath, ((_a = config3.face.description) == null ? void 0 : _a.modelPath) || "");
if (!model) {
model = await tfjs_esm_exports.loadGraphModel(modelUrl);
if (!model)
log("load model failed:", config3.face.description.modelPath);
log("load model failed:", ((_b = config3.face.description) == null ? void 0 : _b.modelPath) || "");
else if (config3.debug)
log("load model:", modelUrl);
} else if (config3.debug)
@ -4220,15 +4223,16 @@ function enhance(input) {
return image18;
}
async function predict2(image18, config3, idx, count2) {
var _a, _b;
var _a, _b, _c;
if (!model)
return null;
if (skipped < config3.face.description.skipFrames && config3.skipFrame && lastCount === count2 && ((_a = last[idx]) == null ? void 0 : _a.age) && ((_b = last[idx]) == null ? void 0 : _b.age) > 0) {
if (skipped < (((_a = config3.face.description) == null ? void 0 : _a.skipFrames) || 0) && config3.skipFrame && lastCount === count2 && ((_b = last[idx]) == null ? void 0 : _b.age) && ((_c = last[idx]) == null ? void 0 : _c.age) > 0) {
skipped++;
return last[idx];
}
skipped = 0;
return new Promise(async (resolve) => {
var _a2, _b2;
const enhanced = enhance(image18);
let resT;
const obj = {
@ -4237,13 +4241,13 @@ async function predict2(image18, config3, idx, count2) {
genderScore: 0,
descriptor: []
};
if (config3.face.description.enabled)
if ((_a2 = config3.face.description) == null ? void 0 : _a2.enabled)
resT = await model.predict(enhanced);
tfjs_esm_exports.dispose(enhanced);
if (resT) {
const gender = await resT.find((t) => t.shape[1] === 1).data();
const confidence = Math.trunc(200 * Math.abs(gender[0] - 0.5)) / 100;
if (confidence > config3.face.description.minConfidence) {
if (confidence > (((_b2 = config3.face.description) == null ? void 0 : _b2.minConfidence) || 0)) {
obj.gender = gender[0] <= 0.5 ? "female" : "male";
obj.genderScore = Math.min(0.99, confidence);
}
@ -4270,10 +4274,11 @@ var lastCount2 = 0;
var skipped2 = Number.MAX_SAFE_INTEGER;
var rgb = [0.2989, 0.587, 0.114];
async function load4(config3) {
var _a, _b;
if (!model2) {
model2 = await tfjs_esm_exports.loadGraphModel(join(config3.modelBasePath, config3.face.emotion.modelPath));
model2 = await tfjs_esm_exports.loadGraphModel(join(config3.modelBasePath, ((_a = config3.face.emotion) == null ? void 0 : _a.modelPath) || ""));
if (!model2 || !model2.modelUrl)
log("load model failed:", config3.face.emotion.modelPath);
log("load model failed:", ((_b = config3.face.emotion) == null ? void 0 : _b.modelPath) || "");
else if (config3.debug)
log("load model:", model2.modelUrl);
} else if (config3.debug)
@ -4281,14 +4286,16 @@ async function load4(config3) {
return model2;
}
async function predict3(image18, config3, idx, count2) {
var _a;
if (!model2)
return null;
if (skipped2 < config3.face.emotion.skipFrames && config3.skipFrame && lastCount2 === count2 && last2[idx] && last2[idx].length > 0) {
if (skipped2 < (((_a = config3.face.emotion) == null ? void 0 : _a.skipFrames) || 0) && config3.skipFrame && lastCount2 === count2 && last2[idx] && last2[idx].length > 0) {
skipped2++;
return last2[idx];
}
skipped2 = 0;
return new Promise(async (resolve) => {
var _a2, _b;
const resize = tfjs_esm_exports.image.resizeBilinear(image18, [model2.inputs[0].shape[2], model2.inputs[0].shape[1]], false);
const [red, green, blue] = tfjs_esm_exports.split(resize, 3, 3);
tfjs_esm_exports.dispose(resize);
@ -4305,12 +4312,12 @@ async function predict3(image18, config3, idx, count2) {
const normalize = tfjs_esm_exports.tidy(() => tfjs_esm_exports.mul(tfjs_esm_exports.sub(grayscale, 0.5), 2));
tfjs_esm_exports.dispose(grayscale);
const obj = [];
if (config3.face.emotion.enabled) {
if ((_a2 = config3.face.emotion) == null ? void 0 : _a2.enabled) {
const emotionT = await model2.predict(normalize);
const data2 = await emotionT.data();
tfjs_esm_exports.dispose(emotionT);
for (let i = 0; i < data2.length; i++) {
if (data2[i] > config3.face.emotion.minConfidence)
if (data2[i] > (((_b = config3.face.emotion) == null ? void 0 : _b.minConfidence) || 0))
obj.push({ score: Math.min(0.99, Math.trunc(100 * data2[i]) / 100), emotion: annotations[i] });
}
obj.sort((a, b) => b.score - a.score);
@ -4653,7 +4660,7 @@ async function predict4(input, config3) {
}
async function load5(config3) {
if (!model3) {
model3 = await tfjs_esm_exports.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath));
model3 = await tfjs_esm_exports.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath || ""));
if (!model3 || !model3["modelUrl"])
log("load model failed:", config3.body.modelPath);
else if (config3.debug)
@ -8364,18 +8371,19 @@ async function predict5(input, config3) {
return hands;
}
async function load6(config3) {
var _a, _b, _c, _d, _e, _f;
if (!handDetectorModel || !handPoseModel) {
[handDetectorModel, handPoseModel] = await Promise.all([
config3.hand.enabled ? tfjs_esm_exports.loadGraphModel(join(config3.modelBasePath, config3.hand.detector.modelPath), { fromTFHub: config3.hand.detector.modelPath.includes("tfhub.dev") }) : null,
config3.hand.landmarks ? tfjs_esm_exports.loadGraphModel(join(config3.modelBasePath, config3.hand.skeleton.modelPath), { fromTFHub: config3.hand.skeleton.modelPath.includes("tfhub.dev") }) : null
config3.hand.enabled ? tfjs_esm_exports.loadGraphModel(join(config3.modelBasePath, ((_a = config3.hand.detector) == null ? void 0 : _a.modelPath) || ""), { fromTFHub: (((_b = config3.hand.detector) == null ? void 0 : _b.modelPath) || "").includes("tfhub.dev") }) : null,
config3.hand.landmarks ? tfjs_esm_exports.loadGraphModel(join(config3.modelBasePath, ((_c = config3.hand.skeleton) == null ? void 0 : _c.modelPath) || ""), { fromTFHub: (((_d = config3.hand.skeleton) == null ? void 0 : _d.modelPath) || "").includes("tfhub.dev") }) : null
]);
if (config3.hand.enabled) {
if (!handDetectorModel || !handDetectorModel["modelUrl"])
log("load model failed:", config3.hand.detector.modelPath);
log("load model failed:", ((_e = config3.hand.detector) == null ? void 0 : _e.modelPath) || "");
else if (config3.debug)
log("load model:", handDetectorModel["modelUrl"]);
if (!handPoseModel || !handPoseModel["modelUrl"])
log("load model failed:", config3.hand.skeleton.modelPath);
log("load model failed:", ((_f = config3.hand.skeleton) == null ? void 0 : _f.modelPath) || "");
else if (config3.debug)
log("load model:", handPoseModel["modelUrl"]);
}
@ -8470,7 +8478,7 @@ var upper = [
var model4;
async function load7(config3) {
if (!model4) {
model4 = await tfjs_esm_exports.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath));
model4 = await tfjs_esm_exports.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath || ""));
model4["width"] = parseInt(model4["signature"].inputs["input_1:0"].tensorShape.dim[2].size);
model4["height"] = parseInt(model4["signature"].inputs["input_1:0"].tensorShape.dim[1].size);
if (!model4 || !model4["modelUrl"])
@ -8539,7 +8547,7 @@ var skipped3 = Number.MAX_SAFE_INTEGER;
var bodyParts = ["head", "neck", "rightShoulder", "rightElbow", "rightWrist", "chest", "leftShoulder", "leftElbow", "leftWrist", "pelvis", "rightHip", "rightKnee", "rightAnkle", "leftHip", "leftKnee", "leftAnkle"];
async function load8(config3) {
if (!model5) {
model5 = await tfjs_esm_exports.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath));
model5 = await tfjs_esm_exports.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath || ""));
if (!model5 || !model5["modelUrl"])
log("load model failed:", config3.body.modelPath);
else if (config3.debug)
@ -8564,12 +8572,14 @@ function max2d(inputs, minScore) {
});
}
async function predict7(image18, config3) {
if (skipped3 < config3.body.skipFrames && config3.skipFrame && Object.keys(keypoints).length > 0) {
var _a;
if (skipped3 < (((_a = config3.body) == null ? void 0 : _a.skipFrames) || 0) && config3.skipFrame && Object.keys(keypoints).length > 0) {
skipped3++;
return [{ id: 0, score, box: box4, boxRaw, keypoints }];
}
skipped3 = 0;
return new Promise(async (resolve) => {
var _a2;
const tensor2 = tfjs_esm_exports.tidy(() => {
if (!model5.inputs[0].shape)
return null;
@ -8590,7 +8600,7 @@ async function predict7(image18, config3) {
tfjs_esm_exports.dispose(squeeze7);
for (let id = 0; id < stack2.length; id++) {
const [x2, y2, partScore] = max2d(stack2[id], config3.body.minConfidence);
if (score > config3.body.minConfidence) {
if (score > (((_a2 = config3.body) == null ? void 0 : _a2.minConfidence) || 0)) {
keypoints.push({
score: Math.round(100 * partScore) / 100,
part: bodyParts[id],
@ -8638,7 +8648,7 @@ var skipped4 = Number.MAX_SAFE_INTEGER;
var bodyParts2 = ["nose", "leftEye", "rightEye", "leftEar", "rightEar", "leftShoulder", "rightShoulder", "leftElbow", "rightElbow", "leftWrist", "rightWrist", "leftHip", "rightHip", "leftKnee", "rightKnee", "leftAnkle", "rightAnkle"];
async function load9(config3) {
if (!model6) {
model6 = await tfjs_esm_exports.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath));
model6 = await tfjs_esm_exports.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath || ""));
if (!model6 || !model6["modelUrl"])
log("load model failed:", config3.body.modelPath);
else if (config3.debug)
@ -8730,7 +8740,7 @@ async function parseMultiPose(res, config3, image18) {
return persons2;
}
async function predict8(image18, config3) {
if (skipped4 < config3.body.skipFrames && config3.skipFrame && Object.keys(keypoints2).length > 0) {
if (skipped4 < (config3.body.skipFrames || 0) && config3.skipFrame && Object.keys(keypoints2).length > 0) {
skipped4++;
return [{ id: 0, score: score2, box: box5, boxRaw: boxRaw2, keypoints: keypoints2 }];
}
@ -8854,7 +8864,7 @@ var skipped5 = Number.MAX_SAFE_INTEGER;
var scaleBox = 2.5;
async function load10(config3) {
if (!model7) {
model7 = await tfjs_esm_exports.loadGraphModel(join(config3.modelBasePath, config3.object.modelPath));
model7 = await tfjs_esm_exports.loadGraphModel(join(config3.modelBasePath, config3.object.modelPath || ""));
const inputs = Object.values(model7.modelSignature["inputs"]);
model7.inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : null;
if (!model7.inputSize)
@ -8929,7 +8939,7 @@ async function process2(res, inputSize, outputShape, config3) {
return results;
}
async function predict9(image18, config3) {
if (skipped5 < config3.object.skipFrames && config3.skipFrame && last3.length > 0) {
if (skipped5 < (config3.object.skipFrames || 0) && config3.skipFrame && last3.length > 0) {
skipped5++;
return last3;
}
@ -8957,7 +8967,7 @@ var last4 = [];
var skipped6 = Number.MAX_SAFE_INTEGER;
async function load11(config3) {
if (!model8) {
model8 = await tfjs_esm_exports.loadGraphModel(join(config3.modelBasePath, config3.object.modelPath));
model8 = await tfjs_esm_exports.loadGraphModel(join(config3.modelBasePath, config3.object.modelPath || ""));
const inputs = Object.values(model8.modelSignature["inputs"]);
model8.inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : null;
if (!model8.inputSize)
@ -9016,7 +9026,7 @@ async function process3(res, inputSize, outputShape, config3) {
return results;
}
async function predict10(input, config3) {
if (skipped6 < config3.object.skipFrames && config3.skipFrame && last4.length > 0) {
if (skipped6 < (config3.object.skipFrames || 0) && config3.skipFrame && last4.length > 0) {
skipped6++;
return last4;
}
@ -9770,14 +9780,14 @@ function process4(input, config3) {
targetHeight = maxSize;
targetWidth = targetHeight * originalWidth / originalHeight;
}
if (config3.filter.width > 0)
if ((config3.filter.width || 0) > 0)
targetWidth = config3.filter.width;
else if (config3.filter.height > 0)
targetWidth = originalWidth * (config3.filter.height / originalHeight);
if (config3.filter.height > 0)
else if ((config3.filter.height || 0) > 0)
targetWidth = originalWidth * ((config3.filter.height || 0) / originalHeight);
if ((config3.filter.height || 0) > 0)
targetHeight = config3.filter.height;
else if (config3.filter.width > 0)
targetHeight = originalHeight * (config3.filter.width / originalWidth);
else if ((config3.filter.width || 0) > 0)
targetHeight = originalHeight * ((config3.filter.width || 0) / originalWidth);
if (!targetWidth || !targetHeight)
throw new Error("Human: Input cannot determine dimension");
if (!inCanvas || (inCanvas == null ? void 0 : inCanvas.width) !== targetWidth || (inCanvas == null ? void 0 : inCanvas.height) !== targetHeight) {
@ -9885,7 +9895,7 @@ var model9;
var busy = false;
async function load12(config3) {
if (!model9) {
model9 = await tfjs_esm_exports.loadGraphModel(join(config3.modelBasePath, config3.segmentation.modelPath));
model9 = await tfjs_esm_exports.loadGraphModel(join(config3.modelBasePath, config3.segmentation.modelPath || ""));
if (!model9 || !model9["modelUrl"])
log("load model failed:", config3.segmentation.modelPath);
else if (config3.debug)
@ -12022,7 +12032,7 @@ var Human = class {
}
async detect(input, userConfig) {
return new Promise(async (resolve) => {
var _a, _b;
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
this.state = "config";
let timeStamp;
let elapsedTime;
@ -12089,26 +12099,26 @@ var Human = class {
}
this.analyze("Start Body:");
if (this.config.async) {
if (this.config.body.modelPath.includes("posenet"))
if ((_a = this.config.body.modelPath) == null ? void 0 : _a.includes("posenet"))
bodyRes = this.config.body.enabled ? predict4(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes("blazepose"))
else if ((_b = this.config.body.modelPath) == null ? void 0 : _b.includes("blazepose"))
bodyRes = this.config.body.enabled ? predict6(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes("efficientpose"))
else if ((_c = this.config.body.modelPath) == null ? void 0 : _c.includes("efficientpose"))
bodyRes = this.config.body.enabled ? predict7(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes("movenet"))
else if ((_d = this.config.body.modelPath) == null ? void 0 : _d.includes("movenet"))
bodyRes = this.config.body.enabled ? predict8(this.process.tensor, this.config) : [];
if (this.performance.body)
delete this.performance.body;
} else {
this.state = "run:body";
timeStamp = now();
if (this.config.body.modelPath.includes("posenet"))
if ((_e = this.config.body.modelPath) == null ? void 0 : _e.includes("posenet"))
bodyRes = this.config.body.enabled ? await predict4(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes("blazepose"))
else if ((_f = this.config.body.modelPath) == null ? void 0 : _f.includes("blazepose"))
bodyRes = this.config.body.enabled ? await predict6(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes("efficientpose"))
else if ((_g = this.config.body.modelPath) == null ? void 0 : _g.includes("efficientpose"))
bodyRes = this.config.body.enabled ? await predict7(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes("movenet"))
else if ((_h = this.config.body.modelPath) == null ? void 0 : _h.includes("movenet"))
bodyRes = this.config.body.enabled ? await predict8(this.process.tensor, this.config) : [];
elapsedTime = Math.trunc(now() - timeStamp);
if (elapsedTime > 0)
@ -12131,18 +12141,18 @@ var Human = class {
this.analyze("End Hand:");
this.analyze("Start Object:");
if (this.config.async) {
if (this.config.object.modelPath.includes("nanodet"))
if ((_i = this.config.object.modelPath) == null ? void 0 : _i.includes("nanodet"))
objectRes = this.config.object.enabled ? predict9(this.process.tensor, this.config) : [];
else if (this.config.object.modelPath.includes("centernet"))
else if ((_j = this.config.object.modelPath) == null ? void 0 : _j.includes("centernet"))
objectRes = this.config.object.enabled ? predict10(this.process.tensor, this.config) : [];
if (this.performance.object)
delete this.performance.object;
} else {
this.state = "run:object";
timeStamp = now();
if (this.config.object.modelPath.includes("nanodet"))
if ((_k = this.config.object.modelPath) == null ? void 0 : _k.includes("nanodet"))
objectRes = this.config.object.enabled ? await predict9(this.process.tensor, this.config) : [];
else if (this.config.object.modelPath.includes("centernet"))
else if ((_l = this.config.object.modelPath) == null ? void 0 : _l.includes("centernet"))
objectRes = this.config.object.enabled ? await predict10(this.process.tensor, this.config) : [];
elapsedTime = Math.trunc(now() - timeStamp);
if (elapsedTime > 0)
@ -12162,7 +12172,7 @@ var Human = class {
}
this.performance.total = Math.trunc(now() - timeStart);
this.state = "idle";
const shape = ((_b = (_a = this.process) == null ? void 0 : _a.tensor) == null ? void 0 : _b.shape) || [];
const shape = ((_n = (_m = this.process) == null ? void 0 : _m.tensor) == null ? void 0 : _n.shape) || [];
this.result = {
face: faceRes,
body: bodyRes,
@ -12216,6 +12226,7 @@ _warmupCanvas = new WeakMap();
_warmupNode = new WeakMap();
export {
Human,
Human as default
Human as default,
config as defaults
};
//# sourceMappingURL=human.esm-nobundle.js.map

File diff suppressed because one or more lines are too long

115
dist/human.esm.js vendored
View File

@ -59992,6 +59992,7 @@ var BlazeFaceModel = class {
this.config = config3;
}
async getBoundingBoxes(inputImage, userConfig) {
var _a, _b, _c, _d;
if (!inputImage || inputImage["isDisposedInternal"] || inputImage.shape.length !== 4 || inputImage.shape[1] < 1 || inputImage.shape[2] < 1)
return null;
const [batch, boxes, scores] = tidy(() => {
@ -60014,14 +60015,14 @@ var BlazeFaceModel = class {
return [batchOut, boxesOut, scoresOut];
});
this.config = mergeDeep(this.config, userConfig);
const nmsTensor = await image.nonMaxSuppressionAsync(boxes, scores, this.config.face.detector.maxDetected, this.config.face.detector.iouThreshold, this.config.face.detector.minConfidence);
const nmsTensor = await image.nonMaxSuppressionAsync(boxes, scores, ((_a = this.config.face.detector) == null ? void 0 : _a.maxDetected) || 0, ((_b = this.config.face.detector) == null ? void 0 : _b.iouThreshold) || 0, ((_c = this.config.face.detector) == null ? void 0 : _c.minConfidence) || 0);
const nms = await nmsTensor.array();
dispose(nmsTensor);
const annotatedBoxes = [];
const scoresData = await scores.data();
for (let i = 0; i < nms.length; i++) {
const confidence = scoresData[nms[i]];
if (confidence > this.config.face.detector.minConfidence) {
if (confidence > (((_d = this.config.face.detector) == null ? void 0 : _d.minConfidence) || 0)) {
const boundingBox = slice(boxes, [nms[i], 0], [1, -1]);
const localBox = createBox(boundingBox);
dispose(boundingBox);
@ -60040,10 +60041,11 @@ var BlazeFaceModel = class {
}
};
async function load(config3) {
const model11 = await loadGraphModel(join(config3.modelBasePath, config3.face.detector.modelPath), { fromTFHub: config3.face.detector.modelPath.includes("tfhub.dev") });
var _a, _b, _c;
const model11 = await loadGraphModel(join(config3.modelBasePath, ((_a = config3.face.detector) == null ? void 0 : _a.modelPath) || ""), { fromTFHub: (((_b = config3.face.detector) == null ? void 0 : _b.modelPath) || "").includes("tfhub.dev") });
const blazeFace = new BlazeFaceModel(model11, config3);
if (!model11 || !model11.modelUrl)
log("load model failed:", config3.face.detector.modelPath);
log("load model failed:", ((_c = config3.face.detector) == null ? void 0 : _c.modelPath) || "");
else if (config3.debug)
log("load model:", model11.modelUrl);
return blazeFace;
@ -63678,11 +63680,12 @@ var last = [];
var lastCount = 0;
var skipped = Number.MAX_SAFE_INTEGER;
async function load3(config3) {
const modelUrl = join(config3.modelBasePath, config3.face.description.modelPath);
var _a, _b;
const modelUrl = join(config3.modelBasePath, ((_a = config3.face.description) == null ? void 0 : _a.modelPath) || "");
if (!model2) {
model2 = await loadGraphModel(modelUrl);
if (!model2)
log("load model failed:", config3.face.description.modelPath);
log("load model failed:", ((_b = config3.face.description) == null ? void 0 : _b.modelPath) || "");
else if (config3.debug)
log("load model:", modelUrl);
} else if (config3.debug)
@ -63728,15 +63731,16 @@ function enhance(input2) {
return image4;
}
async function predict2(image4, config3, idx, count3) {
var _a, _b;
var _a, _b, _c;
if (!model2)
return null;
if (skipped < config3.face.description.skipFrames && config3.skipFrame && lastCount === count3 && ((_a = last[idx]) == null ? void 0 : _a.age) && ((_b = last[idx]) == null ? void 0 : _b.age) > 0) {
if (skipped < (((_a = config3.face.description) == null ? void 0 : _a.skipFrames) || 0) && config3.skipFrame && lastCount === count3 && ((_b = last[idx]) == null ? void 0 : _b.age) && ((_c = last[idx]) == null ? void 0 : _c.age) > 0) {
skipped++;
return last[idx];
}
skipped = 0;
return new Promise(async (resolve) => {
var _a2, _b2;
const enhanced = enhance(image4);
let resT;
const obj = {
@ -63745,13 +63749,13 @@ async function predict2(image4, config3, idx, count3) {
genderScore: 0,
descriptor: []
};
if (config3.face.description.enabled)
if ((_a2 = config3.face.description) == null ? void 0 : _a2.enabled)
resT = await model2.predict(enhanced);
dispose(enhanced);
if (resT) {
const gender = await resT.find((t) => t.shape[1] === 1).data();
const confidence = Math.trunc(200 * Math.abs(gender[0] - 0.5)) / 100;
if (confidence > config3.face.description.minConfidence) {
if (confidence > (((_b2 = config3.face.description) == null ? void 0 : _b2.minConfidence) || 0)) {
obj.gender = gender[0] <= 0.5 ? "female" : "male";
obj.genderScore = Math.min(0.99, confidence);
}
@ -63778,10 +63782,11 @@ var lastCount2 = 0;
var skipped2 = Number.MAX_SAFE_INTEGER;
var rgb = [0.2989, 0.587, 0.114];
async function load4(config3) {
var _a, _b;
if (!model3) {
model3 = await loadGraphModel(join(config3.modelBasePath, config3.face.emotion.modelPath));
model3 = await loadGraphModel(join(config3.modelBasePath, ((_a = config3.face.emotion) == null ? void 0 : _a.modelPath) || ""));
if (!model3 || !model3.modelUrl)
log("load model failed:", config3.face.emotion.modelPath);
log("load model failed:", ((_b = config3.face.emotion) == null ? void 0 : _b.modelPath) || "");
else if (config3.debug)
log("load model:", model3.modelUrl);
} else if (config3.debug)
@ -63789,14 +63794,16 @@ async function load4(config3) {
return model3;
}
async function predict3(image4, config3, idx, count3) {
var _a;
if (!model3)
return null;
if (skipped2 < config3.face.emotion.skipFrames && config3.skipFrame && lastCount2 === count3 && last2[idx] && last2[idx].length > 0) {
if (skipped2 < (((_a = config3.face.emotion) == null ? void 0 : _a.skipFrames) || 0) && config3.skipFrame && lastCount2 === count3 && last2[idx] && last2[idx].length > 0) {
skipped2++;
return last2[idx];
}
skipped2 = 0;
return new Promise(async (resolve) => {
var _a2, _b;
const resize = image.resizeBilinear(image4, [model3.inputs[0].shape[2], model3.inputs[0].shape[1]], false);
const [red, green, blue] = split(resize, 3, 3);
dispose(resize);
@ -63813,12 +63820,12 @@ async function predict3(image4, config3, idx, count3) {
const normalize = tidy(() => mul(sub(grayscale, 0.5), 2));
dispose(grayscale);
const obj = [];
if (config3.face.emotion.enabled) {
if ((_a2 = config3.face.emotion) == null ? void 0 : _a2.enabled) {
const emotionT = await model3.predict(normalize);
const data = await emotionT.data();
dispose(emotionT);
for (let i = 0; i < data.length; i++) {
if (data[i] > config3.face.emotion.minConfidence)
if (data[i] > (((_b = config3.face.emotion) == null ? void 0 : _b.minConfidence) || 0))
obj.push({ score: Math.min(0.99, Math.trunc(100 * data[i]) / 100), emotion: annotations[i] });
}
obj.sort((a, b) => b.score - a.score);
@ -64161,7 +64168,7 @@ async function predict4(input2, config3) {
}
async function load5(config3) {
if (!model4) {
model4 = await loadGraphModel(join(config3.modelBasePath, config3.body.modelPath));
model4 = await loadGraphModel(join(config3.modelBasePath, config3.body.modelPath || ""));
if (!model4 || !model4["modelUrl"])
log("load model failed:", config3.body.modelPath);
else if (config3.debug)
@ -67872,18 +67879,19 @@ async function predict5(input2, config3) {
return hands;
}
async function load6(config3) {
var _a, _b, _c, _d, _e, _f;
if (!handDetectorModel || !handPoseModel) {
[handDetectorModel, handPoseModel] = await Promise.all([
config3.hand.enabled ? loadGraphModel(join(config3.modelBasePath, config3.hand.detector.modelPath), { fromTFHub: config3.hand.detector.modelPath.includes("tfhub.dev") }) : null,
config3.hand.landmarks ? loadGraphModel(join(config3.modelBasePath, config3.hand.skeleton.modelPath), { fromTFHub: config3.hand.skeleton.modelPath.includes("tfhub.dev") }) : null
config3.hand.enabled ? loadGraphModel(join(config3.modelBasePath, ((_a = config3.hand.detector) == null ? void 0 : _a.modelPath) || ""), { fromTFHub: (((_b = config3.hand.detector) == null ? void 0 : _b.modelPath) || "").includes("tfhub.dev") }) : null,
config3.hand.landmarks ? loadGraphModel(join(config3.modelBasePath, ((_c = config3.hand.skeleton) == null ? void 0 : _c.modelPath) || ""), { fromTFHub: (((_d = config3.hand.skeleton) == null ? void 0 : _d.modelPath) || "").includes("tfhub.dev") }) : null
]);
if (config3.hand.enabled) {
if (!handDetectorModel || !handDetectorModel["modelUrl"])
log("load model failed:", config3.hand.detector.modelPath);
log("load model failed:", ((_e = config3.hand.detector) == null ? void 0 : _e.modelPath) || "");
else if (config3.debug)
log("load model:", handDetectorModel["modelUrl"]);
if (!handPoseModel || !handPoseModel["modelUrl"])
log("load model failed:", config3.hand.skeleton.modelPath);
log("load model failed:", ((_f = config3.hand.skeleton) == null ? void 0 : _f.modelPath) || "");
else if (config3.debug)
log("load model:", handPoseModel["modelUrl"]);
}
@ -67978,7 +67986,7 @@ var upper = [
var model5;
async function load7(config3) {
if (!model5) {
model5 = await loadGraphModel(join(config3.modelBasePath, config3.body.modelPath));
model5 = await loadGraphModel(join(config3.modelBasePath, config3.body.modelPath || ""));
model5["width"] = parseInt(model5["signature"].inputs["input_1:0"].tensorShape.dim[2].size);
model5["height"] = parseInt(model5["signature"].inputs["input_1:0"].tensorShape.dim[1].size);
if (!model5 || !model5["modelUrl"])
@ -68047,7 +68055,7 @@ var skipped3 = Number.MAX_SAFE_INTEGER;
var bodyParts = ["head", "neck", "rightShoulder", "rightElbow", "rightWrist", "chest", "leftShoulder", "leftElbow", "leftWrist", "pelvis", "rightHip", "rightKnee", "rightAnkle", "leftHip", "leftKnee", "leftAnkle"];
async function load8(config3) {
if (!model6) {
model6 = await loadGraphModel(join(config3.modelBasePath, config3.body.modelPath));
model6 = await loadGraphModel(join(config3.modelBasePath, config3.body.modelPath || ""));
if (!model6 || !model6["modelUrl"])
log("load model failed:", config3.body.modelPath);
else if (config3.debug)
@ -68072,12 +68080,14 @@ function max2d(inputs, minScore) {
});
}
async function predict7(image4, config3) {
if (skipped3 < config3.body.skipFrames && config3.skipFrame && Object.keys(keypoints).length > 0) {
var _a;
if (skipped3 < (((_a = config3.body) == null ? void 0 : _a.skipFrames) || 0) && config3.skipFrame && Object.keys(keypoints).length > 0) {
skipped3++;
return [{ id: 0, score, box: box4, boxRaw, keypoints }];
}
skipped3 = 0;
return new Promise(async (resolve) => {
var _a2;
const tensor2 = tidy(() => {
if (!model6.inputs[0].shape)
return null;
@ -68098,7 +68108,7 @@ async function predict7(image4, config3) {
dispose(squeeze2);
for (let id = 0; id < stack2.length; id++) {
const [x2, y2, partScore] = max2d(stack2[id], config3.body.minConfidence);
if (score > config3.body.minConfidence) {
if (score > (((_a2 = config3.body) == null ? void 0 : _a2.minConfidence) || 0)) {
keypoints.push({
score: Math.round(100 * partScore) / 100,
part: bodyParts[id],
@ -68146,7 +68156,7 @@ var skipped4 = Number.MAX_SAFE_INTEGER;
var bodyParts2 = ["nose", "leftEye", "rightEye", "leftEar", "rightEar", "leftShoulder", "rightShoulder", "leftElbow", "rightElbow", "leftWrist", "rightWrist", "leftHip", "rightHip", "leftKnee", "rightKnee", "leftAnkle", "rightAnkle"];
async function load9(config3) {
if (!model7) {
model7 = await loadGraphModel(join(config3.modelBasePath, config3.body.modelPath));
model7 = await loadGraphModel(join(config3.modelBasePath, config3.body.modelPath || ""));
if (!model7 || !model7["modelUrl"])
log("load model failed:", config3.body.modelPath);
else if (config3.debug)
@ -68238,7 +68248,7 @@ async function parseMultiPose(res, config3, image4) {
return persons2;
}
async function predict8(image4, config3) {
if (skipped4 < config3.body.skipFrames && config3.skipFrame && Object.keys(keypoints2).length > 0) {
if (skipped4 < (config3.body.skipFrames || 0) && config3.skipFrame && Object.keys(keypoints2).length > 0) {
skipped4++;
return [{ id: 0, score: score2, box: box5, boxRaw: boxRaw2, keypoints: keypoints2 }];
}
@ -68362,7 +68372,7 @@ var skipped5 = Number.MAX_SAFE_INTEGER;
var scaleBox = 2.5;
async function load10(config3) {
if (!model8) {
model8 = await loadGraphModel(join(config3.modelBasePath, config3.object.modelPath));
model8 = await loadGraphModel(join(config3.modelBasePath, config3.object.modelPath || ""));
const inputs = Object.values(model8.modelSignature["inputs"]);
model8.inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : null;
if (!model8.inputSize)
@ -68437,7 +68447,7 @@ async function process2(res, inputSize, outputShape, config3) {
return results;
}
async function predict9(image4, config3) {
if (skipped5 < config3.object.skipFrames && config3.skipFrame && last3.length > 0) {
if (skipped5 < (config3.object.skipFrames || 0) && config3.skipFrame && last3.length > 0) {
skipped5++;
return last3;
}
@ -68465,7 +68475,7 @@ var last4 = [];
var skipped6 = Number.MAX_SAFE_INTEGER;
async function load11(config3) {
if (!model9) {
model9 = await loadGraphModel(join(config3.modelBasePath, config3.object.modelPath));
model9 = await loadGraphModel(join(config3.modelBasePath, config3.object.modelPath || ""));
const inputs = Object.values(model9.modelSignature["inputs"]);
model9.inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : null;
if (!model9.inputSize)
@ -68524,7 +68534,7 @@ async function process3(res, inputSize, outputShape, config3) {
return results;
}
async function predict10(input2, config3) {
if (skipped6 < config3.object.skipFrames && config3.skipFrame && last4.length > 0) {
if (skipped6 < (config3.object.skipFrames || 0) && config3.skipFrame && last4.length > 0) {
skipped6++;
return last4;
}
@ -69278,14 +69288,14 @@ function process4(input2, config3) {
targetHeight = maxSize;
targetWidth = targetHeight * originalWidth / originalHeight;
}
if (config3.filter.width > 0)
if ((config3.filter.width || 0) > 0)
targetWidth = config3.filter.width;
else if (config3.filter.height > 0)
targetWidth = originalWidth * (config3.filter.height / originalHeight);
if (config3.filter.height > 0)
else if ((config3.filter.height || 0) > 0)
targetWidth = originalWidth * ((config3.filter.height || 0) / originalHeight);
if ((config3.filter.height || 0) > 0)
targetHeight = config3.filter.height;
else if (config3.filter.width > 0)
targetHeight = originalHeight * (config3.filter.width / originalWidth);
else if ((config3.filter.width || 0) > 0)
targetHeight = originalHeight * ((config3.filter.width || 0) / originalWidth);
if (!targetWidth || !targetHeight)
throw new Error("Human: Input cannot determine dimension");
if (!inCanvas || (inCanvas == null ? void 0 : inCanvas.width) !== targetWidth || (inCanvas == null ? void 0 : inCanvas.height) !== targetHeight) {
@ -69393,7 +69403,7 @@ var model10;
var busy = false;
async function load12(config3) {
if (!model10) {
model10 = await loadGraphModel(join(config3.modelBasePath, config3.segmentation.modelPath));
model10 = await loadGraphModel(join(config3.modelBasePath, config3.segmentation.modelPath || ""));
if (!model10 || !model10["modelUrl"])
log("load model failed:", config3.segmentation.modelPath);
else if (config3.debug)
@ -71530,7 +71540,7 @@ var Human = class {
}
async detect(input2, userConfig) {
return new Promise(async (resolve) => {
var _a, _b;
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
this.state = "config";
let timeStamp;
let elapsedTime;
@ -71597,26 +71607,26 @@ var Human = class {
}
this.analyze("Start Body:");
if (this.config.async) {
if (this.config.body.modelPath.includes("posenet"))
if ((_a = this.config.body.modelPath) == null ? void 0 : _a.includes("posenet"))
bodyRes = this.config.body.enabled ? predict4(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes("blazepose"))
else if ((_b = this.config.body.modelPath) == null ? void 0 : _b.includes("blazepose"))
bodyRes = this.config.body.enabled ? predict6(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes("efficientpose"))
else if ((_c = this.config.body.modelPath) == null ? void 0 : _c.includes("efficientpose"))
bodyRes = this.config.body.enabled ? predict7(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes("movenet"))
else if ((_d = this.config.body.modelPath) == null ? void 0 : _d.includes("movenet"))
bodyRes = this.config.body.enabled ? predict8(this.process.tensor, this.config) : [];
if (this.performance.body)
delete this.performance.body;
} else {
this.state = "run:body";
timeStamp = now();
if (this.config.body.modelPath.includes("posenet"))
if ((_e = this.config.body.modelPath) == null ? void 0 : _e.includes("posenet"))
bodyRes = this.config.body.enabled ? await predict4(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes("blazepose"))
else if ((_f = this.config.body.modelPath) == null ? void 0 : _f.includes("blazepose"))
bodyRes = this.config.body.enabled ? await predict6(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes("efficientpose"))
else if ((_g = this.config.body.modelPath) == null ? void 0 : _g.includes("efficientpose"))
bodyRes = this.config.body.enabled ? await predict7(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes("movenet"))
else if ((_h = this.config.body.modelPath) == null ? void 0 : _h.includes("movenet"))
bodyRes = this.config.body.enabled ? await predict8(this.process.tensor, this.config) : [];
elapsedTime = Math.trunc(now() - timeStamp);
if (elapsedTime > 0)
@ -71639,18 +71649,18 @@ var Human = class {
this.analyze("End Hand:");
this.analyze("Start Object:");
if (this.config.async) {
if (this.config.object.modelPath.includes("nanodet"))
if ((_i = this.config.object.modelPath) == null ? void 0 : _i.includes("nanodet"))
objectRes = this.config.object.enabled ? predict9(this.process.tensor, this.config) : [];
else if (this.config.object.modelPath.includes("centernet"))
else if ((_j = this.config.object.modelPath) == null ? void 0 : _j.includes("centernet"))
objectRes = this.config.object.enabled ? predict10(this.process.tensor, this.config) : [];
if (this.performance.object)
delete this.performance.object;
} else {
this.state = "run:object";
timeStamp = now();
if (this.config.object.modelPath.includes("nanodet"))
if ((_k = this.config.object.modelPath) == null ? void 0 : _k.includes("nanodet"))
objectRes = this.config.object.enabled ? await predict9(this.process.tensor, this.config) : [];
else if (this.config.object.modelPath.includes("centernet"))
else if ((_l = this.config.object.modelPath) == null ? void 0 : _l.includes("centernet"))
objectRes = this.config.object.enabled ? await predict10(this.process.tensor, this.config) : [];
elapsedTime = Math.trunc(now() - timeStamp);
if (elapsedTime > 0)
@ -71670,7 +71680,7 @@ var Human = class {
}
this.performance.total = Math.trunc(now() - timeStart);
this.state = "idle";
const shape = ((_b = (_a = this.process) == null ? void 0 : _a.tensor) == null ? void 0 : _b.shape) || [];
const shape = ((_n = (_m = this.process) == null ? void 0 : _m.tensor) == null ? void 0 : _n.shape) || [];
this.result = {
face: faceRes,
body: bodyRes,
@ -71724,7 +71734,8 @@ _warmupCanvas = new WeakMap();
_warmupNode = new WeakMap();
export {
Human,
Human as default
Human as default,
config as defaults
};
/**
* @license

File diff suppressed because one or more lines are too long

150
dist/human.js vendored

File diff suppressed because one or more lines are too long

118
dist/human.node-gpu.js vendored
View File

@ -84,7 +84,8 @@ var require_tfjs_esm = __commonJS({
// src/human.ts
__export(exports, {
Human: () => Human,
default: () => Human
default: () => Human,
defaults: () => config
});
// src/helpers.ts
@ -500,6 +501,7 @@ var BlazeFaceModel = class {
this.config = config3;
}
async getBoundingBoxes(inputImage, userConfig) {
var _a, _b, _c, _d;
if (!inputImage || inputImage["isDisposedInternal"] || inputImage.shape.length !== 4 || inputImage.shape[1] < 1 || inputImage.shape[2] < 1)
return null;
const [batch, boxes, scores] = tf3.tidy(() => {
@ -522,14 +524,14 @@ var BlazeFaceModel = class {
return [batchOut, boxesOut, scoresOut];
});
this.config = mergeDeep(this.config, userConfig);
const nmsTensor = await tf3.image.nonMaxSuppressionAsync(boxes, scores, this.config.face.detector.maxDetected, this.config.face.detector.iouThreshold, this.config.face.detector.minConfidence);
const nmsTensor = await tf3.image.nonMaxSuppressionAsync(boxes, scores, ((_a = this.config.face.detector) == null ? void 0 : _a.maxDetected) || 0, ((_b = this.config.face.detector) == null ? void 0 : _b.iouThreshold) || 0, ((_c = this.config.face.detector) == null ? void 0 : _c.minConfidence) || 0);
const nms = await nmsTensor.array();
tf3.dispose(nmsTensor);
const annotatedBoxes = [];
const scoresData = await scores.data();
for (let i = 0; i < nms.length; i++) {
const confidence = scoresData[nms[i]];
if (confidence > this.config.face.detector.minConfidence) {
if (confidence > (((_d = this.config.face.detector) == null ? void 0 : _d.minConfidence) || 0)) {
const boundingBox = tf3.slice(boxes, [nms[i], 0], [1, -1]);
const localBox = createBox(boundingBox);
tf3.dispose(boundingBox);
@ -548,10 +550,11 @@ var BlazeFaceModel = class {
}
};
async function load(config3) {
const model10 = await tf3.loadGraphModel(join(config3.modelBasePath, config3.face.detector.modelPath), { fromTFHub: config3.face.detector.modelPath.includes("tfhub.dev") });
var _a, _b, _c;
const model10 = await tf3.loadGraphModel(join(config3.modelBasePath, ((_a = config3.face.detector) == null ? void 0 : _a.modelPath) || ""), { fromTFHub: (((_b = config3.face.detector) == null ? void 0 : _b.modelPath) || "").includes("tfhub.dev") });
const blazeFace = new BlazeFaceModel(model10, config3);
if (!model10 || !model10.modelUrl)
log("load model failed:", config3.face.detector.modelPath);
log("load model failed:", ((_c = config3.face.detector) == null ? void 0 : _c.modelPath) || "");
else if (config3.debug)
log("load model:", model10.modelUrl);
return blazeFace;
@ -4190,11 +4193,12 @@ var last = [];
var lastCount = 0;
var skipped = Number.MAX_SAFE_INTEGER;
async function load3(config3) {
const modelUrl = join(config3.modelBasePath, config3.face.description.modelPath);
var _a, _b;
const modelUrl = join(config3.modelBasePath, ((_a = config3.face.description) == null ? void 0 : _a.modelPath) || "");
if (!model) {
model = await tf6.loadGraphModel(modelUrl);
if (!model)
log("load model failed:", config3.face.description.modelPath);
log("load model failed:", ((_b = config3.face.description) == null ? void 0 : _b.modelPath) || "");
else if (config3.debug)
log("load model:", modelUrl);
} else if (config3.debug)
@ -4240,15 +4244,16 @@ function enhance(input) {
return image18;
}
async function predict2(image18, config3, idx, count2) {
var _a, _b;
var _a, _b, _c;
if (!model)
return null;
if (skipped < config3.face.description.skipFrames && config3.skipFrame && lastCount === count2 && ((_a = last[idx]) == null ? void 0 : _a.age) && ((_b = last[idx]) == null ? void 0 : _b.age) > 0) {
if (skipped < (((_a = config3.face.description) == null ? void 0 : _a.skipFrames) || 0) && config3.skipFrame && lastCount === count2 && ((_b = last[idx]) == null ? void 0 : _b.age) && ((_c = last[idx]) == null ? void 0 : _c.age) > 0) {
skipped++;
return last[idx];
}
skipped = 0;
return new Promise(async (resolve) => {
var _a2, _b2;
const enhanced = enhance(image18);
let resT;
const obj = {
@ -4257,13 +4262,13 @@ async function predict2(image18, config3, idx, count2) {
genderScore: 0,
descriptor: []
};
if (config3.face.description.enabled)
if ((_a2 = config3.face.description) == null ? void 0 : _a2.enabled)
resT = await model.predict(enhanced);
tf6.dispose(enhanced);
if (resT) {
const gender = await resT.find((t) => t.shape[1] === 1).data();
const confidence = Math.trunc(200 * Math.abs(gender[0] - 0.5)) / 100;
if (confidence > config3.face.description.minConfidence) {
if (confidence > (((_b2 = config3.face.description) == null ? void 0 : _b2.minConfidence) || 0)) {
obj.gender = gender[0] <= 0.5 ? "female" : "male";
obj.genderScore = Math.min(0.99, confidence);
}
@ -4291,10 +4296,11 @@ var lastCount2 = 0;
var skipped2 = Number.MAX_SAFE_INTEGER;
var rgb = [0.2989, 0.587, 0.114];
async function load4(config3) {
var _a, _b;
if (!model2) {
model2 = await tf7.loadGraphModel(join(config3.modelBasePath, config3.face.emotion.modelPath));
model2 = await tf7.loadGraphModel(join(config3.modelBasePath, ((_a = config3.face.emotion) == null ? void 0 : _a.modelPath) || ""));
if (!model2 || !model2.modelUrl)
log("load model failed:", config3.face.emotion.modelPath);
log("load model failed:", ((_b = config3.face.emotion) == null ? void 0 : _b.modelPath) || "");
else if (config3.debug)
log("load model:", model2.modelUrl);
} else if (config3.debug)
@ -4302,14 +4308,16 @@ async function load4(config3) {
return model2;
}
async function predict3(image18, config3, idx, count2) {
var _a;
if (!model2)
return null;
if (skipped2 < config3.face.emotion.skipFrames && config3.skipFrame && lastCount2 === count2 && last2[idx] && last2[idx].length > 0) {
if (skipped2 < (((_a = config3.face.emotion) == null ? void 0 : _a.skipFrames) || 0) && config3.skipFrame && lastCount2 === count2 && last2[idx] && last2[idx].length > 0) {
skipped2++;
return last2[idx];
}
skipped2 = 0;
return new Promise(async (resolve) => {
var _a2, _b;
const resize = tf7.image.resizeBilinear(image18, [model2.inputs[0].shape[2], model2.inputs[0].shape[1]], false);
const [red, green, blue] = tf7.split(resize, 3, 3);
tf7.dispose(resize);
@ -4326,12 +4334,12 @@ async function predict3(image18, config3, idx, count2) {
const normalize = tf7.tidy(() => tf7.mul(tf7.sub(grayscale, 0.5), 2));
tf7.dispose(grayscale);
const obj = [];
if (config3.face.emotion.enabled) {
if ((_a2 = config3.face.emotion) == null ? void 0 : _a2.enabled) {
const emotionT = await model2.predict(normalize);
const data = await emotionT.data();
tf7.dispose(emotionT);
for (let i = 0; i < data.length; i++) {
if (data[i] > config3.face.emotion.minConfidence)
if (data[i] > (((_b = config3.face.emotion) == null ? void 0 : _b.minConfidence) || 0))
obj.push({ score: Math.min(0.99, Math.trunc(100 * data[i]) / 100), emotion: annotations[i] });
}
obj.sort((a, b) => b.score - a.score);
@ -4677,7 +4685,7 @@ async function predict4(input, config3) {
}
async function load5(config3) {
if (!model3) {
model3 = await tf8.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath));
model3 = await tf8.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath || ""));
if (!model3 || !model3["modelUrl"])
log("load model failed:", config3.body.modelPath);
else if (config3.debug)
@ -8398,18 +8406,19 @@ async function predict5(input, config3) {
return hands;
}
async function load6(config3) {
var _a, _b, _c, _d, _e, _f;
if (!handDetectorModel || !handPoseModel) {
[handDetectorModel, handPoseModel] = await Promise.all([
config3.hand.enabled ? tf12.loadGraphModel(join(config3.modelBasePath, config3.hand.detector.modelPath), { fromTFHub: config3.hand.detector.modelPath.includes("tfhub.dev") }) : null,
config3.hand.landmarks ? tf12.loadGraphModel(join(config3.modelBasePath, config3.hand.skeleton.modelPath), { fromTFHub: config3.hand.skeleton.modelPath.includes("tfhub.dev") }) : null
config3.hand.enabled ? tf12.loadGraphModel(join(config3.modelBasePath, ((_a = config3.hand.detector) == null ? void 0 : _a.modelPath) || ""), { fromTFHub: (((_b = config3.hand.detector) == null ? void 0 : _b.modelPath) || "").includes("tfhub.dev") }) : null,
config3.hand.landmarks ? tf12.loadGraphModel(join(config3.modelBasePath, ((_c = config3.hand.skeleton) == null ? void 0 : _c.modelPath) || ""), { fromTFHub: (((_d = config3.hand.skeleton) == null ? void 0 : _d.modelPath) || "").includes("tfhub.dev") }) : null
]);
if (config3.hand.enabled) {
if (!handDetectorModel || !handDetectorModel["modelUrl"])
log("load model failed:", config3.hand.detector.modelPath);
log("load model failed:", ((_e = config3.hand.detector) == null ? void 0 : _e.modelPath) || "");
else if (config3.debug)
log("load model:", handDetectorModel["modelUrl"]);
if (!handPoseModel || !handPoseModel["modelUrl"])
log("load model failed:", config3.hand.skeleton.modelPath);
log("load model failed:", ((_f = config3.hand.skeleton) == null ? void 0 : _f.modelPath) || "");
else if (config3.debug)
log("load model:", handPoseModel["modelUrl"]);
}
@ -8507,7 +8516,7 @@ var upper = [
var model4;
async function load7(config3) {
if (!model4) {
model4 = await tf13.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath));
model4 = await tf13.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath || ""));
model4["width"] = parseInt(model4["signature"].inputs["input_1:0"].tensorShape.dim[2].size);
model4["height"] = parseInt(model4["signature"].inputs["input_1:0"].tensorShape.dim[1].size);
if (!model4 || !model4["modelUrl"])
@ -8577,7 +8586,7 @@ var skipped3 = Number.MAX_SAFE_INTEGER;
var bodyParts = ["head", "neck", "rightShoulder", "rightElbow", "rightWrist", "chest", "leftShoulder", "leftElbow", "leftWrist", "pelvis", "rightHip", "rightKnee", "rightAnkle", "leftHip", "leftKnee", "leftAnkle"];
async function load8(config3) {
if (!model5) {
model5 = await tf14.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath));
model5 = await tf14.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath || ""));
if (!model5 || !model5["modelUrl"])
log("load model failed:", config3.body.modelPath);
else if (config3.debug)
@ -8602,12 +8611,14 @@ function max2d(inputs, minScore) {
});
}
async function predict7(image18, config3) {
if (skipped3 < config3.body.skipFrames && config3.skipFrame && Object.keys(keypoints).length > 0) {
var _a;
if (skipped3 < (((_a = config3.body) == null ? void 0 : _a.skipFrames) || 0) && config3.skipFrame && Object.keys(keypoints).length > 0) {
skipped3++;
return [{ id: 0, score, box: box4, boxRaw, keypoints }];
}
skipped3 = 0;
return new Promise(async (resolve) => {
var _a2;
const tensor2 = tf14.tidy(() => {
if (!model5.inputs[0].shape)
return null;
@ -8628,7 +8639,7 @@ async function predict7(image18, config3) {
tf14.dispose(squeeze7);
for (let id = 0; id < stack2.length; id++) {
const [x2, y2, partScore] = max2d(stack2[id], config3.body.minConfidence);
if (score > config3.body.minConfidence) {
if (score > (((_a2 = config3.body) == null ? void 0 : _a2.minConfidence) || 0)) {
keypoints.push({
score: Math.round(100 * partScore) / 100,
part: bodyParts[id],
@ -8677,7 +8688,7 @@ var skipped4 = Number.MAX_SAFE_INTEGER;
var bodyParts2 = ["nose", "leftEye", "rightEye", "leftEar", "rightEar", "leftShoulder", "rightShoulder", "leftElbow", "rightElbow", "leftWrist", "rightWrist", "leftHip", "rightHip", "leftKnee", "rightKnee", "leftAnkle", "rightAnkle"];
async function load9(config3) {
if (!model6) {
model6 = await tf15.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath));
model6 = await tf15.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath || ""));
if (!model6 || !model6["modelUrl"])
log("load model failed:", config3.body.modelPath);
else if (config3.debug)
@ -8769,7 +8780,7 @@ async function parseMultiPose(res, config3, image18) {
return persons2;
}
async function predict8(image18, config3) {
if (skipped4 < config3.body.skipFrames && config3.skipFrame && Object.keys(keypoints2).length > 0) {
if (skipped4 < (config3.body.skipFrames || 0) && config3.skipFrame && Object.keys(keypoints2).length > 0) {
skipped4++;
return [{ id: 0, score: score2, box: box5, boxRaw: boxRaw2, keypoints: keypoints2 }];
}
@ -8896,7 +8907,7 @@ var skipped5 = Number.MAX_SAFE_INTEGER;
var scaleBox = 2.5;
async function load10(config3) {
if (!model7) {
model7 = await tf16.loadGraphModel(join(config3.modelBasePath, config3.object.modelPath));
model7 = await tf16.loadGraphModel(join(config3.modelBasePath, config3.object.modelPath || ""));
const inputs = Object.values(model7.modelSignature["inputs"]);
model7.inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : null;
if (!model7.inputSize)
@ -8971,7 +8982,7 @@ async function process2(res, inputSize, outputShape, config3) {
return results;
}
async function predict9(image18, config3) {
if (skipped5 < config3.object.skipFrames && config3.skipFrame && last3.length > 0) {
if (skipped5 < (config3.object.skipFrames || 0) && config3.skipFrame && last3.length > 0) {
skipped5++;
return last3;
}
@ -9000,7 +9011,7 @@ var last4 = [];
var skipped6 = Number.MAX_SAFE_INTEGER;
async function load11(config3) {
if (!model8) {
model8 = await tf17.loadGraphModel(join(config3.modelBasePath, config3.object.modelPath));
model8 = await tf17.loadGraphModel(join(config3.modelBasePath, config3.object.modelPath || ""));
const inputs = Object.values(model8.modelSignature["inputs"]);
model8.inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : null;
if (!model8.inputSize)
@ -9059,7 +9070,7 @@ async function process3(res, inputSize, outputShape, config3) {
return results;
}
async function predict10(input, config3) {
if (skipped6 < config3.object.skipFrames && config3.skipFrame && last4.length > 0) {
if (skipped6 < (config3.object.skipFrames || 0) && config3.skipFrame && last4.length > 0) {
skipped6++;
return last4;
}
@ -9819,14 +9830,14 @@ function process4(input, config3) {
targetHeight = maxSize;
targetWidth = targetHeight * originalWidth / originalHeight;
}
if (config3.filter.width > 0)
if ((config3.filter.width || 0) > 0)
targetWidth = config3.filter.width;
else if (config3.filter.height > 0)
targetWidth = originalWidth * (config3.filter.height / originalHeight);
if (config3.filter.height > 0)
else if ((config3.filter.height || 0) > 0)
targetWidth = originalWidth * ((config3.filter.height || 0) / originalHeight);
if ((config3.filter.height || 0) > 0)
targetHeight = config3.filter.height;
else if (config3.filter.width > 0)
targetHeight = originalHeight * (config3.filter.width / originalWidth);
else if ((config3.filter.width || 0) > 0)
targetHeight = originalHeight * ((config3.filter.width || 0) / originalWidth);
if (!targetWidth || !targetHeight)
throw new Error("Human: Input cannot determine dimension");
if (!inCanvas || (inCanvas == null ? void 0 : inCanvas.width) !== targetWidth || (inCanvas == null ? void 0 : inCanvas.height) !== targetHeight) {
@ -9934,7 +9945,7 @@ var model9;
var busy = false;
async function load12(config3) {
if (!model9) {
model9 = await tf19.loadGraphModel(join(config3.modelBasePath, config3.segmentation.modelPath));
model9 = await tf19.loadGraphModel(join(config3.modelBasePath, config3.segmentation.modelPath || ""));
if (!model9 || !model9["modelUrl"])
log("load model failed:", config3.segmentation.modelPath);
else if (config3.debug)
@ -12072,7 +12083,7 @@ var Human = class {
}
async detect(input, userConfig) {
return new Promise(async (resolve) => {
var _a, _b;
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
this.state = "config";
let timeStamp;
let elapsedTime;
@ -12139,26 +12150,26 @@ var Human = class {
}
this.analyze("Start Body:");
if (this.config.async) {
if (this.config.body.modelPath.includes("posenet"))
if ((_a = this.config.body.modelPath) == null ? void 0 : _a.includes("posenet"))
bodyRes = this.config.body.enabled ? predict4(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes("blazepose"))
else if ((_b = this.config.body.modelPath) == null ? void 0 : _b.includes("blazepose"))
bodyRes = this.config.body.enabled ? predict6(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes("efficientpose"))
else if ((_c = this.config.body.modelPath) == null ? void 0 : _c.includes("efficientpose"))
bodyRes = this.config.body.enabled ? predict7(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes("movenet"))
else if ((_d = this.config.body.modelPath) == null ? void 0 : _d.includes("movenet"))
bodyRes = this.config.body.enabled ? predict8(this.process.tensor, this.config) : [];
if (this.performance.body)
delete this.performance.body;
} else {
this.state = "run:body";
timeStamp = now();
if (this.config.body.modelPath.includes("posenet"))
if ((_e = this.config.body.modelPath) == null ? void 0 : _e.includes("posenet"))
bodyRes = this.config.body.enabled ? await predict4(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes("blazepose"))
else if ((_f = this.config.body.modelPath) == null ? void 0 : _f.includes("blazepose"))
bodyRes = this.config.body.enabled ? await predict6(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes("efficientpose"))
else if ((_g = this.config.body.modelPath) == null ? void 0 : _g.includes("efficientpose"))
bodyRes = this.config.body.enabled ? await predict7(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes("movenet"))
else if ((_h = this.config.body.modelPath) == null ? void 0 : _h.includes("movenet"))
bodyRes = this.config.body.enabled ? await predict8(this.process.tensor, this.config) : [];
elapsedTime = Math.trunc(now() - timeStamp);
if (elapsedTime > 0)
@ -12181,18 +12192,18 @@ var Human = class {
this.analyze("End Hand:");
this.analyze("Start Object:");
if (this.config.async) {
if (this.config.object.modelPath.includes("nanodet"))
if ((_i = this.config.object.modelPath) == null ? void 0 : _i.includes("nanodet"))
objectRes = this.config.object.enabled ? predict9(this.process.tensor, this.config) : [];
else if (this.config.object.modelPath.includes("centernet"))
else if ((_j = this.config.object.modelPath) == null ? void 0 : _j.includes("centernet"))
objectRes = this.config.object.enabled ? predict10(this.process.tensor, this.config) : [];
if (this.performance.object)
delete this.performance.object;
} else {
this.state = "run:object";
timeStamp = now();
if (this.config.object.modelPath.includes("nanodet"))
if ((_k = this.config.object.modelPath) == null ? void 0 : _k.includes("nanodet"))
objectRes = this.config.object.enabled ? await predict9(this.process.tensor, this.config) : [];
else if (this.config.object.modelPath.includes("centernet"))
else if ((_l = this.config.object.modelPath) == null ? void 0 : _l.includes("centernet"))
objectRes = this.config.object.enabled ? await predict10(this.process.tensor, this.config) : [];
elapsedTime = Math.trunc(now() - timeStamp);
if (elapsedTime > 0)
@ -12212,7 +12223,7 @@ var Human = class {
}
this.performance.total = Math.trunc(now() - timeStart);
this.state = "idle";
const shape = ((_b = (_a = this.process) == null ? void 0 : _a.tensor) == null ? void 0 : _b.shape) || [];
const shape = ((_n = (_m = this.process) == null ? void 0 : _m.tensor) == null ? void 0 : _n.shape) || [];
this.result = {
face: faceRes,
body: bodyRes,
@ -12266,5 +12277,6 @@ _warmupCanvas = new WeakMap();
_warmupNode = new WeakMap();
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Human
Human,
defaults
});

View File

@ -85,7 +85,8 @@ var require_tfjs_esm = __commonJS({
// src/human.ts
__export(exports, {
Human: () => Human,
default: () => Human
default: () => Human,
defaults: () => config
});
// src/helpers.ts
@ -501,6 +502,7 @@ var BlazeFaceModel = class {
this.config = config3;
}
async getBoundingBoxes(inputImage, userConfig) {
var _a, _b, _c, _d;
if (!inputImage || inputImage["isDisposedInternal"] || inputImage.shape.length !== 4 || inputImage.shape[1] < 1 || inputImage.shape[2] < 1)
return null;
const [batch, boxes, scores] = tf3.tidy(() => {
@ -523,14 +525,14 @@ var BlazeFaceModel = class {
return [batchOut, boxesOut, scoresOut];
});
this.config = mergeDeep(this.config, userConfig);
const nmsTensor = await tf3.image.nonMaxSuppressionAsync(boxes, scores, this.config.face.detector.maxDetected, this.config.face.detector.iouThreshold, this.config.face.detector.minConfidence);
const nmsTensor = await tf3.image.nonMaxSuppressionAsync(boxes, scores, ((_a = this.config.face.detector) == null ? void 0 : _a.maxDetected) || 0, ((_b = this.config.face.detector) == null ? void 0 : _b.iouThreshold) || 0, ((_c = this.config.face.detector) == null ? void 0 : _c.minConfidence) || 0);
const nms = await nmsTensor.array();
tf3.dispose(nmsTensor);
const annotatedBoxes = [];
const scoresData = await scores.data();
for (let i = 0; i < nms.length; i++) {
const confidence = scoresData[nms[i]];
if (confidence > this.config.face.detector.minConfidence) {
if (confidence > (((_d = this.config.face.detector) == null ? void 0 : _d.minConfidence) || 0)) {
const boundingBox = tf3.slice(boxes, [nms[i], 0], [1, -1]);
const localBox = createBox(boundingBox);
tf3.dispose(boundingBox);
@ -549,10 +551,11 @@ var BlazeFaceModel = class {
}
};
async function load(config3) {
const model10 = await tf3.loadGraphModel(join(config3.modelBasePath, config3.face.detector.modelPath), { fromTFHub: config3.face.detector.modelPath.includes("tfhub.dev") });
var _a, _b, _c;
const model10 = await tf3.loadGraphModel(join(config3.modelBasePath, ((_a = config3.face.detector) == null ? void 0 : _a.modelPath) || ""), { fromTFHub: (((_b = config3.face.detector) == null ? void 0 : _b.modelPath) || "").includes("tfhub.dev") });
const blazeFace = new BlazeFaceModel(model10, config3);
if (!model10 || !model10.modelUrl)
log("load model failed:", config3.face.detector.modelPath);
log("load model failed:", ((_c = config3.face.detector) == null ? void 0 : _c.modelPath) || "");
else if (config3.debug)
log("load model:", model10.modelUrl);
return blazeFace;
@ -4191,11 +4194,12 @@ var last = [];
var lastCount = 0;
var skipped = Number.MAX_SAFE_INTEGER;
async function load3(config3) {
const modelUrl = join(config3.modelBasePath, config3.face.description.modelPath);
var _a, _b;
const modelUrl = join(config3.modelBasePath, ((_a = config3.face.description) == null ? void 0 : _a.modelPath) || "");
if (!model) {
model = await tf6.loadGraphModel(modelUrl);
if (!model)
log("load model failed:", config3.face.description.modelPath);
log("load model failed:", ((_b = config3.face.description) == null ? void 0 : _b.modelPath) || "");
else if (config3.debug)
log("load model:", modelUrl);
} else if (config3.debug)
@ -4241,15 +4245,16 @@ function enhance(input) {
return image18;
}
async function predict2(image18, config3, idx, count2) {
var _a, _b;
var _a, _b, _c;
if (!model)
return null;
if (skipped < config3.face.description.skipFrames && config3.skipFrame && lastCount === count2 && ((_a = last[idx]) == null ? void 0 : _a.age) && ((_b = last[idx]) == null ? void 0 : _b.age) > 0) {
if (skipped < (((_a = config3.face.description) == null ? void 0 : _a.skipFrames) || 0) && config3.skipFrame && lastCount === count2 && ((_b = last[idx]) == null ? void 0 : _b.age) && ((_c = last[idx]) == null ? void 0 : _c.age) > 0) {
skipped++;
return last[idx];
}
skipped = 0;
return new Promise(async (resolve) => {
var _a2, _b2;
const enhanced = enhance(image18);
let resT;
const obj = {
@ -4258,13 +4263,13 @@ async function predict2(image18, config3, idx, count2) {
genderScore: 0,
descriptor: []
};
if (config3.face.description.enabled)
if ((_a2 = config3.face.description) == null ? void 0 : _a2.enabled)
resT = await model.predict(enhanced);
tf6.dispose(enhanced);
if (resT) {
const gender = await resT.find((t) => t.shape[1] === 1).data();
const confidence = Math.trunc(200 * Math.abs(gender[0] - 0.5)) / 100;
if (confidence > config3.face.description.minConfidence) {
if (confidence > (((_b2 = config3.face.description) == null ? void 0 : _b2.minConfidence) || 0)) {
obj.gender = gender[0] <= 0.5 ? "female" : "male";
obj.genderScore = Math.min(0.99, confidence);
}
@ -4292,10 +4297,11 @@ var lastCount2 = 0;
var skipped2 = Number.MAX_SAFE_INTEGER;
var rgb = [0.2989, 0.587, 0.114];
async function load4(config3) {
var _a, _b;
if (!model2) {
model2 = await tf7.loadGraphModel(join(config3.modelBasePath, config3.face.emotion.modelPath));
model2 = await tf7.loadGraphModel(join(config3.modelBasePath, ((_a = config3.face.emotion) == null ? void 0 : _a.modelPath) || ""));
if (!model2 || !model2.modelUrl)
log("load model failed:", config3.face.emotion.modelPath);
log("load model failed:", ((_b = config3.face.emotion) == null ? void 0 : _b.modelPath) || "");
else if (config3.debug)
log("load model:", model2.modelUrl);
} else if (config3.debug)
@ -4303,14 +4309,16 @@ async function load4(config3) {
return model2;
}
async function predict3(image18, config3, idx, count2) {
var _a;
if (!model2)
return null;
if (skipped2 < config3.face.emotion.skipFrames && config3.skipFrame && lastCount2 === count2 && last2[idx] && last2[idx].length > 0) {
if (skipped2 < (((_a = config3.face.emotion) == null ? void 0 : _a.skipFrames) || 0) && config3.skipFrame && lastCount2 === count2 && last2[idx] && last2[idx].length > 0) {
skipped2++;
return last2[idx];
}
skipped2 = 0;
return new Promise(async (resolve) => {
var _a2, _b;
const resize = tf7.image.resizeBilinear(image18, [model2.inputs[0].shape[2], model2.inputs[0].shape[1]], false);
const [red, green, blue] = tf7.split(resize, 3, 3);
tf7.dispose(resize);
@ -4327,12 +4335,12 @@ async function predict3(image18, config3, idx, count2) {
const normalize = tf7.tidy(() => tf7.mul(tf7.sub(grayscale, 0.5), 2));
tf7.dispose(grayscale);
const obj = [];
if (config3.face.emotion.enabled) {
if ((_a2 = config3.face.emotion) == null ? void 0 : _a2.enabled) {
const emotionT = await model2.predict(normalize);
const data = await emotionT.data();
tf7.dispose(emotionT);
for (let i = 0; i < data.length; i++) {
if (data[i] > config3.face.emotion.minConfidence)
if (data[i] > (((_b = config3.face.emotion) == null ? void 0 : _b.minConfidence) || 0))
obj.push({ score: Math.min(0.99, Math.trunc(100 * data[i]) / 100), emotion: annotations[i] });
}
obj.sort((a, b) => b.score - a.score);
@ -4678,7 +4686,7 @@ async function predict4(input, config3) {
}
async function load5(config3) {
if (!model3) {
model3 = await tf8.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath));
model3 = await tf8.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath || ""));
if (!model3 || !model3["modelUrl"])
log("load model failed:", config3.body.modelPath);
else if (config3.debug)
@ -8399,18 +8407,19 @@ async function predict5(input, config3) {
return hands;
}
async function load6(config3) {
var _a, _b, _c, _d, _e, _f;
if (!handDetectorModel || !handPoseModel) {
[handDetectorModel, handPoseModel] = await Promise.all([
config3.hand.enabled ? tf12.loadGraphModel(join(config3.modelBasePath, config3.hand.detector.modelPath), { fromTFHub: config3.hand.detector.modelPath.includes("tfhub.dev") }) : null,
config3.hand.landmarks ? tf12.loadGraphModel(join(config3.modelBasePath, config3.hand.skeleton.modelPath), { fromTFHub: config3.hand.skeleton.modelPath.includes("tfhub.dev") }) : null
config3.hand.enabled ? tf12.loadGraphModel(join(config3.modelBasePath, ((_a = config3.hand.detector) == null ? void 0 : _a.modelPath) || ""), { fromTFHub: (((_b = config3.hand.detector) == null ? void 0 : _b.modelPath) || "").includes("tfhub.dev") }) : null,
config3.hand.landmarks ? tf12.loadGraphModel(join(config3.modelBasePath, ((_c = config3.hand.skeleton) == null ? void 0 : _c.modelPath) || ""), { fromTFHub: (((_d = config3.hand.skeleton) == null ? void 0 : _d.modelPath) || "").includes("tfhub.dev") }) : null
]);
if (config3.hand.enabled) {
if (!handDetectorModel || !handDetectorModel["modelUrl"])
log("load model failed:", config3.hand.detector.modelPath);
log("load model failed:", ((_e = config3.hand.detector) == null ? void 0 : _e.modelPath) || "");
else if (config3.debug)
log("load model:", handDetectorModel["modelUrl"]);
if (!handPoseModel || !handPoseModel["modelUrl"])
log("load model failed:", config3.hand.skeleton.modelPath);
log("load model failed:", ((_f = config3.hand.skeleton) == null ? void 0 : _f.modelPath) || "");
else if (config3.debug)
log("load model:", handPoseModel["modelUrl"]);
}
@ -8508,7 +8517,7 @@ var upper = [
var model4;
async function load7(config3) {
if (!model4) {
model4 = await tf13.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath));
model4 = await tf13.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath || ""));
model4["width"] = parseInt(model4["signature"].inputs["input_1:0"].tensorShape.dim[2].size);
model4["height"] = parseInt(model4["signature"].inputs["input_1:0"].tensorShape.dim[1].size);
if (!model4 || !model4["modelUrl"])
@ -8578,7 +8587,7 @@ var skipped3 = Number.MAX_SAFE_INTEGER;
var bodyParts = ["head", "neck", "rightShoulder", "rightElbow", "rightWrist", "chest", "leftShoulder", "leftElbow", "leftWrist", "pelvis", "rightHip", "rightKnee", "rightAnkle", "leftHip", "leftKnee", "leftAnkle"];
async function load8(config3) {
if (!model5) {
model5 = await tf14.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath));
model5 = await tf14.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath || ""));
if (!model5 || !model5["modelUrl"])
log("load model failed:", config3.body.modelPath);
else if (config3.debug)
@ -8603,12 +8612,14 @@ function max2d(inputs, minScore) {
});
}
async function predict7(image18, config3) {
if (skipped3 < config3.body.skipFrames && config3.skipFrame && Object.keys(keypoints).length > 0) {
var _a;
if (skipped3 < (((_a = config3.body) == null ? void 0 : _a.skipFrames) || 0) && config3.skipFrame && Object.keys(keypoints).length > 0) {
skipped3++;
return [{ id: 0, score, box: box4, boxRaw, keypoints }];
}
skipped3 = 0;
return new Promise(async (resolve) => {
var _a2;
const tensor2 = tf14.tidy(() => {
if (!model5.inputs[0].shape)
return null;
@ -8629,7 +8640,7 @@ async function predict7(image18, config3) {
tf14.dispose(squeeze7);
for (let id = 0; id < stack2.length; id++) {
const [x2, y2, partScore] = max2d(stack2[id], config3.body.minConfidence);
if (score > config3.body.minConfidence) {
if (score > (((_a2 = config3.body) == null ? void 0 : _a2.minConfidence) || 0)) {
keypoints.push({
score: Math.round(100 * partScore) / 100,
part: bodyParts[id],
@ -8678,7 +8689,7 @@ var skipped4 = Number.MAX_SAFE_INTEGER;
var bodyParts2 = ["nose", "leftEye", "rightEye", "leftEar", "rightEar", "leftShoulder", "rightShoulder", "leftElbow", "rightElbow", "leftWrist", "rightWrist", "leftHip", "rightHip", "leftKnee", "rightKnee", "leftAnkle", "rightAnkle"];
async function load9(config3) {
if (!model6) {
model6 = await tf15.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath));
model6 = await tf15.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath || ""));
if (!model6 || !model6["modelUrl"])
log("load model failed:", config3.body.modelPath);
else if (config3.debug)
@ -8770,7 +8781,7 @@ async function parseMultiPose(res, config3, image18) {
return persons2;
}
async function predict8(image18, config3) {
if (skipped4 < config3.body.skipFrames && config3.skipFrame && Object.keys(keypoints2).length > 0) {
if (skipped4 < (config3.body.skipFrames || 0) && config3.skipFrame && Object.keys(keypoints2).length > 0) {
skipped4++;
return [{ id: 0, score: score2, box: box5, boxRaw: boxRaw2, keypoints: keypoints2 }];
}
@ -8897,7 +8908,7 @@ var skipped5 = Number.MAX_SAFE_INTEGER;
var scaleBox = 2.5;
async function load10(config3) {
if (!model7) {
model7 = await tf16.loadGraphModel(join(config3.modelBasePath, config3.object.modelPath));
model7 = await tf16.loadGraphModel(join(config3.modelBasePath, config3.object.modelPath || ""));
const inputs = Object.values(model7.modelSignature["inputs"]);
model7.inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : null;
if (!model7.inputSize)
@ -8972,7 +8983,7 @@ async function process2(res, inputSize, outputShape, config3) {
return results;
}
async function predict9(image18, config3) {
if (skipped5 < config3.object.skipFrames && config3.skipFrame && last3.length > 0) {
if (skipped5 < (config3.object.skipFrames || 0) && config3.skipFrame && last3.length > 0) {
skipped5++;
return last3;
}
@ -9001,7 +9012,7 @@ var last4 = [];
var skipped6 = Number.MAX_SAFE_INTEGER;
async function load11(config3) {
if (!model8) {
model8 = await tf17.loadGraphModel(join(config3.modelBasePath, config3.object.modelPath));
model8 = await tf17.loadGraphModel(join(config3.modelBasePath, config3.object.modelPath || ""));
const inputs = Object.values(model8.modelSignature["inputs"]);
model8.inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : null;
if (!model8.inputSize)
@ -9060,7 +9071,7 @@ async function process3(res, inputSize, outputShape, config3) {
return results;
}
async function predict10(input, config3) {
if (skipped6 < config3.object.skipFrames && config3.skipFrame && last4.length > 0) {
if (skipped6 < (config3.object.skipFrames || 0) && config3.skipFrame && last4.length > 0) {
skipped6++;
return last4;
}
@ -9820,14 +9831,14 @@ function process4(input, config3) {
targetHeight = maxSize;
targetWidth = targetHeight * originalWidth / originalHeight;
}
if (config3.filter.width > 0)
if ((config3.filter.width || 0) > 0)
targetWidth = config3.filter.width;
else if (config3.filter.height > 0)
targetWidth = originalWidth * (config3.filter.height / originalHeight);
if (config3.filter.height > 0)
else if ((config3.filter.height || 0) > 0)
targetWidth = originalWidth * ((config3.filter.height || 0) / originalHeight);
if ((config3.filter.height || 0) > 0)
targetHeight = config3.filter.height;
else if (config3.filter.width > 0)
targetHeight = originalHeight * (config3.filter.width / originalWidth);
else if ((config3.filter.width || 0) > 0)
targetHeight = originalHeight * ((config3.filter.width || 0) / originalWidth);
if (!targetWidth || !targetHeight)
throw new Error("Human: Input cannot determine dimension");
if (!inCanvas || (inCanvas == null ? void 0 : inCanvas.width) !== targetWidth || (inCanvas == null ? void 0 : inCanvas.height) !== targetHeight) {
@ -9935,7 +9946,7 @@ var model9;
var busy = false;
async function load12(config3) {
if (!model9) {
model9 = await tf19.loadGraphModel(join(config3.modelBasePath, config3.segmentation.modelPath));
model9 = await tf19.loadGraphModel(join(config3.modelBasePath, config3.segmentation.modelPath || ""));
if (!model9 || !model9["modelUrl"])
log("load model failed:", config3.segmentation.modelPath);
else if (config3.debug)
@ -12073,7 +12084,7 @@ var Human = class {
}
async detect(input, userConfig) {
return new Promise(async (resolve) => {
var _a, _b;
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
this.state = "config";
let timeStamp;
let elapsedTime;
@ -12140,26 +12151,26 @@ var Human = class {
}
this.analyze("Start Body:");
if (this.config.async) {
if (this.config.body.modelPath.includes("posenet"))
if ((_a = this.config.body.modelPath) == null ? void 0 : _a.includes("posenet"))
bodyRes = this.config.body.enabled ? predict4(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes("blazepose"))
else if ((_b = this.config.body.modelPath) == null ? void 0 : _b.includes("blazepose"))
bodyRes = this.config.body.enabled ? predict6(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes("efficientpose"))
else if ((_c = this.config.body.modelPath) == null ? void 0 : _c.includes("efficientpose"))
bodyRes = this.config.body.enabled ? predict7(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes("movenet"))
else if ((_d = this.config.body.modelPath) == null ? void 0 : _d.includes("movenet"))
bodyRes = this.config.body.enabled ? predict8(this.process.tensor, this.config) : [];
if (this.performance.body)
delete this.performance.body;
} else {
this.state = "run:body";
timeStamp = now();
if (this.config.body.modelPath.includes("posenet"))
if ((_e = this.config.body.modelPath) == null ? void 0 : _e.includes("posenet"))
bodyRes = this.config.body.enabled ? await predict4(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes("blazepose"))
else if ((_f = this.config.body.modelPath) == null ? void 0 : _f.includes("blazepose"))
bodyRes = this.config.body.enabled ? await predict6(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes("efficientpose"))
else if ((_g = this.config.body.modelPath) == null ? void 0 : _g.includes("efficientpose"))
bodyRes = this.config.body.enabled ? await predict7(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes("movenet"))
else if ((_h = this.config.body.modelPath) == null ? void 0 : _h.includes("movenet"))
bodyRes = this.config.body.enabled ? await predict8(this.process.tensor, this.config) : [];
elapsedTime = Math.trunc(now() - timeStamp);
if (elapsedTime > 0)
@ -12182,18 +12193,18 @@ var Human = class {
this.analyze("End Hand:");
this.analyze("Start Object:");
if (this.config.async) {
if (this.config.object.modelPath.includes("nanodet"))
if ((_i = this.config.object.modelPath) == null ? void 0 : _i.includes("nanodet"))
objectRes = this.config.object.enabled ? predict9(this.process.tensor, this.config) : [];
else if (this.config.object.modelPath.includes("centernet"))
else if ((_j = this.config.object.modelPath) == null ? void 0 : _j.includes("centernet"))
objectRes = this.config.object.enabled ? predict10(this.process.tensor, this.config) : [];
if (this.performance.object)
delete this.performance.object;
} else {
this.state = "run:object";
timeStamp = now();
if (this.config.object.modelPath.includes("nanodet"))
if ((_k = this.config.object.modelPath) == null ? void 0 : _k.includes("nanodet"))
objectRes = this.config.object.enabled ? await predict9(this.process.tensor, this.config) : [];
else if (this.config.object.modelPath.includes("centernet"))
else if ((_l = this.config.object.modelPath) == null ? void 0 : _l.includes("centernet"))
objectRes = this.config.object.enabled ? await predict10(this.process.tensor, this.config) : [];
elapsedTime = Math.trunc(now() - timeStamp);
if (elapsedTime > 0)
@ -12213,7 +12224,7 @@ var Human = class {
}
this.performance.total = Math.trunc(now() - timeStart);
this.state = "idle";
const shape = ((_b = (_a = this.process) == null ? void 0 : _a.tensor) == null ? void 0 : _b.shape) || [];
const shape = ((_n = (_m = this.process) == null ? void 0 : _m.tensor) == null ? void 0 : _n.shape) || [];
this.result = {
face: faceRes,
body: bodyRes,
@ -12267,5 +12278,6 @@ _warmupCanvas = new WeakMap();
_warmupNode = new WeakMap();
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Human
Human,
defaults
});

118
dist/human.node.js vendored
View File

@ -84,7 +84,8 @@ var require_tfjs_esm = __commonJS({
// src/human.ts
__export(exports, {
Human: () => Human,
default: () => Human
default: () => Human,
defaults: () => config
});
// src/helpers.ts
@ -500,6 +501,7 @@ var BlazeFaceModel = class {
this.config = config3;
}
async getBoundingBoxes(inputImage, userConfig) {
var _a, _b, _c, _d;
if (!inputImage || inputImage["isDisposedInternal"] || inputImage.shape.length !== 4 || inputImage.shape[1] < 1 || inputImage.shape[2] < 1)
return null;
const [batch, boxes, scores] = tf3.tidy(() => {
@ -522,14 +524,14 @@ var BlazeFaceModel = class {
return [batchOut, boxesOut, scoresOut];
});
this.config = mergeDeep(this.config, userConfig);
const nmsTensor = await tf3.image.nonMaxSuppressionAsync(boxes, scores, this.config.face.detector.maxDetected, this.config.face.detector.iouThreshold, this.config.face.detector.minConfidence);
const nmsTensor = await tf3.image.nonMaxSuppressionAsync(boxes, scores, ((_a = this.config.face.detector) == null ? void 0 : _a.maxDetected) || 0, ((_b = this.config.face.detector) == null ? void 0 : _b.iouThreshold) || 0, ((_c = this.config.face.detector) == null ? void 0 : _c.minConfidence) || 0);
const nms = await nmsTensor.array();
tf3.dispose(nmsTensor);
const annotatedBoxes = [];
const scoresData = await scores.data();
for (let i = 0; i < nms.length; i++) {
const confidence = scoresData[nms[i]];
if (confidence > this.config.face.detector.minConfidence) {
if (confidence > (((_d = this.config.face.detector) == null ? void 0 : _d.minConfidence) || 0)) {
const boundingBox = tf3.slice(boxes, [nms[i], 0], [1, -1]);
const localBox = createBox(boundingBox);
tf3.dispose(boundingBox);
@ -548,10 +550,11 @@ var BlazeFaceModel = class {
}
};
async function load(config3) {
const model10 = await tf3.loadGraphModel(join(config3.modelBasePath, config3.face.detector.modelPath), { fromTFHub: config3.face.detector.modelPath.includes("tfhub.dev") });
var _a, _b, _c;
const model10 = await tf3.loadGraphModel(join(config3.modelBasePath, ((_a = config3.face.detector) == null ? void 0 : _a.modelPath) || ""), { fromTFHub: (((_b = config3.face.detector) == null ? void 0 : _b.modelPath) || "").includes("tfhub.dev") });
const blazeFace = new BlazeFaceModel(model10, config3);
if (!model10 || !model10.modelUrl)
log("load model failed:", config3.face.detector.modelPath);
log("load model failed:", ((_c = config3.face.detector) == null ? void 0 : _c.modelPath) || "");
else if (config3.debug)
log("load model:", model10.modelUrl);
return blazeFace;
@ -4190,11 +4193,12 @@ var last = [];
var lastCount = 0;
var skipped = Number.MAX_SAFE_INTEGER;
async function load3(config3) {
const modelUrl = join(config3.modelBasePath, config3.face.description.modelPath);
var _a, _b;
const modelUrl = join(config3.modelBasePath, ((_a = config3.face.description) == null ? void 0 : _a.modelPath) || "");
if (!model) {
model = await tf6.loadGraphModel(modelUrl);
if (!model)
log("load model failed:", config3.face.description.modelPath);
log("load model failed:", ((_b = config3.face.description) == null ? void 0 : _b.modelPath) || "");
else if (config3.debug)
log("load model:", modelUrl);
} else if (config3.debug)
@ -4240,15 +4244,16 @@ function enhance(input) {
return image18;
}
async function predict2(image18, config3, idx, count2) {
var _a, _b;
var _a, _b, _c;
if (!model)
return null;
if (skipped < config3.face.description.skipFrames && config3.skipFrame && lastCount === count2 && ((_a = last[idx]) == null ? void 0 : _a.age) && ((_b = last[idx]) == null ? void 0 : _b.age) > 0) {
if (skipped < (((_a = config3.face.description) == null ? void 0 : _a.skipFrames) || 0) && config3.skipFrame && lastCount === count2 && ((_b = last[idx]) == null ? void 0 : _b.age) && ((_c = last[idx]) == null ? void 0 : _c.age) > 0) {
skipped++;
return last[idx];
}
skipped = 0;
return new Promise(async (resolve) => {
var _a2, _b2;
const enhanced = enhance(image18);
let resT;
const obj = {
@ -4257,13 +4262,13 @@ async function predict2(image18, config3, idx, count2) {
genderScore: 0,
descriptor: []
};
if (config3.face.description.enabled)
if ((_a2 = config3.face.description) == null ? void 0 : _a2.enabled)
resT = await model.predict(enhanced);
tf6.dispose(enhanced);
if (resT) {
const gender = await resT.find((t) => t.shape[1] === 1).data();
const confidence = Math.trunc(200 * Math.abs(gender[0] - 0.5)) / 100;
if (confidence > config3.face.description.minConfidence) {
if (confidence > (((_b2 = config3.face.description) == null ? void 0 : _b2.minConfidence) || 0)) {
obj.gender = gender[0] <= 0.5 ? "female" : "male";
obj.genderScore = Math.min(0.99, confidence);
}
@ -4291,10 +4296,11 @@ var lastCount2 = 0;
var skipped2 = Number.MAX_SAFE_INTEGER;
var rgb = [0.2989, 0.587, 0.114];
async function load4(config3) {
var _a, _b;
if (!model2) {
model2 = await tf7.loadGraphModel(join(config3.modelBasePath, config3.face.emotion.modelPath));
model2 = await tf7.loadGraphModel(join(config3.modelBasePath, ((_a = config3.face.emotion) == null ? void 0 : _a.modelPath) || ""));
if (!model2 || !model2.modelUrl)
log("load model failed:", config3.face.emotion.modelPath);
log("load model failed:", ((_b = config3.face.emotion) == null ? void 0 : _b.modelPath) || "");
else if (config3.debug)
log("load model:", model2.modelUrl);
} else if (config3.debug)
@ -4302,14 +4308,16 @@ async function load4(config3) {
return model2;
}
async function predict3(image18, config3, idx, count2) {
var _a;
if (!model2)
return null;
if (skipped2 < config3.face.emotion.skipFrames && config3.skipFrame && lastCount2 === count2 && last2[idx] && last2[idx].length > 0) {
if (skipped2 < (((_a = config3.face.emotion) == null ? void 0 : _a.skipFrames) || 0) && config3.skipFrame && lastCount2 === count2 && last2[idx] && last2[idx].length > 0) {
skipped2++;
return last2[idx];
}
skipped2 = 0;
return new Promise(async (resolve) => {
var _a2, _b;
const resize = tf7.image.resizeBilinear(image18, [model2.inputs[0].shape[2], model2.inputs[0].shape[1]], false);
const [red, green, blue] = tf7.split(resize, 3, 3);
tf7.dispose(resize);
@ -4326,12 +4334,12 @@ async function predict3(image18, config3, idx, count2) {
const normalize = tf7.tidy(() => tf7.mul(tf7.sub(grayscale, 0.5), 2));
tf7.dispose(grayscale);
const obj = [];
if (config3.face.emotion.enabled) {
if ((_a2 = config3.face.emotion) == null ? void 0 : _a2.enabled) {
const emotionT = await model2.predict(normalize);
const data = await emotionT.data();
tf7.dispose(emotionT);
for (let i = 0; i < data.length; i++) {
if (data[i] > config3.face.emotion.minConfidence)
if (data[i] > (((_b = config3.face.emotion) == null ? void 0 : _b.minConfidence) || 0))
obj.push({ score: Math.min(0.99, Math.trunc(100 * data[i]) / 100), emotion: annotations[i] });
}
obj.sort((a, b) => b.score - a.score);
@ -4677,7 +4685,7 @@ async function predict4(input, config3) {
}
async function load5(config3) {
if (!model3) {
model3 = await tf8.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath));
model3 = await tf8.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath || ""));
if (!model3 || !model3["modelUrl"])
log("load model failed:", config3.body.modelPath);
else if (config3.debug)
@ -8398,18 +8406,19 @@ async function predict5(input, config3) {
return hands;
}
async function load6(config3) {
var _a, _b, _c, _d, _e, _f;
if (!handDetectorModel || !handPoseModel) {
[handDetectorModel, handPoseModel] = await Promise.all([
config3.hand.enabled ? tf12.loadGraphModel(join(config3.modelBasePath, config3.hand.detector.modelPath), { fromTFHub: config3.hand.detector.modelPath.includes("tfhub.dev") }) : null,
config3.hand.landmarks ? tf12.loadGraphModel(join(config3.modelBasePath, config3.hand.skeleton.modelPath), { fromTFHub: config3.hand.skeleton.modelPath.includes("tfhub.dev") }) : null
config3.hand.enabled ? tf12.loadGraphModel(join(config3.modelBasePath, ((_a = config3.hand.detector) == null ? void 0 : _a.modelPath) || ""), { fromTFHub: (((_b = config3.hand.detector) == null ? void 0 : _b.modelPath) || "").includes("tfhub.dev") }) : null,
config3.hand.landmarks ? tf12.loadGraphModel(join(config3.modelBasePath, ((_c = config3.hand.skeleton) == null ? void 0 : _c.modelPath) || ""), { fromTFHub: (((_d = config3.hand.skeleton) == null ? void 0 : _d.modelPath) || "").includes("tfhub.dev") }) : null
]);
if (config3.hand.enabled) {
if (!handDetectorModel || !handDetectorModel["modelUrl"])
log("load model failed:", config3.hand.detector.modelPath);
log("load model failed:", ((_e = config3.hand.detector) == null ? void 0 : _e.modelPath) || "");
else if (config3.debug)
log("load model:", handDetectorModel["modelUrl"]);
if (!handPoseModel || !handPoseModel["modelUrl"])
log("load model failed:", config3.hand.skeleton.modelPath);
log("load model failed:", ((_f = config3.hand.skeleton) == null ? void 0 : _f.modelPath) || "");
else if (config3.debug)
log("load model:", handPoseModel["modelUrl"]);
}
@ -8507,7 +8516,7 @@ var upper = [
var model4;
async function load7(config3) {
if (!model4) {
model4 = await tf13.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath));
model4 = await tf13.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath || ""));
model4["width"] = parseInt(model4["signature"].inputs["input_1:0"].tensorShape.dim[2].size);
model4["height"] = parseInt(model4["signature"].inputs["input_1:0"].tensorShape.dim[1].size);
if (!model4 || !model4["modelUrl"])
@ -8577,7 +8586,7 @@ var skipped3 = Number.MAX_SAFE_INTEGER;
var bodyParts = ["head", "neck", "rightShoulder", "rightElbow", "rightWrist", "chest", "leftShoulder", "leftElbow", "leftWrist", "pelvis", "rightHip", "rightKnee", "rightAnkle", "leftHip", "leftKnee", "leftAnkle"];
async function load8(config3) {
if (!model5) {
model5 = await tf14.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath));
model5 = await tf14.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath || ""));
if (!model5 || !model5["modelUrl"])
log("load model failed:", config3.body.modelPath);
else if (config3.debug)
@ -8602,12 +8611,14 @@ function max2d(inputs, minScore) {
});
}
async function predict7(image18, config3) {
if (skipped3 < config3.body.skipFrames && config3.skipFrame && Object.keys(keypoints).length > 0) {
var _a;
if (skipped3 < (((_a = config3.body) == null ? void 0 : _a.skipFrames) || 0) && config3.skipFrame && Object.keys(keypoints).length > 0) {
skipped3++;
return [{ id: 0, score, box: box4, boxRaw, keypoints }];
}
skipped3 = 0;
return new Promise(async (resolve) => {
var _a2;
const tensor2 = tf14.tidy(() => {
if (!model5.inputs[0].shape)
return null;
@ -8628,7 +8639,7 @@ async function predict7(image18, config3) {
tf14.dispose(squeeze7);
for (let id = 0; id < stack2.length; id++) {
const [x2, y2, partScore] = max2d(stack2[id], config3.body.minConfidence);
if (score > config3.body.minConfidence) {
if (score > (((_a2 = config3.body) == null ? void 0 : _a2.minConfidence) || 0)) {
keypoints.push({
score: Math.round(100 * partScore) / 100,
part: bodyParts[id],
@ -8677,7 +8688,7 @@ var skipped4 = Number.MAX_SAFE_INTEGER;
var bodyParts2 = ["nose", "leftEye", "rightEye", "leftEar", "rightEar", "leftShoulder", "rightShoulder", "leftElbow", "rightElbow", "leftWrist", "rightWrist", "leftHip", "rightHip", "leftKnee", "rightKnee", "leftAnkle", "rightAnkle"];
async function load9(config3) {
if (!model6) {
model6 = await tf15.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath));
model6 = await tf15.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath || ""));
if (!model6 || !model6["modelUrl"])
log("load model failed:", config3.body.modelPath);
else if (config3.debug)
@ -8769,7 +8780,7 @@ async function parseMultiPose(res, config3, image18) {
return persons2;
}
async function predict8(image18, config3) {
if (skipped4 < config3.body.skipFrames && config3.skipFrame && Object.keys(keypoints2).length > 0) {
if (skipped4 < (config3.body.skipFrames || 0) && config3.skipFrame && Object.keys(keypoints2).length > 0) {
skipped4++;
return [{ id: 0, score: score2, box: box5, boxRaw: boxRaw2, keypoints: keypoints2 }];
}
@ -8896,7 +8907,7 @@ var skipped5 = Number.MAX_SAFE_INTEGER;
var scaleBox = 2.5;
async function load10(config3) {
if (!model7) {
model7 = await tf16.loadGraphModel(join(config3.modelBasePath, config3.object.modelPath));
model7 = await tf16.loadGraphModel(join(config3.modelBasePath, config3.object.modelPath || ""));
const inputs = Object.values(model7.modelSignature["inputs"]);
model7.inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : null;
if (!model7.inputSize)
@ -8971,7 +8982,7 @@ async function process2(res, inputSize, outputShape, config3) {
return results;
}
async function predict9(image18, config3) {
if (skipped5 < config3.object.skipFrames && config3.skipFrame && last3.length > 0) {
if (skipped5 < (config3.object.skipFrames || 0) && config3.skipFrame && last3.length > 0) {
skipped5++;
return last3;
}
@ -9000,7 +9011,7 @@ var last4 = [];
var skipped6 = Number.MAX_SAFE_INTEGER;
async function load11(config3) {
if (!model8) {
model8 = await tf17.loadGraphModel(join(config3.modelBasePath, config3.object.modelPath));
model8 = await tf17.loadGraphModel(join(config3.modelBasePath, config3.object.modelPath || ""));
const inputs = Object.values(model8.modelSignature["inputs"]);
model8.inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : null;
if (!model8.inputSize)
@ -9059,7 +9070,7 @@ async function process3(res, inputSize, outputShape, config3) {
return results;
}
async function predict10(input, config3) {
if (skipped6 < config3.object.skipFrames && config3.skipFrame && last4.length > 0) {
if (skipped6 < (config3.object.skipFrames || 0) && config3.skipFrame && last4.length > 0) {
skipped6++;
return last4;
}
@ -9819,14 +9830,14 @@ function process4(input, config3) {
targetHeight = maxSize;
targetWidth = targetHeight * originalWidth / originalHeight;
}
if (config3.filter.width > 0)
if ((config3.filter.width || 0) > 0)
targetWidth = config3.filter.width;
else if (config3.filter.height > 0)
targetWidth = originalWidth * (config3.filter.height / originalHeight);
if (config3.filter.height > 0)
else if ((config3.filter.height || 0) > 0)
targetWidth = originalWidth * ((config3.filter.height || 0) / originalHeight);
if ((config3.filter.height || 0) > 0)
targetHeight = config3.filter.height;
else if (config3.filter.width > 0)
targetHeight = originalHeight * (config3.filter.width / originalWidth);
else if ((config3.filter.width || 0) > 0)
targetHeight = originalHeight * ((config3.filter.width || 0) / originalWidth);
if (!targetWidth || !targetHeight)
throw new Error("Human: Input cannot determine dimension");
if (!inCanvas || (inCanvas == null ? void 0 : inCanvas.width) !== targetWidth || (inCanvas == null ? void 0 : inCanvas.height) !== targetHeight) {
@ -9934,7 +9945,7 @@ var model9;
var busy = false;
async function load12(config3) {
if (!model9) {
model9 = await tf19.loadGraphModel(join(config3.modelBasePath, config3.segmentation.modelPath));
model9 = await tf19.loadGraphModel(join(config3.modelBasePath, config3.segmentation.modelPath || ""));
if (!model9 || !model9["modelUrl"])
log("load model failed:", config3.segmentation.modelPath);
else if (config3.debug)
@ -12072,7 +12083,7 @@ var Human = class {
}
async detect(input, userConfig) {
return new Promise(async (resolve) => {
var _a, _b;
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
this.state = "config";
let timeStamp;
let elapsedTime;
@ -12139,26 +12150,26 @@ var Human = class {
}
this.analyze("Start Body:");
if (this.config.async) {
if (this.config.body.modelPath.includes("posenet"))
if ((_a = this.config.body.modelPath) == null ? void 0 : _a.includes("posenet"))
bodyRes = this.config.body.enabled ? predict4(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes("blazepose"))
else if ((_b = this.config.body.modelPath) == null ? void 0 : _b.includes("blazepose"))
bodyRes = this.config.body.enabled ? predict6(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes("efficientpose"))
else if ((_c = this.config.body.modelPath) == null ? void 0 : _c.includes("efficientpose"))
bodyRes = this.config.body.enabled ? predict7(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes("movenet"))
else if ((_d = this.config.body.modelPath) == null ? void 0 : _d.includes("movenet"))
bodyRes = this.config.body.enabled ? predict8(this.process.tensor, this.config) : [];
if (this.performance.body)
delete this.performance.body;
} else {
this.state = "run:body";
timeStamp = now();
if (this.config.body.modelPath.includes("posenet"))
if ((_e = this.config.body.modelPath) == null ? void 0 : _e.includes("posenet"))
bodyRes = this.config.body.enabled ? await predict4(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes("blazepose"))
else if ((_f = this.config.body.modelPath) == null ? void 0 : _f.includes("blazepose"))
bodyRes = this.config.body.enabled ? await predict6(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes("efficientpose"))
else if ((_g = this.config.body.modelPath) == null ? void 0 : _g.includes("efficientpose"))
bodyRes = this.config.body.enabled ? await predict7(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes("movenet"))
else if ((_h = this.config.body.modelPath) == null ? void 0 : _h.includes("movenet"))
bodyRes = this.config.body.enabled ? await predict8(this.process.tensor, this.config) : [];
elapsedTime = Math.trunc(now() - timeStamp);
if (elapsedTime > 0)
@ -12181,18 +12192,18 @@ var Human = class {
this.analyze("End Hand:");
this.analyze("Start Object:");
if (this.config.async) {
if (this.config.object.modelPath.includes("nanodet"))
if ((_i = this.config.object.modelPath) == null ? void 0 : _i.includes("nanodet"))
objectRes = this.config.object.enabled ? predict9(this.process.tensor, this.config) : [];
else if (this.config.object.modelPath.includes("centernet"))
else if ((_j = this.config.object.modelPath) == null ? void 0 : _j.includes("centernet"))
objectRes = this.config.object.enabled ? predict10(this.process.tensor, this.config) : [];
if (this.performance.object)
delete this.performance.object;
} else {
this.state = "run:object";
timeStamp = now();
if (this.config.object.modelPath.includes("nanodet"))
if ((_k = this.config.object.modelPath) == null ? void 0 : _k.includes("nanodet"))
objectRes = this.config.object.enabled ? await predict9(this.process.tensor, this.config) : [];
else if (this.config.object.modelPath.includes("centernet"))
else if ((_l = this.config.object.modelPath) == null ? void 0 : _l.includes("centernet"))
objectRes = this.config.object.enabled ? await predict10(this.process.tensor, this.config) : [];
elapsedTime = Math.trunc(now() - timeStamp);
if (elapsedTime > 0)
@ -12212,7 +12223,7 @@ var Human = class {
}
this.performance.total = Math.trunc(now() - timeStart);
this.state = "idle";
const shape = ((_b = (_a = this.process) == null ? void 0 : _a.tensor) == null ? void 0 : _b.shape) || [];
const shape = ((_n = (_m = this.process) == null ? void 0 : _m.tensor) == null ? void 0 : _n.shape) || [];
this.result = {
face: faceRes,
body: bodyRes,
@ -12266,5 +12277,6 @@ _warmupCanvas = new WeakMap();
_warmupNode = new WeakMap();
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Human
Human,
defaults
});

View File

@ -62,14 +62,14 @@ export class BlazeFaceModel {
this.config = mergeDeep(this.config, userConfig) as Config;
const nmsTensor = await tf.image.nonMaxSuppressionAsync(boxes, scores, this.config.face.detector.maxDetected, this.config.face.detector.iouThreshold, this.config.face.detector.minConfidence);
const nmsTensor = await tf.image.nonMaxSuppressionAsync(boxes, scores, (this.config.face.detector?.maxDetected || 0), (this.config.face.detector?.iouThreshold || 0), (this.config.face.detector?.minConfidence || 0));
const nms = await nmsTensor.array();
tf.dispose(nmsTensor);
const annotatedBoxes: Array<{ box: { startPoint: Tensor, endPoint: Tensor }, landmarks: Tensor, anchor: number[], confidence: number }> = [];
const scoresData = await scores.data();
for (let i = 0; i < nms.length; i++) {
const confidence = scoresData[nms[i]];
if (confidence > this.config.face.detector.minConfidence) {
if (confidence > (this.config.face.detector?.minConfidence || 0)) {
const boundingBox = tf.slice(boxes, [nms[i], 0], [1, -1]);
const localBox = box.createBox(boundingBox);
tf.dispose(boundingBox);
@ -89,9 +89,9 @@ export class BlazeFaceModel {
}
export async function load(config: Config) {
const model = await tf.loadGraphModel(join(config.modelBasePath, config.face.detector.modelPath), { fromTFHub: config.face.detector.modelPath.includes('tfhub.dev') });
const model = await tf.loadGraphModel(join(config.modelBasePath, config.face.detector?.modelPath || ''), { fromTFHub: (config.face.detector?.modelPath || '').includes('tfhub.dev') });
const blazeFace = new BlazeFaceModel(model, config);
if (!model || !model.modelUrl) log('load model failed:', config.face.detector.modelPath);
if (!model || !model.modelUrl) log('load model failed:', config.face.detector?.modelPath || '');
else if (config.debug) log('load model:', model.modelUrl);
return blazeFace;
}

View File

@ -8,15 +8,15 @@ import * as blazeface from './blazeface';
import * as facepipeline from './facepipeline';
import * as coords from './coords';
import { GraphModel, Tensor } from '../tfjs/types';
import { Face } from '../result';
import { FaceResult } from '../result';
import { Config } from '../config';
let faceModels: [blazeface.BlazeFaceModel | null, GraphModel | null, GraphModel | null] = [null, null, null];
let facePipeline;
export async function predict(input: Tensor, config: Config): Promise<Face[]> {
export async function predict(input: Tensor, config: Config): Promise<FaceResult[]> {
const predictions = await facePipeline.predict(input, config);
const results: Array<Face> = [];
const results: Array<FaceResult> = [];
let id = 0;
for (const prediction of (predictions || [])) {
if (!prediction || prediction.isDisposedInternal) continue; // guard against disposed tensors on long running operations such as pause in middle of processing

View File

@ -8,14 +8,14 @@ import { log, join } from '../helpers';
import * as tf from '../../dist/tfjs.esm.js';
import * as annotations from './annotations';
import { Tensor, GraphModel } from '../tfjs/types';
import { Body } from '../result';
import { BodyResult } from '../result';
import { Config } from '../config';
let model: GraphModel;
export async function load(config: Config): Promise<GraphModel> {
if (!model) {
model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath)) as unknown as GraphModel;
model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath || '')) as unknown as GraphModel;
model['width'] = parseInt(model['signature'].inputs['input_1:0'].tensorShape.dim[2].size);
model['height'] = parseInt(model['signature'].inputs['input_1:0'].tensorShape.dim[1].size);
if (!model || !model['modelUrl']) log('load model failed:', config.body.modelPath);
@ -24,7 +24,7 @@ export async function load(config: Config): Promise<GraphModel> {
return model;
}
export async function predict(image: Tensor, config: Config): Promise<Body[]> {
export async function predict(image: Tensor, config: Config): Promise<BodyResult[]> {
if (!model) return [];
if (!config.body.enabled) return [];
const imgSize = { width: (image.shape[2] || 0), height: (image.shape[1] || 0) };

View File

@ -8,9 +8,177 @@
* @typedef Config
*/
/** Controlls and configures all face-specific options:
* - face detection, face mesh detection, age, gender, emotion detection and face description
* Parameters:
* - enabled: true/false
* - modelPath: path for each of face models
* - minConfidence: threshold for discarding a prediction
* - iouThreshold: ammount of overlap between two detected objects before one object is removed
* - maxDetected: maximum number of faces detected in the input, should be set to the minimum number for performance
* - rotation: use calculated rotated face image or just box with rotation as-is, false means higher performance, but incorrect mesh mapping on higher face angles
* - return: return extracted face as tensor for futher user processing, in which case user is reponsible for manually disposing the tensor
*/
export interface FaceConfig {
enabled: boolean,
detector: {
modelPath: string,
rotation: boolean,
maxDetected: number,
skipFrames: number,
minConfidence: number,
iouThreshold: number,
return: boolean,
},
mesh: {
enabled: boolean,
modelPath: string,
},
iris: {
enabled: boolean,
modelPath: string,
},
description: {
enabled: boolean,
modelPath: string,
skipFrames: number,
minConfidence: number,
},
emotion: {
enabled: boolean,
minConfidence: number,
skipFrames: number,
modelPath: string,
},
}
/** Controlls and configures all body detection specific options
* - enabled: true/false
* - modelPath: body pose model, can be absolute path or relative to modelBasePath
* - minConfidence: threshold for discarding a prediction
* - maxDetected: maximum number of people detected in the input, should be set to the minimum number for performance
*/
export interface BodyConfig {
enabled: boolean,
modelPath: string,
maxDetected: number,
minConfidence: number,
skipFrames: number,
}
/** Controlls and configures all hand detection specific options
* - enabled: true/false
* - landmarks: detect hand landmarks or just hand boundary box
* - modelPath: paths for hand detector and hand skeleton models, can be absolute path or relative to modelBasePath
* - minConfidence: threshold for discarding a prediction
* - iouThreshold: ammount of overlap between two detected objects before one object is removed
* - maxDetected: maximum number of hands detected in the input, should be set to the minimum number for performance
* - rotation: use best-guess rotated hand image or just box with rotation as-is, false means higher performance, but incorrect finger mapping if hand is inverted
*/
export interface HandConfig {
enabled: boolean,
rotation: boolean,
skipFrames: number,
minConfidence: number,
iouThreshold: number,
maxDetected: number,
landmarks: boolean,
detector: {
modelPath: string,
},
skeleton: {
modelPath: string,
},
}
/** Controlls and configures all object detection specific options
* - enabled: true/false
* - modelPath: object detection model, can be absolute path or relative to modelBasePath
* - minConfidence: minimum score that detection must have to return as valid object
* - iouThreshold: ammount of overlap between two detected objects before one object is removed
* - maxDetected: maximum number of detections to return
*/
export interface ObjectConfig {
enabled: boolean,
modelPath: string,
minConfidence: number,
iouThreshold: number,
maxDetected: number,
skipFrames: number,
}
/** Controlls and configures all body segmentation module
* removes background from input containing person
* if segmentation is enabled it will run as preprocessing task before any other model
* alternatively leave it disabled and use it on-demand using human.segmentation method which can
* remove background or replace it with user-provided background
*
* - enabled: true/false
* - modelPath: object detection model, can be absolute path or relative to modelBasePath
*/
export interface SegmentationConfig {
enabled: boolean,
modelPath: string,
}
/** Run input through image filters before inference
* - image filters run with near-zero latency as they are executed on the GPU
*/
export interface FilterConfig {
enabled: boolean,
/** Resize input width
* - if both width and height are set to 0, there is no resizing
* - if just one is set, second one is scaled automatically
* - if both are set, values are used as-is
*/
width: number,
/** Resize input height
* - if both width and height are set to 0, there is no resizing
* - if just one is set, second one is scaled automatically
* - if both are set, values are used as-is
*/
height: number,
/** Return processed canvas imagedata in result */
return: boolean,
/** Flip input as mirror image */
flip: boolean,
/** Range: -1 (darken) to 1 (lighten) */
brightness: number,
/** Range: -1 (reduce contrast) to 1 (increase contrast) */
contrast: number,
/** Range: 0 (no sharpening) to 1 (maximum sharpening) */
sharpness: number,
/** Range: 0 (no blur) to N (blur radius in pixels) */
blur: number
/** Range: -1 (reduce saturation) to 1 (increase saturation) */
saturation: number,
/** Range: 0 (no change) to 360 (hue rotation in degrees) */
hue: number,
/** Image negative */
negative: boolean,
/** Image sepia colors */
sepia: boolean,
/** Image vintage colors */
vintage: boolean,
/** Image kodachrome colors */
kodachrome: boolean,
/** Image technicolor colors */
technicolor: boolean,
/** Image polaroid camera effect */
polaroid: boolean,
/** Range: 0 (no pixelate) to N (number of pixels to pixelate) */
pixelate: number,
}
/** Controlls gesture detection */
export interface GestureConfig {
enabled: boolean,
}
export interface Config {
/** Backend used for TFJS operations */
backend: '' | 'cpu' | 'wasm' | 'webgl' | 'humangl' | 'tensorflow' | 'webgpu' | null | string,
// backend: '' | 'cpu' | 'wasm' | 'webgl' | 'humangl' | 'tensorflow' | 'webgpu' | null,
backend: string;
/** Path to *.wasm files if backend is set to `wasm` */
wasmPath: string,
@ -25,7 +193,8 @@ export interface Config {
* - warmup pre-initializes all models for faster inference but can take significant time on startup
* - only used for `webgl` and `humangl` backends
*/
warmup: 'none' | 'face' | 'full' | 'body' | string,
// warmup: 'none' | 'face' | 'full' | 'body' | string,
warmup: string;
/** Base model path (typically starting with file://, http:// or https://) for all models
* - individual modelPath values are relative to this path
@ -47,170 +216,20 @@ export interface Config {
/** Run input through image filters before inference
* - image filters run with near-zero latency as they are executed on the GPU
*/
filter: {
enabled: boolean,
/** Resize input width
* - if both width and height are set to 0, there is no resizing
* - if just one is set, second one is scaled automatically
* - if both are set, values are used as-is
*/
width: number,
/** Resize input height
* - if both width and height are set to 0, there is no resizing
* - if just one is set, second one is scaled automatically
* - if both are set, values are used as-is
*/
height: number,
/** Return processed canvas imagedata in result */
return: boolean,
/** Flip input as mirror image */
flip: boolean,
/** Range: -1 (darken) to 1 (lighten) */
brightness: number,
/** Range: -1 (reduce contrast) to 1 (increase contrast) */
contrast: number,
/** Range: 0 (no sharpening) to 1 (maximum sharpening) */
sharpness: number,
/** Range: 0 (no blur) to N (blur radius in pixels) */
blur: number
/** Range: -1 (reduce saturation) to 1 (increase saturation) */
saturation: number,
/** Range: 0 (no change) to 360 (hue rotation in degrees) */
hue: number,
/** Image negative */
negative: boolean,
/** Image sepia colors */
sepia: boolean,
/** Image vintage colors */
vintage: boolean,
/** Image kodachrome colors */
kodachrome: boolean,
/** Image technicolor colors */
technicolor: boolean,
/** Image polaroid camera effect */
polaroid: boolean,
/** Range: 0 (no pixelate) to N (number of pixels to pixelate) */
pixelate: number,
},
filter: Partial<FilterConfig>,
// type definition end
/** Controlls gesture detection */
gesture: {
enabled: boolean,
},
gesture: Partial<GestureConfig>;
/** Controlls and configures all face-specific options:
* - face detection, face mesh detection, age, gender, emotion detection and face description
* Parameters:
* - enabled: true/false
* - modelPath: path for each of face models
* - minConfidence: threshold for discarding a prediction
* - iouThreshold: ammount of overlap between two detected objects before one object is removed
* - maxDetected: maximum number of faces detected in the input, should be set to the minimum number for performance
* - rotation: use calculated rotated face image or just box with rotation as-is, false means higher performance, but incorrect mesh mapping on higher face angles
* - return: return extracted face as tensor for futher user processing, in which case user is reponsible for manually disposing the tensor
*/
face: {
enabled: boolean,
detector: {
modelPath: string,
rotation: boolean,
maxDetected: number,
skipFrames: number,
minConfidence: number,
iouThreshold: number,
return: boolean,
},
mesh: {
enabled: boolean,
modelPath: string,
},
iris: {
enabled: boolean,
modelPath: string,
},
description: {
enabled: boolean,
modelPath: string,
skipFrames: number,
minConfidence: number,
},
emotion: {
enabled: boolean,
minConfidence: number,
skipFrames: number,
modelPath: string,
},
},
face: Partial<FaceConfig>,
/** Controlls and configures all body detection specific options
* - enabled: true/false
* - modelPath: body pose model, can be absolute path or relative to modelBasePath
* - minConfidence: threshold for discarding a prediction
* - maxDetected: maximum number of people detected in the input, should be set to the minimum number for performance
*/
body: {
enabled: boolean,
modelPath: string,
maxDetected: number,
minConfidence: number,
skipFrames: number,
},
body: Partial<BodyConfig>,
/** Controlls and configures all hand detection specific options
* - enabled: true/false
* - landmarks: detect hand landmarks or just hand boundary box
* - modelPath: paths for hand detector and hand skeleton models, can be absolute path or relative to modelBasePath
* - minConfidence: threshold for discarding a prediction
* - iouThreshold: ammount of overlap between two detected objects before one object is removed
* - maxDetected: maximum number of hands detected in the input, should be set to the minimum number for performance
* - rotation: use best-guess rotated hand image or just box with rotation as-is, false means higher performance, but incorrect finger mapping if hand is inverted
*/
hand: {
enabled: boolean,
rotation: boolean,
skipFrames: number,
minConfidence: number,
iouThreshold: number,
maxDetected: number,
landmarks: boolean,
detector: {
modelPath: string,
},
skeleton: {
modelPath: string,
},
},
hand: Partial<HandConfig>,
/** Controlls and configures all object detection specific options
* - enabled: true/false
* - modelPath: object detection model, can be absolute path or relative to modelBasePath
* - minConfidence: minimum score that detection must have to return as valid object
* - iouThreshold: ammount of overlap between two detected objects before one object is removed
* - maxDetected: maximum number of detections to return
*/
object: {
enabled: boolean,
modelPath: string,
minConfidence: number,
iouThreshold: number,
maxDetected: number,
skipFrames: number,
},
object: Partial<ObjectConfig>,
/** Controlls and configures all body segmentation module
* removes background from input containing person
* if segmentation is enabled it will run as preprocessing task before any other model
* alternatively leave it disabled and use it on-demand using human.segmentation method which can
* remove background or replace it with user-provided background
*
* - enabled: true/false
* - modelPath: object detection model, can be absolute path or relative to modelBasePath
*/
segmentation: {
enabled: boolean,
modelPath: string,
},
segmentation: Partial<SegmentationConfig>,
}
const config: Config = {

View File

@ -4,7 +4,7 @@
import { TRI468 as triangulation } from '../blazeface/coords';
import { mergeDeep, now } from '../helpers';
import type { Result, Face, Body, Hand, Item, Gesture, Person } from '../result';
import type { Result, FaceResult, BodyResult, HandResult, ObjectResult, GestureResult, PersonResult } from '../result';
/**
* Draw Options
@ -139,7 +139,7 @@ function curves(ctx, points: [number, number, number?][] = [], localOptions) {
}
}
export async function gesture(inCanvas: HTMLCanvasElement, result: Array<Gesture>, drawOptions?: DrawOptions) {
export async function gesture(inCanvas: HTMLCanvasElement, result: Array<GestureResult>, drawOptions?: DrawOptions) {
const localOptions = mergeDeep(options, drawOptions);
if (!result || !inCanvas) return;
const ctx = getCanvasContext(inCanvas);
@ -164,7 +164,7 @@ export async function gesture(inCanvas: HTMLCanvasElement, result: Array<Gesture
}
}
export async function face(inCanvas: HTMLCanvasElement, result: Array<Face>, drawOptions?: DrawOptions) {
export async function face(inCanvas: HTMLCanvasElement, result: Array<FaceResult>, drawOptions?: DrawOptions) {
const localOptions = mergeDeep(options, drawOptions);
if (!result || !inCanvas) return;
const ctx = getCanvasContext(inCanvas);
@ -266,7 +266,7 @@ export async function face(inCanvas: HTMLCanvasElement, result: Array<Face>, dra
}
}
export async function body(inCanvas: HTMLCanvasElement, result: Array<Body>, drawOptions?: DrawOptions) {
export async function body(inCanvas: HTMLCanvasElement, result: Array<BodyResult>, drawOptions?: DrawOptions) {
const localOptions = mergeDeep(options, drawOptions);
if (!result || !inCanvas) return;
const ctx = getCanvasContext(inCanvas);
@ -376,7 +376,7 @@ export async function body(inCanvas: HTMLCanvasElement, result: Array<Body>, dra
}
}
export async function hand(inCanvas: HTMLCanvasElement, result: Array<Hand>, drawOptions?: DrawOptions) {
export async function hand(inCanvas: HTMLCanvasElement, result: Array<HandResult>, drawOptions?: DrawOptions) {
const localOptions = mergeDeep(options, drawOptions);
if (!result || !inCanvas) return;
const ctx = getCanvasContext(inCanvas);
@ -441,7 +441,7 @@ export async function hand(inCanvas: HTMLCanvasElement, result: Array<Hand>, dra
}
}
export async function object(inCanvas: HTMLCanvasElement, result: Array<Item>, drawOptions?: DrawOptions) {
export async function object(inCanvas: HTMLCanvasElement, result: Array<ObjectResult>, drawOptions?: DrawOptions) {
const localOptions = mergeDeep(options, drawOptions);
if (!result || !inCanvas) return;
const ctx = getCanvasContext(inCanvas);
@ -466,7 +466,7 @@ export async function object(inCanvas: HTMLCanvasElement, result: Array<Item>, d
}
}
export async function person(inCanvas: HTMLCanvasElement, result: Array<Person>, drawOptions?: DrawOptions) {
export async function person(inCanvas: HTMLCanvasElement, result: Array<PersonResult>, drawOptions?: DrawOptions) {
const localOptions = mergeDeep(options, drawOptions);
if (!result || !inCanvas) return;
const ctx = getCanvasContext(inCanvas);

View File

@ -4,7 +4,7 @@
import { log, join } from '../helpers';
import * as tf from '../../dist/tfjs.esm.js';
import { Body } from '../result';
import { BodyResult } from '../result';
import { GraphModel, Tensor } from '../tfjs/types';
import { Config } from '../config';
@ -22,7 +22,7 @@ const bodyParts = ['head', 'neck', 'rightShoulder', 'rightElbow', 'rightWrist',
export async function load(config: Config): Promise<GraphModel> {
if (!model) {
model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath)) as unknown as GraphModel;
model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath || '')) as unknown as GraphModel;
if (!model || !model['modelUrl']) log('load model failed:', config.body.modelPath);
else if (config.debug) log('load model:', model['modelUrl']);
} else if (config.debug) log('cached model:', model['modelUrl']);
@ -46,8 +46,8 @@ function max2d(inputs, minScore) {
});
}
export async function predict(image: Tensor, config: Config): Promise<Body[]> {
if ((skipped < config.body.skipFrames) && config.skipFrame && Object.keys(keypoints).length > 0) {
export async function predict(image: Tensor, config: Config): Promise<BodyResult[]> {
if ((skipped < (config.body?.skipFrames || 0)) && config.skipFrame && Object.keys(keypoints).length > 0) {
skipped++;
return [{ id: 0, score, box, boxRaw, keypoints }];
}
@ -76,7 +76,7 @@ export async function predict(image: Tensor, config: Config): Promise<Body[]> {
for (let id = 0; id < stack.length; id++) {
// actual processing to get coordinates and score
const [x, y, partScore] = max2d(stack[id], config.body.minConfidence);
if (score > config.body.minConfidence) {
if (score > (config.body?.minConfidence || 0)) {
keypoints.push({
score: Math.round(100 * partScore) / 100,
part: bodyParts[id],

View File

@ -19,8 +19,8 @@ const rgb = [0.2989, 0.5870, 0.1140]; // factors for red/green/blue colors when
export async function load(config: Config): Promise<GraphModel> {
if (!model) {
model = await tf.loadGraphModel(join(config.modelBasePath, config.face.emotion.modelPath));
if (!model || !model.modelUrl) log('load model failed:', config.face.emotion.modelPath);
model = await tf.loadGraphModel(join(config.modelBasePath, config.face.emotion?.modelPath || ''));
if (!model || !model.modelUrl) log('load model failed:', config.face.emotion?.modelPath || '');
else if (config.debug) log('load model:', model.modelUrl);
} else if (config.debug) log('cached model:', model.modelUrl);
return model;
@ -28,7 +28,7 @@ export async function load(config: Config): Promise<GraphModel> {
export async function predict(image: Tensor, config: Config, idx, count) {
if (!model) return null;
if ((skipped < config.face.emotion.skipFrames) && config.skipFrame && (lastCount === count) && last[idx] && (last[idx].length > 0)) {
if ((skipped < (config.face.emotion?.skipFrames || 0)) && config.skipFrame && (lastCount === count) && last[idx] && (last[idx].length > 0)) {
skipped++;
return last[idx];
}
@ -51,12 +51,12 @@ export async function predict(image: Tensor, config: Config, idx, count) {
const normalize = tf.tidy(() => tf.mul(tf.sub(grayscale, 0.5), 2));
tf.dispose(grayscale);
const obj: Array<{ score: number, emotion: string }> = [];
if (config.face.emotion.enabled) {
if (config.face.emotion?.enabled) {
const emotionT = await model.predict(normalize); // result is already in range 0..1, no need for additional activation
const data = await emotionT.data();
tf.dispose(emotionT);
for (let i = 0; i < data.length; i++) {
if (data[i] > config.face.emotion.minConfidence) obj.push({ score: Math.min(0.99, Math.trunc(100 * data[i]) / 100), emotion: annotations[i] });
if (data[i] > (config.face.emotion?.minConfidence || 0)) obj.push({ score: Math.min(0.99, Math.trunc(100 * data[i]) / 100), emotion: annotations[i] });
}
obj.sort((a, b) => b.score - a.score);
}

View File

@ -8,7 +8,7 @@ import * as tf from '../dist/tfjs.esm.js';
import * as facemesh from './blazeface/facemesh';
import * as emotion from './emotion/emotion';
import * as faceres from './faceres/faceres';
import { Face } from './result';
import { FaceResult } from './result';
import { Tensor } from './tfjs/types';
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
@ -145,7 +145,7 @@ const calculateFaceAngle = (face, imageSize): {
return { angle, matrix, gaze };
};
export const detectFace = async (parent /* instance of human */, input: Tensor): Promise<Face[]> => {
export const detectFace = async (parent /* instance of human */, input: Tensor): Promise<FaceResult[]> => {
// run facemesh, includes blazeface and iris
// eslint-disable-next-line no-async-promise-executor
let timeStamp;
@ -155,7 +155,7 @@ export const detectFace = async (parent /* instance of human */, input: Tensor):
let emotionRes;
let embeddingRes;
let descRes;
const faceRes: Array<Face> = [];
const faceRes: Array<FaceResult> = [];
parent.state = 'run:face';
timeStamp = now();
const faces = await facemesh.predict(input, parent.config);

View File

@ -23,10 +23,10 @@ let skipped = Number.MAX_SAFE_INTEGER;
type DB = Array<{ name: string, source: string, embedding: number[] }>;
export async function load(config: Config): Promise<GraphModel> {
const modelUrl = join(config.modelBasePath, config.face.description.modelPath);
const modelUrl = join(config.modelBasePath, config.face.description?.modelPath || '');
if (!model) {
model = await tf.loadGraphModel(modelUrl) as unknown as GraphModel;
if (!model) log('load model failed:', config.face.description.modelPath);
if (!model) log('load model failed:', config.face.description?.modelPath || '');
else if (config.debug) log('load model:', modelUrl);
} else if (config.debug) log('cached model:', modelUrl);
return model;
@ -112,7 +112,7 @@ export function enhance(input): Tensor {
export async function predict(image: Tensor, config: Config, idx, count) {
if (!model) return null;
if ((skipped < config.face.description.skipFrames) && config.skipFrame && (lastCount === count) && last[idx]?.age && (last[idx]?.age > 0)) {
if ((skipped < (config.face.description?.skipFrames || 0)) && config.skipFrame && (lastCount === count) && last[idx]?.age && (last[idx]?.age > 0)) {
skipped++;
return last[idx];
}
@ -128,13 +128,13 @@ export async function predict(image: Tensor, config: Config, idx, count) {
descriptor: <number[]>[],
};
if (config.face.description.enabled) resT = await model.predict(enhanced);
if (config.face.description?.enabled) resT = await model.predict(enhanced);
tf.dispose(enhanced);
if (resT) {
const gender = await resT.find((t) => t.shape[1] === 1).data();
const confidence = Math.trunc(200 * Math.abs((gender[0] - 0.5))) / 100;
if (confidence > config.face.description.minConfidence) {
if (confidence > (config.face.description?.minConfidence || 0)) {
obj.gender = gender[0] <= 0.5 ? 'female' : 'male';
obj.genderScore = Math.min(0.99, confidence);
}

View File

@ -2,7 +2,7 @@
* Gesture detection module
*/
import { Gesture } from '../result';
import { GestureResult } from '../result';
import * as fingerPose from '../fingerpose/fingerpose';
/**
@ -39,7 +39,7 @@ export type HandGesture =
| 'victory'
| 'thumbs up';
export const body = (res): Gesture[] => {
export const body = (res): GestureResult[] => {
if (!res) return [];
const gestures: Array<{ body: number, gesture: BodyGesture }> = [];
for (let i = 0; i < res.length; i++) {
@ -59,7 +59,7 @@ export const body = (res): Gesture[] => {
return gestures;
};
export const face = (res): Gesture[] => {
export const face = (res): GestureResult[] => {
if (!res) return [];
const gestures: Array<{ face: number, gesture: FaceGesture }> = [];
for (let i = 0; i < res.length; i++) {
@ -80,7 +80,7 @@ export const face = (res): Gesture[] => {
return gestures;
};
export const iris = (res): Gesture[] => {
export const iris = (res): GestureResult[] => {
if (!res) return [];
const gestures: Array<{ iris: number, gesture: IrisGesture }> = [];
for (let i = 0; i < res.length; i++) {
@ -118,7 +118,7 @@ export const iris = (res): Gesture[] => {
return gestures;
};
export const hand = (res): Gesture[] => {
export const hand = (res): GestureResult[] => {
if (!res) return [];
const gestures: Array<{ hand: number, gesture: HandGesture }> = [];
for (let i = 0; i < res.length; i++) {

View File

@ -7,7 +7,7 @@ import * as tf from '../../dist/tfjs.esm.js';
import * as handdetector from './handdetector';
import * as handpipeline from './handpipeline';
import * as fingerPose from '../fingerpose/fingerpose';
import { Hand } from '../result';
import { HandResult } from '../result';
import { Tensor, GraphModel } from '../tfjs/types';
import { Config } from '../config';
@ -24,10 +24,10 @@ let handDetectorModel: GraphModel | null;
let handPoseModel: GraphModel | null;
let handPipeline: handpipeline.HandPipeline;
export async function predict(input: Tensor, config: Config): Promise<Hand[]> {
export async function predict(input: Tensor, config: Config): Promise<HandResult[]> {
const predictions = await handPipeline.estimateHands(input, config);
if (!predictions) return [];
const hands: Array<Hand> = [];
const hands: Array<HandResult> = [];
for (let i = 0; i < predictions.length; i++) {
const annotations = {};
if (predictions[i].landmarks) {
@ -72,8 +72,8 @@ export async function predict(input: Tensor, config: Config): Promise<Hand[]> {
box,
boxRaw,
keypoints,
annotations: annotations as Hand['annotations'],
landmarks: landmarks as Hand['landmarks'],
annotations: annotations as HandResult['annotations'],
landmarks: landmarks as HandResult['landmarks'],
});
}
return hands;
@ -82,13 +82,13 @@ export async function predict(input: Tensor, config: Config): Promise<Hand[]> {
export async function load(config: Config): Promise<[GraphModel | null, GraphModel | null]> {
if (!handDetectorModel || !handPoseModel) {
[handDetectorModel, handPoseModel] = await Promise.all([
config.hand.enabled ? tf.loadGraphModel(join(config.modelBasePath, config.hand.detector.modelPath), { fromTFHub: config.hand.detector.modelPath.includes('tfhub.dev') }) as unknown as GraphModel : null,
config.hand.landmarks ? tf.loadGraphModel(join(config.modelBasePath, config.hand.skeleton.modelPath), { fromTFHub: config.hand.skeleton.modelPath.includes('tfhub.dev') }) as unknown as GraphModel : null,
config.hand.enabled ? tf.loadGraphModel(join(config.modelBasePath, config.hand.detector?.modelPath || ''), { fromTFHub: (config.hand.detector?.modelPath || '').includes('tfhub.dev') }) as unknown as GraphModel : null,
config.hand.landmarks ? tf.loadGraphModel(join(config.modelBasePath, config.hand.skeleton?.modelPath || ''), { fromTFHub: (config.hand.skeleton?.modelPath || '').includes('tfhub.dev') }) as unknown as GraphModel : null,
]);
if (config.hand.enabled) {
if (!handDetectorModel || !handDetectorModel['modelUrl']) log('load model failed:', config.hand.detector.modelPath);
if (!handDetectorModel || !handDetectorModel['modelUrl']) log('load model failed:', config.hand.detector?.modelPath || '');
else if (config.debug) log('load model:', handDetectorModel['modelUrl']);
if (!handPoseModel || !handPoseModel['modelUrl']) log('load model failed:', config.hand.skeleton.modelPath);
if (!handPoseModel || !handPoseModel['modelUrl']) log('load model failed:', config.hand.skeleton?.modelPath || '');
else if (config.debug) log('load model:', handPoseModel['modelUrl']);
}
} else {

View File

@ -4,7 +4,7 @@
import { log, now, mergeDeep } from './helpers';
import { Config, defaults } from './config';
import { Result, Face, Hand, Body, Item, Gesture } from './result';
import { Result, FaceResult, HandResult, BodyResult, ObjectResult, GestureResult } from './result';
import * as sysinfo from './sysinfo';
import * as tf from '../dist/tfjs.esm.js';
import * as backend from './tfjs/backend';
@ -30,8 +30,9 @@ import * as app from '../package.json';
import { Tensor, GraphModel } from './tfjs/types';
// export types
export { Config } from './config';
export type { Result, Face, Hand, Body, Item, Gesture, Person } from './result';
export * from './config';
export * from './result';
export type { DrawOptions } from './draw/draw';
/** Defines all possible input types for **Human** detection
@ -101,16 +102,6 @@ export class Human {
canvas: typeof draw.canvas,
all: typeof draw.all,
};
/** Types used by Human */
static Config: Config;
static Result: Result;
static Face: Face;
static Hand: Hand;
static Body: Body;
static Item: Item;
static Gesture: Gesture;
static Person: Gesture
static DrawOptions: draw.DrawOptions;
/** @internal: Currently loaded models */
models: {
face: [unknown, GraphModel | null, GraphModel | null] | null,
@ -529,10 +520,10 @@ export class Human {
// prepare where to store model results
// keep them with weak typing as it can be promise or not
let faceRes: Face[] | Promise<Face[]> | never[] = [];
let bodyRes: Body[] | Promise<Body[]> | never[] = [];
let handRes: Hand[] | Promise<Hand[]> | never[] = [];
let objectRes: Item[] | Promise<Item[]> | never[] = [];
let faceRes: FaceResult[] | Promise<FaceResult[]> | never[] = [];
let bodyRes: BodyResult[] | Promise<BodyResult[]> | never[] = [];
let handRes: HandResult[] | Promise<HandResult[]> | never[] = [];
let objectRes: ObjectResult[] | Promise<ObjectResult[]> | never[] = [];
// run face detection followed by all models that rely on face bounding box: face mesh, age, gender, emotion
if (this.config.async) {
@ -549,18 +540,18 @@ export class Human {
// run body: can be posenet, blazepose, efficientpose, movenet
this.analyze('Start Body:');
if (this.config.async) {
if (this.config.body.modelPath.includes('posenet')) bodyRes = this.config.body.enabled ? posenet.predict(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes('blazepose')) bodyRes = this.config.body.enabled ? blazepose.predict(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes('efficientpose')) bodyRes = this.config.body.enabled ? efficientpose.predict(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes('movenet')) bodyRes = this.config.body.enabled ? movenet.predict(this.process.tensor, this.config) : [];
if (this.config.body.modelPath?.includes('posenet')) bodyRes = this.config.body.enabled ? posenet.predict(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath?.includes('blazepose')) bodyRes = this.config.body.enabled ? blazepose.predict(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath?.includes('efficientpose')) bodyRes = this.config.body.enabled ? efficientpose.predict(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath?.includes('movenet')) bodyRes = this.config.body.enabled ? movenet.predict(this.process.tensor, this.config) : [];
if (this.performance.body) delete this.performance.body;
} else {
this.state = 'run:body';
timeStamp = now();
if (this.config.body.modelPath.includes('posenet')) bodyRes = this.config.body.enabled ? await posenet.predict(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes('blazepose')) bodyRes = this.config.body.enabled ? await blazepose.predict(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes('efficientpose')) bodyRes = this.config.body.enabled ? await efficientpose.predict(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath.includes('movenet')) bodyRes = this.config.body.enabled ? await movenet.predict(this.process.tensor, this.config) : [];
if (this.config.body.modelPath?.includes('posenet')) bodyRes = this.config.body.enabled ? await posenet.predict(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath?.includes('blazepose')) bodyRes = this.config.body.enabled ? await blazepose.predict(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath?.includes('efficientpose')) bodyRes = this.config.body.enabled ? await efficientpose.predict(this.process.tensor, this.config) : [];
else if (this.config.body.modelPath?.includes('movenet')) bodyRes = this.config.body.enabled ? await movenet.predict(this.process.tensor, this.config) : [];
elapsedTime = Math.trunc(now() - timeStamp);
if (elapsedTime > 0) this.performance.body = elapsedTime;
}
@ -583,14 +574,14 @@ export class Human {
// run nanodet
this.analyze('Start Object:');
if (this.config.async) {
if (this.config.object.modelPath.includes('nanodet')) objectRes = this.config.object.enabled ? nanodet.predict(this.process.tensor, this.config) : [];
else if (this.config.object.modelPath.includes('centernet')) objectRes = this.config.object.enabled ? centernet.predict(this.process.tensor, this.config) : [];
if (this.config.object.modelPath?.includes('nanodet')) objectRes = this.config.object.enabled ? nanodet.predict(this.process.tensor, this.config) : [];
else if (this.config.object.modelPath?.includes('centernet')) objectRes = this.config.object.enabled ? centernet.predict(this.process.tensor, this.config) : [];
if (this.performance.object) delete this.performance.object;
} else {
this.state = 'run:object';
timeStamp = now();
if (this.config.object.modelPath.includes('nanodet')) objectRes = this.config.object.enabled ? await nanodet.predict(this.process.tensor, this.config) : [];
else if (this.config.object.modelPath.includes('centernet')) objectRes = this.config.object.enabled ? await centernet.predict(this.process.tensor, this.config) : [];
if (this.config.object.modelPath?.includes('nanodet')) objectRes = this.config.object.enabled ? await nanodet.predict(this.process.tensor, this.config) : [];
else if (this.config.object.modelPath?.includes('centernet')) objectRes = this.config.object.enabled ? await centernet.predict(this.process.tensor, this.config) : [];
elapsedTime = Math.trunc(now() - timeStamp);
if (elapsedTime > 0) this.performance.object = elapsedTime;
}
@ -600,7 +591,7 @@ export class Human {
if (this.config.async) [faceRes, bodyRes, handRes, objectRes] = await Promise.all([faceRes, bodyRes, handRes, objectRes]);
// run gesture analysis last
let gestureRes: Gesture[] = [];
let gestureRes: GestureResult[] = [];
if (this.config.gesture.enabled) {
timeStamp = now();
gestureRes = [...gesture.face(faceRes), ...gesture.body(bodyRes), ...gesture.hand(handRes), ...gesture.iris(faceRes)];
@ -612,15 +603,15 @@ export class Human {
this.state = 'idle';
const shape = this.process?.tensor?.shape || [];
this.result = {
face: faceRes as Face[],
body: bodyRes as Body[],
hand: handRes as Hand[],
face: faceRes as FaceResult[],
body: bodyRes as BodyResult[],
hand: handRes as HandResult[],
gesture: gestureRes,
object: objectRes as Item[],
object: objectRes as ObjectResult[],
performance: this.performance,
canvas: this.process.canvas,
timestamp: Date.now(),
get persons() { return persons.join(faceRes as Face[], bodyRes as Body[], handRes as Hand[], gestureRes, shape); },
get persons() { return persons.join(faceRes as FaceResult[], bodyRes as BodyResult[], handRes as HandResult[], gestureRes, shape); },
};
// finally dispose input tensor

View File

@ -57,10 +57,10 @@ export function process(input: Input, config: Config): { tensor: Tensor | null,
}
// create our canvas and resize it if needed
if (config.filter.width > 0) targetWidth = config.filter.width;
else if (config.filter.height > 0) targetWidth = originalWidth * (config.filter.height / originalHeight);
if (config.filter.height > 0) targetHeight = config.filter.height;
else if (config.filter.width > 0) targetHeight = originalHeight * (config.filter.width / originalWidth);
if ((config.filter.width || 0) > 0) targetWidth = config.filter.width;
else if ((config.filter.height || 0) > 0) targetWidth = originalWidth * ((config.filter.height || 0) / originalHeight);
if ((config.filter.height || 0) > 0) targetHeight = config.filter.height;
else if ((config.filter.width || 0) > 0) targetHeight = originalHeight * ((config.filter.width || 0) / originalWidth);
if (!targetWidth || !targetHeight) throw new Error('Human: Input cannot determine dimension');
if (!inCanvas || (inCanvas?.width !== targetWidth) || (inCanvas?.height !== targetHeight)) {
inCanvas = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(targetWidth, targetHeight) : document.createElement('canvas');

View File

@ -2,7 +2,7 @@
* Module that interpolates results for smoother animations
*/
import type { Result, Face, Body, Hand, Item, Gesture, Person } from './result';
import type { Result, FaceResult, BodyResult, HandResult, ObjectResult, GestureResult, PersonResult } from './result';
const bufferedResult: Result = { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0 };
@ -26,7 +26,7 @@ export function calc(newResult: Result): Result {
// interpolate body results
if (!bufferedResult.body || (newResult.body.length !== bufferedResult.body.length)) {
bufferedResult.body = JSON.parse(JSON.stringify(newResult.body as Body[])); // deep clone once
bufferedResult.body = JSON.parse(JSON.stringify(newResult.body as BodyResult[])); // deep clone once
} else {
for (let i = 0; i < newResult.body.length; i++) {
const box = newResult.body[i].box // update box
@ -52,7 +52,7 @@ export function calc(newResult: Result): Result {
// interpolate hand results
if (!bufferedResult.hand || (newResult.hand.length !== bufferedResult.hand.length)) {
bufferedResult.hand = JSON.parse(JSON.stringify(newResult.hand as Hand[])); // deep clone once
bufferedResult.hand = JSON.parse(JSON.stringify(newResult.hand as HandResult[])); // deep clone once
} else {
for (let i = 0; i < newResult.hand.length; i++) {
const box = (newResult.hand[i].box// update box
@ -69,13 +69,13 @@ export function calc(newResult: Result): Result {
annotations[key] = newResult.hand[i].annotations[key]
.map((val, j) => val.map((coord, k) => ((bufferedFactor - 1) * bufferedResult.hand[i].annotations[key][j][k] + coord) / bufferedFactor));
}
bufferedResult.hand[i] = { ...newResult.hand[i], box, boxRaw, keypoints, annotations: annotations as Hand['annotations'] }; // shallow clone plus updated values
bufferedResult.hand[i] = { ...newResult.hand[i], box, boxRaw, keypoints, annotations: annotations as HandResult['annotations'] }; // shallow clone plus updated values
}
}
// interpolate face results
if (!bufferedResult.face || (newResult.face.length !== bufferedResult.face.length)) {
bufferedResult.face = JSON.parse(JSON.stringify(newResult.face as Face[])); // deep clone once
bufferedResult.face = JSON.parse(JSON.stringify(newResult.face as FaceResult[])); // deep clone once
} else {
for (let i = 0; i < newResult.face.length; i++) {
const box = (newResult.face[i].box // update box
@ -104,7 +104,7 @@ export function calc(newResult: Result): Result {
// interpolate object detection results
if (!bufferedResult.object || (newResult.object.length !== bufferedResult.object.length)) {
bufferedResult.object = JSON.parse(JSON.stringify(newResult.object as Item[])); // deep clone once
bufferedResult.object = JSON.parse(JSON.stringify(newResult.object as ObjectResult[])); // deep clone once
} else {
for (let i = 0; i < newResult.object.length; i++) {
const box = (newResult.object[i].box // update box
@ -119,7 +119,7 @@ export function calc(newResult: Result): Result {
if (newResult.persons) {
const newPersons = newResult.persons; // trigger getter function
if (!bufferedResult.persons || (newPersons.length !== bufferedResult.persons.length)) {
bufferedResult.persons = JSON.parse(JSON.stringify(newPersons as Person[]));
bufferedResult.persons = JSON.parse(JSON.stringify(newPersons as PersonResult[]));
} else {
for (let i = 0; i < newPersons.length; i++) { // update person box, we don't update the rest as it's updated as reference anyhow
bufferedResult.persons[i].box = (newPersons[i].box
@ -129,7 +129,7 @@ export function calc(newResult: Result): Result {
}
// just copy latest gestures without interpolation
if (newResult.gesture) bufferedResult.gesture = newResult.gesture as Gesture[];
if (newResult.gesture) bufferedResult.gesture = newResult.gesture as GestureResult[];
if (newResult.performance) bufferedResult.performance = newResult.performance;
return bufferedResult;

View File

@ -4,7 +4,7 @@
import { log, join } from '../helpers';
import * as tf from '../../dist/tfjs.esm.js';
import { Body } from '../result';
import { BodyResult } from '../result';
import { GraphModel, Tensor } from '../tfjs/types';
import { Config } from '../config';
@ -23,7 +23,7 @@ const bodyParts = ['nose', 'leftEye', 'rightEye', 'leftEar', 'rightEar', 'leftSh
export async function load(config: Config): Promise<GraphModel> {
if (!model) {
model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath)) as unknown as GraphModel;
model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath || '')) as unknown as GraphModel;
if (!model || !model['modelUrl']) log('load model failed:', config.body.modelPath);
else if (config.debug) log('load model:', model['modelUrl']);
} else if (config.debug) log('cached model:', model['modelUrl']);
@ -114,8 +114,8 @@ async function parseMultiPose(res, config, image) {
return persons;
}
export async function predict(image: Tensor, config: Config): Promise<Body[]> {
if ((skipped < config.body.skipFrames) && config.skipFrame && Object.keys(keypoints).length > 0) {
export async function predict(image: Tensor, config: Config): Promise<BodyResult[]> {
if ((skipped < (config.body.skipFrames || 0)) && config.skipFrame && Object.keys(keypoints).length > 0) {
skipped++;
return [{ id: 0, score, box, boxRaw, keypoints }];
}

View File

@ -5,17 +5,17 @@
import { log, join } from '../helpers';
import * as tf from '../../dist/tfjs.esm.js';
import { labels } from './labels';
import { Item } from '../result';
import { ObjectResult } from '../result';
import { GraphModel, Tensor } from '../tfjs/types';
import { Config } from '../config';
let model;
let last: Item[] = [];
let last: ObjectResult[] = [];
let skipped = Number.MAX_SAFE_INTEGER;
export async function load(config: Config): Promise<GraphModel> {
if (!model) {
model = await tf.loadGraphModel(join(config.modelBasePath, config.object.modelPath));
model = await tf.loadGraphModel(join(config.modelBasePath, config.object.modelPath || ''));
const inputs = Object.values(model.modelSignature['inputs']);
model.inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : null;
if (!model.inputSize) throw new Error(`Human: Cannot determine model inputSize: ${config.object.modelPath}`);
@ -27,7 +27,7 @@ export async function load(config: Config): Promise<GraphModel> {
async function process(res: Tensor, inputSize, outputShape, config: Config) {
if (!res) return [];
const results: Array<Item> = [];
const results: Array<ObjectResult> = [];
const detections = await res.array();
const squeezeT = tf.squeeze(res);
tf.dispose(res);
@ -70,8 +70,8 @@ async function process(res: Tensor, inputSize, outputShape, config: Config) {
return results;
}
export async function predict(input: Tensor, config: Config): Promise<Item[]> {
if ((skipped < config.object.skipFrames) && config.skipFrame && (last.length > 0)) {
export async function predict(input: Tensor, config: Config): Promise<ObjectResult[]> {
if ((skipped < (config.object.skipFrames || 0)) && config.skipFrame && (last.length > 0)) {
skipped++;
return last;
}

View File

@ -5,19 +5,19 @@
import { log, join } from '../helpers';
import * as tf from '../../dist/tfjs.esm.js';
import { labels } from './labels';
import { Item } from '../result';
import { ObjectResult } from '../result';
import { GraphModel, Tensor } from '../tfjs/types';
import { Config } from '../config';
let model;
let last: Array<Item> = [];
let last: Array<ObjectResult> = [];
let skipped = Number.MAX_SAFE_INTEGER;
const scaleBox = 2.5; // increase box size
export async function load(config: Config): Promise<GraphModel> {
if (!model) {
model = await tf.loadGraphModel(join(config.modelBasePath, config.object.modelPath));
model = await tf.loadGraphModel(join(config.modelBasePath, config.object.modelPath || ''));
const inputs = Object.values(model.modelSignature['inputs']);
model.inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : null;
if (!model.inputSize) throw new Error(`Human: Cannot determine model inputSize: ${config.object.modelPath}`);
@ -29,7 +29,7 @@ export async function load(config: Config): Promise<GraphModel> {
async function process(res, inputSize, outputShape, config) {
let id = 0;
let results: Array<Item> = [];
let results: Array<ObjectResult> = [];
for (const strideSize of [1, 2, 4]) { // try each stride size as it detects large/medium/small objects
// find scores, boxes, classes
tf.tidy(async () => { // wrap in tidy to automatically deallocate temp tensors
@ -102,8 +102,8 @@ async function process(res, inputSize, outputShape, config) {
return results;
}
export async function predict(image: Tensor, config: Config): Promise<Item[]> {
if ((skipped < config.object.skipFrames) && config.skipFrame && (last.length > 0)) {
export async function predict(image: Tensor, config: Config): Promise<ObjectResult[]> {
if ((skipped < (config.object.skipFrames || 0)) && config.skipFrame && (last.length > 0)) {
skipped++;
return last;
}

View File

@ -2,13 +2,13 @@
* Module that analyzes existing results and recombines them into a unified person object
*/
import { Face, Body, Hand, Gesture, Person } from './result';
import { FaceResult, BodyResult, HandResult, GestureResult, PersonResult } from './result';
export function join(faces: Array<Face>, bodies: Array<Body>, hands: Array<Hand>, gestures: Array<Gesture>, shape: Array<number> | undefined): Array<Person> {
export function join(faces: Array<FaceResult>, bodies: Array<BodyResult>, hands: Array<HandResult>, gestures: Array<GestureResult>, shape: Array<number> | undefined): Array<PersonResult> {
let id = 0;
const persons: Array<Person> = [];
const persons: Array<PersonResult> = [];
for (const face of faces) { // person is defined primarily by face and then we append other objects as found
const person: Person = { id: id++, face, body: null, hands: { left: null, right: null }, gestures: [], box: [0, 0, 0, 0] };
const person: PersonResult = { id: id++, face, body: null, hands: { left: null, right: null }, gestures: [], box: [0, 0, 0, 0] };
for (const body of bodies) {
if (face.box[0] > body.box[0] // x within body
&& face.box[0] < body.box[0] + body.box[2]

View File

@ -6,14 +6,14 @@ import { log, join } from '../helpers';
import * as tf from '../../dist/tfjs.esm.js';
import * as poses from './poses';
import * as util from './utils';
import { Body } from '../result';
import { BodyResult } from '../result';
import { Tensor, GraphModel } from '../tfjs/types';
import { Config } from '../config';
let model: GraphModel;
const poseNetOutputs = ['MobilenetV1/offset_2/BiasAdd'/* offsets */, 'MobilenetV1/heatmap_2/BiasAdd'/* heatmapScores */, 'MobilenetV1/displacement_fwd_2/BiasAdd'/* displacementFwd */, 'MobilenetV1/displacement_bwd_2/BiasAdd'/* displacementBwd */];
export async function predict(input: Tensor, config: Config): Promise<Body[]> {
export async function predict(input: Tensor, config: Config): Promise<BodyResult[]> {
const res = tf.tidy(() => {
if (!model.inputs[0].shape) return [];
const resized = tf.image.resizeBilinear(input, [model.inputs[0].shape[2], model.inputs[0].shape[1]]);
@ -29,13 +29,13 @@ export async function predict(input: Tensor, config: Config): Promise<Body[]> {
const decoded = await poses.decode(buffers[0], buffers[1], buffers[2], buffers[3], config.body.maxDetected, config.body.minConfidence);
if (!model.inputs[0].shape) return [];
const scaled = util.scalePoses(decoded, [input.shape[1], input.shape[2]], [model.inputs[0].shape[2], model.inputs[0].shape[1]]) as Body[];
const scaled = util.scalePoses(decoded, [input.shape[1], input.shape[2]], [model.inputs[0].shape[2], model.inputs[0].shape[1]]) as BodyResult[];
return scaled;
}
export async function load(config: Config): Promise<GraphModel> {
if (!model) {
model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath)) as unknown as GraphModel;
model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath || '')) as unknown as GraphModel;
if (!model || !model['modelUrl']) log('load model failed:', config.body.modelPath);
else if (config.debug) log('load model:', model['modelUrl']);
} else if (config.debug) log('cached model:', model['modelUrl']);

View File

@ -1,5 +1,5 @@
import * as kpt from './keypoints';
import { Body } from '../result';
import { BodyResult } from '../result';
export function eitherPointDoesntMeetConfidence(a: number, b: number, minConfidence: number) {
return (a < minConfidence || b < minConfidence);
@ -30,7 +30,7 @@ export function getBoundingBox(keypoints): [number, number, number, number] {
return [coord.minX, coord.minY, coord.maxX - coord.minX, coord.maxY - coord.minY];
}
export function scalePoses(poses, [height, width], [inputResolutionHeight, inputResolutionWidth]): Array<Body> {
export function scalePoses(poses, [height, width], [inputResolutionHeight, inputResolutionWidth]): Array<BodyResult> {
const scaleY = height / inputResolutionHeight;
const scaleX = width / inputResolutionWidth;
const scalePose = (pose, i) => ({

View File

@ -32,7 +32,7 @@ import { FaceGesture, BodyGesture, HandGesture, IrisGesture } from './gesture/ge
* - gaze: gaze direction as object with values for bearing in radians and relative strength
* - tensor: face tensor as Tensor object which contains detected face
*/
export interface Face {
export interface FaceResult {
id: number
score: number,
boxScore: number,
@ -69,7 +69,7 @@ export interface Face {
* - score: body part score value
* - presence: body part presence value
*/
export interface Body {
export interface BodyResult {
id: number,
score: number,
box: [number, number, number, number],
@ -94,7 +94,7 @@ export interface Body {
* - annotations: annotated landmarks for each hand part with keypoints
* - landmarks: annotated landmarks for eachb hand part with logical curl and direction strings
*/
export interface Hand {
export interface HandResult {
id: number,
score: number,
box: [number, number, number, number],
@ -122,7 +122,7 @@ export interface Hand {
* - center: optional center point as array of [x, y], normalized to image resolution
* - centerRaw: optional center point as array of [x, y], normalized to range 0..1
*/
export interface Item {
export interface ObjectResult {
id: number,
score: number,
class: number,
@ -139,7 +139,7 @@ export interface Item {
* - part: part name and number where gesture was detected: face, iris, body, hand
* - gesture: gesture detected
*/
export type Gesture =
export type GestureResult =
{ 'face': number, gesture: FaceGesture }
| { 'iris': number, gesture: IrisGesture }
| { 'body': number, gesture: BodyGesture }
@ -157,12 +157,12 @@ export type Gesture =
* - box: bounding box: x, y, width, height normalized to input image resolution
* - boxRaw: bounding box: x, y, width, height normalized to 0..1
*/
export interface Person {
export interface PersonResult {
id: number,
face: Face,
body: Body | null,
hands: { left: Hand | null, right: Hand | null },
gestures: Array<Gesture>,
face: FaceResult,
body: BodyResult | null,
hands: { left: HandResult | null, right: HandResult | null },
gestures: Array<GestureResult>,
box: [number, number, number, number],
boxRaw?: [number, number, number, number],
}
@ -173,16 +173,16 @@ export interface Person {
* Contains all possible detection results
*/
export interface Result {
/** {@link Face}: detection & analysis results */
face: Array<Face>,
/** {@link Body}: detection & analysis results */
body: Array<Body>,
/** {@link Hand}: detection & analysis results */
hand: Array<Hand>,
/** {@link Gesture}: detection & analysis results */
gesture: Array<Gesture>,
/** {@link Object}: detection & analysis results */
object: Array<Item>
/** {@link FaceResult}: detection & analysis results */
face: Array<FaceResult>,
/** {@link BodyResult}: detection & analysis results */
body: Array<BodyResult>,
/** {@link HandResult}: detection & analysis results */
hand: Array<HandResult>,
/** {@link GestureResult}: detection & analysis results */
gesture: Array<GestureResult>,
/** {@link ItemResult}: detection & analysis results */
object: Array<ObjectResult>
/** global performance object with timing values for each operation */
performance: Record<string, unknown>,
/** optional processed canvas that can be used to draw input on screen */
@ -190,5 +190,5 @@ export interface Result {
/** timestamp of detection representing the milliseconds elapsed since the UNIX epoch */
readonly timestamp: number,
/** getter property that returns unified persons object */
persons: Array<Person>,
persons: Array<PersonResult>,
}

View File

@ -15,7 +15,7 @@ let busy = false;
export async function load(config: Config): Promise<GraphModel> {
if (!model) {
model = await tf.loadGraphModel(join(config.modelBasePath, config.segmentation.modelPath)) as unknown as GraphModel;
model = await tf.loadGraphModel(join(config.modelBasePath, config.segmentation.modelPath || '')) as unknown as GraphModel;
if (!model || !model['modelUrl']) log('load model failed:', config.segmentation.modelPath);
else if (config.debug) log('load model:', model['modelUrl']);
} else if (config.debug) log('cached model:', model['modelUrl']);

View File

@ -1197,3 +1197,963 @@
2021-09-11 22:47:32 STATE: Lint: {"locations":["src/**/*.ts","test/*.js","demo/**/*.js"],"files":75,"errors":0,"warnings":0}
2021-09-11 22:47:32 STATE: ChangeLog: {"repository":"https://github.com/vladmandic/human","branch":"main","output":"CHANGELOG.md"}
2021-09-11 22:47:32 INFO:  Done...
2021-09-11 23:31:33 INFO:  @vladmandic/human version 2.1.5
2021-09-11 23:31:33 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.5.0
2021-09-11 23:31:33 INFO:  Application: {"name":"@vladmandic/human","version":"2.1.5"}
2021-09-11 23:31:33 INFO:  Environment: {"profile":"production","config":"build.json","tsconfig":true,"eslintrc":true,"git":true}
2021-09-11 23:31:33 INFO:  Toolchain: {"build":"0.4.1","esbuild":"0.12.26","typescript":"4.4.3","typedoc":"0.21.9","eslint":"7.32.0"}
2021-09-11 23:31:33 INFO:  Build: {"profile":"production","steps":["clean","compile","typings","typedoc","lint","changelog"]}
2021-09-11 23:31:33 STATE: Clean: {"locations":["dist/*","types/*","typedoc/*"]}
2021-09-11 23:31:34 STATE: 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-11 23:31:34 STATE: Compile: {"name":"human/nodejs/cpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node.js","files":48,"inputBytes":465210,"outputBytes":397891}
2021-09-11 23:31:34 STATE: 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-11 23:31:34 STATE: Compile: {"name":"human/nodejs/gpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-gpu.js","files":48,"inputBytes":465218,"outputBytes":397895}
2021-09-11 23:31:34 STATE: 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-11 23:31:34 STATE: Compile: {"name":"human/nodejs/wasm","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-wasm.js","files":48,"inputBytes":465285,"outputBytes":397967}
2021-09-11 23:31:34 STATE: 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-11 23:31:34 STATE: Compile: {"name":"human/browser/esm/nobundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm-nobundle.js","files":48,"inputBytes":465384,"outputBytes":399855}
2021-09-11 23:31:34 STATE: 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-11 23:31:34 STATE: Compile: {"name":"human/browser/iife/bundle","format":"iife","platform":"browser","input":"src/human.ts","output":"dist/human.js","files":48,"inputBytes":2807777,"outputBytes":1392634}
2021-09-11 23:31:35 STATE: Compile: {"name":"human/browser/esm/bundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm.js","files":48,"inputBytes":2807777,"outputBytes":2584793}
2021-09-11 23:31:50 STATE: Typings: {"input":"src/human.ts","output":"types","files":47}
2021-09-11 23:31:50 ERROR: TSC: /home/vlado/dev/human/src/blazeface/facemesh.ts [11,10]: Module '"../result"' has no exported member 'Face'.
2021-09-11 23:31:50 ERROR: TSC: /home/vlado/dev/human/src/blazepose/blazepose.ts [11,10]: Module '"../result"' has no exported member 'Body'.
2021-09-11 23:31:50 ERROR: TSC: /home/vlado/dev/human/src/draw/draw.ts [7,23]: Module '"../result"' has no exported member 'Face'.
2021-09-11 23:31:50 ERROR: TSC: /home/vlado/dev/human/src/draw/draw.ts [7,29]: Module '"../result"' has no exported member 'Body'.
2021-09-11 23:31:50 ERROR: TSC: /home/vlado/dev/human/src/draw/draw.ts [7,35]: Module '"../result"' has no exported member 'Hand'.
2021-09-11 23:31:50 ERROR: TSC: /home/vlado/dev/human/src/draw/draw.ts [7,41]: Module '"../result"' has no exported member 'Item'.
2021-09-11 23:31:50 ERROR: TSC: /home/vlado/dev/human/src/draw/draw.ts [7,47]: Module '"../result"' has no exported member 'Gesture'.
2021-09-11 23:31:50 ERROR: TSC: /home/vlado/dev/human/src/draw/draw.ts [7,56]: Module '"../result"' has no exported member 'Person'.
2021-09-11 23:31:50 ERROR: TSC: /home/vlado/dev/human/src/efficientpose/efficientpose.ts [7,10]: Module '"../result"' has no exported member 'Body'.
2021-09-11 23:31:50 ERROR: TSC: /home/vlado/dev/human/src/face.ts [11,10]: Module '"./result"' has no exported member 'Face'.
2021-09-11 23:31:50 ERROR: TSC: /home/vlado/dev/human/src/gesture/gesture.ts [5,10]: Module '"../result"' has no exported member 'Gesture'.
2021-09-11 23:31:50 ERROR: TSC: /home/vlado/dev/human/src/handpose/handpose.ts [10,10]: Module '"../result"' has no exported member 'Hand'.
2021-09-11 23:31:50 ERROR: TSC: /home/vlado/dev/human/src/interpolate.ts [5,23]: Module '"./result"' has no exported member 'Face'.
2021-09-11 23:31:50 ERROR: TSC: /home/vlado/dev/human/src/interpolate.ts [5,29]: Module '"./result"' has no exported member 'Body'.
2021-09-11 23:31:50 ERROR: TSC: /home/vlado/dev/human/src/interpolate.ts [5,35]: Module '"./result"' has no exported member 'Hand'.
2021-09-11 23:31:50 ERROR: TSC: /home/vlado/dev/human/src/interpolate.ts [5,41]: Module '"./result"' has no exported member 'Item'.
2021-09-11 23:31:50 ERROR: TSC: /home/vlado/dev/human/src/interpolate.ts [5,47]: Module '"./result"' has no exported member 'Gesture'.
2021-09-11 23:31:50 ERROR: TSC: /home/vlado/dev/human/src/interpolate.ts [5,56]: Module '"./result"' has no exported member 'Person'.
2021-09-11 23:31:50 ERROR: TSC: /home/vlado/dev/human/src/movenet/movenet.ts [7,10]: Module '"../result"' has no exported member 'Body'.
2021-09-11 23:31:50 ERROR: TSC: /home/vlado/dev/human/src/object/centernet.ts [8,10]: Module '"../result"' has no exported member 'Item'.
2021-09-11 23:31:50 ERROR: TSC: /home/vlado/dev/human/src/object/nanodet.ts [8,10]: Module '"../result"' has no exported member 'Item'.
2021-09-11 23:31:50 ERROR: TSC: /home/vlado/dev/human/src/persons.ts [5,10]: Module '"./result"' has no exported member 'Face'.
2021-09-11 23:31:50 ERROR: TSC: /home/vlado/dev/human/src/persons.ts [5,16]: Module '"./result"' has no exported member 'Body'.
2021-09-11 23:31:50 ERROR: TSC: /home/vlado/dev/human/src/persons.ts [5,22]: Module '"./result"' has no exported member 'Hand'.
2021-09-11 23:31:50 ERROR: TSC: /home/vlado/dev/human/src/persons.ts [5,28]: Module '"./result"' has no exported member 'Gesture'.
2021-09-11 23:31:50 ERROR: TSC: /home/vlado/dev/human/src/persons.ts [5,37]: Module '"./result"' has no exported member 'Person'.
2021-09-11 23:31:50 ERROR: TSC: /home/vlado/dev/human/src/posenet/posenet.ts [9,10]: Module '"../result"' has no exported member 'Body'.
2021-09-11 23:31:50 ERROR: TSC: /home/vlado/dev/human/src/posenet/utils.ts [2,10]: Module '"../result"' has no exported member 'Body'.
2021-09-11 23:31:53 ERROR: src/blazeface/facemesh.ts:11:10 - error TS2305: Module '"../result"' has no exported member 'Face'.
11 import { Face } from '../result';
   ~~~~
3
2021-09-11 23:31:53 ERROR: src/blazepose/blazepose.ts:11:10 - error TS2305: Module '"../result"' has no exported member 'Body'.
11 import { Body } from '../result';
   ~~~~
3
2021-09-11 23:31:53 ERROR: src/draw/draw.ts:7:23 - error TS2305: Module '"../result"' has no exported member 'Face'.
7 import type { Result, Face, Body, Hand, Item, Gesture, Person } from '../result';
   ~~~~
3
2021-09-11 23:31:53 ERROR: src/draw/draw.ts:7:29 - error TS2305: Module '"../result"' has no exported member 'Body'.
7 import type { Result, Face, Body, Hand, Item, Gesture, Person } from '../result';
   ~~~~
3
2021-09-11 23:31:53 ERROR: src/draw/draw.ts:7:35 - error TS2305: Module '"../result"' has no exported member 'Hand'.
7 import type { Result, Face, Body, Hand, Item, Gesture, Person } from '../result';
   ~~~~
3
2021-09-11 23:31:53 ERROR: src/draw/draw.ts:7:41 - error TS2305: Module '"../result"' has no exported member 'Item'.
7 import type { Result, Face, Body, Hand, Item, Gesture, Person } from '../result';
   ~~~~
3
2021-09-11 23:31:53 ERROR: src/draw/draw.ts:7:47 - error TS2305: Module '"../result"' has no exported member 'Gesture'.
7 import type { Result, Face, Body, Hand, Item, Gesture, Person } from '../result';
   ~~~~~~~
3
2021-09-11 23:31:53 ERROR: src/draw/draw.ts:7:56 - error TS2305: Module '"../result"' has no exported member 'Person'.
7 import type { Result, Face, Body, Hand, Item, Gesture, Person } from '../result';
   ~~~~~~
3
2021-09-11 23:31:53 ERROR: src/efficientpose/efficientpose.ts:7:10 - error TS2305: Module '"../result"' has no exported member 'Body'.
7 import { Body } from '../result';
   ~~~~
3
2021-09-11 23:31:53 ERROR: src/face.ts:11:10 - error TS2305: Module '"./result"' has no exported member 'Face'.
11 import { Face } from './result';
   ~~~~
3
2021-09-11 23:31:53 ERROR: src/gesture/gesture.ts:5:10 - error TS2305: Module '"../result"' has no exported member 'Gesture'.
5 import { Gesture } from '../result';
   ~~~~~~~
3
2021-09-11 23:31:53 ERROR: src/handpose/handpose.ts:10:10 - error TS2305: Module '"../result"' has no exported member 'Hand'.
10 import { Hand } from '../result';
   ~~~~
3
2021-09-11 23:31:53 ERROR: src/interpolate.ts:5:23 - error TS2305: Module '"./result"' has no exported member 'Face'.
5 import type { Result, Face, Body, Hand, Item, Gesture, Person } from './result';
   ~~~~
3
2021-09-11 23:31:53 ERROR: src/interpolate.ts:5:29 - error TS2305: Module '"./result"' has no exported member 'Body'.
5 import type { Result, Face, Body, Hand, Item, Gesture, Person } from './result';
   ~~~~
3
2021-09-11 23:31:53 ERROR: src/interpolate.ts:5:35 - error TS2305: Module '"./result"' has no exported member 'Hand'.
5 import type { Result, Face, Body, Hand, Item, Gesture, Person } from './result';
   ~~~~
3
2021-09-11 23:31:53 ERROR: src/interpolate.ts:5:41 - error TS2305: Module '"./result"' has no exported member 'Item'.
5 import type { Result, Face, Body, Hand, Item, Gesture, Person } from './result';
   ~~~~
3
2021-09-11 23:31:53 ERROR: src/interpolate.ts:5:47 - error TS2305: Module '"./result"' has no exported member 'Gesture'.
5 import type { Result, Face, Body, Hand, Item, Gesture, Person } from './result';
   ~~~~~~~
3
2021-09-11 23:31:53 ERROR: src/interpolate.ts:5:56 - error TS2305: Module '"./result"' has no exported member 'Person'.
5 import type { Result, Face, Body, Hand, Item, Gesture, Person } from './result';
   ~~~~~~
3
2021-09-11 23:31:53 ERROR: src/movenet/movenet.ts:7:10 - error TS2305: Module '"../result"' has no exported member 'Body'.
7 import { Body } from '../result';
   ~~~~
3
2021-09-11 23:31:53 ERROR: src/object/centernet.ts:8:10 - error TS2305: Module '"../result"' has no exported member 'Item'.
8 import { Item } from '../result';
   ~~~~
3
2021-09-11 23:31:53 ERROR: src/object/nanodet.ts:8:10 - error TS2305: Module '"../result"' has no exported member 'Item'.
8 import { Item } from '../result';
   ~~~~
3
2021-09-11 23:31:53 ERROR: src/persons.ts:5:10 - error TS2305: Module '"./result"' has no exported member 'Face'.
5 import { Face, Body, Hand, Gesture, Person } from './result';
   ~~~~
3
2021-09-11 23:31:53 ERROR: src/persons.ts:5:16 - error TS2305: Module '"./result"' has no exported member 'Body'.
5 import { Face, Body, Hand, Gesture, Person } from './result';
   ~~~~
3
2021-09-11 23:31:53 ERROR: src/persons.ts:5:22 - error TS2305: Module '"./result"' has no exported member 'Hand'.
5 import { Face, Body, Hand, Gesture, Person } from './result';
   ~~~~
3
2021-09-11 23:31:53 ERROR: src/persons.ts:5:28 - error TS2305: Module '"./result"' has no exported member 'Gesture'.
5 import { Face, Body, Hand, Gesture, Person } from './result';
   ~~~~~~~
3
2021-09-11 23:31:53 ERROR: src/persons.ts:5:37 - error TS2305: Module '"./result"' has no exported member 'Person'.
5 import { Face, Body, Hand, Gesture, Person } from './result';
   ~~~~~~
3
2021-09-11 23:31:53 ERROR: src/posenet/posenet.ts:9:10 - error TS2305: Module '"../result"' has no exported member 'Body'.
9 import { Body } from '../result';
   ~~~~
3
2021-09-11 23:31:53 ERROR: src/posenet/utils.ts:2:10 - error TS2305: Module '"../result"' has no exported member 'Body'.
2 import { Body } from '../result';
   ~~~~
3
2021-09-11 23:31:53 ERROR: TypeDoc: convert returned empty project
2021-09-11 23:32:20 STATE: Lint: {"locations":["src/**/*.ts","test/*.js","demo/**/*.js"],"files":75,"errors":0,"warnings":0}
2021-09-11 23:32:20 STATE: ChangeLog: {"repository":"https://github.com/vladmandic/human","branch":"main","output":"CHANGELOG.md"}
2021-09-11 23:32:20 INFO:  Done...
2021-09-11 23:34:49 INFO:  @vladmandic/human version 2.1.5
2021-09-11 23:34:49 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.5.0
2021-09-11 23:34:49 INFO:  Application: {"name":"@vladmandic/human","version":"2.1.5"}
2021-09-11 23:34:49 INFO:  Environment: {"profile":"production","config":"build.json","tsconfig":true,"eslintrc":true,"git":true}
2021-09-11 23:34:49 INFO:  Toolchain: {"build":"0.4.1","esbuild":"0.12.26","typescript":"4.4.3","typedoc":"0.21.9","eslint":"7.32.0"}
2021-09-11 23:34:49 INFO:  Build: {"profile":"production","steps":["clean","compile","typings","typedoc","lint","changelog"]}
2021-09-11 23:34:49 STATE: Clean: {"locations":["dist/*","types/*","typedoc/*"]}
2021-09-11 23:34:49 STATE: 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-11 23:34:49 STATE: Compile: {"name":"human/nodejs/cpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node.js","files":48,"inputBytes":465475,"outputBytes":397891}
2021-09-11 23:34:49 STATE: 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-11 23:34:49 STATE: Compile: {"name":"human/nodejs/gpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-gpu.js","files":48,"inputBytes":465483,"outputBytes":397895}
2021-09-11 23:34:49 STATE: 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-11 23:34:49 STATE: Compile: {"name":"human/nodejs/wasm","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-wasm.js","files":48,"inputBytes":465550,"outputBytes":397967}
2021-09-11 23:34:49 STATE: 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-11 23:34:49 STATE: Compile: {"name":"human/browser/esm/nobundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm-nobundle.js","files":48,"inputBytes":465649,"outputBytes":399855}
2021-09-11 23:34:50 STATE: 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-11 23:34:50 STATE: Compile: {"name":"human/browser/iife/bundle","format":"iife","platform":"browser","input":"src/human.ts","output":"dist/human.js","files":48,"inputBytes":2808042,"outputBytes":1392634}
2021-09-11 23:34:50 STATE: Compile: {"name":"human/browser/esm/bundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm.js","files":48,"inputBytes":2808042,"outputBytes":2584793}
2021-09-11 23:35:05 STATE: Typings: {"input":"src/human.ts","output":"types","files":47}
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/blazeface/blazeface.ts [65,76]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/blazeface/blazeface.ts [65,115]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/blazeface/blazeface.ts [65,155]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/blazeface/blazeface.ts [72,24]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/blazeface/blazeface.ts [92,68]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/blazeface/blazeface.ts [92,114]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/blazeface/blazeface.ts [94,60]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/blazeface/facemesh.ts [11,10]: Module '"../result"' has no exported member 'Face'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/blazepose/blazepose.ts [11,10]: Module '"../result"' has no exported member 'Body'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/blazepose/blazepose.ts [18,64]: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/draw/draw.ts [7,23]: Module '"../result"' has no exported member 'Face'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/draw/draw.ts [7,29]: Module '"../result"' has no exported member 'Body'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/draw/draw.ts [7,35]: Module '"../result"' has no exported member 'Hand'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/draw/draw.ts [7,41]: Module '"../result"' has no exported member 'Item'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/draw/draw.ts [7,47]: Module '"../result"' has no exported member 'Gesture'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/draw/draw.ts [7,56]: Module '"../result"' has no exported member 'Person'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/efficientpose/efficientpose.ts [7,10]: Module '"../result"' has no exported member 'Body'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/efficientpose/efficientpose.ts [25,64]: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/efficientpose/efficientpose.ts [50,18]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/efficientpose/efficientpose.ts [79,21]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/emotion/emotion.ts [22,64]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/emotion/emotion.ts [23,62]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/emotion/emotion.ts [31,18]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/emotion/emotion.ts [54,9]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/emotion/emotion.ts [59,23]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/face.ts [11,10]: Module '"./result"' has no exported member 'Face'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/faceres/faceres.ts [26,47]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/faceres/faceres.ts [29,43]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/faceres/faceres.ts [115,18]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/faceres/faceres.ts [131,9]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/faceres/faceres.ts [137,24]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/gesture/gesture.ts [5,10]: Module '"../result"' has no exported member 'Gesture'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/handpose/handpose.ts [10,10]: Module '"../result"' has no exported member 'Hand'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/handpose/handpose.ts [85,74]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/handpose/handpose.ts [85,120]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/handpose/handpose.ts [86,76]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/handpose/handpose.ts [86,122]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/handpose/handpose.ts [89,91]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/handpose/handpose.ts [91,83]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/image/image.ts [60,9]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/image/image.ts [61,14]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/image/image.ts [61,71]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/image/image.ts [62,9]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/image/image.ts [63,14]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/image/image.ts [63,72]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/interpolate.ts [5,59]: Module '"./result"' has no exported member 'ItemResult'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/movenet/movenet.ts [7,10]: Module '"../result"' has no exported member 'Body'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/movenet/movenet.ts [26,64]: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/movenet/movenet.ts [118,18]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/object/centernet.ts [8,10]: Module '"../result"' has no exported member 'Item'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/object/centernet.ts [18,64]: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/object/centernet.ts [74,18]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/object/nanodet.ts [8,10]: Module '"../result"' has no exported member 'Item'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/object/nanodet.ts [20,64]: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/object/nanodet.ts [106,18]: Object is possibly 'undefined'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/posenet/posenet.ts [9,10]: Module '"../result"' has no exported member 'Body'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/posenet/posenet.ts [38,64]: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/posenet/utils.ts [2,10]: Module '"../result"' has no exported member 'Body'.
2021-09-11 23:35:05 ERROR: TSC: /home/vlado/dev/human/src/segmentation/segmentation.ts [18,64]: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
2021-09-11 23:35:08 ERROR: src/blazeface/blazeface.ts:65:76 - error TS2532: Object is possibly 'undefined'.
65 const nmsTensor = await tf.image.nonMaxSuppressionAsync(boxes, scores, this.config.face.detector.maxDetected, this.config.face.detector.iouThreshold, this.config.face.detector.minConfidence);
   ~~~~~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/blazeface/blazeface.ts:65:115 - error TS2532: Object is possibly 'undefined'.
65 const nmsTensor = await tf.image.nonMaxSuppressionAsync(boxes, scores, this.config.face.detector.maxDetected, this.config.face.detector.iouThreshold, this.config.face.detector.minConfidence);
   ~~~~~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/blazeface/blazeface.ts:65:155 - error TS2532: Object is possibly 'undefined'.
65 const nmsTensor = await tf.image.nonMaxSuppressionAsync(boxes, scores, this.config.face.detector.maxDetected, this.config.face.detector.iouThreshold, this.config.face.detector.minConfidence);
   ~~~~~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/blazeface/blazeface.ts:72:24 - error TS2532: Object is possibly 'undefined'.
72 if (confidence > this.config.face.detector.minConfidence) {
   ~~~~~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/blazeface/blazeface.ts:92:68 - error TS2532: Object is possibly 'undefined'.
92 const model = await tf.loadGraphModel(join(config.modelBasePath, config.face.detector.modelPath), { fromTFHub: config.face.detector.modelPath.includes('tfhub.dev') });
   ~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/blazeface/blazeface.ts:92:114 - error TS2532: Object is possibly 'undefined'.
92 const model = await tf.loadGraphModel(join(config.modelBasePath, config.face.detector.modelPath), { fromTFHub: config.face.detector.modelPath.includes('tfhub.dev') });
   ~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/blazeface/blazeface.ts:94:60 - error TS2532: Object is possibly 'undefined'.
94 if (!model || !model.modelUrl) log('load model failed:', config.face.detector.modelPath);
   ~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/blazeface/facemesh.ts:11:10 - error TS2305: Module '"../result"' has no exported member 'Face'.
11 import { Face } from '../result';
   ~~~~
3
2021-09-11 23:35:08 ERROR: src/blazepose/blazepose.ts:11:10 - error TS2305: Module '"../result"' has no exported member 'Body'.
11 import { Body } from '../result';
   ~~~~
3
2021-09-11 23:35:08 ERROR: src/blazepose/blazepose.ts:18:64 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
Type 'undefined' is not assignable to type 'string'.
18 model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath)) as unknown as GraphModel;
   ~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/draw/draw.ts:7:23 - error TS2305: Module '"../result"' has no exported member 'Face'.
7 import type { Result, Face, Body, Hand, Item, Gesture, Person } from '../result';
   ~~~~
3
2021-09-11 23:35:08 ERROR: src/draw/draw.ts:7:29 - error TS2305: Module '"../result"' has no exported member 'Body'.
7 import type { Result, Face, Body, Hand, Item, Gesture, Person } from '../result';
   ~~~~
3
2021-09-11 23:35:08 ERROR: src/draw/draw.ts:7:35 - error TS2305: Module '"../result"' has no exported member 'Hand'.
7 import type { Result, Face, Body, Hand, Item, Gesture, Person } from '../result';
   ~~~~
3
2021-09-11 23:35:08 ERROR: src/draw/draw.ts:7:41 - error TS2305: Module '"../result"' has no exported member 'Item'.
7 import type { Result, Face, Body, Hand, Item, Gesture, Person } from '../result';
   ~~~~
3
2021-09-11 23:35:08 ERROR: src/draw/draw.ts:7:47 - error TS2305: Module '"../result"' has no exported member 'Gesture'.
7 import type { Result, Face, Body, Hand, Item, Gesture, Person } from '../result';
   ~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/draw/draw.ts:7:56 - error TS2305: Module '"../result"' has no exported member 'Person'.
7 import type { Result, Face, Body, Hand, Item, Gesture, Person } from '../result';
   ~~~~~~
3
2021-09-11 23:35:08 ERROR: src/efficientpose/efficientpose.ts:7:10 - error TS2305: Module '"../result"' has no exported member 'Body'.
7 import { Body } from '../result';
   ~~~~
3
2021-09-11 23:35:08 ERROR: src/efficientpose/efficientpose.ts:25:64 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
Type 'undefined' is not assignable to type 'string'.
25 model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath)) as unknown as GraphModel;
   ~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/efficientpose/efficientpose.ts:50:18 - error TS2532: Object is possibly 'undefined'.
50 if ((skipped < config.body.skipFrames) && config.skipFrame && Object.keys(keypoints).length > 0) {
   ~~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/efficientpose/efficientpose.ts:79:21 - error TS2532: Object is possibly 'undefined'.
79 if (score > config.body.minConfidence) {
   ~~~~~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/emotion/emotion.ts:22:64 - error TS2532: Object is possibly 'undefined'.
22 model = await tf.loadGraphModel(join(config.modelBasePath, config.face.emotion.modelPath));
   ~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/emotion/emotion.ts:23:62 - error TS2532: Object is possibly 'undefined'.
23 if (!model || !model.modelUrl) log('load model failed:', config.face.emotion.modelPath);
   ~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/emotion/emotion.ts:31:18 - error TS2532: Object is possibly 'undefined'.
31 if ((skipped < config.face.emotion.skipFrames) && config.skipFrame && (lastCount === count) && last[idx] && (last[idx].length > 0)) {
   ~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/emotion/emotion.ts:54:9 - error TS2532: Object is possibly 'undefined'.
54 if (config.face.emotion.enabled) {
   ~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/emotion/emotion.ts:59:23 - error TS2532: Object is possibly 'undefined'.
59 if (data[i] > config.face.emotion.minConfidence) obj.push({ score: Math.min(0.99, Math.trunc(100 * data[i]) / 100), emotion: annotations[i] });
   ~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/face.ts:11:10 - error TS2305: Module '"./result"' has no exported member 'Face'.
11 import { Face } from './result';
   ~~~~
3
2021-09-11 23:35:08 ERROR: src/faceres/faceres.ts:26:47 - error TS2532: Object is possibly 'undefined'.
26 const modelUrl = join(config.modelBasePath, config.face.description.modelPath);
   ~~~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/faceres/faceres.ts:29:43 - error TS2532: Object is possibly 'undefined'.
29 if (!model) log('load model failed:', config.face.description.modelPath);
   ~~~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/faceres/faceres.ts:115:18 - error TS2532: Object is possibly 'undefined'.
115 if ((skipped < config.face.description.skipFrames) && config.skipFrame && (lastCount === count) && last[idx]?.age && (last[idx]?.age > 0)) {
   ~~~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/faceres/faceres.ts:131:9 - error TS2532: Object is possibly 'undefined'.
131 if (config.face.description.enabled) resT = await model.predict(enhanced);
   ~~~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/faceres/faceres.ts:137:24 - error TS2532: Object is possibly 'undefined'.
137 if (confidence > config.face.description.minConfidence) {
   ~~~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/gesture/gesture.ts:5:10 - error TS2305: Module '"../result"' has no exported member 'Gesture'.
5 import { Gesture } from '../result';
   ~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/handpose/handpose.ts:10:10 - error TS2305: Module '"../result"' has no exported member 'Hand'.
10 import { Hand } from '../result';
   ~~~~
3
2021-09-11 23:35:08 ERROR: src/handpose/handpose.ts:85:74 - error TS2532: Object is possibly 'undefined'.
85 config.hand.enabled ? tf.loadGraphModel(join(config.modelBasePath, config.hand.detector.modelPath), { fromTFHub: config.hand.detector.modelPath.includes('tfhub.dev') }) as unknown as GraphModel : null,
   ~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/handpose/handpose.ts:85:120 - error TS2532: Object is possibly 'undefined'.
85 config.hand.enabled ? tf.loadGraphModel(join(config.modelBasePath, config.hand.detector.modelPath), { fromTFHub: config.hand.detector.modelPath.includes('tfhub.dev') }) as unknown as GraphModel : null,
   ~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/handpose/handpose.ts:86:76 - error TS2532: Object is possibly 'undefined'.
86 config.hand.landmarks ? tf.loadGraphModel(join(config.modelBasePath, config.hand.skeleton.modelPath), { fromTFHub: config.hand.skeleton.modelPath.includes('tfhub.dev') }) as unknown as GraphModel : null,
   ~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/handpose/handpose.ts:86:122 - error TS2532: Object is possibly 'undefined'.
86 config.hand.landmarks ? tf.loadGraphModel(join(config.modelBasePath, config.hand.skeleton.modelPath), { fromTFHub: config.hand.skeleton.modelPath.includes('tfhub.dev') }) as unknown as GraphModel : null,
   ~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/handpose/handpose.ts:89:91 - error TS2532: Object is possibly 'undefined'.
89 if (!handDetectorModel || !handDetectorModel['modelUrl']) log('load model failed:', config.hand.detector.modelPath);
   ~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/handpose/handpose.ts:91:83 - error TS2532: Object is possibly 'undefined'.
91 if (!handPoseModel || !handPoseModel['modelUrl']) log('load model failed:', config.hand.skeleton.modelPath);
   ~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/image/image.ts:60:9 - error TS2532: Object is possibly 'undefined'.
60 if (config.filter.width > 0) targetWidth = config.filter.width;
   ~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/image/image.ts:61:14 - error TS2532: Object is possibly 'undefined'.
61 else if (config.filter.height > 0) targetWidth = originalWidth * (config.filter.height / originalHeight);
   ~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/image/image.ts:61:71 - error TS2532: Object is possibly 'undefined'.
61 else if (config.filter.height > 0) targetWidth = originalWidth * (config.filter.height / originalHeight);
   ~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/image/image.ts:62:9 - error TS2532: Object is possibly 'undefined'.
62 if (config.filter.height > 0) targetHeight = config.filter.height;
   ~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/image/image.ts:63:14 - error TS2532: Object is possibly 'undefined'.
63 else if (config.filter.width > 0) targetHeight = originalHeight * (config.filter.width / originalWidth);
   ~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/image/image.ts:63:72 - error TS2532: Object is possibly 'undefined'.
63 else if (config.filter.width > 0) targetHeight = originalHeight * (config.filter.width / originalWidth);
   ~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/interpolate.ts:5:59 - error TS2305: Module '"./result"' has no exported member 'ItemResult'.
5 import type { Result, FaceResult, BodyResult, HandResult, ItemResult, GestureResult, PersonResult } from './result';
   ~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/movenet/movenet.ts:7:10 - error TS2305: Module '"../result"' has no exported member 'Body'.
7 import { Body } from '../result';
   ~~~~
3
2021-09-11 23:35:08 ERROR: src/movenet/movenet.ts:26:64 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
Type 'undefined' is not assignable to type 'string'.
26 model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath)) as unknown as GraphModel;
   ~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/movenet/movenet.ts:118:18 - error TS2532: Object is possibly 'undefined'.
118 if ((skipped < config.body.skipFrames) && config.skipFrame && Object.keys(keypoints).length > 0) {
   ~~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/object/centernet.ts:8:10 - error TS2305: Module '"../result"' has no exported member 'Item'.
8 import { Item } from '../result';
   ~~~~
3
2021-09-11 23:35:08 ERROR: src/object/centernet.ts:18:64 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
Type 'undefined' is not assignable to type 'string'.
18 model = await tf.loadGraphModel(join(config.modelBasePath, config.object.modelPath));
   ~~~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/object/centernet.ts:74:18 - error TS2532: Object is possibly 'undefined'.
74 if ((skipped < config.object.skipFrames) && config.skipFrame && (last.length > 0)) {
   ~~~~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/object/nanodet.ts:8:10 - error TS2305: Module '"../result"' has no exported member 'Item'.
8 import { Item } from '../result';
   ~~~~
3
2021-09-11 23:35:08 ERROR: src/object/nanodet.ts:20:64 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
Type 'undefined' is not assignable to type 'string'.
20 model = await tf.loadGraphModel(join(config.modelBasePath, config.object.modelPath));
   ~~~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/object/nanodet.ts:106:18 - error TS2532: Object is possibly 'undefined'.
106 if ((skipped < config.object.skipFrames) && config.skipFrame && (last.length > 0)) {
   ~~~~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/posenet/posenet.ts:9:10 - error TS2305: Module '"../result"' has no exported member 'Body'.
9 import { Body } from '../result';
   ~~~~
3
2021-09-11 23:35:08 ERROR: src/posenet/posenet.ts:38:64 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
Type 'undefined' is not assignable to type 'string'.
38 model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath)) as unknown as GraphModel;
   ~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: src/posenet/utils.ts:2:10 - error TS2305: Module '"../result"' has no exported member 'Body'.
2 import { Body } from '../result';
   ~~~~
3
2021-09-11 23:35:08 ERROR: src/segmentation/segmentation.ts:18:64 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
Type 'undefined' is not assignable to type 'string'.
18 model = await tf.loadGraphModel(join(config.modelBasePath, config.segmentation.modelPath)) as unknown as GraphModel;
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:35:08 ERROR: TypeDoc: convert returned empty project
2021-09-11 23:35:33 STATE: Lint: {"locations":["src/**/*.ts","test/*.js","demo/**/*.js"],"files":75,"errors":0,"warnings":0}
2021-09-11 23:35:33 STATE: ChangeLog: {"repository":"https://github.com/vladmandic/human","branch":"main","output":"CHANGELOG.md"}
2021-09-11 23:35:33 INFO:  Done...
2021-09-11 23:43:43 INFO:  @vladmandic/human version 2.1.5
2021-09-11 23:43:43 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.5.0
2021-09-11 23:43:43 INFO:  Application: {"name":"@vladmandic/human","version":"2.1.5"}
2021-09-11 23:43:43 INFO:  Environment: {"profile":"production","config":"build.json","tsconfig":true,"eslintrc":true,"git":true}
2021-09-11 23:43:43 INFO:  Toolchain: {"build":"0.4.1","esbuild":"0.12.26","typescript":"4.4.3","typedoc":"0.21.9","eslint":"7.32.0"}
2021-09-11 23:43:43 INFO:  Build: {"profile":"production","steps":["clean","compile","typings","typedoc","lint","changelog"]}
2021-09-11 23:43:43 STATE: Clean: {"locations":["dist/*","types/*","typedoc/*"]}
2021-09-11 23:43:43 STATE: 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-11 23:43:43 STATE: Compile: {"name":"human/nodejs/cpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node.js","files":48,"inputBytes":465733,"outputBytes":398285}
2021-09-11 23:43:43 STATE: 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-11 23:43:43 STATE: Compile: {"name":"human/nodejs/gpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-gpu.js","files":48,"inputBytes":465741,"outputBytes":398289}
2021-09-11 23:43:43 STATE: 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-11 23:43:43 STATE: Compile: {"name":"human/nodejs/wasm","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-wasm.js","files":48,"inputBytes":465808,"outputBytes":398361}
2021-09-11 23:43:43 STATE: 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-11 23:43:43 STATE: Compile: {"name":"human/browser/esm/nobundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm-nobundle.js","files":48,"inputBytes":465907,"outputBytes":400249}
2021-09-11 23:43:44 STATE: 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-11 23:43:44 STATE: Compile: {"name":"human/browser/iife/bundle","format":"iife","platform":"browser","input":"src/human.ts","output":"dist/human.js","files":48,"inputBytes":2808300,"outputBytes":1392896}
2021-09-11 23:43:45 STATE: Compile: {"name":"human/browser/esm/bundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm.js","files":48,"inputBytes":2808300,"outputBytes":2585187}
2021-09-11 23:44:00 STATE: Typings: {"input":"src/human.ts","output":"types","files":47}
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/blazeface/facemesh.ts [11,10]: Module '"../result"' has no exported member 'Face'.
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/blazepose/blazepose.ts [11,10]: Module '"../result"' has no exported member 'Body'.
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/blazepose/blazepose.ts [18,64]: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/draw/draw.ts [7,23]: Module '"../result"' has no exported member 'Face'.
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/draw/draw.ts [7,29]: Module '"../result"' has no exported member 'Body'.
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/draw/draw.ts [7,35]: Module '"../result"' has no exported member 'Hand'.
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/draw/draw.ts [7,41]: Module '"../result"' has no exported member 'Item'.
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/draw/draw.ts [7,47]: Module '"../result"' has no exported member 'Gesture'.
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/draw/draw.ts [7,56]: Module '"../result"' has no exported member 'Person'.
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/efficientpose/efficientpose.ts [7,10]: Module '"../result"' has no exported member 'Body'.
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/efficientpose/efficientpose.ts [25,64]: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/efficientpose/efficientpose.ts [50,18]: Object is possibly 'undefined'.
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/efficientpose/efficientpose.ts [79,21]: Object is possibly 'undefined'.
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/emotion/emotion.ts [22,64]: Object is possibly 'undefined'.
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/emotion/emotion.ts [23,62]: Object is possibly 'undefined'.
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/emotion/emotion.ts [31,18]: Object is possibly 'undefined'.
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/emotion/emotion.ts [54,9]: Object is possibly 'undefined'.
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/emotion/emotion.ts [59,23]: Object is possibly 'undefined'.
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/face.ts [11,10]: Module '"./result"' has no exported member 'Face'.
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/faceres/faceres.ts [26,47]: Object is possibly 'undefined'.
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/faceres/faceres.ts [29,43]: Object is possibly 'undefined'.
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/faceres/faceres.ts [115,18]: Object is possibly 'undefined'.
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/faceres/faceres.ts [131,9]: Object is possibly 'undefined'.
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/faceres/faceres.ts [137,24]: Object is possibly 'undefined'.
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/gesture/gesture.ts [5,10]: Module '"../result"' has no exported member 'Gesture'.
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/handpose/handpose.ts [10,10]: Module '"../result"' has no exported member 'Hand'.
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/handpose/handpose.ts [85,74]: Object is possibly 'undefined'.
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/handpose/handpose.ts [85,120]: Object is possibly 'undefined'.
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/handpose/handpose.ts [86,76]: Object is possibly 'undefined'.
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/handpose/handpose.ts [86,122]: Object is possibly 'undefined'.
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/handpose/handpose.ts [89,91]: Object is possibly 'undefined'.
2021-09-11 23:44:00 ERROR: TSC: /home/vlado/dev/human/src/handpose/handpose.ts [91,83]: Object is possibly 'undefined'.
2021-09-11 23:44:04 ERROR: src/blazeface/facemesh.ts:11:10 - error TS2305: Module '"../result"' has no exported member 'Face'.
11 import { Face } from '../result';
   ~~~~
3
2021-09-11 23:44:04 ERROR: src/blazepose/blazepose.ts:11:10 - error TS2305: Module '"../result"' has no exported member 'Body'.
11 import { Body } from '../result';
   ~~~~
3
2021-09-11 23:44:04 ERROR: src/blazepose/blazepose.ts:18:64 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
Type 'undefined' is not assignable to type 'string'.
18 model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath)) as unknown as GraphModel;
   ~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:44:04 ERROR: src/draw/draw.ts:7:23 - error TS2305: Module '"../result"' has no exported member 'Face'.
7 import type { Result, Face, Body, Hand, Item, Gesture, Person } from '../result';
   ~~~~
3
2021-09-11 23:44:04 ERROR: src/draw/draw.ts:7:29 - error TS2305: Module '"../result"' has no exported member 'Body'.
7 import type { Result, Face, Body, Hand, Item, Gesture, Person } from '../result';
   ~~~~
3
2021-09-11 23:44:04 ERROR: src/draw/draw.ts:7:35 - error TS2305: Module '"../result"' has no exported member 'Hand'.
7 import type { Result, Face, Body, Hand, Item, Gesture, Person } from '../result';
   ~~~~
3
2021-09-11 23:44:04 ERROR: src/draw/draw.ts:7:41 - error TS2305: Module '"../result"' has no exported member 'Item'.
7 import type { Result, Face, Body, Hand, Item, Gesture, Person } from '../result';
   ~~~~
3
2021-09-11 23:44:04 ERROR: src/draw/draw.ts:7:47 - error TS2305: Module '"../result"' has no exported member 'Gesture'.
7 import type { Result, Face, Body, Hand, Item, Gesture, Person } from '../result';
   ~~~~~~~
3
2021-09-11 23:44:04 ERROR: src/draw/draw.ts:7:56 - error TS2305: Module '"../result"' has no exported member 'Person'.
7 import type { Result, Face, Body, Hand, Item, Gesture, Person } from '../result';
   ~~~~~~
3
2021-09-11 23:44:04 ERROR: src/efficientpose/efficientpose.ts:7:10 - error TS2305: Module '"../result"' has no exported member 'Body'.
7 import { Body } from '../result';
   ~~~~
3
2021-09-11 23:44:04 ERROR: src/efficientpose/efficientpose.ts:25:64 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
Type 'undefined' is not assignable to type 'string'.
25 model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath)) as unknown as GraphModel;
   ~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:44:04 ERROR: src/efficientpose/efficientpose.ts:50:18 - error TS2532: Object is possibly 'undefined'.
50 if ((skipped < config.body.skipFrames) && config.skipFrame && Object.keys(keypoints).length > 0) {
   ~~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:44:04 ERROR: src/efficientpose/efficientpose.ts:79:21 - error TS2532: Object is possibly 'undefined'.
79 if (score > config.body.minConfidence) {
   ~~~~~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:44:04 ERROR: src/emotion/emotion.ts:22:64 - error TS2532: Object is possibly 'undefined'.
22 model = await tf.loadGraphModel(join(config.modelBasePath, config.face.emotion.modelPath));
   ~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:44:04 ERROR: src/emotion/emotion.ts:23:62 - error TS2532: Object is possibly 'undefined'.
23 if (!model || !model.modelUrl) log('load model failed:', config.face.emotion.modelPath);
   ~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:44:04 ERROR: src/emotion/emotion.ts:31:18 - error TS2532: Object is possibly 'undefined'.
31 if ((skipped < config.face.emotion.skipFrames) && config.skipFrame && (lastCount === count) && last[idx] && (last[idx].length > 0)) {
   ~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:44:04 ERROR: src/emotion/emotion.ts:54:9 - error TS2532: Object is possibly 'undefined'.
54 if (config.face.emotion.enabled) {
   ~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:44:04 ERROR: src/emotion/emotion.ts:59:23 - error TS2532: Object is possibly 'undefined'.
59 if (data[i] > config.face.emotion.minConfidence) obj.push({ score: Math.min(0.99, Math.trunc(100 * data[i]) / 100), emotion: annotations[i] });
   ~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:44:04 ERROR: src/face.ts:11:10 - error TS2305: Module '"./result"' has no exported member 'Face'.
11 import { Face } from './result';
   ~~~~
3
2021-09-11 23:44:04 ERROR: src/faceres/faceres.ts:26:47 - error TS2532: Object is possibly 'undefined'.
26 const modelUrl = join(config.modelBasePath, config.face.description.modelPath);
   ~~~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:44:04 ERROR: src/faceres/faceres.ts:29:43 - error TS2532: Object is possibly 'undefined'.
29 if (!model) log('load model failed:', config.face.description.modelPath);
   ~~~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:44:04 ERROR: src/faceres/faceres.ts:115:18 - error TS2532: Object is possibly 'undefined'.
115 if ((skipped < config.face.description.skipFrames) && config.skipFrame && (lastCount === count) && last[idx]?.age && (last[idx]?.age > 0)) {
   ~~~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:44:04 ERROR: src/faceres/faceres.ts:131:9 - error TS2532: Object is possibly 'undefined'.
131 if (config.face.description.enabled) resT = await model.predict(enhanced);
   ~~~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:44:04 ERROR: src/faceres/faceres.ts:137:24 - error TS2532: Object is possibly 'undefined'.
137 if (confidence > config.face.description.minConfidence) {
   ~~~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:44:04 ERROR: src/gesture/gesture.ts:5:10 - error TS2305: Module '"../result"' has no exported member 'Gesture'.
5 import { Gesture } from '../result';
   ~~~~~~~
3
2021-09-11 23:44:04 ERROR: src/handpose/handpose.ts:10:10 - error TS2305: Module '"../result"' has no exported member 'Hand'.
10 import { Hand } from '../result';
   ~~~~
3
2021-09-11 23:44:04 ERROR: src/handpose/handpose.ts:85:74 - error TS2532: Object is possibly 'undefined'.
85 config.hand.enabled ? tf.loadGraphModel(join(config.modelBasePath, config.hand.detector.modelPath), { fromTFHub: config.hand.detector.modelPath.includes('tfhub.dev') }) as unknown as GraphModel : null,
   ~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:44:04 ERROR: src/handpose/handpose.ts:85:120 - error TS2532: Object is possibly 'undefined'.
85 config.hand.enabled ? tf.loadGraphModel(join(config.modelBasePath, config.hand.detector.modelPath), { fromTFHub: config.hand.detector.modelPath.includes('tfhub.dev') }) as unknown as GraphModel : null,
   ~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:44:04 ERROR: src/handpose/handpose.ts:86:76 - error TS2532: Object is possibly 'undefined'.
86 config.hand.landmarks ? tf.loadGraphModel(join(config.modelBasePath, config.hand.skeleton.modelPath), { fromTFHub: config.hand.skeleton.modelPath.includes('tfhub.dev') }) as unknown as GraphModel : null,
   ~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:44:04 ERROR: src/handpose/handpose.ts:86:122 - error TS2532: Object is possibly 'undefined'.
86 config.hand.landmarks ? tf.loadGraphModel(join(config.modelBasePath, config.hand.skeleton.modelPath), { fromTFHub: config.hand.skeleton.modelPath.includes('tfhub.dev') }) as unknown as GraphModel : null,
   ~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:44:04 ERROR: src/handpose/handpose.ts:89:91 - error TS2532: Object is possibly 'undefined'.
89 if (!handDetectorModel || !handDetectorModel['modelUrl']) log('load model failed:', config.hand.detector.modelPath);
   ~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:44:04 ERROR: src/handpose/handpose.ts:91:83 - error TS2532: Object is possibly 'undefined'.
91 if (!handPoseModel || !handPoseModel['modelUrl']) log('load model failed:', config.hand.skeleton.modelPath);
   ~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:44:04 ERROR: TypeDoc: convert returned empty project
2021-09-11 23:44:29 STATE: Lint: {"locations":["src/**/*.ts","test/*.js","demo/**/*.js"],"files":75,"errors":0,"warnings":0}
2021-09-11 23:44:29 STATE: ChangeLog: {"repository":"https://github.com/vladmandic/human","branch":"main","output":"CHANGELOG.md"}
2021-09-11 23:44:29 INFO:  Done...
2021-09-11 23:46:48 INFO:  @vladmandic/human version 2.1.5
2021-09-11 23:46:48 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.5.0
2021-09-11 23:46:48 INFO:  Application: {"name":"@vladmandic/human","version":"2.1.5"}
2021-09-11 23:46:48 INFO:  Environment: {"profile":"production","config":"build.json","tsconfig":true,"eslintrc":true,"git":true}
2021-09-11 23:46:48 INFO:  Toolchain: {"build":"0.4.1","esbuild":"0.12.26","typescript":"4.4.3","typedoc":"0.21.9","eslint":"7.32.0"}
2021-09-11 23:46:48 INFO:  Build: {"profile":"production","steps":["clean","compile","typings","typedoc","lint","changelog"]}
2021-09-11 23:46:48 STATE: Clean: {"locations":["dist/*","types/*","typedoc/*"]}
2021-09-11 23:46:48 STATE: 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-11 23:46:48 STATE: Compile: {"name":"human/nodejs/cpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node.js","files":48,"inputBytes":465840,"outputBytes":398760}
2021-09-11 23:46:48 STATE: 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-11 23:46:48 STATE: Compile: {"name":"human/nodejs/gpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-gpu.js","files":48,"inputBytes":465848,"outputBytes":398764}
2021-09-11 23:46:48 STATE: 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-11 23:46:48 STATE: Compile: {"name":"human/nodejs/wasm","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-wasm.js","files":48,"inputBytes":465915,"outputBytes":398836}
2021-09-11 23:46:48 STATE: 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-11 23:46:48 STATE: Compile: {"name":"human/browser/esm/nobundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm-nobundle.js","files":48,"inputBytes":466014,"outputBytes":400724}
2021-09-11 23:46:48 STATE: 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-11 23:46:49 STATE: Compile: {"name":"human/browser/iife/bundle","format":"iife","platform":"browser","input":"src/human.ts","output":"dist/human.js","files":48,"inputBytes":2808407,"outputBytes":1393207}
2021-09-11 23:46:49 STATE: Compile: {"name":"human/browser/esm/bundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm.js","files":48,"inputBytes":2808407,"outputBytes":2585662}
2021-09-11 23:47:05 STATE: Typings: {"input":"src/human.ts","output":"types","files":47}
2021-09-11 23:47:05 ERROR: TSC: /home/vlado/dev/human/src/blazeface/facemesh.ts [11,10]: Module '"../result"' has no exported member 'Face'.
2021-09-11 23:47:05 ERROR: TSC: /home/vlado/dev/human/src/blazepose/blazepose.ts [11,10]: Module '"../result"' has no exported member 'Body'.
2021-09-11 23:47:05 ERROR: TSC: /home/vlado/dev/human/src/blazepose/blazepose.ts [18,64]: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
2021-09-11 23:47:05 ERROR: TSC: /home/vlado/dev/human/src/draw/draw.ts [7,23]: Module '"../result"' has no exported member 'Face'.
2021-09-11 23:47:05 ERROR: TSC: /home/vlado/dev/human/src/draw/draw.ts [7,29]: Module '"../result"' has no exported member 'Body'.
2021-09-11 23:47:05 ERROR: TSC: /home/vlado/dev/human/src/draw/draw.ts [7,35]: Module '"../result"' has no exported member 'Hand'.
2021-09-11 23:47:05 ERROR: TSC: /home/vlado/dev/human/src/draw/draw.ts [7,41]: Module '"../result"' has no exported member 'Item'.
2021-09-11 23:47:05 ERROR: TSC: /home/vlado/dev/human/src/draw/draw.ts [7,47]: Module '"../result"' has no exported member 'Gesture'.
2021-09-11 23:47:05 ERROR: TSC: /home/vlado/dev/human/src/draw/draw.ts [7,56]: Module '"../result"' has no exported member 'Person'.
2021-09-11 23:47:05 ERROR: TSC: /home/vlado/dev/human/src/efficientpose/efficientpose.ts [7,10]: Module '"../result"' has no exported member 'Body'.
2021-09-11 23:47:05 ERROR: TSC: /home/vlado/dev/human/src/efficientpose/efficientpose.ts [25,64]: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
2021-09-11 23:47:05 ERROR: TSC: /home/vlado/dev/human/src/efficientpose/efficientpose.ts [50,18]: Object is possibly 'undefined'.
2021-09-11 23:47:05 ERROR: TSC: /home/vlado/dev/human/src/efficientpose/efficientpose.ts [79,21]: Object is possibly 'undefined'.
2021-09-11 23:47:05 ERROR: TSC: /home/vlado/dev/human/src/emotion/emotion.ts [22,64]: Object is possibly 'undefined'.
2021-09-11 23:47:05 ERROR: TSC: /home/vlado/dev/human/src/emotion/emotion.ts [23,62]: Object is possibly 'undefined'.
2021-09-11 23:47:05 ERROR: TSC: /home/vlado/dev/human/src/emotion/emotion.ts [31,18]: Object is possibly 'undefined'.
2021-09-11 23:47:05 ERROR: TSC: /home/vlado/dev/human/src/emotion/emotion.ts [54,9]: Object is possibly 'undefined'.
2021-09-11 23:47:05 ERROR: TSC: /home/vlado/dev/human/src/emotion/emotion.ts [59,23]: Object is possibly 'undefined'.
2021-09-11 23:47:05 ERROR: TSC: /home/vlado/dev/human/src/face.ts [11,10]: Module '"./result"' has no exported member 'Face'.
2021-09-11 23:47:05 ERROR: TSC: /home/vlado/dev/human/src/gesture/gesture.ts [5,10]: Module '"../result"' has no exported member 'Gesture'.
2021-09-11 23:47:08 ERROR: src/blazeface/facemesh.ts:11:10 - error TS2305: Module '"../result"' has no exported member 'Face'.
11 import { Face } from '../result';
   ~~~~
3
2021-09-11 23:47:08 ERROR: src/blazepose/blazepose.ts:11:10 - error TS2305: Module '"../result"' has no exported member 'Body'.
11 import { Body } from '../result';
   ~~~~
3
2021-09-11 23:47:08 ERROR: src/blazepose/blazepose.ts:18:64 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
Type 'undefined' is not assignable to type 'string'.
18 model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath)) as unknown as GraphModel;
   ~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:47:08 ERROR: src/draw/draw.ts:7:23 - error TS2305: Module '"../result"' has no exported member 'Face'.
7 import type { Result, Face, Body, Hand, Item, Gesture, Person } from '../result';
   ~~~~
3
2021-09-11 23:47:08 ERROR: src/draw/draw.ts:7:29 - error TS2305: Module '"../result"' has no exported member 'Body'.
7 import type { Result, Face, Body, Hand, Item, Gesture, Person } from '../result';
   ~~~~
3
2021-09-11 23:47:08 ERROR: src/draw/draw.ts:7:35 - error TS2305: Module '"../result"' has no exported member 'Hand'.
7 import type { Result, Face, Body, Hand, Item, Gesture, Person } from '../result';
   ~~~~
3
2021-09-11 23:47:08 ERROR: src/draw/draw.ts:7:41 - error TS2305: Module '"../result"' has no exported member 'Item'.
7 import type { Result, Face, Body, Hand, Item, Gesture, Person } from '../result';
   ~~~~
3
2021-09-11 23:47:08 ERROR: src/draw/draw.ts:7:47 - error TS2305: Module '"../result"' has no exported member 'Gesture'.
7 import type { Result, Face, Body, Hand, Item, Gesture, Person } from '../result';
   ~~~~~~~
3
2021-09-11 23:47:08 ERROR: src/draw/draw.ts:7:56 - error TS2305: Module '"../result"' has no exported member 'Person'.
7 import type { Result, Face, Body, Hand, Item, Gesture, Person } from '../result';
   ~~~~~~
3
2021-09-11 23:47:08 ERROR: src/efficientpose/efficientpose.ts:7:10 - error TS2305: Module '"../result"' has no exported member 'Body'.
7 import { Body } from '../result';
   ~~~~
3
2021-09-11 23:47:08 ERROR: src/efficientpose/efficientpose.ts:25:64 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
Type 'undefined' is not assignable to type 'string'.
25 model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath)) as unknown as GraphModel;
   ~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:47:08 ERROR: src/efficientpose/efficientpose.ts:50:18 - error TS2532: Object is possibly 'undefined'.
50 if ((skipped < config.body.skipFrames) && config.skipFrame && Object.keys(keypoints).length > 0) {
   ~~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:47:08 ERROR: src/efficientpose/efficientpose.ts:79:21 - error TS2532: Object is possibly 'undefined'.
79 if (score > config.body.minConfidence) {
   ~~~~~~~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:47:08 ERROR: src/emotion/emotion.ts:22:64 - error TS2532: Object is possibly 'undefined'.
22 model = await tf.loadGraphModel(join(config.modelBasePath, config.face.emotion.modelPath));
   ~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:47:08 ERROR: src/emotion/emotion.ts:23:62 - error TS2532: Object is possibly 'undefined'.
23 if (!model || !model.modelUrl) log('load model failed:', config.face.emotion.modelPath);
   ~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:47:08 ERROR: src/emotion/emotion.ts:31:18 - error TS2532: Object is possibly 'undefined'.
31 if ((skipped < config.face.emotion.skipFrames) && config.skipFrame && (lastCount === count) && last[idx] && (last[idx].length > 0)) {
   ~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:47:08 ERROR: src/emotion/emotion.ts:54:9 - error TS2532: Object is possibly 'undefined'.
54 if (config.face.emotion.enabled) {
   ~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:47:08 ERROR: src/emotion/emotion.ts:59:23 - error TS2532: Object is possibly 'undefined'.
59 if (data[i] > config.face.emotion.minConfidence) obj.push({ score: Math.min(0.99, Math.trunc(100 * data[i]) / 100), emotion: annotations[i] });
   ~~~~~~~~~~~~~~~~~~~
3
2021-09-11 23:47:08 ERROR: src/face.ts:11:10 - error TS2305: Module '"./result"' has no exported member 'Face'.
11 import { Face } from './result';
   ~~~~
3
2021-09-11 23:47:08 ERROR: src/gesture/gesture.ts:5:10 - error TS2305: Module '"../result"' has no exported member 'Gesture'.
5 import { Gesture } from '../result';
   ~~~~~~~
3
2021-09-11 23:47:08 ERROR: TypeDoc: convert returned empty project
2021-09-11 23:47:32 STATE: Lint: {"locations":["src/**/*.ts","test/*.js","demo/**/*.js"],"files":75,"errors":0,"warnings":0}
2021-09-11 23:47:33 STATE: ChangeLog: {"repository":"https://github.com/vladmandic/human","branch":"main","output":"CHANGELOG.md"}
2021-09-11 23:47:33 INFO:  Done...
2021-09-11 23:53:16 INFO:  @vladmandic/human version 2.1.5
2021-09-11 23:53:16 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.5.0
2021-09-11 23:53:16 INFO:  Application: {"name":"@vladmandic/human","version":"2.1.5"}
2021-09-11 23:53:16 INFO:  Environment: {"profile":"production","config":"build.json","tsconfig":true,"eslintrc":true,"git":true}
2021-09-11 23:53:16 INFO:  Toolchain: {"build":"0.4.1","esbuild":"0.12.26","typescript":"4.4.3","typedoc":"0.21.9","eslint":"7.32.0"}
2021-09-11 23:53:16 INFO:  Build: {"profile":"production","steps":["clean","compile","typings","typedoc","lint","changelog"]}
2021-09-11 23:53:16 STATE: Clean: {"locations":["dist/*","types/*","typedoc/*"]}
2021-09-11 23:53:16 STATE: 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-11 23:53:16 STATE: Compile: {"name":"human/nodejs/cpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node.js","files":48,"inputBytes":466065,"outputBytes":399095}
2021-09-11 23:53:16 STATE: 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-11 23:53:16 STATE: Compile: {"name":"human/nodejs/gpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-gpu.js","files":48,"inputBytes":466073,"outputBytes":399099}
2021-09-11 23:53:16 STATE: 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-11 23:53:16 STATE: Compile: {"name":"human/nodejs/wasm","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-wasm.js","files":48,"inputBytes":466140,"outputBytes":399171}
2021-09-11 23:53:16 STATE: 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-11 23:53:16 STATE: Compile: {"name":"human/browser/esm/nobundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm-nobundle.js","files":48,"inputBytes":466239,"outputBytes":401059}
2021-09-11 23:53:16 STATE: 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-11 23:53:17 STATE: Compile: {"name":"human/browser/iife/bundle","format":"iife","platform":"browser","input":"src/human.ts","output":"dist/human.js","files":48,"inputBytes":2808632,"outputBytes":1393422}
2021-09-11 23:53:17 STATE: Compile: {"name":"human/browser/esm/bundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm.js","files":48,"inputBytes":2808632,"outputBytes":2585997}
2021-09-11 23:53:34 STATE: Typings: {"input":"src/human.ts","output":"types","files":47}
2021-09-11 23:53:40 STATE: TypeDoc: {"input":"src/human.ts","output":"typedoc","objects":22,"index":true}
2021-09-11 23:54:05 STATE: Lint: {"locations":["src/**/*.ts","test/*.js","demo/**/*.js"],"files":75,"errors":0,"warnings":0}
2021-09-11 23:54:05 STATE: ChangeLog: {"repository":"https://github.com/vladmandic/human","branch":"main","output":"CHANGELOG.md"}
2021-09-11 23:54:05 INFO:  Done...

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -74,25 +74,38 @@
<section class="tsd-index-section ">
<h3>Interfaces</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-interface"><a href="interfaces/Body.html" class="tsd-kind-icon">Body</a></li>
<li class="tsd-kind-interface"><a href="interfaces/BodyConfig.html" class="tsd-kind-icon">Body<wbr>Config</a></li>
<li class="tsd-kind-interface"><a href="interfaces/BodyResult.html" class="tsd-kind-icon">Body<wbr>Result</a></li>
<li class="tsd-kind-interface"><a href="interfaces/Config.html" class="tsd-kind-icon">Config</a></li>
<li class="tsd-kind-interface"><a href="interfaces/DrawOptions.html" class="tsd-kind-icon">Draw<wbr>Options</a></li>
<li class="tsd-kind-interface"><a href="interfaces/Face.html" class="tsd-kind-icon">Face</a></li>
<li class="tsd-kind-interface"><a href="interfaces/Hand.html" class="tsd-kind-icon">Hand</a></li>
<li class="tsd-kind-interface"><a href="interfaces/Item.html" class="tsd-kind-icon">Item</a></li>
<li class="tsd-kind-interface"><a href="interfaces/Person.html" class="tsd-kind-icon">Person</a></li>
<li class="tsd-kind-interface"><a href="interfaces/FaceConfig.html" class="tsd-kind-icon">Face<wbr>Config</a></li>
<li class="tsd-kind-interface"><a href="interfaces/FaceResult.html" class="tsd-kind-icon">Face<wbr>Result</a></li>
<li class="tsd-kind-interface"><a href="interfaces/FilterConfig.html" class="tsd-kind-icon">Filter<wbr>Config</a></li>
<li class="tsd-kind-interface"><a href="interfaces/GestureConfig.html" class="tsd-kind-icon">Gesture<wbr>Config</a></li>
<li class="tsd-kind-interface"><a href="interfaces/HandConfig.html" class="tsd-kind-icon">Hand<wbr>Config</a></li>
<li class="tsd-kind-interface"><a href="interfaces/HandResult.html" class="tsd-kind-icon">Hand<wbr>Result</a></li>
<li class="tsd-kind-interface"><a href="interfaces/ObjectConfig.html" class="tsd-kind-icon">Object<wbr>Config</a></li>
<li class="tsd-kind-interface"><a href="interfaces/ObjectResult.html" class="tsd-kind-icon">Object<wbr>Result</a></li>
<li class="tsd-kind-interface"><a href="interfaces/PersonResult.html" class="tsd-kind-icon">Person<wbr>Result</a></li>
<li class="tsd-kind-interface"><a href="interfaces/Result.html" class="tsd-kind-icon">Result</a></li>
<li class="tsd-kind-interface"><a href="interfaces/SegmentationConfig.html" class="tsd-kind-icon">Segmentation<wbr>Config</a></li>
</ul>
</section>
<section class="tsd-index-section ">
<h3>Type aliases</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-type-alias"><a href="index.html#Error" class="tsd-kind-icon">Error</a></li>
<li class="tsd-kind-type-alias"><a href="index.html#Gesture" class="tsd-kind-icon">Gesture</a></li>
<li class="tsd-kind-type-alias"><a href="index.html#GestureResult" class="tsd-kind-icon">Gesture<wbr>Result</a></li>
<li class="tsd-kind-type-alias"><a href="index.html#Input" class="tsd-kind-icon">Input</a></li>
<li class="tsd-kind-type-alias"><a href="index.html#TensorFlow" class="tsd-kind-icon">Tensor<wbr>Flow</a></li>
</ul>
</section>
<section class="tsd-index-section ">
<h3>Variables</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-variable"><a href="index.html#defaults" class="tsd-kind-icon">defaults</a></li>
</ul>
</section>
</div>
</section>
</section>
@ -112,7 +125,7 @@
<div class="tsd-signature tsd-kind-icon">Error<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>error<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/human.ts#L45">human.ts:45</a></li>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/human.ts#L46">human.ts:46</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -130,9 +143,9 @@
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-type-alias">
<a name="Gesture" class="tsd-anchor"></a>
<h3>Gesture</h3>
<div class="tsd-signature tsd-kind-icon">Gesture<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>face<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>gesture<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">FaceGesture</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">{ </span>gesture<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">IrisGesture</span><span class="tsd-signature-symbol">; </span>iris<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">{ </span>body<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>gesture<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">BodyGesture</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">{ </span>gesture<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HandGesture</span><span class="tsd-signature-symbol">; </span>hand<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span></div>
<a name="GestureResult" class="tsd-anchor"></a>
<h3>Gesture<wbr>Result</h3>
<div class="tsd-signature tsd-kind-icon">Gesture<wbr>Result<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>face<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>gesture<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">FaceGesture</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">{ </span>gesture<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">IrisGesture</span><span class="tsd-signature-symbol">; </span>iris<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">{ </span>body<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>gesture<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">BodyGesture</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">{ </span>gesture<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HandGesture</span><span class="tsd-signature-symbol">; </span>hand<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L142">result.ts:142</a></li>
@ -150,7 +163,7 @@
<div class="tsd-signature tsd-kind-icon">Input<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Tensor</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">typeof </span><span class="tsd-signature-type">Image</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ImageData</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ImageBitmap</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLImageElement</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLMediaElement</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLVideoElement</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLCanvasElement</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">OffscreenCanvas</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/human.ts#L40">human.ts:40</a></li>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/human.ts#L41">human.ts:41</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -165,7 +178,7 @@
<div class="tsd-signature tsd-kind-icon">Tensor<wbr>Flow<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">typeof </span><span class="tsd-signature-type">tf</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/human.ts#L50">human.ts:50</a></li>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/human.ts#L51">human.ts:51</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -179,6 +192,19 @@
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Variables</h2>
<section class="tsd-panel tsd-member tsd-kind-variable">
<a name="defaults" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagConst">Const</span> defaults</h3>
<div class="tsd-signature tsd-kind-icon">defaults<span class="tsd-signature-symbol">:</span> <a href="interfaces/Config.html" class="tsd-signature-type" data-tsd-kind="Interface">Config</a><span class="tsd-signature-symbol"> = ...</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L235">config.ts:235</a></li>
</ul>
</aside>
</section>
</section>
</div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<nav class="tsd-navigation primary">
@ -197,7 +223,10 @@
<a href="classes/Human.html" class="tsd-kind-icon">Human</a>
</li>
<li class=" tsd-kind-interface">
<a href="interfaces/Body.html" class="tsd-kind-icon">Body</a>
<a href="interfaces/BodyConfig.html" class="tsd-kind-icon">Body<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="interfaces/BodyResult.html" class="tsd-kind-icon">Body<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="interfaces/Config.html" class="tsd-kind-icon">Config</a>
@ -206,25 +235,43 @@
<a href="interfaces/DrawOptions.html" class="tsd-kind-icon">Draw<wbr>Options</a>
</li>
<li class=" tsd-kind-interface">
<a href="interfaces/Face.html" class="tsd-kind-icon">Face</a>
<a href="interfaces/FaceConfig.html" class="tsd-kind-icon">Face<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="interfaces/Hand.html" class="tsd-kind-icon">Hand</a>
<a href="interfaces/FaceResult.html" class="tsd-kind-icon">Face<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="interfaces/Item.html" class="tsd-kind-icon">Item</a>
<a href="interfaces/FilterConfig.html" class="tsd-kind-icon">Filter<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="interfaces/Person.html" class="tsd-kind-icon">Person</a>
<a href="interfaces/GestureConfig.html" class="tsd-kind-icon">Gesture<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="interfaces/HandConfig.html" class="tsd-kind-icon">Hand<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="interfaces/HandResult.html" class="tsd-kind-icon">Hand<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="interfaces/ObjectConfig.html" class="tsd-kind-icon">Object<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="interfaces/ObjectResult.html" class="tsd-kind-icon">Object<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="interfaces/PersonResult.html" class="tsd-kind-icon">Person<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="interfaces/Result.html" class="tsd-kind-icon">Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="interfaces/SegmentationConfig.html" class="tsd-kind-icon">Segmentation<wbr>Config</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="index.html#Error" class="tsd-kind-icon">Error</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="index.html#Gesture" class="tsd-kind-icon">Gesture</a>
<a href="index.html#GestureResult" class="tsd-kind-icon">Gesture<wbr>Result</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="index.html#Input" class="tsd-kind-icon">Input</a>
@ -232,6 +279,9 @@
<li class=" tsd-kind-type-alias">
<a href="index.html#TensorFlow" class="tsd-kind-icon">Tensor<wbr>Flow</a>
</li>
<li class=" tsd-kind-variable">
<a href="index.html#defaults" class="tsd-kind-icon">defaults</a>
</li>
</ul>
</nav>
</div>
@ -249,9 +299,6 @@
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
</ul>
</div>
</div>
</footer>

View File

@ -0,0 +1,278 @@
<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>BodyConfig | @vladmandic/human - v2.1.5</title>
<meta name="description" content="Documentation for @vladmandic/human - v2.1.5">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
<script async src="../assets/js/search.js" id="search-script"></script>
</head>
<body>
<header>
<div class="tsd-page-toolbar">
<div class="container">
<div class="table-wrap">
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
<div class="field">
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
<input id="tsd-search-field" type="text" />
</div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a href="../index.html" class="title">@vladmandic/human - v2.1.5</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
<div class="tsd-filter-group">
<div class="tsd-select" id="tsd-filter-visibility">
<span class="tsd-select-label">All</span>
<ul class="tsd-select-list">
<li data-value="public">Public</li>
<li data-value="protected">Public/Protected</li>
<li data-value="private" class="selected">All</li>
</ul>
</div>
<input type="checkbox" id="tsd-filter-inherited" checked />
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
</div>
</div>
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
</div>
</div>
</div>
</div>
<div class="tsd-page-title">
<div class="container">
<ul class="tsd-breadcrumb">
<li>
<a href="../index.html">@vladmandic/human - v2.1.5</a>
</li>
<li>
<a href="BodyConfig.html">BodyConfig</a>
</li>
</ul>
<h1>Interface BodyConfig</h1>
</div>
</div>
</header>
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Controlls and configures all body detection specific options</p>
<ul>
<li>enabled: true/false</li>
<li>modelPath: body pose model, can be absolute path or relative to modelBasePath</li>
<li>minConfidence: threshold for discarding a prediction</li>
<li>maxDetected: maximum number of people detected in the input, should be set to the minimum number for performance</li>
</ul>
</div>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<span class="target">BodyConfig</span>
</li>
</ul>
</section>
<section class="tsd-panel-group tsd-index-group">
<h2>Index</h2>
<section class="tsd-panel tsd-index-panel">
<div class="tsd-index-content">
<section class="tsd-index-section ">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyConfig.html#enabled" class="tsd-kind-icon">enabled</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyConfig.html#maxDetected" class="tsd-kind-icon">max<wbr>Detected</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyConfig.html#minConfidence" class="tsd-kind-icon">min<wbr>Confidence</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyConfig.html#modelPath" class="tsd-kind-icon">model<wbr>Path</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyConfig.html#skipFrames" class="tsd-kind-icon">skip<wbr>Frames</a></li>
</ul>
</section>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="enabled" class="tsd-anchor"></a>
<h3>enabled</h3>
<div class="tsd-signature tsd-kind-icon">enabled<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L62">config.ts:62</a></li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="maxDetected" class="tsd-anchor"></a>
<h3>max<wbr>Detected</h3>
<div class="tsd-signature tsd-kind-icon">max<wbr>Detected<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L64">config.ts:64</a></li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="minConfidence" class="tsd-anchor"></a>
<h3>min<wbr>Confidence</h3>
<div class="tsd-signature tsd-kind-icon">min<wbr>Confidence<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L65">config.ts:65</a></li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="modelPath" class="tsd-anchor"></a>
<h3>model<wbr>Path</h3>
<div class="tsd-signature tsd-kind-icon">model<wbr>Path<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L63">config.ts:63</a></li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="skipFrames" class="tsd-anchor"></a>
<h3>skip<wbr>Frames</h3>
<div class="tsd-signature tsd-kind-icon">skip<wbr>Frames<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L66">config.ts:66</a></li>
</ul>
</aside>
</section>
</section>
</div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<nav class="tsd-navigation primary">
<ul>
<li class=" ">
<a href="../index.html">Exports</a>
</li>
</ul>
</nav>
<nav class="tsd-navigation secondary menu-sticky">
<ul class="before-current">
<li class=" tsd-kind-reference">
<a href="../index.html#default" class="tsd-kind-icon">default</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/Human.html" class="tsd-kind-icon">Human</a>
</li>
</ul>
<ul class="current">
<li class="current tsd-kind-interface">
<a href="BodyConfig.html" class="tsd-kind-icon">Body<wbr>Config</a>
<ul>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="BodyConfig.html#enabled" class="tsd-kind-icon">enabled</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="BodyConfig.html#maxDetected" class="tsd-kind-icon">max<wbr>Detected</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="BodyConfig.html#minConfidence" class="tsd-kind-icon">min<wbr>Confidence</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="BodyConfig.html#modelPath" class="tsd-kind-icon">model<wbr>Path</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="BodyConfig.html#skipFrames" class="tsd-kind-icon">skip<wbr>Frames</a>
</li>
</ul>
</li>
</ul>
<ul class="after-current">
<li class=" tsd-kind-interface">
<a href="BodyResult.html" class="tsd-kind-icon">Body<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="Config.html" class="tsd-kind-icon">Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="DrawOptions.html" class="tsd-kind-icon">Draw<wbr>Options</a>
</li>
<li class=" tsd-kind-interface">
<a href="FaceConfig.html" class="tsd-kind-icon">Face<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="FaceResult.html" class="tsd-kind-icon">Face<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="FilterConfig.html" class="tsd-kind-icon">Filter<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="GestureConfig.html" class="tsd-kind-icon">Gesture<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="HandConfig.html" class="tsd-kind-icon">Hand<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="HandResult.html" class="tsd-kind-icon">Hand<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="ObjectConfig.html" class="tsd-kind-icon">Object<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="ObjectResult.html" class="tsd-kind-icon">Object<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="PersonResult.html" class="tsd-kind-icon">Person<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="Result.html" class="tsd-kind-icon">Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="SegmentationConfig.html" class="tsd-kind-icon">Segmentation<wbr>Config</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Error" class="tsd-kind-icon">Error</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#GestureResult" class="tsd-kind-icon">Gesture<wbr>Result</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Input" class="tsd-kind-icon">Input</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#TensorFlow" class="tsd-kind-icon">Tensor<wbr>Flow</a>
</li>
<li class=" tsd-kind-variable">
<a href="../index.html#defaults" class="tsd-kind-icon">defaults</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<footer>
<div class="container">
<h2>Legend</h2>
<div class="tsd-legend-group">
<ul class="tsd-legend">
<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
</ul>
</div>
</div>
</footer>
<div class="overlay"></div>
<script src="../assets/js/main.js"></script>
</body>
</html>

View File

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Body | @vladmandic/human - v2.1.5</title>
<title>BodyResult | @vladmandic/human - v2.1.5</title>
<meta name="description" content="Documentation for @vladmandic/human - v2.1.5">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
@ -53,10 +53,10 @@
<a href="../index.html">@vladmandic/human - v2.1.5</a>
</li>
<li>
<a href="Body.html">Body</a>
<a href="BodyResult.html">BodyResult</a>
</li>
</ul>
<h1>Interface Body</h1>
<h1>Interface BodyResult</h1>
</div>
</div>
</header>
@ -86,7 +86,7 @@
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<span class="target">Body</span>
<span class="target">BodyResult</span>
</li>
</ul>
</section>
@ -97,11 +97,11 @@
<section class="tsd-index-section ">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Body.html#box" class="tsd-kind-icon">box</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Body.html#boxRaw" class="tsd-kind-icon">box<wbr>Raw</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Body.html#id" class="tsd-kind-icon">id</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Body.html#keypoints" class="tsd-kind-icon">keypoints</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Body.html#score" class="tsd-kind-icon">score</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyResult.html#box" class="tsd-kind-icon">box</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyResult.html#boxRaw" class="tsd-kind-icon">box<wbr>Raw</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyResult.html#id" class="tsd-kind-icon">id</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyResult.html#keypoints" class="tsd-kind-icon">keypoints</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyResult.html#score" class="tsd-kind-icon">score</a></li>
</ul>
</section>
</div>
@ -177,25 +177,28 @@
<li class=" tsd-kind-class">
<a href="../classes/Human.html" class="tsd-kind-icon">Human</a>
</li>
<li class=" tsd-kind-interface">
<a href="BodyConfig.html" class="tsd-kind-icon">Body<wbr>Config</a>
</li>
</ul>
<ul class="current">
<li class="current tsd-kind-interface">
<a href="Body.html" class="tsd-kind-icon">Body</a>
<a href="BodyResult.html" class="tsd-kind-icon">Body<wbr>Result</a>
<ul>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Body.html#box" class="tsd-kind-icon">box</a>
<a href="BodyResult.html#box" class="tsd-kind-icon">box</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Body.html#boxRaw" class="tsd-kind-icon">box<wbr>Raw</a>
<a href="BodyResult.html#boxRaw" class="tsd-kind-icon">box<wbr>Raw</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Body.html#id" class="tsd-kind-icon">id</a>
<a href="BodyResult.html#id" class="tsd-kind-icon">id</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Body.html#keypoints" class="tsd-kind-icon">keypoints</a>
<a href="BodyResult.html#keypoints" class="tsd-kind-icon">keypoints</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Body.html#score" class="tsd-kind-icon">score</a>
<a href="BodyResult.html#score" class="tsd-kind-icon">score</a>
</li>
</ul>
</li>
@ -208,25 +211,43 @@
<a href="DrawOptions.html" class="tsd-kind-icon">Draw<wbr>Options</a>
</li>
<li class=" tsd-kind-interface">
<a href="Face.html" class="tsd-kind-icon">Face</a>
<a href="FaceConfig.html" class="tsd-kind-icon">Face<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="Hand.html" class="tsd-kind-icon">Hand</a>
<a href="FaceResult.html" class="tsd-kind-icon">Face<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="Item.html" class="tsd-kind-icon">Item</a>
<a href="FilterConfig.html" class="tsd-kind-icon">Filter<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="Person.html" class="tsd-kind-icon">Person</a>
<a href="GestureConfig.html" class="tsd-kind-icon">Gesture<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="HandConfig.html" class="tsd-kind-icon">Hand<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="HandResult.html" class="tsd-kind-icon">Hand<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="ObjectConfig.html" class="tsd-kind-icon">Object<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="ObjectResult.html" class="tsd-kind-icon">Object<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="PersonResult.html" class="tsd-kind-icon">Person<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="Result.html" class="tsd-kind-icon">Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="SegmentationConfig.html" class="tsd-kind-icon">Segmentation<wbr>Config</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Error" class="tsd-kind-icon">Error</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Gesture" class="tsd-kind-icon">Gesture</a>
<a href="../index.html#GestureResult" class="tsd-kind-icon">Gesture<wbr>Result</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Input" class="tsd-kind-icon">Input</a>
@ -234,6 +255,9 @@
<li class=" tsd-kind-type-alias">
<a href="../index.html#TensorFlow" class="tsd-kind-icon">Tensor<wbr>Flow</a>
</li>
<li class=" tsd-kind-variable">
<a href="../index.html#defaults" class="tsd-kind-icon">defaults</a>
</li>
</ul>
</nav>
</div>
@ -251,9 +275,6 @@
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
</ul>
</div>
</div>
</footer>

View File

@ -63,14 +63,6 @@
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Configuration interface definition for <strong>Human</strong> library</p>
</div>
<p>Contains all configurable parameters</p>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
@ -114,7 +106,7 @@
<div class="tsd-signature tsd-kind-icon">async<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L22">config.ts:22</a></li>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L190">config.ts:190</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -126,10 +118,10 @@
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="backend" class="tsd-anchor"></a>
<h3>backend</h3>
<div class="tsd-signature tsd-kind-icon">backend<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span></div>
<div class="tsd-signature tsd-kind-icon">backend<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L13">config.ts:13</a></li>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L181">config.ts:181</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -141,43 +133,12 @@
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="body" class="tsd-anchor"></a>
<h3>body</h3>
<div class="tsd-signature tsd-kind-icon">body<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>maxDetected<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>minConfidence<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>skipFrames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span></div>
<div class="tsd-signature tsd-kind-icon">body<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol">&lt;</span><a href="BodyConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">BodyConfig</a><span class="tsd-signature-symbol">&gt;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L152">config.ts:152</a></li>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L226">config.ts:226</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Controlls and configures all body detection specific options</p>
<ul>
<li>enabled: true/false</li>
<li>modelPath: body pose model, can be absolute path or relative to modelBasePath</li>
<li>minConfidence: threshold for discarding a prediction</li>
<li>maxDetected: maximum number of people detected in the input, should be set to the minimum number for performance</li>
</ul>
</div>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
</li>
<li class="tsd-parameter">
<h5>max<wbr>Detected<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
</li>
<li class="tsd-parameter">
<h5>min<wbr>Confidence<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
</li>
<li class="tsd-parameter">
<h5>model<wbr>Path<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5>
</li>
<li class="tsd-parameter">
<h5>skip<wbr>Frames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="cacheSensitivity" class="tsd-anchor"></a>
@ -185,7 +146,7 @@
<div class="tsd-signature tsd-kind-icon">cache<wbr>Sensitivity<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L39">config.ts:39</a></li>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L208">config.ts:208</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -204,7 +165,7 @@
<div class="tsd-signature tsd-kind-icon">debug<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L19">config.ts:19</a></li>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L187">config.ts:187</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -216,126 +177,20 @@
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="face" class="tsd-anchor"></a>
<h3>face</h3>
<div class="tsd-signature tsd-kind-icon">face<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>description<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>minConfidence<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>skipFrames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">; </span>detector<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>iouThreshold<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>maxDetected<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>minConfidence<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>return<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>rotation<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>skipFrames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">; </span>emotion<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>minConfidence<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>skipFrames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">; </span>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>iris<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">; </span>mesh<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol"> }</span></div>
<div class="tsd-signature tsd-kind-icon">face<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol">&lt;</span><a href="FaceConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">FaceConfig</a><span class="tsd-signature-symbol">&gt;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L113">config.ts:113</a></li>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L224">config.ts:224</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Controlls and configures all face-specific options:</p>
<ul>
<li>face detection, face mesh detection, age, gender, emotion detection and face description
Parameters:</li>
<li>enabled: true/false</li>
<li>modelPath: path for each of face models</li>
<li>minConfidence: threshold for discarding a prediction</li>
<li>iouThreshold: ammount of overlap between two detected objects before one object is removed</li>
<li>maxDetected: maximum number of faces detected in the input, should be set to the minimum number for performance</li>
<li>rotation: use calculated rotated face image or just box with rotation as-is, false means higher performance, but incorrect mesh mapping on higher face angles</li>
<li>return: return extracted face as tensor for futher user processing, in which case user is reponsible for manually disposing the tensor</li>
</ul>
</div>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>description<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>minConfidence<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>skipFrames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span></h5>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
</li>
<li class="tsd-parameter">
<h5>min<wbr>Confidence<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
</li>
<li class="tsd-parameter">
<h5>model<wbr>Path<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5>
</li>
<li class="tsd-parameter">
<h5>skip<wbr>Frames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
</li>
</ul>
</li>
<li class="tsd-parameter">
<h5>detector<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>iouThreshold<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>maxDetected<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>minConfidence<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>return<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>rotation<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>skipFrames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span></h5>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>iou<wbr>Threshold<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
</li>
<li class="tsd-parameter">
<h5>max<wbr>Detected<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
</li>
<li class="tsd-parameter">
<h5>min<wbr>Confidence<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
</li>
<li class="tsd-parameter">
<h5>model<wbr>Path<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5>
</li>
<li class="tsd-parameter">
<h5>return<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
</li>
<li class="tsd-parameter">
<h5>rotation<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
</li>
<li class="tsd-parameter">
<h5>skip<wbr>Frames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
</li>
</ul>
</li>
<li class="tsd-parameter">
<h5>emotion<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>minConfidence<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>skipFrames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span></h5>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
</li>
<li class="tsd-parameter">
<h5>min<wbr>Confidence<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
</li>
<li class="tsd-parameter">
<h5>model<wbr>Path<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5>
</li>
<li class="tsd-parameter">
<h5>skip<wbr>Frames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
</li>
</ul>
</li>
<li class="tsd-parameter">
<h5>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
</li>
<li class="tsd-parameter">
<h5>iris<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span></h5>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
</li>
<li class="tsd-parameter">
<h5>model<wbr>Path<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5>
</li>
</ul>
</li>
<li class="tsd-parameter">
<h5>mesh<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span></h5>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
</li>
<li class="tsd-parameter">
<h5>model<wbr>Path<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5>
</li>
</ul>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="filter" class="tsd-anchor"></a>
<h3>filter</h3>
<div class="tsd-signature tsd-kind-icon">filter<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>blur<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>brightness<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>contrast<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>flip<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>height<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>hue<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>kodachrome<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>negative<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>pixelate<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>polaroid<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>return<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>saturation<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>sepia<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>sharpness<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>technicolor<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>vintage<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>width<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span></div>
<div class="tsd-signature tsd-kind-icon">filter<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol">&lt;</span><a href="FilterConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">FilterConfig</a><span class="tsd-signature-symbol">&gt;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L50">config.ts:50</a></li>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L219">config.ts:219</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -346,249 +201,26 @@
</ul>
</div>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>blur<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Range: 0 (no blur) to N (blur radius in pixels)</p>
</div>
</div>
</li>
<li class="tsd-parameter">
<h5>brightness<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Range: -1 (darken) to 1 (lighten)</p>
</div>
</div>
</li>
<li class="tsd-parameter">
<h5>contrast<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Range: -1 (reduce contrast) to 1 (increase contrast)</p>
</div>
</div>
</li>
<li class="tsd-parameter">
<h5>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
</li>
<li class="tsd-parameter">
<h5>flip<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Flip input as mirror image</p>
</div>
</div>
</li>
<li class="tsd-parameter">
<h5>height<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Resize input height</p>
<ul>
<li>if both width and height are set to 0, there is no resizing</li>
<li>if just one is set, second one is scaled automatically</li>
<li>if both are set, values are used as-is</li>
</ul>
</div>
</div>
</li>
<li class="tsd-parameter">
<h5>hue<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Range: 0 (no change) to 360 (hue rotation in degrees)</p>
</div>
</div>
</li>
<li class="tsd-parameter">
<h5>kodachrome<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Image kodachrome colors</p>
</div>
</div>
</li>
<li class="tsd-parameter">
<h5>negative<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Image negative</p>
</div>
</div>
</li>
<li class="tsd-parameter">
<h5>pixelate<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Range: 0 (no pixelate) to N (number of pixels to pixelate)</p>
</div>
</div>
</li>
<li class="tsd-parameter">
<h5>polaroid<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Image polaroid camera effect</p>
</div>
</div>
</li>
<li class="tsd-parameter">
<h5>return<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Return processed canvas imagedata in result</p>
</div>
</div>
</li>
<li class="tsd-parameter">
<h5>saturation<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Range: -1 (reduce saturation) to 1 (increase saturation)</p>
</div>
</div>
</li>
<li class="tsd-parameter">
<h5>sepia<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Image sepia colors</p>
</div>
</div>
</li>
<li class="tsd-parameter">
<h5>sharpness<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Range: 0 (no sharpening) to 1 (maximum sharpening)</p>
</div>
</div>
</li>
<li class="tsd-parameter">
<h5>technicolor<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Image technicolor colors</p>
</div>
</div>
</li>
<li class="tsd-parameter">
<h5>vintage<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Image vintage colors</p>
</div>
</div>
</li>
<li class="tsd-parameter">
<h5>width<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Resize input width</p>
<ul>
<li>if both width and height are set to 0, there is no resizing</li>
<li>if just one is set, second one is scaled automatically</li>
<li>if both are set, values are used as-is</li>
</ul>
</div>
</div>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="gesture" class="tsd-anchor"></a>
<h3>gesture</h3>
<div class="tsd-signature tsd-kind-icon">gesture<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> }</span></div>
<div class="tsd-signature tsd-kind-icon">gesture<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol">&lt;</span><a href="GestureConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">GestureConfig</a><span class="tsd-signature-symbol">&gt;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L98">config.ts:98</a></li>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L222">config.ts:222</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Controlls gesture detection</p>
</div>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="hand" class="tsd-anchor"></a>
<h3>hand</h3>
<div class="tsd-signature tsd-kind-icon">hand<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>detector<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">; </span>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>iouThreshold<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>landmarks<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>maxDetected<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>minConfidence<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>rotation<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>skeleton<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">; </span>skipFrames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span></div>
<div class="tsd-signature tsd-kind-icon">hand<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol">&lt;</span><a href="HandConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">HandConfig</a><span class="tsd-signature-symbol">&gt;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L169">config.ts:169</a></li>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L228">config.ts:228</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Controlls and configures all hand detection specific options</p>
<ul>
<li>enabled: true/false</li>
<li>landmarks: detect hand landmarks or just hand boundary box</li>
<li>modelPath: paths for hand detector and hand skeleton models, can be absolute path or relative to modelBasePath</li>
<li>minConfidence: threshold for discarding a prediction</li>
<li>iouThreshold: ammount of overlap between two detected objects before one object is removed</li>
<li>maxDetected: maximum number of hands detected in the input, should be set to the minimum number for performance</li>
<li>rotation: use best-guess rotated hand image or just box with rotation as-is, false means higher performance, but incorrect finger mapping if hand is inverted</li>
</ul>
</div>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>detector<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span></h5>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>model<wbr>Path<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5>
</li>
</ul>
</li>
<li class="tsd-parameter">
<h5>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
</li>
<li class="tsd-parameter">
<h5>iou<wbr>Threshold<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
</li>
<li class="tsd-parameter">
<h5>landmarks<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
</li>
<li class="tsd-parameter">
<h5>max<wbr>Detected<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
</li>
<li class="tsd-parameter">
<h5>min<wbr>Confidence<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
</li>
<li class="tsd-parameter">
<h5>rotation<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
</li>
<li class="tsd-parameter">
<h5>skeleton<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span></h5>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>model<wbr>Path<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5>
</li>
</ul>
</li>
<li class="tsd-parameter">
<h5>skip<wbr>Frames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="modelBasePath" class="tsd-anchor"></a>
@ -596,7 +228,7 @@
<div class="tsd-signature tsd-kind-icon">model<wbr>Base<wbr>Path<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L33">config.ts:33</a></li>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L202">config.ts:202</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -611,81 +243,22 @@
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="object" class="tsd-anchor"></a>
<h3>object</h3>
<div class="tsd-signature tsd-kind-icon">object<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>iouThreshold<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>maxDetected<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>minConfidence<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>skipFrames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span></div>
<div class="tsd-signature tsd-kind-icon">object<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol">&lt;</span><a href="ObjectConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">ObjectConfig</a><span class="tsd-signature-symbol">&gt;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L192">config.ts:192</a></li>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L230">config.ts:230</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Controlls and configures all object detection specific options</p>
<ul>
<li>enabled: true/false</li>
<li>modelPath: object detection model, can be absolute path or relative to modelBasePath</li>
<li>minConfidence: minimum score that detection must have to return as valid object</li>
<li>iouThreshold: ammount of overlap between two detected objects before one object is removed</li>
<li>maxDetected: maximum number of detections to return</li>
</ul>
</div>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
</li>
<li class="tsd-parameter">
<h5>iou<wbr>Threshold<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
</li>
<li class="tsd-parameter">
<h5>max<wbr>Detected<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
</li>
<li class="tsd-parameter">
<h5>min<wbr>Confidence<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
</li>
<li class="tsd-parameter">
<h5>model<wbr>Path<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5>
</li>
<li class="tsd-parameter">
<h5>skip<wbr>Frames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="segmentation" class="tsd-anchor"></a>
<h3>segmentation</h3>
<div class="tsd-signature tsd-kind-icon">segmentation<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span></div>
<div class="tsd-signature tsd-kind-icon">segmentation<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol">&lt;</span><a href="SegmentationConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">SegmentationConfig</a><span class="tsd-signature-symbol">&gt;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L210">config.ts:210</a></li>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L232">config.ts:232</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Controlls and configures all body segmentation module
removes background from input containing person
if segmentation is enabled it will run as preprocessing task before any other model
alternatively leave it disabled and use it on-demand using human.segmentation method which can
remove background or replace it with user-provided background</p>
</div>
<ul>
<li>enabled: true/false</li>
<li>modelPath: object detection model, can be absolute path or relative to modelBasePath</li>
</ul>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
</li>
<li class="tsd-parameter">
<h5>model<wbr>Path<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="skipFrame" class="tsd-anchor"></a>
@ -693,7 +266,7 @@
<div class="tsd-signature tsd-kind-icon">skip<wbr>Frame<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L45">config.ts:45</a></li>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L214">config.ts:214</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -712,7 +285,7 @@
<div class="tsd-signature tsd-kind-icon">warmup<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L28">config.ts:28</a></li>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L197">config.ts:197</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -731,7 +304,7 @@
<div class="tsd-signature tsd-kind-icon">wasm<wbr>Path<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L16">config.ts:16</a></li>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L184">config.ts:184</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -759,7 +332,10 @@
<a href="../classes/Human.html" class="tsd-kind-icon">Human</a>
</li>
<li class=" tsd-kind-interface">
<a href="Body.html" class="tsd-kind-icon">Body</a>
<a href="BodyConfig.html" class="tsd-kind-icon">Body<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="BodyResult.html" class="tsd-kind-icon">Body<wbr>Result</a>
</li>
</ul>
<ul class="current">
@ -819,25 +395,43 @@
<a href="DrawOptions.html" class="tsd-kind-icon">Draw<wbr>Options</a>
</li>
<li class=" tsd-kind-interface">
<a href="Face.html" class="tsd-kind-icon">Face</a>
<a href="FaceConfig.html" class="tsd-kind-icon">Face<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="Hand.html" class="tsd-kind-icon">Hand</a>
<a href="FaceResult.html" class="tsd-kind-icon">Face<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="Item.html" class="tsd-kind-icon">Item</a>
<a href="FilterConfig.html" class="tsd-kind-icon">Filter<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="Person.html" class="tsd-kind-icon">Person</a>
<a href="GestureConfig.html" class="tsd-kind-icon">Gesture<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="HandConfig.html" class="tsd-kind-icon">Hand<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="HandResult.html" class="tsd-kind-icon">Hand<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="ObjectConfig.html" class="tsd-kind-icon">Object<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="ObjectResult.html" class="tsd-kind-icon">Object<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="PersonResult.html" class="tsd-kind-icon">Person<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="Result.html" class="tsd-kind-icon">Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="SegmentationConfig.html" class="tsd-kind-icon">Segmentation<wbr>Config</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Error" class="tsd-kind-icon">Error</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Gesture" class="tsd-kind-icon">Gesture</a>
<a href="../index.html#GestureResult" class="tsd-kind-icon">Gesture<wbr>Result</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Input" class="tsd-kind-icon">Input</a>
@ -845,6 +439,9 @@
<li class=" tsd-kind-type-alias">
<a href="../index.html#TensorFlow" class="tsd-kind-icon">Tensor<wbr>Flow</a>
</li>
<li class=" tsd-kind-variable">
<a href="../index.html#defaults" class="tsd-kind-icon">defaults</a>
</li>
</ul>
</nav>
</div>
@ -862,9 +459,6 @@
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
</ul>
</div>
</div>
</footer>

View File

@ -315,7 +315,10 @@
<a href="../classes/Human.html" class="tsd-kind-icon">Human</a>
</li>
<li class=" tsd-kind-interface">
<a href="Body.html" class="tsd-kind-icon">Body</a>
<a href="BodyConfig.html" class="tsd-kind-icon">Body<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="BodyResult.html" class="tsd-kind-icon">Body<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="Config.html" class="tsd-kind-icon">Config</a>
@ -381,25 +384,43 @@
</ul>
<ul class="after-current">
<li class=" tsd-kind-interface">
<a href="Face.html" class="tsd-kind-icon">Face</a>
<a href="FaceConfig.html" class="tsd-kind-icon">Face<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="Hand.html" class="tsd-kind-icon">Hand</a>
<a href="FaceResult.html" class="tsd-kind-icon">Face<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="Item.html" class="tsd-kind-icon">Item</a>
<a href="FilterConfig.html" class="tsd-kind-icon">Filter<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="Person.html" class="tsd-kind-icon">Person</a>
<a href="GestureConfig.html" class="tsd-kind-icon">Gesture<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="HandConfig.html" class="tsd-kind-icon">Hand<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="HandResult.html" class="tsd-kind-icon">Hand<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="ObjectConfig.html" class="tsd-kind-icon">Object<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="ObjectResult.html" class="tsd-kind-icon">Object<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="PersonResult.html" class="tsd-kind-icon">Person<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="Result.html" class="tsd-kind-icon">Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="SegmentationConfig.html" class="tsd-kind-icon">Segmentation<wbr>Config</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Error" class="tsd-kind-icon">Error</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Gesture" class="tsd-kind-icon">Gesture</a>
<a href="../index.html#GestureResult" class="tsd-kind-icon">Gesture<wbr>Result</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Input" class="tsd-kind-icon">Input</a>
@ -407,6 +428,9 @@
<li class=" tsd-kind-type-alias">
<a href="../index.html#TensorFlow" class="tsd-kind-icon">Tensor<wbr>Flow</a>
</li>
<li class=" tsd-kind-variable">
<a href="../index.html#defaults" class="tsd-kind-icon">defaults</a>
</li>
</ul>
</nav>
</div>
@ -424,9 +448,6 @@
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
</ul>
</div>
</div>
</footer>

View File

@ -0,0 +1,379 @@
<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>FaceConfig | @vladmandic/human - v2.1.5</title>
<meta name="description" content="Documentation for @vladmandic/human - v2.1.5">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
<script async src="../assets/js/search.js" id="search-script"></script>
</head>
<body>
<header>
<div class="tsd-page-toolbar">
<div class="container">
<div class="table-wrap">
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
<div class="field">
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
<input id="tsd-search-field" type="text" />
</div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a href="../index.html" class="title">@vladmandic/human - v2.1.5</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
<div class="tsd-filter-group">
<div class="tsd-select" id="tsd-filter-visibility">
<span class="tsd-select-label">All</span>
<ul class="tsd-select-list">
<li data-value="public">Public</li>
<li data-value="protected">Public/Protected</li>
<li data-value="private" class="selected">All</li>
</ul>
</div>
<input type="checkbox" id="tsd-filter-inherited" checked />
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
</div>
</div>
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
</div>
</div>
</div>
</div>
<div class="tsd-page-title">
<div class="container">
<ul class="tsd-breadcrumb">
<li>
<a href="../index.html">@vladmandic/human - v2.1.5</a>
</li>
<li>
<a href="FaceConfig.html">FaceConfig</a>
</li>
</ul>
<h1>Interface FaceConfig</h1>
</div>
</div>
</header>
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Controlls and configures all face-specific options:</p>
<ul>
<li>face detection, face mesh detection, age, gender, emotion detection and face description
Parameters:</li>
<li>enabled: true/false</li>
<li>modelPath: path for each of face models</li>
<li>minConfidence: threshold for discarding a prediction</li>
<li>iouThreshold: ammount of overlap between two detected objects before one object is removed</li>
<li>maxDetected: maximum number of faces detected in the input, should be set to the minimum number for performance</li>
<li>rotation: use calculated rotated face image or just box with rotation as-is, false means higher performance, but incorrect mesh mapping on higher face angles</li>
<li>return: return extracted face as tensor for futher user processing, in which case user is reponsible for manually disposing the tensor</li>
</ul>
</div>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<span class="target">FaceConfig</span>
</li>
</ul>
</section>
<section class="tsd-panel-group tsd-index-group">
<h2>Index</h2>
<section class="tsd-panel tsd-index-panel">
<div class="tsd-index-content">
<section class="tsd-index-section ">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceConfig.html#description" class="tsd-kind-icon">description</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceConfig.html#detector" class="tsd-kind-icon">detector</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceConfig.html#emotion" class="tsd-kind-icon">emotion</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceConfig.html#enabled-2" class="tsd-kind-icon">enabled</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceConfig.html#iris" class="tsd-kind-icon">iris</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceConfig.html#mesh" class="tsd-kind-icon">mesh</a></li>
</ul>
</section>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="description" class="tsd-anchor"></a>
<h3>description</h3>
<div class="tsd-signature tsd-kind-icon">description<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>minConfidence<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>skipFrames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L41">config.ts:41</a></li>
</ul>
</aside>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
</li>
<li class="tsd-parameter">
<h5>min<wbr>Confidence<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
</li>
<li class="tsd-parameter">
<h5>model<wbr>Path<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5>
</li>
<li class="tsd-parameter">
<h5>skip<wbr>Frames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="detector" class="tsd-anchor"></a>
<h3>detector</h3>
<div class="tsd-signature tsd-kind-icon">detector<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>iouThreshold<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>maxDetected<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>minConfidence<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>return<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>rotation<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>skipFrames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L24">config.ts:24</a></li>
</ul>
</aside>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>iou<wbr>Threshold<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
</li>
<li class="tsd-parameter">
<h5>max<wbr>Detected<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
</li>
<li class="tsd-parameter">
<h5>min<wbr>Confidence<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
</li>
<li class="tsd-parameter">
<h5>model<wbr>Path<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5>
</li>
<li class="tsd-parameter">
<h5>return<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
</li>
<li class="tsd-parameter">
<h5>rotation<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
</li>
<li class="tsd-parameter">
<h5>skip<wbr>Frames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="emotion" class="tsd-anchor"></a>
<h3>emotion</h3>
<div class="tsd-signature tsd-kind-icon">emotion<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>minConfidence<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>skipFrames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L47">config.ts:47</a></li>
</ul>
</aside>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
</li>
<li class="tsd-parameter">
<h5>min<wbr>Confidence<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
</li>
<li class="tsd-parameter">
<h5>model<wbr>Path<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5>
</li>
<li class="tsd-parameter">
<h5>skip<wbr>Frames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="enabled-2" class="tsd-anchor"></a>
<h3>enabled</h3>
<div class="tsd-signature tsd-kind-icon">enabled<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L23">config.ts:23</a></li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="iris" class="tsd-anchor"></a>
<h3>iris</h3>
<div class="tsd-signature tsd-kind-icon">iris<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L37">config.ts:37</a></li>
</ul>
</aside>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
</li>
<li class="tsd-parameter">
<h5>model<wbr>Path<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="mesh" class="tsd-anchor"></a>
<h3>mesh</h3>
<div class="tsd-signature tsd-kind-icon">mesh<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L33">config.ts:33</a></li>
</ul>
</aside>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
</li>
<li class="tsd-parameter">
<h5>model<wbr>Path<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5>
</li>
</ul>
</div>
</section>
</section>
</div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<nav class="tsd-navigation primary">
<ul>
<li class=" ">
<a href="../index.html">Exports</a>
</li>
</ul>
</nav>
<nav class="tsd-navigation secondary menu-sticky">
<ul class="before-current">
<li class=" tsd-kind-reference">
<a href="../index.html#default" class="tsd-kind-icon">default</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/Human.html" class="tsd-kind-icon">Human</a>
</li>
<li class=" tsd-kind-interface">
<a href="BodyConfig.html" class="tsd-kind-icon">Body<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="BodyResult.html" class="tsd-kind-icon">Body<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="Config.html" class="tsd-kind-icon">Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="DrawOptions.html" class="tsd-kind-icon">Draw<wbr>Options</a>
</li>
</ul>
<ul class="current">
<li class="current tsd-kind-interface">
<a href="FaceConfig.html" class="tsd-kind-icon">Face<wbr>Config</a>
<ul>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="FaceConfig.html#description" class="tsd-kind-icon">description</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="FaceConfig.html#detector" class="tsd-kind-icon">detector</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="FaceConfig.html#emotion" class="tsd-kind-icon">emotion</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="FaceConfig.html#enabled-2" class="tsd-kind-icon">enabled</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="FaceConfig.html#iris" class="tsd-kind-icon">iris</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="FaceConfig.html#mesh" class="tsd-kind-icon">mesh</a>
</li>
</ul>
</li>
</ul>
<ul class="after-current">
<li class=" tsd-kind-interface">
<a href="FaceResult.html" class="tsd-kind-icon">Face<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="FilterConfig.html" class="tsd-kind-icon">Filter<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="GestureConfig.html" class="tsd-kind-icon">Gesture<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="HandConfig.html" class="tsd-kind-icon">Hand<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="HandResult.html" class="tsd-kind-icon">Hand<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="ObjectConfig.html" class="tsd-kind-icon">Object<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="ObjectResult.html" class="tsd-kind-icon">Object<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="PersonResult.html" class="tsd-kind-icon">Person<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="Result.html" class="tsd-kind-icon">Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="SegmentationConfig.html" class="tsd-kind-icon">Segmentation<wbr>Config</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Error" class="tsd-kind-icon">Error</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#GestureResult" class="tsd-kind-icon">Gesture<wbr>Result</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Input" class="tsd-kind-icon">Input</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#TensorFlow" class="tsd-kind-icon">Tensor<wbr>Flow</a>
</li>
<li class=" tsd-kind-variable">
<a href="../index.html#defaults" class="tsd-kind-icon">defaults</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<footer>
<div class="container">
<h2>Legend</h2>
<div class="tsd-legend-group">
<ul class="tsd-legend">
<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
</ul>
</div>
</div>
</footer>
<div class="overlay"></div>
<script src="../assets/js/main.js"></script>
</body>
</html>

View File

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Face | @vladmandic/human - v2.1.5</title>
<title>FaceResult | @vladmandic/human - v2.1.5</title>
<meta name="description" content="Documentation for @vladmandic/human - v2.1.5">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
@ -53,10 +53,10 @@
<a href="../index.html">@vladmandic/human - v2.1.5</a>
</li>
<li>
<a href="Face.html">Face</a>
<a href="FaceResult.html">FaceResult</a>
</li>
</ul>
<h1>Interface Face</h1>
<h1>Interface FaceResult</h1>
</div>
</div>
</header>
@ -100,7 +100,7 @@
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<span class="target">Face</span>
<span class="target">FaceResult</span>
</li>
</ul>
</section>
@ -111,23 +111,23 @@
<section class="tsd-index-section ">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Face.html#age" class="tsd-kind-icon">age</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Face.html#annotations" class="tsd-kind-icon">annotations</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Face.html#box" class="tsd-kind-icon">box</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Face.html#boxRaw" class="tsd-kind-icon">box<wbr>Raw</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Face.html#boxScore" class="tsd-kind-icon">box<wbr>Score</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Face.html#embedding" class="tsd-kind-icon">embedding</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Face.html#emotion" class="tsd-kind-icon">emotion</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Face.html#faceScore" class="tsd-kind-icon">face<wbr>Score</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Face.html#gender" class="tsd-kind-icon">gender</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Face.html#genderScore" class="tsd-kind-icon">gender<wbr>Score</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Face.html#id" class="tsd-kind-icon">id</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Face.html#iris" class="tsd-kind-icon">iris</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Face.html#mesh" class="tsd-kind-icon">mesh</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Face.html#meshRaw" class="tsd-kind-icon">mesh<wbr>Raw</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Face.html#rotation" class="tsd-kind-icon">rotation</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Face.html#score" class="tsd-kind-icon">score</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Face.html#tensor" class="tsd-kind-icon">tensor</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceResult.html#age" class="tsd-kind-icon">age</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceResult.html#annotations" class="tsd-kind-icon">annotations</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceResult.html#box" class="tsd-kind-icon">box</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceResult.html#boxRaw" class="tsd-kind-icon">box<wbr>Raw</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceResult.html#boxScore" class="tsd-kind-icon">box<wbr>Score</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceResult.html#embedding" class="tsd-kind-icon">embedding</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceResult.html#emotion" class="tsd-kind-icon">emotion</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceResult.html#faceScore" class="tsd-kind-icon">face<wbr>Score</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceResult.html#gender" class="tsd-kind-icon">gender</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceResult.html#genderScore" class="tsd-kind-icon">gender<wbr>Score</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceResult.html#id" class="tsd-kind-icon">id</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceResult.html#iris" class="tsd-kind-icon">iris</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceResult.html#mesh" class="tsd-kind-icon">mesh</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceResult.html#meshRaw" class="tsd-kind-icon">mesh<wbr>Raw</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceResult.html#rotation" class="tsd-kind-icon">rotation</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceResult.html#score" class="tsd-kind-icon">score</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceResult.html#tensor" class="tsd-kind-icon">tensor</a></li>
</ul>
</section>
</div>
@ -357,7 +357,10 @@
<a href="../classes/Human.html" class="tsd-kind-icon">Human</a>
</li>
<li class=" tsd-kind-interface">
<a href="Body.html" class="tsd-kind-icon">Body</a>
<a href="BodyConfig.html" class="tsd-kind-icon">Body<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="BodyResult.html" class="tsd-kind-icon">Body<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="Config.html" class="tsd-kind-icon">Config</a>
@ -365,83 +368,101 @@
<li class=" tsd-kind-interface">
<a href="DrawOptions.html" class="tsd-kind-icon">Draw<wbr>Options</a>
</li>
<li class=" tsd-kind-interface">
<a href="FaceConfig.html" class="tsd-kind-icon">Face<wbr>Config</a>
</li>
</ul>
<ul class="current">
<li class="current tsd-kind-interface">
<a href="Face.html" class="tsd-kind-icon">Face</a>
<a href="FaceResult.html" class="tsd-kind-icon">Face<wbr>Result</a>
<ul>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Face.html#age" class="tsd-kind-icon">age</a>
<a href="FaceResult.html#age" class="tsd-kind-icon">age</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Face.html#annotations" class="tsd-kind-icon">annotations</a>
<a href="FaceResult.html#annotations" class="tsd-kind-icon">annotations</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Face.html#box" class="tsd-kind-icon">box</a>
<a href="FaceResult.html#box" class="tsd-kind-icon">box</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Face.html#boxRaw" class="tsd-kind-icon">box<wbr>Raw</a>
<a href="FaceResult.html#boxRaw" class="tsd-kind-icon">box<wbr>Raw</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Face.html#boxScore" class="tsd-kind-icon">box<wbr>Score</a>
<a href="FaceResult.html#boxScore" class="tsd-kind-icon">box<wbr>Score</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Face.html#embedding" class="tsd-kind-icon">embedding</a>
<a href="FaceResult.html#embedding" class="tsd-kind-icon">embedding</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Face.html#emotion" class="tsd-kind-icon">emotion</a>
<a href="FaceResult.html#emotion" class="tsd-kind-icon">emotion</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Face.html#faceScore" class="tsd-kind-icon">face<wbr>Score</a>
<a href="FaceResult.html#faceScore" class="tsd-kind-icon">face<wbr>Score</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Face.html#gender" class="tsd-kind-icon">gender</a>
<a href="FaceResult.html#gender" class="tsd-kind-icon">gender</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Face.html#genderScore" class="tsd-kind-icon">gender<wbr>Score</a>
<a href="FaceResult.html#genderScore" class="tsd-kind-icon">gender<wbr>Score</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Face.html#id" class="tsd-kind-icon">id</a>
<a href="FaceResult.html#id" class="tsd-kind-icon">id</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Face.html#iris" class="tsd-kind-icon">iris</a>
<a href="FaceResult.html#iris" class="tsd-kind-icon">iris</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Face.html#mesh" class="tsd-kind-icon">mesh</a>
<a href="FaceResult.html#mesh" class="tsd-kind-icon">mesh</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Face.html#meshRaw" class="tsd-kind-icon">mesh<wbr>Raw</a>
<a href="FaceResult.html#meshRaw" class="tsd-kind-icon">mesh<wbr>Raw</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Face.html#rotation" class="tsd-kind-icon">rotation</a>
<a href="FaceResult.html#rotation" class="tsd-kind-icon">rotation</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Face.html#score" class="tsd-kind-icon">score</a>
<a href="FaceResult.html#score" class="tsd-kind-icon">score</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Face.html#tensor" class="tsd-kind-icon">tensor</a>
<a href="FaceResult.html#tensor" class="tsd-kind-icon">tensor</a>
</li>
</ul>
</li>
</ul>
<ul class="after-current">
<li class=" tsd-kind-interface">
<a href="Hand.html" class="tsd-kind-icon">Hand</a>
<a href="FilterConfig.html" class="tsd-kind-icon">Filter<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="Item.html" class="tsd-kind-icon">Item</a>
<a href="GestureConfig.html" class="tsd-kind-icon">Gesture<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="Person.html" class="tsd-kind-icon">Person</a>
<a href="HandConfig.html" class="tsd-kind-icon">Hand<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="HandResult.html" class="tsd-kind-icon">Hand<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="ObjectConfig.html" class="tsd-kind-icon">Object<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="ObjectResult.html" class="tsd-kind-icon">Object<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="PersonResult.html" class="tsd-kind-icon">Person<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="Result.html" class="tsd-kind-icon">Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="SegmentationConfig.html" class="tsd-kind-icon">Segmentation<wbr>Config</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Error" class="tsd-kind-icon">Error</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Gesture" class="tsd-kind-icon">Gesture</a>
<a href="../index.html#GestureResult" class="tsd-kind-icon">Gesture<wbr>Result</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Input" class="tsd-kind-icon">Input</a>
@ -449,6 +470,9 @@
<li class=" tsd-kind-type-alias">
<a href="../index.html#TensorFlow" class="tsd-kind-icon">Tensor<wbr>Flow</a>
</li>
<li class=" tsd-kind-variable">
<a href="../index.html#defaults" class="tsd-kind-icon">defaults</a>
</li>
</ul>
</nav>
</div>
@ -466,9 +490,6 @@
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
</ul>
</div>
</div>
</footer>

View File

@ -0,0 +1,552 @@
<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>FilterConfig | @vladmandic/human - v2.1.5</title>
<meta name="description" content="Documentation for @vladmandic/human - v2.1.5">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
<script async src="../assets/js/search.js" id="search-script"></script>
</head>
<body>
<header>
<div class="tsd-page-toolbar">
<div class="container">
<div class="table-wrap">
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
<div class="field">
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
<input id="tsd-search-field" type="text" />
</div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a href="../index.html" class="title">@vladmandic/human - v2.1.5</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
<div class="tsd-filter-group">
<div class="tsd-select" id="tsd-filter-visibility">
<span class="tsd-select-label">All</span>
<ul class="tsd-select-list">
<li data-value="public">Public</li>
<li data-value="protected">Public/Protected</li>
<li data-value="private" class="selected">All</li>
</ul>
</div>
<input type="checkbox" id="tsd-filter-inherited" checked />
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
</div>
</div>
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
</div>
</div>
</div>
</div>
<div class="tsd-page-title">
<div class="container">
<ul class="tsd-breadcrumb">
<li>
<a href="../index.html">@vladmandic/human - v2.1.5</a>
</li>
<li>
<a href="FilterConfig.html">FilterConfig</a>
</li>
</ul>
<h1>Interface FilterConfig</h1>
</div>
</div>
</header>
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Run input through image filters before inference</p>
<ul>
<li>image filters run with near-zero latency as they are executed on the GPU</li>
</ul>
</div>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<span class="target">FilterConfig</span>
</li>
</ul>
</section>
<section class="tsd-panel-group tsd-index-group">
<h2>Index</h2>
<section class="tsd-panel tsd-index-panel">
<div class="tsd-index-content">
<section class="tsd-index-section ">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#blur" class="tsd-kind-icon">blur</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#brightness" class="tsd-kind-icon">brightness</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#contrast" class="tsd-kind-icon">contrast</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#enabled" class="tsd-kind-icon">enabled</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#flip" class="tsd-kind-icon">flip</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#height" class="tsd-kind-icon">height</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#hue" class="tsd-kind-icon">hue</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#kodachrome" class="tsd-kind-icon">kodachrome</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#negative" class="tsd-kind-icon">negative</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#pixelate" class="tsd-kind-icon">pixelate</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#polaroid" class="tsd-kind-icon">polaroid</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#return" class="tsd-kind-icon">return</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#saturation" class="tsd-kind-icon">saturation</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#sepia" class="tsd-kind-icon">sepia</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#sharpness" class="tsd-kind-icon">sharpness</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#technicolor" class="tsd-kind-icon">technicolor</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#vintage" class="tsd-kind-icon">vintage</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#width" class="tsd-kind-icon">width</a></li>
</ul>
</section>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="blur" class="tsd-anchor"></a>
<h3>blur</h3>
<div class="tsd-signature tsd-kind-icon">blur<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L152">config.ts:152</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Range: 0 (no blur) to N (blur radius in pixels)</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="brightness" class="tsd-anchor"></a>
<h3>brightness</h3>
<div class="tsd-signature tsd-kind-icon">brightness<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L146">config.ts:146</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Range: -1 (darken) to 1 (lighten)</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="contrast" class="tsd-anchor"></a>
<h3>contrast</h3>
<div class="tsd-signature tsd-kind-icon">contrast<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L148">config.ts:148</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Range: -1 (reduce contrast) to 1 (increase contrast)</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="enabled" class="tsd-anchor"></a>
<h3>enabled</h3>
<div class="tsd-signature tsd-kind-icon">enabled<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L128">config.ts:128</a></li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="flip" class="tsd-anchor"></a>
<h3>flip</h3>
<div class="tsd-signature tsd-kind-icon">flip<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L144">config.ts:144</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Flip input as mirror image</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="height" class="tsd-anchor"></a>
<h3>height</h3>
<div class="tsd-signature tsd-kind-icon">height<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L140">config.ts:140</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Resize input height</p>
<ul>
<li>if both width and height are set to 0, there is no resizing</li>
<li>if just one is set, second one is scaled automatically</li>
<li>if both are set, values are used as-is</li>
</ul>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="hue" class="tsd-anchor"></a>
<h3>hue</h3>
<div class="tsd-signature tsd-kind-icon">hue<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L156">config.ts:156</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Range: 0 (no change) to 360 (hue rotation in degrees)</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="kodachrome" class="tsd-anchor"></a>
<h3>kodachrome</h3>
<div class="tsd-signature tsd-kind-icon">kodachrome<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L164">config.ts:164</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Image kodachrome colors</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="negative" class="tsd-anchor"></a>
<h3>negative</h3>
<div class="tsd-signature tsd-kind-icon">negative<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L158">config.ts:158</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Image negative</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="pixelate" class="tsd-anchor"></a>
<h3>pixelate</h3>
<div class="tsd-signature tsd-kind-icon">pixelate<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L170">config.ts:170</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Range: 0 (no pixelate) to N (number of pixels to pixelate)</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="polaroid" class="tsd-anchor"></a>
<h3>polaroid</h3>
<div class="tsd-signature tsd-kind-icon">polaroid<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L168">config.ts:168</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Image polaroid camera effect</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="return" class="tsd-anchor"></a>
<h3>return</h3>
<div class="tsd-signature tsd-kind-icon">return<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L142">config.ts:142</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Return processed canvas imagedata in result</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="saturation" class="tsd-anchor"></a>
<h3>saturation</h3>
<div class="tsd-signature tsd-kind-icon">saturation<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L154">config.ts:154</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Range: -1 (reduce saturation) to 1 (increase saturation)</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="sepia" class="tsd-anchor"></a>
<h3>sepia</h3>
<div class="tsd-signature tsd-kind-icon">sepia<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L160">config.ts:160</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Image sepia colors</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="sharpness" class="tsd-anchor"></a>
<h3>sharpness</h3>
<div class="tsd-signature tsd-kind-icon">sharpness<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L150">config.ts:150</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Range: 0 (no sharpening) to 1 (maximum sharpening)</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="technicolor" class="tsd-anchor"></a>
<h3>technicolor</h3>
<div class="tsd-signature tsd-kind-icon">technicolor<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L166">config.ts:166</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Image technicolor colors</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="vintage" class="tsd-anchor"></a>
<h3>vintage</h3>
<div class="tsd-signature tsd-kind-icon">vintage<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L162">config.ts:162</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Image vintage colors</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="width" class="tsd-anchor"></a>
<h3>width</h3>
<div class="tsd-signature tsd-kind-icon">width<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L134">config.ts:134</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Resize input width</p>
<ul>
<li>if both width and height are set to 0, there is no resizing</li>
<li>if just one is set, second one is scaled automatically</li>
<li>if both are set, values are used as-is</li>
</ul>
</div>
</div>
</section>
</section>
</div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<nav class="tsd-navigation primary">
<ul>
<li class=" ">
<a href="../index.html">Exports</a>
</li>
</ul>
</nav>
<nav class="tsd-navigation secondary menu-sticky">
<ul class="before-current">
<li class=" tsd-kind-reference">
<a href="../index.html#default" class="tsd-kind-icon">default</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/Human.html" class="tsd-kind-icon">Human</a>
</li>
<li class=" tsd-kind-interface">
<a href="BodyConfig.html" class="tsd-kind-icon">Body<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="BodyResult.html" class="tsd-kind-icon">Body<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="Config.html" class="tsd-kind-icon">Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="DrawOptions.html" class="tsd-kind-icon">Draw<wbr>Options</a>
</li>
<li class=" tsd-kind-interface">
<a href="FaceConfig.html" class="tsd-kind-icon">Face<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="FaceResult.html" class="tsd-kind-icon">Face<wbr>Result</a>
</li>
</ul>
<ul class="current">
<li class="current tsd-kind-interface">
<a href="FilterConfig.html" class="tsd-kind-icon">Filter<wbr>Config</a>
<ul>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="FilterConfig.html#blur" class="tsd-kind-icon">blur</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="FilterConfig.html#brightness" class="tsd-kind-icon">brightness</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="FilterConfig.html#contrast" class="tsd-kind-icon">contrast</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="FilterConfig.html#enabled" class="tsd-kind-icon">enabled</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="FilterConfig.html#flip" class="tsd-kind-icon">flip</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="FilterConfig.html#height" class="tsd-kind-icon">height</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="FilterConfig.html#hue" class="tsd-kind-icon">hue</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="FilterConfig.html#kodachrome" class="tsd-kind-icon">kodachrome</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="FilterConfig.html#negative" class="tsd-kind-icon">negative</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="FilterConfig.html#pixelate" class="tsd-kind-icon">pixelate</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="FilterConfig.html#polaroid" class="tsd-kind-icon">polaroid</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="FilterConfig.html#return" class="tsd-kind-icon">return</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="FilterConfig.html#saturation" class="tsd-kind-icon">saturation</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="FilterConfig.html#sepia" class="tsd-kind-icon">sepia</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="FilterConfig.html#sharpness" class="tsd-kind-icon">sharpness</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="FilterConfig.html#technicolor" class="tsd-kind-icon">technicolor</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="FilterConfig.html#vintage" class="tsd-kind-icon">vintage</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="FilterConfig.html#width" class="tsd-kind-icon">width</a>
</li>
</ul>
</li>
</ul>
<ul class="after-current">
<li class=" tsd-kind-interface">
<a href="GestureConfig.html" class="tsd-kind-icon">Gesture<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="HandConfig.html" class="tsd-kind-icon">Hand<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="HandResult.html" class="tsd-kind-icon">Hand<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="ObjectConfig.html" class="tsd-kind-icon">Object<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="ObjectResult.html" class="tsd-kind-icon">Object<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="PersonResult.html" class="tsd-kind-icon">Person<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="Result.html" class="tsd-kind-icon">Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="SegmentationConfig.html" class="tsd-kind-icon">Segmentation<wbr>Config</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Error" class="tsd-kind-icon">Error</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#GestureResult" class="tsd-kind-icon">Gesture<wbr>Result</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Input" class="tsd-kind-icon">Input</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#TensorFlow" class="tsd-kind-icon">Tensor<wbr>Flow</a>
</li>
<li class=" tsd-kind-variable">
<a href="../index.html#defaults" class="tsd-kind-icon">defaults</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<footer>
<div class="container">
<h2>Legend</h2>
<div class="tsd-legend-group">
<ul class="tsd-legend">
<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
</ul>
</div>
</div>
</footer>
<div class="overlay"></div>
<script src="../assets/js/main.js"></script>
</body>
</html>

View File

@ -0,0 +1,216 @@
<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>GestureConfig | @vladmandic/human - v2.1.5</title>
<meta name="description" content="Documentation for @vladmandic/human - v2.1.5">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
<script async src="../assets/js/search.js" id="search-script"></script>
</head>
<body>
<header>
<div class="tsd-page-toolbar">
<div class="container">
<div class="table-wrap">
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
<div class="field">
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
<input id="tsd-search-field" type="text" />
</div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a href="../index.html" class="title">@vladmandic/human - v2.1.5</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
<div class="tsd-filter-group">
<div class="tsd-select" id="tsd-filter-visibility">
<span class="tsd-select-label">All</span>
<ul class="tsd-select-list">
<li data-value="public">Public</li>
<li data-value="protected">Public/Protected</li>
<li data-value="private" class="selected">All</li>
</ul>
</div>
<input type="checkbox" id="tsd-filter-inherited" checked />
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
</div>
</div>
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
</div>
</div>
</div>
</div>
<div class="tsd-page-title">
<div class="container">
<ul class="tsd-breadcrumb">
<li>
<a href="../index.html">@vladmandic/human - v2.1.5</a>
</li>
<li>
<a href="GestureConfig.html">GestureConfig</a>
</li>
</ul>
<h1>Interface GestureConfig</h1>
</div>
</div>
</header>
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Controlls gesture detection</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<span class="target">GestureConfig</span>
</li>
</ul>
</section>
<section class="tsd-panel-group tsd-index-group">
<h2>Index</h2>
<section class="tsd-panel tsd-index-panel">
<div class="tsd-index-content">
<section class="tsd-index-section ">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="GestureConfig.html#enabled" class="tsd-kind-icon">enabled</a></li>
</ul>
</section>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="enabled" class="tsd-anchor"></a>
<h3>enabled</h3>
<div class="tsd-signature tsd-kind-icon">enabled<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L175">config.ts:175</a></li>
</ul>
</aside>
</section>
</section>
</div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<nav class="tsd-navigation primary">
<ul>
<li class=" ">
<a href="../index.html">Exports</a>
</li>
</ul>
</nav>
<nav class="tsd-navigation secondary menu-sticky">
<ul class="before-current">
<li class=" tsd-kind-reference">
<a href="../index.html#default" class="tsd-kind-icon">default</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/Human.html" class="tsd-kind-icon">Human</a>
</li>
<li class=" tsd-kind-interface">
<a href="BodyConfig.html" class="tsd-kind-icon">Body<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="BodyResult.html" class="tsd-kind-icon">Body<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="Config.html" class="tsd-kind-icon">Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="DrawOptions.html" class="tsd-kind-icon">Draw<wbr>Options</a>
</li>
<li class=" tsd-kind-interface">
<a href="FaceConfig.html" class="tsd-kind-icon">Face<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="FaceResult.html" class="tsd-kind-icon">Face<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="FilterConfig.html" class="tsd-kind-icon">Filter<wbr>Config</a>
</li>
</ul>
<ul class="current">
<li class="current tsd-kind-interface">
<a href="GestureConfig.html" class="tsd-kind-icon">Gesture<wbr>Config</a>
<ul>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="GestureConfig.html#enabled" class="tsd-kind-icon">enabled</a>
</li>
</ul>
</li>
</ul>
<ul class="after-current">
<li class=" tsd-kind-interface">
<a href="HandConfig.html" class="tsd-kind-icon">Hand<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="HandResult.html" class="tsd-kind-icon">Hand<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="ObjectConfig.html" class="tsd-kind-icon">Object<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="ObjectResult.html" class="tsd-kind-icon">Object<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="PersonResult.html" class="tsd-kind-icon">Person<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="Result.html" class="tsd-kind-icon">Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="SegmentationConfig.html" class="tsd-kind-icon">Segmentation<wbr>Config</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Error" class="tsd-kind-icon">Error</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#GestureResult" class="tsd-kind-icon">Gesture<wbr>Result</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Input" class="tsd-kind-icon">Input</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#TensorFlow" class="tsd-kind-icon">Tensor<wbr>Flow</a>
</li>
<li class=" tsd-kind-variable">
<a href="../index.html#defaults" class="tsd-kind-icon">defaults</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<footer>
<div class="container">
<h2>Legend</h2>
<div class="tsd-legend-group">
<ul class="tsd-legend">
<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
</ul>
</div>
</div>
</footer>
<div class="overlay"></div>
<script src="../assets/js/main.js"></script>
</body>
</html>

View File

@ -0,0 +1,353 @@
<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>HandConfig | @vladmandic/human - v2.1.5</title>
<meta name="description" content="Documentation for @vladmandic/human - v2.1.5">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
<script async src="../assets/js/search.js" id="search-script"></script>
</head>
<body>
<header>
<div class="tsd-page-toolbar">
<div class="container">
<div class="table-wrap">
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
<div class="field">
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
<input id="tsd-search-field" type="text" />
</div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a href="../index.html" class="title">@vladmandic/human - v2.1.5</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
<div class="tsd-filter-group">
<div class="tsd-select" id="tsd-filter-visibility">
<span class="tsd-select-label">All</span>
<ul class="tsd-select-list">
<li data-value="public">Public</li>
<li data-value="protected">Public/Protected</li>
<li data-value="private" class="selected">All</li>
</ul>
</div>
<input type="checkbox" id="tsd-filter-inherited" checked />
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
</div>
</div>
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
</div>
</div>
</div>
</div>
<div class="tsd-page-title">
<div class="container">
<ul class="tsd-breadcrumb">
<li>
<a href="../index.html">@vladmandic/human - v2.1.5</a>
</li>
<li>
<a href="HandConfig.html">HandConfig</a>
</li>
</ul>
<h1>Interface HandConfig</h1>
</div>
</div>
</header>
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Controlls and configures all hand detection specific options</p>
<ul>
<li>enabled: true/false</li>
<li>landmarks: detect hand landmarks or just hand boundary box</li>
<li>modelPath: paths for hand detector and hand skeleton models, can be absolute path or relative to modelBasePath</li>
<li>minConfidence: threshold for discarding a prediction</li>
<li>iouThreshold: ammount of overlap between two detected objects before one object is removed</li>
<li>maxDetected: maximum number of hands detected in the input, should be set to the minimum number for performance</li>
<li>rotation: use best-guess rotated hand image or just box with rotation as-is, false means higher performance, but incorrect finger mapping if hand is inverted</li>
</ul>
</div>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<span class="target">HandConfig</span>
</li>
</ul>
</section>
<section class="tsd-panel-group tsd-index-group">
<h2>Index</h2>
<section class="tsd-panel tsd-index-panel">
<div class="tsd-index-content">
<section class="tsd-index-section ">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandConfig.html#detector" class="tsd-kind-icon">detector</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandConfig.html#enabled" class="tsd-kind-icon">enabled</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandConfig.html#iouThreshold" class="tsd-kind-icon">iou<wbr>Threshold</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandConfig.html#landmarks" class="tsd-kind-icon">landmarks</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandConfig.html#maxDetected" class="tsd-kind-icon">max<wbr>Detected</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandConfig.html#minConfidence" class="tsd-kind-icon">min<wbr>Confidence</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandConfig.html#rotation" class="tsd-kind-icon">rotation</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandConfig.html#skeleton" class="tsd-kind-icon">skeleton</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandConfig.html#skipFrames" class="tsd-kind-icon">skip<wbr>Frames</a></li>
</ul>
</section>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="detector" class="tsd-anchor"></a>
<h3>detector</h3>
<div class="tsd-signature tsd-kind-icon">detector<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L86">config.ts:86</a></li>
</ul>
</aside>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>model<wbr>Path<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="enabled" class="tsd-anchor"></a>
<h3>enabled</h3>
<div class="tsd-signature tsd-kind-icon">enabled<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L79">config.ts:79</a></li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="iouThreshold" class="tsd-anchor"></a>
<h3>iou<wbr>Threshold</h3>
<div class="tsd-signature tsd-kind-icon">iou<wbr>Threshold<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L83">config.ts:83</a></li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="landmarks" class="tsd-anchor"></a>
<h3>landmarks</h3>
<div class="tsd-signature tsd-kind-icon">landmarks<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L85">config.ts:85</a></li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="maxDetected" class="tsd-anchor"></a>
<h3>max<wbr>Detected</h3>
<div class="tsd-signature tsd-kind-icon">max<wbr>Detected<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L84">config.ts:84</a></li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="minConfidence" class="tsd-anchor"></a>
<h3>min<wbr>Confidence</h3>
<div class="tsd-signature tsd-kind-icon">min<wbr>Confidence<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L82">config.ts:82</a></li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="rotation" class="tsd-anchor"></a>
<h3>rotation</h3>
<div class="tsd-signature tsd-kind-icon">rotation<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L80">config.ts:80</a></li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="skeleton" class="tsd-anchor"></a>
<h3>skeleton</h3>
<div class="tsd-signature tsd-kind-icon">skeleton<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L89">config.ts:89</a></li>
</ul>
</aside>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>model<wbr>Path<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="skipFrames" class="tsd-anchor"></a>
<h3>skip<wbr>Frames</h3>
<div class="tsd-signature tsd-kind-icon">skip<wbr>Frames<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L81">config.ts:81</a></li>
</ul>
</aside>
</section>
</section>
</div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<nav class="tsd-navigation primary">
<ul>
<li class=" ">
<a href="../index.html">Exports</a>
</li>
</ul>
</nav>
<nav class="tsd-navigation secondary menu-sticky">
<ul class="before-current">
<li class=" tsd-kind-reference">
<a href="../index.html#default" class="tsd-kind-icon">default</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/Human.html" class="tsd-kind-icon">Human</a>
</li>
<li class=" tsd-kind-interface">
<a href="BodyConfig.html" class="tsd-kind-icon">Body<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="BodyResult.html" class="tsd-kind-icon">Body<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="Config.html" class="tsd-kind-icon">Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="DrawOptions.html" class="tsd-kind-icon">Draw<wbr>Options</a>
</li>
<li class=" tsd-kind-interface">
<a href="FaceConfig.html" class="tsd-kind-icon">Face<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="FaceResult.html" class="tsd-kind-icon">Face<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="FilterConfig.html" class="tsd-kind-icon">Filter<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="GestureConfig.html" class="tsd-kind-icon">Gesture<wbr>Config</a>
</li>
</ul>
<ul class="current">
<li class="current tsd-kind-interface">
<a href="HandConfig.html" class="tsd-kind-icon">Hand<wbr>Config</a>
<ul>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="HandConfig.html#detector" class="tsd-kind-icon">detector</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="HandConfig.html#enabled" class="tsd-kind-icon">enabled</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="HandConfig.html#iouThreshold" class="tsd-kind-icon">iou<wbr>Threshold</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="HandConfig.html#landmarks" class="tsd-kind-icon">landmarks</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="HandConfig.html#maxDetected" class="tsd-kind-icon">max<wbr>Detected</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="HandConfig.html#minConfidence" class="tsd-kind-icon">min<wbr>Confidence</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="HandConfig.html#rotation" class="tsd-kind-icon">rotation</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="HandConfig.html#skeleton" class="tsd-kind-icon">skeleton</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="HandConfig.html#skipFrames" class="tsd-kind-icon">skip<wbr>Frames</a>
</li>
</ul>
</li>
</ul>
<ul class="after-current">
<li class=" tsd-kind-interface">
<a href="HandResult.html" class="tsd-kind-icon">Hand<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="ObjectConfig.html" class="tsd-kind-icon">Object<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="ObjectResult.html" class="tsd-kind-icon">Object<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="PersonResult.html" class="tsd-kind-icon">Person<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="Result.html" class="tsd-kind-icon">Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="SegmentationConfig.html" class="tsd-kind-icon">Segmentation<wbr>Config</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Error" class="tsd-kind-icon">Error</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#GestureResult" class="tsd-kind-icon">Gesture<wbr>Result</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Input" class="tsd-kind-icon">Input</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#TensorFlow" class="tsd-kind-icon">Tensor<wbr>Flow</a>
</li>
<li class=" tsd-kind-variable">
<a href="../index.html#defaults" class="tsd-kind-icon">defaults</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<footer>
<div class="container">
<h2>Legend</h2>
<div class="tsd-legend-group">
<ul class="tsd-legend">
<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
</ul>
</div>
</div>
</footer>
<div class="overlay"></div>
<script src="../assets/js/main.js"></script>
</body>
</html>

View File

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Hand | @vladmandic/human - v2.1.5</title>
<title>HandResult | @vladmandic/human - v2.1.5</title>
<meta name="description" content="Documentation for @vladmandic/human - v2.1.5">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
@ -53,10 +53,10 @@
<a href="../index.html">@vladmandic/human - v2.1.5</a>
</li>
<li>
<a href="Hand.html">Hand</a>
<a href="HandResult.html">HandResult</a>
</li>
</ul>
<h1>Interface Hand</h1>
<h1>Interface HandResult</h1>
</div>
</div>
</header>
@ -84,7 +84,7 @@
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<span class="target">Hand</span>
<span class="target">HandResult</span>
</li>
</ul>
</section>
@ -95,13 +95,13 @@
<section class="tsd-index-section ">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Hand.html#annotations" class="tsd-kind-icon">annotations</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Hand.html#box" class="tsd-kind-icon">box</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Hand.html#boxRaw" class="tsd-kind-icon">box<wbr>Raw</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Hand.html#id" class="tsd-kind-icon">id</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Hand.html#keypoints" class="tsd-kind-icon">keypoints</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Hand.html#landmarks" class="tsd-kind-icon">landmarks</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Hand.html#score" class="tsd-kind-icon">score</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandResult.html#annotations" class="tsd-kind-icon">annotations</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandResult.html#box" class="tsd-kind-icon">box</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandResult.html#boxRaw" class="tsd-kind-icon">box<wbr>Raw</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandResult.html#id" class="tsd-kind-icon">id</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandResult.html#keypoints" class="tsd-kind-icon">keypoints</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandResult.html#landmarks" class="tsd-kind-icon">landmarks</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandResult.html#score" class="tsd-kind-icon">score</a></li>
</ul>
</section>
</div>
@ -162,7 +162,7 @@
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="landmarks" class="tsd-anchor"></a>
<h3>landmarks</h3>
<div class="tsd-signature tsd-kind-icon">landmarks<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">&quot;index&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;middle&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;pinky&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;ring&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;thumb&quot;</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">{ </span>curl<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">&quot;none&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;full&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;half&quot;</span><span class="tsd-signature-symbol">; </span>direction<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">&quot;verticalUp&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;verticalDown&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;horizontalLeft&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;horizontalRight&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;diagonalUpRight&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;diagonalUpLeft&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;diagonalDownRight&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;diagonalDownLeft&quot;</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">&gt;</span></div>
<div class="tsd-signature tsd-kind-icon">landmarks<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">&quot;index&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;middle&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;pinky&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;ring&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;thumb&quot;</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">{ </span>curl<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">&quot;none&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;half&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;full&quot;</span><span class="tsd-signature-symbol">; </span>direction<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">&quot;verticalUp&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;verticalDown&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;horizontalLeft&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;horizontalRight&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;diagonalUpRight&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;diagonalUpLeft&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;diagonalDownRight&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;diagonalDownLeft&quot;</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">&gt;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L107">result.ts:107</a></li>
@ -198,7 +198,10 @@
<a href="../classes/Human.html" class="tsd-kind-icon">Human</a>
</li>
<li class=" tsd-kind-interface">
<a href="Body.html" class="tsd-kind-icon">Body</a>
<a href="BodyConfig.html" class="tsd-kind-icon">Body<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="BodyResult.html" class="tsd-kind-icon">Body<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="Config.html" class="tsd-kind-icon">Config</a>
@ -207,52 +210,70 @@
<a href="DrawOptions.html" class="tsd-kind-icon">Draw<wbr>Options</a>
</li>
<li class=" tsd-kind-interface">
<a href="Face.html" class="tsd-kind-icon">Face</a>
<a href="FaceConfig.html" class="tsd-kind-icon">Face<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="FaceResult.html" class="tsd-kind-icon">Face<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="FilterConfig.html" class="tsd-kind-icon">Filter<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="GestureConfig.html" class="tsd-kind-icon">Gesture<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="HandConfig.html" class="tsd-kind-icon">Hand<wbr>Config</a>
</li>
</ul>
<ul class="current">
<li class="current tsd-kind-interface">
<a href="Hand.html" class="tsd-kind-icon">Hand</a>
<a href="HandResult.html" class="tsd-kind-icon">Hand<wbr>Result</a>
<ul>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Hand.html#annotations" class="tsd-kind-icon">annotations</a>
<a href="HandResult.html#annotations" class="tsd-kind-icon">annotations</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Hand.html#box" class="tsd-kind-icon">box</a>
<a href="HandResult.html#box" class="tsd-kind-icon">box</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Hand.html#boxRaw" class="tsd-kind-icon">box<wbr>Raw</a>
<a href="HandResult.html#boxRaw" class="tsd-kind-icon">box<wbr>Raw</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Hand.html#id" class="tsd-kind-icon">id</a>
<a href="HandResult.html#id" class="tsd-kind-icon">id</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Hand.html#keypoints" class="tsd-kind-icon">keypoints</a>
<a href="HandResult.html#keypoints" class="tsd-kind-icon">keypoints</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Hand.html#landmarks" class="tsd-kind-icon">landmarks</a>
<a href="HandResult.html#landmarks" class="tsd-kind-icon">landmarks</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Hand.html#score" class="tsd-kind-icon">score</a>
<a href="HandResult.html#score" class="tsd-kind-icon">score</a>
</li>
</ul>
</li>
</ul>
<ul class="after-current">
<li class=" tsd-kind-interface">
<a href="Item.html" class="tsd-kind-icon">Item</a>
<a href="ObjectConfig.html" class="tsd-kind-icon">Object<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="Person.html" class="tsd-kind-icon">Person</a>
<a href="ObjectResult.html" class="tsd-kind-icon">Object<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="PersonResult.html" class="tsd-kind-icon">Person<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="Result.html" class="tsd-kind-icon">Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="SegmentationConfig.html" class="tsd-kind-icon">Segmentation<wbr>Config</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Error" class="tsd-kind-icon">Error</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Gesture" class="tsd-kind-icon">Gesture</a>
<a href="../index.html#GestureResult" class="tsd-kind-icon">Gesture<wbr>Result</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Input" class="tsd-kind-icon">Input</a>
@ -260,6 +281,9 @@
<li class=" tsd-kind-type-alias">
<a href="../index.html#TensorFlow" class="tsd-kind-icon">Tensor<wbr>Flow</a>
</li>
<li class=" tsd-kind-variable">
<a href="../index.html#defaults" class="tsd-kind-icon">defaults</a>
</li>
</ul>
</nav>
</div>
@ -277,9 +301,6 @@
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
</ul>
</div>
</div>
</footer>

View File

@ -0,0 +1,293 @@
<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>ObjectConfig | @vladmandic/human - v2.1.5</title>
<meta name="description" content="Documentation for @vladmandic/human - v2.1.5">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
<script async src="../assets/js/search.js" id="search-script"></script>
</head>
<body>
<header>
<div class="tsd-page-toolbar">
<div class="container">
<div class="table-wrap">
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
<div class="field">
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
<input id="tsd-search-field" type="text" />
</div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a href="../index.html" class="title">@vladmandic/human - v2.1.5</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
<div class="tsd-filter-group">
<div class="tsd-select" id="tsd-filter-visibility">
<span class="tsd-select-label">All</span>
<ul class="tsd-select-list">
<li data-value="public">Public</li>
<li data-value="protected">Public/Protected</li>
<li data-value="private" class="selected">All</li>
</ul>
</div>
<input type="checkbox" id="tsd-filter-inherited" checked />
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
</div>
</div>
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
</div>
</div>
</div>
</div>
<div class="tsd-page-title">
<div class="container">
<ul class="tsd-breadcrumb">
<li>
<a href="../index.html">@vladmandic/human - v2.1.5</a>
</li>
<li>
<a href="ObjectConfig.html">ObjectConfig</a>
</li>
</ul>
<h1>Interface ObjectConfig</h1>
</div>
</div>
</header>
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Controlls and configures all object detection specific options</p>
<ul>
<li>enabled: true/false</li>
<li>modelPath: object detection model, can be absolute path or relative to modelBasePath</li>
<li>minConfidence: minimum score that detection must have to return as valid object</li>
<li>iouThreshold: ammount of overlap between two detected objects before one object is removed</li>
<li>maxDetected: maximum number of detections to return</li>
</ul>
</div>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<span class="target">ObjectConfig</span>
</li>
</ul>
</section>
<section class="tsd-panel-group tsd-index-group">
<h2>Index</h2>
<section class="tsd-panel tsd-index-panel">
<div class="tsd-index-content">
<section class="tsd-index-section ">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="ObjectConfig.html#enabled" class="tsd-kind-icon">enabled</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="ObjectConfig.html#iouThreshold" class="tsd-kind-icon">iou<wbr>Threshold</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="ObjectConfig.html#maxDetected" class="tsd-kind-icon">max<wbr>Detected</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="ObjectConfig.html#minConfidence" class="tsd-kind-icon">min<wbr>Confidence</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="ObjectConfig.html#modelPath" class="tsd-kind-icon">model<wbr>Path</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="ObjectConfig.html#skipFrames" class="tsd-kind-icon">skip<wbr>Frames</a></li>
</ul>
</section>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="enabled" class="tsd-anchor"></a>
<h3>enabled</h3>
<div class="tsd-signature tsd-kind-icon">enabled<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L102">config.ts:102</a></li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="iouThreshold" class="tsd-anchor"></a>
<h3>iou<wbr>Threshold</h3>
<div class="tsd-signature tsd-kind-icon">iou<wbr>Threshold<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L105">config.ts:105</a></li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="maxDetected" class="tsd-anchor"></a>
<h3>max<wbr>Detected</h3>
<div class="tsd-signature tsd-kind-icon">max<wbr>Detected<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L106">config.ts:106</a></li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="minConfidence" class="tsd-anchor"></a>
<h3>min<wbr>Confidence</h3>
<div class="tsd-signature tsd-kind-icon">min<wbr>Confidence<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L104">config.ts:104</a></li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="modelPath" class="tsd-anchor"></a>
<h3>model<wbr>Path</h3>
<div class="tsd-signature tsd-kind-icon">model<wbr>Path<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L103">config.ts:103</a></li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="skipFrames" class="tsd-anchor"></a>
<h3>skip<wbr>Frames</h3>
<div class="tsd-signature tsd-kind-icon">skip<wbr>Frames<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L107">config.ts:107</a></li>
</ul>
</aside>
</section>
</section>
</div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<nav class="tsd-navigation primary">
<ul>
<li class=" ">
<a href="../index.html">Exports</a>
</li>
</ul>
</nav>
<nav class="tsd-navigation secondary menu-sticky">
<ul class="before-current">
<li class=" tsd-kind-reference">
<a href="../index.html#default" class="tsd-kind-icon">default</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/Human.html" class="tsd-kind-icon">Human</a>
</li>
<li class=" tsd-kind-interface">
<a href="BodyConfig.html" class="tsd-kind-icon">Body<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="BodyResult.html" class="tsd-kind-icon">Body<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="Config.html" class="tsd-kind-icon">Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="DrawOptions.html" class="tsd-kind-icon">Draw<wbr>Options</a>
</li>
<li class=" tsd-kind-interface">
<a href="FaceConfig.html" class="tsd-kind-icon">Face<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="FaceResult.html" class="tsd-kind-icon">Face<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="FilterConfig.html" class="tsd-kind-icon">Filter<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="GestureConfig.html" class="tsd-kind-icon">Gesture<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="HandConfig.html" class="tsd-kind-icon">Hand<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="HandResult.html" class="tsd-kind-icon">Hand<wbr>Result</a>
</li>
</ul>
<ul class="current">
<li class="current tsd-kind-interface">
<a href="ObjectConfig.html" class="tsd-kind-icon">Object<wbr>Config</a>
<ul>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="ObjectConfig.html#enabled" class="tsd-kind-icon">enabled</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="ObjectConfig.html#iouThreshold" class="tsd-kind-icon">iou<wbr>Threshold</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="ObjectConfig.html#maxDetected" class="tsd-kind-icon">max<wbr>Detected</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="ObjectConfig.html#minConfidence" class="tsd-kind-icon">min<wbr>Confidence</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="ObjectConfig.html#modelPath" class="tsd-kind-icon">model<wbr>Path</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="ObjectConfig.html#skipFrames" class="tsd-kind-icon">skip<wbr>Frames</a>
</li>
</ul>
</li>
</ul>
<ul class="after-current">
<li class=" tsd-kind-interface">
<a href="ObjectResult.html" class="tsd-kind-icon">Object<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="PersonResult.html" class="tsd-kind-icon">Person<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="Result.html" class="tsd-kind-icon">Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="SegmentationConfig.html" class="tsd-kind-icon">Segmentation<wbr>Config</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Error" class="tsd-kind-icon">Error</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#GestureResult" class="tsd-kind-icon">Gesture<wbr>Result</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Input" class="tsd-kind-icon">Input</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#TensorFlow" class="tsd-kind-icon">Tensor<wbr>Flow</a>
</li>
<li class=" tsd-kind-variable">
<a href="../index.html#defaults" class="tsd-kind-icon">defaults</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<footer>
<div class="container">
<h2>Legend</h2>
<div class="tsd-legend-group">
<ul class="tsd-legend">
<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
</ul>
</div>
</div>
</footer>
<div class="overlay"></div>
<script src="../assets/js/main.js"></script>
</body>
</html>

View File

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Item | @vladmandic/human - v2.1.5</title>
<title>ObjectResult | @vladmandic/human - v2.1.5</title>
<meta name="description" content="Documentation for @vladmandic/human - v2.1.5">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
@ -53,10 +53,10 @@
<a href="../index.html">@vladmandic/human - v2.1.5</a>
</li>
<li>
<a href="Item.html">Item</a>
<a href="ObjectResult.html">ObjectResult</a>
</li>
</ul>
<h1>Interface Item</h1>
<h1>Interface ObjectResult</h1>
</div>
</div>
</header>
@ -85,7 +85,7 @@
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<span class="target">Item</span>
<span class="target">ObjectResult</span>
</li>
</ul>
</section>
@ -96,12 +96,12 @@
<section class="tsd-index-section ">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Item.html#box" class="tsd-kind-icon">box</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Item.html#boxRaw" class="tsd-kind-icon">box<wbr>Raw</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Item.html#class" class="tsd-kind-icon">class</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Item.html#id" class="tsd-kind-icon">id</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Item.html#label" class="tsd-kind-icon">label</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Item.html#score" class="tsd-kind-icon">score</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="ObjectResult.html#box" class="tsd-kind-icon">box</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="ObjectResult.html#boxRaw" class="tsd-kind-icon">box<wbr>Raw</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="ObjectResult.html#class" class="tsd-kind-icon">class</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="ObjectResult.html#id" class="tsd-kind-icon">id</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="ObjectResult.html#label" class="tsd-kind-icon">label</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="ObjectResult.html#score" class="tsd-kind-icon">score</a></li>
</ul>
</section>
</div>
@ -188,7 +188,10 @@
<a href="../classes/Human.html" class="tsd-kind-icon">Human</a>
</li>
<li class=" tsd-kind-interface">
<a href="Body.html" class="tsd-kind-icon">Body</a>
<a href="BodyConfig.html" class="tsd-kind-icon">Body<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="BodyResult.html" class="tsd-kind-icon">Body<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="Config.html" class="tsd-kind-icon">Config</a>
@ -197,49 +200,67 @@
<a href="DrawOptions.html" class="tsd-kind-icon">Draw<wbr>Options</a>
</li>
<li class=" tsd-kind-interface">
<a href="Face.html" class="tsd-kind-icon">Face</a>
<a href="FaceConfig.html" class="tsd-kind-icon">Face<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="Hand.html" class="tsd-kind-icon">Hand</a>
<a href="FaceResult.html" class="tsd-kind-icon">Face<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="FilterConfig.html" class="tsd-kind-icon">Filter<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="GestureConfig.html" class="tsd-kind-icon">Gesture<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="HandConfig.html" class="tsd-kind-icon">Hand<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="HandResult.html" class="tsd-kind-icon">Hand<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="ObjectConfig.html" class="tsd-kind-icon">Object<wbr>Config</a>
</li>
</ul>
<ul class="current">
<li class="current tsd-kind-interface">
<a href="Item.html" class="tsd-kind-icon">Item</a>
<a href="ObjectResult.html" class="tsd-kind-icon">Object<wbr>Result</a>
<ul>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Item.html#box" class="tsd-kind-icon">box</a>
<a href="ObjectResult.html#box" class="tsd-kind-icon">box</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Item.html#boxRaw" class="tsd-kind-icon">box<wbr>Raw</a>
<a href="ObjectResult.html#boxRaw" class="tsd-kind-icon">box<wbr>Raw</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Item.html#class" class="tsd-kind-icon">class</a>
<a href="ObjectResult.html#class" class="tsd-kind-icon">class</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Item.html#id" class="tsd-kind-icon">id</a>
<a href="ObjectResult.html#id" class="tsd-kind-icon">id</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Item.html#label" class="tsd-kind-icon">label</a>
<a href="ObjectResult.html#label" class="tsd-kind-icon">label</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Item.html#score" class="tsd-kind-icon">score</a>
<a href="ObjectResult.html#score" class="tsd-kind-icon">score</a>
</li>
</ul>
</li>
</ul>
<ul class="after-current">
<li class=" tsd-kind-interface">
<a href="Person.html" class="tsd-kind-icon">Person</a>
<a href="PersonResult.html" class="tsd-kind-icon">Person<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="Result.html" class="tsd-kind-icon">Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="SegmentationConfig.html" class="tsd-kind-icon">Segmentation<wbr>Config</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Error" class="tsd-kind-icon">Error</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Gesture" class="tsd-kind-icon">Gesture</a>
<a href="../index.html#GestureResult" class="tsd-kind-icon">Gesture<wbr>Result</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Input" class="tsd-kind-icon">Input</a>
@ -247,6 +268,9 @@
<li class=" tsd-kind-type-alias">
<a href="../index.html#TensorFlow" class="tsd-kind-icon">Tensor<wbr>Flow</a>
</li>
<li class=" tsd-kind-variable">
<a href="../index.html#defaults" class="tsd-kind-icon">defaults</a>
</li>
</ul>
</nav>
</div>
@ -264,9 +288,6 @@
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
</ul>
</div>
</div>
</footer>

View File

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Person | @vladmandic/human - v2.1.5</title>
<title>PersonResult | @vladmandic/human - v2.1.5</title>
<meta name="description" content="Documentation for @vladmandic/human - v2.1.5">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
@ -53,10 +53,10 @@
<a href="../index.html">@vladmandic/human - v2.1.5</a>
</li>
<li>
<a href="Person.html">Person</a>
<a href="PersonResult.html">PersonResult</a>
</li>
</ul>
<h1>Interface Person</h1>
<h1>Interface PersonResult</h1>
</div>
</div>
</header>
@ -89,7 +89,7 @@
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<span class="target">Person</span>
<span class="target">PersonResult</span>
</li>
</ul>
</section>
@ -100,13 +100,13 @@
<section class="tsd-index-section ">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Person.html#body" class="tsd-kind-icon">body</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Person.html#box" class="tsd-kind-icon">box</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Person.html#boxRaw" class="tsd-kind-icon">box<wbr>Raw</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Person.html#face" class="tsd-kind-icon">face</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Person.html#gestures" class="tsd-kind-icon">gestures</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Person.html#hands" class="tsd-kind-icon">hands</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Person.html#id" class="tsd-kind-icon">id</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="PersonResult.html#body" class="tsd-kind-icon">body</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="PersonResult.html#box" class="tsd-kind-icon">box</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="PersonResult.html#boxRaw" class="tsd-kind-icon">box<wbr>Raw</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="PersonResult.html#face" class="tsd-kind-icon">face</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="PersonResult.html#gestures" class="tsd-kind-icon">gestures</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="PersonResult.html#hands" class="tsd-kind-icon">hands</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="PersonResult.html#id" class="tsd-kind-icon">id</a></li>
</ul>
</section>
</div>
@ -117,7 +117,7 @@
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="body" class="tsd-anchor"></a>
<h3>body</h3>
<div class="tsd-signature tsd-kind-icon">body<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="Body.html" class="tsd-signature-type" data-tsd-kind="Interface">Body</a></div>
<div class="tsd-signature tsd-kind-icon">body<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="BodyResult.html" class="tsd-signature-type" data-tsd-kind="Interface">BodyResult</a></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L163">result.ts:163</a></li>
@ -147,7 +147,7 @@
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="face" class="tsd-anchor"></a>
<h3>face</h3>
<div class="tsd-signature tsd-kind-icon">face<span class="tsd-signature-symbol">:</span> <a href="Face.html" class="tsd-signature-type" data-tsd-kind="Interface">Face</a></div>
<div class="tsd-signature tsd-kind-icon">face<span class="tsd-signature-symbol">:</span> <a href="FaceResult.html" class="tsd-signature-type" data-tsd-kind="Interface">FaceResult</a></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L162">result.ts:162</a></li>
@ -157,7 +157,7 @@
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="gestures" class="tsd-anchor"></a>
<h3>gestures</h3>
<div class="tsd-signature tsd-kind-icon">gestures<span class="tsd-signature-symbol">:</span> <a href="../index.html#Gesture" class="tsd-signature-type" data-tsd-kind="Type alias">Gesture</a><span class="tsd-signature-symbol">[]</span></div>
<div class="tsd-signature tsd-kind-icon">gestures<span class="tsd-signature-symbol">:</span> <a href="../index.html#GestureResult" class="tsd-signature-type" data-tsd-kind="Type alias">GestureResult</a><span class="tsd-signature-symbol">[]</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L165">result.ts:165</a></li>
@ -167,7 +167,7 @@
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="hands" class="tsd-anchor"></a>
<h3>hands</h3>
<div class="tsd-signature tsd-kind-icon">hands<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>left<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="Hand.html" class="tsd-signature-type" data-tsd-kind="Interface">Hand</a><span class="tsd-signature-symbol">; </span>right<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="Hand.html" class="tsd-signature-type" data-tsd-kind="Interface">Hand</a><span class="tsd-signature-symbol"> }</span></div>
<div class="tsd-signature tsd-kind-icon">hands<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>left<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="HandResult.html" class="tsd-signature-type" data-tsd-kind="Interface">HandResult</a><span class="tsd-signature-symbol">; </span>right<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="HandResult.html" class="tsd-signature-type" data-tsd-kind="Interface">HandResult</a><span class="tsd-signature-symbol"> }</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L164">result.ts:164</a></li>
@ -177,10 +177,10 @@
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>left<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="Hand.html" class="tsd-signature-type" data-tsd-kind="Interface">Hand</a></h5>
<h5>left<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="HandResult.html" class="tsd-signature-type" data-tsd-kind="Interface">HandResult</a></h5>
</li>
<li class="tsd-parameter">
<h5>right<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="Hand.html" class="tsd-signature-type" data-tsd-kind="Interface">Hand</a></h5>
<h5>right<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="HandResult.html" class="tsd-signature-type" data-tsd-kind="Interface">HandResult</a></h5>
</li>
</ul>
</div>
@ -214,7 +214,10 @@
<a href="../classes/Human.html" class="tsd-kind-icon">Human</a>
</li>
<li class=" tsd-kind-interface">
<a href="Body.html" class="tsd-kind-icon">Body</a>
<a href="BodyConfig.html" class="tsd-kind-icon">Body<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="BodyResult.html" class="tsd-kind-icon">Body<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="Config.html" class="tsd-kind-icon">Config</a>
@ -223,39 +226,54 @@
<a href="DrawOptions.html" class="tsd-kind-icon">Draw<wbr>Options</a>
</li>
<li class=" tsd-kind-interface">
<a href="Face.html" class="tsd-kind-icon">Face</a>
<a href="FaceConfig.html" class="tsd-kind-icon">Face<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="Hand.html" class="tsd-kind-icon">Hand</a>
<a href="FaceResult.html" class="tsd-kind-icon">Face<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="Item.html" class="tsd-kind-icon">Item</a>
<a href="FilterConfig.html" class="tsd-kind-icon">Filter<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="GestureConfig.html" class="tsd-kind-icon">Gesture<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="HandConfig.html" class="tsd-kind-icon">Hand<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="HandResult.html" class="tsd-kind-icon">Hand<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="ObjectConfig.html" class="tsd-kind-icon">Object<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="ObjectResult.html" class="tsd-kind-icon">Object<wbr>Result</a>
</li>
</ul>
<ul class="current">
<li class="current tsd-kind-interface">
<a href="Person.html" class="tsd-kind-icon">Person</a>
<a href="PersonResult.html" class="tsd-kind-icon">Person<wbr>Result</a>
<ul>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Person.html#body" class="tsd-kind-icon">body</a>
<a href="PersonResult.html#body" class="tsd-kind-icon">body</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Person.html#box" class="tsd-kind-icon">box</a>
<a href="PersonResult.html#box" class="tsd-kind-icon">box</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Person.html#boxRaw" class="tsd-kind-icon">box<wbr>Raw</a>
<a href="PersonResult.html#boxRaw" class="tsd-kind-icon">box<wbr>Raw</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Person.html#face" class="tsd-kind-icon">face</a>
<a href="PersonResult.html#face" class="tsd-kind-icon">face</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Person.html#gestures" class="tsd-kind-icon">gestures</a>
<a href="PersonResult.html#gestures" class="tsd-kind-icon">gestures</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Person.html#hands" class="tsd-kind-icon">hands</a>
<a href="PersonResult.html#hands" class="tsd-kind-icon">hands</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="Person.html#id" class="tsd-kind-icon">id</a>
<a href="PersonResult.html#id" class="tsd-kind-icon">id</a>
</li>
</ul>
</li>
@ -264,11 +282,14 @@
<li class=" tsd-kind-interface">
<a href="Result.html" class="tsd-kind-icon">Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="SegmentationConfig.html" class="tsd-kind-icon">Segmentation<wbr>Config</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Error" class="tsd-kind-icon">Error</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Gesture" class="tsd-kind-icon">Gesture</a>
<a href="../index.html#GestureResult" class="tsd-kind-icon">Gesture<wbr>Result</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Input" class="tsd-kind-icon">Input</a>
@ -276,6 +297,9 @@
<li class=" tsd-kind-type-alias">
<a href="../index.html#TensorFlow" class="tsd-kind-icon">Tensor<wbr>Flow</a>
</li>
<li class=" tsd-kind-variable">
<a href="../index.html#defaults" class="tsd-kind-icon">defaults</a>
</li>
</ul>
</nav>
</div>
@ -293,9 +317,6 @@
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
</ul>
</div>
</div>
</footer>

View File

@ -105,7 +105,7 @@
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="body" class="tsd-anchor"></a>
<h3>body</h3>
<div class="tsd-signature tsd-kind-icon">body<span class="tsd-signature-symbol">:</span> <a href="Body.html" class="tsd-signature-type" data-tsd-kind="Interface">Body</a><span class="tsd-signature-symbol">[]</span></div>
<div class="tsd-signature tsd-kind-icon">body<span class="tsd-signature-symbol">:</span> <a href="BodyResult.html" class="tsd-signature-type" data-tsd-kind="Interface">BodyResult</a><span class="tsd-signature-symbol">[]</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L179">result.ts:179</a></li>
@ -113,7 +113,7 @@
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p><a href="../classes/Human.html#Body">Body</a>: detection &amp; analysis results</p>
<p><a href="BodyResult.html">BodyResult</a>: detection &amp; analysis results</p>
</div>
</div>
</section>
@ -135,7 +135,7 @@
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="face" class="tsd-anchor"></a>
<h3>face</h3>
<div class="tsd-signature tsd-kind-icon">face<span class="tsd-signature-symbol">:</span> <a href="Face.html" class="tsd-signature-type" data-tsd-kind="Interface">Face</a><span class="tsd-signature-symbol">[]</span></div>
<div class="tsd-signature tsd-kind-icon">face<span class="tsd-signature-symbol">:</span> <a href="FaceResult.html" class="tsd-signature-type" data-tsd-kind="Interface">FaceResult</a><span class="tsd-signature-symbol">[]</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L177">result.ts:177</a></li>
@ -143,14 +143,14 @@
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p><a href="../classes/Human.html#Face">Face</a>: detection &amp; analysis results</p>
<p><a href="FaceResult.html">FaceResult</a>: detection &amp; analysis results</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="gesture" class="tsd-anchor"></a>
<h3>gesture</h3>
<div class="tsd-signature tsd-kind-icon">gesture<span class="tsd-signature-symbol">:</span> <a href="../index.html#Gesture" class="tsd-signature-type" data-tsd-kind="Type alias">Gesture</a><span class="tsd-signature-symbol">[]</span></div>
<div class="tsd-signature tsd-kind-icon">gesture<span class="tsd-signature-symbol">:</span> <a href="../index.html#GestureResult" class="tsd-signature-type" data-tsd-kind="Type alias">GestureResult</a><span class="tsd-signature-symbol">[]</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L183">result.ts:183</a></li>
@ -158,14 +158,14 @@
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p><a href="../classes/Human.html#Gesture">Gesture</a>: detection &amp; analysis results</p>
<p><a href="../index.html#GestureResult">GestureResult</a>: detection &amp; analysis results</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="hand" class="tsd-anchor"></a>
<h3>hand</h3>
<div class="tsd-signature tsd-kind-icon">hand<span class="tsd-signature-symbol">:</span> <a href="Hand.html" class="tsd-signature-type" data-tsd-kind="Interface">Hand</a><span class="tsd-signature-symbol">[]</span></div>
<div class="tsd-signature tsd-kind-icon">hand<span class="tsd-signature-symbol">:</span> <a href="HandResult.html" class="tsd-signature-type" data-tsd-kind="Interface">HandResult</a><span class="tsd-signature-symbol">[]</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L181">result.ts:181</a></li>
@ -173,14 +173,14 @@
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p><a href="../classes/Human.html#Hand">Hand</a>: detection &amp; analysis results</p>
<p><a href="HandResult.html">HandResult</a>: detection &amp; analysis results</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="object" class="tsd-anchor"></a>
<h3>object</h3>
<div class="tsd-signature tsd-kind-icon">object<span class="tsd-signature-symbol">:</span> <a href="Item.html" class="tsd-signature-type" data-tsd-kind="Interface">Item</a><span class="tsd-signature-symbol">[]</span></div>
<div class="tsd-signature tsd-kind-icon">object<span class="tsd-signature-symbol">:</span> <a href="ObjectResult.html" class="tsd-signature-type" data-tsd-kind="Interface">ObjectResult</a><span class="tsd-signature-symbol">[]</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L185">result.ts:185</a></li>
@ -188,7 +188,7 @@
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>{@link Object}: detection &amp; analysis results</p>
<p>{@link ItemResult}: detection &amp; analysis results</p>
</div>
</div>
</section>
@ -210,7 +210,7 @@
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="persons" class="tsd-anchor"></a>
<h3>persons</h3>
<div class="tsd-signature tsd-kind-icon">persons<span class="tsd-signature-symbol">:</span> <a href="Person.html" class="tsd-signature-type" data-tsd-kind="Interface">Person</a><span class="tsd-signature-symbol">[]</span></div>
<div class="tsd-signature tsd-kind-icon">persons<span class="tsd-signature-symbol">:</span> <a href="PersonResult.html" class="tsd-signature-type" data-tsd-kind="Interface">PersonResult</a><span class="tsd-signature-symbol">[]</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L193">result.ts:193</a></li>
@ -256,7 +256,10 @@
<a href="../classes/Human.html" class="tsd-kind-icon">Human</a>
</li>
<li class=" tsd-kind-interface">
<a href="Body.html" class="tsd-kind-icon">Body</a>
<a href="BodyConfig.html" class="tsd-kind-icon">Body<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="BodyResult.html" class="tsd-kind-icon">Body<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="Config.html" class="tsd-kind-icon">Config</a>
@ -265,16 +268,31 @@
<a href="DrawOptions.html" class="tsd-kind-icon">Draw<wbr>Options</a>
</li>
<li class=" tsd-kind-interface">
<a href="Face.html" class="tsd-kind-icon">Face</a>
<a href="FaceConfig.html" class="tsd-kind-icon">Face<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="Hand.html" class="tsd-kind-icon">Hand</a>
<a href="FaceResult.html" class="tsd-kind-icon">Face<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="Item.html" class="tsd-kind-icon">Item</a>
<a href="FilterConfig.html" class="tsd-kind-icon">Filter<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="Person.html" class="tsd-kind-icon">Person</a>
<a href="GestureConfig.html" class="tsd-kind-icon">Gesture<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="HandConfig.html" class="tsd-kind-icon">Hand<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="HandResult.html" class="tsd-kind-icon">Hand<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="ObjectConfig.html" class="tsd-kind-icon">Object<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="ObjectResult.html" class="tsd-kind-icon">Object<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="PersonResult.html" class="tsd-kind-icon">Person<wbr>Result</a>
</li>
</ul>
<ul class="current">
@ -312,11 +330,14 @@
</li>
</ul>
<ul class="after-current">
<li class=" tsd-kind-interface">
<a href="SegmentationConfig.html" class="tsd-kind-icon">Segmentation<wbr>Config</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Error" class="tsd-kind-icon">Error</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Gesture" class="tsd-kind-icon">Gesture</a>
<a href="../index.html#GestureResult" class="tsd-kind-icon">Gesture<wbr>Result</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Input" class="tsd-kind-icon">Input</a>
@ -324,6 +345,9 @@
<li class=" tsd-kind-type-alias">
<a href="../index.html#TensorFlow" class="tsd-kind-icon">Tensor<wbr>Flow</a>
</li>
<li class=" tsd-kind-variable">
<a href="../index.html#defaults" class="tsd-kind-icon">defaults</a>
</li>
</ul>
</nav>
</div>
@ -341,9 +365,6 @@
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
</ul>
</div>
</div>
</footer>

View File

@ -0,0 +1,238 @@
<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>SegmentationConfig | @vladmandic/human - v2.1.5</title>
<meta name="description" content="Documentation for @vladmandic/human - v2.1.5">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
<script async src="../assets/js/search.js" id="search-script"></script>
</head>
<body>
<header>
<div class="tsd-page-toolbar">
<div class="container">
<div class="table-wrap">
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
<div class="field">
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
<input id="tsd-search-field" type="text" />
</div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a href="../index.html" class="title">@vladmandic/human - v2.1.5</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
<div class="tsd-filter-group">
<div class="tsd-select" id="tsd-filter-visibility">
<span class="tsd-select-label">All</span>
<ul class="tsd-select-list">
<li data-value="public">Public</li>
<li data-value="protected">Public/Protected</li>
<li data-value="private" class="selected">All</li>
</ul>
</div>
<input type="checkbox" id="tsd-filter-inherited" checked />
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
</div>
</div>
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
</div>
</div>
</div>
</div>
<div class="tsd-page-title">
<div class="container">
<ul class="tsd-breadcrumb">
<li>
<a href="../index.html">@vladmandic/human - v2.1.5</a>
</li>
<li>
<a href="SegmentationConfig.html">SegmentationConfig</a>
</li>
</ul>
<h1>Interface SegmentationConfig</h1>
</div>
</div>
</header>
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Controlls and configures all body segmentation module
removes background from input containing person
if segmentation is enabled it will run as preprocessing task before any other model
alternatively leave it disabled and use it on-demand using human.segmentation method which can
remove background or replace it with user-provided background</p>
</div>
<ul>
<li>enabled: true/false</li>
<li>modelPath: object detection model, can be absolute path or relative to modelBasePath</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<span class="target">SegmentationConfig</span>
</li>
</ul>
</section>
<section class="tsd-panel-group tsd-index-group">
<h2>Index</h2>
<section class="tsd-panel tsd-index-panel">
<div class="tsd-index-content">
<section class="tsd-index-section ">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="SegmentationConfig.html#enabled" class="tsd-kind-icon">enabled</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="SegmentationConfig.html#modelPath" class="tsd-kind-icon">model<wbr>Path</a></li>
</ul>
</section>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="enabled" class="tsd-anchor"></a>
<h3>enabled</h3>
<div class="tsd-signature tsd-kind-icon">enabled<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L120">config.ts:120</a></li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="modelPath" class="tsd-anchor"></a>
<h3>model<wbr>Path</h3>
<div class="tsd-signature tsd-kind-icon">model<wbr>Path<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L121">config.ts:121</a></li>
</ul>
</aside>
</section>
</section>
</div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<nav class="tsd-navigation primary">
<ul>
<li class=" ">
<a href="../index.html">Exports</a>
</li>
</ul>
</nav>
<nav class="tsd-navigation secondary menu-sticky">
<ul class="before-current">
<li class=" tsd-kind-reference">
<a href="../index.html#default" class="tsd-kind-icon">default</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/Human.html" class="tsd-kind-icon">Human</a>
</li>
<li class=" tsd-kind-interface">
<a href="BodyConfig.html" class="tsd-kind-icon">Body<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="BodyResult.html" class="tsd-kind-icon">Body<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="Config.html" class="tsd-kind-icon">Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="DrawOptions.html" class="tsd-kind-icon">Draw<wbr>Options</a>
</li>
<li class=" tsd-kind-interface">
<a href="FaceConfig.html" class="tsd-kind-icon">Face<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="FaceResult.html" class="tsd-kind-icon">Face<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="FilterConfig.html" class="tsd-kind-icon">Filter<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="GestureConfig.html" class="tsd-kind-icon">Gesture<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="HandConfig.html" class="tsd-kind-icon">Hand<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="HandResult.html" class="tsd-kind-icon">Hand<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="ObjectConfig.html" class="tsd-kind-icon">Object<wbr>Config</a>
</li>
<li class=" tsd-kind-interface">
<a href="ObjectResult.html" class="tsd-kind-icon">Object<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="PersonResult.html" class="tsd-kind-icon">Person<wbr>Result</a>
</li>
<li class=" tsd-kind-interface">
<a href="Result.html" class="tsd-kind-icon">Result</a>
</li>
</ul>
<ul class="current">
<li class="current tsd-kind-interface">
<a href="SegmentationConfig.html" class="tsd-kind-icon">Segmentation<wbr>Config</a>
<ul>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="SegmentationConfig.html#enabled" class="tsd-kind-icon">enabled</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="SegmentationConfig.html#modelPath" class="tsd-kind-icon">model<wbr>Path</a>
</li>
</ul>
</li>
</ul>
<ul class="after-current">
<li class=" tsd-kind-type-alias">
<a href="../index.html#Error" class="tsd-kind-icon">Error</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#GestureResult" class="tsd-kind-icon">Gesture<wbr>Result</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#Input" class="tsd-kind-icon">Input</a>
</li>
<li class=" tsd-kind-type-alias">
<a href="../index.html#TensorFlow" class="tsd-kind-icon">Tensor<wbr>Flow</a>
</li>
<li class=" tsd-kind-variable">
<a href="../index.html#defaults" class="tsd-kind-icon">defaults</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<footer>
<div class="container">
<h2>Legend</h2>
<div class="tsd-legend-group">
<ul class="tsd-legend">
<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
</ul>
</div>
</div>
</footer>
<div class="overlay"></div>
<script src="../assets/js/main.js"></script>
</body>
</html>

View File

@ -2,9 +2,9 @@
* FaceMesh & BlazeFace Module entry point
*/
import { GraphModel, Tensor } from '../tfjs/types';
import { Face } from '../result';
import { FaceResult } from '../result';
import { Config } from '../config';
export declare function predict(input: Tensor, config: Config): Promise<Face[]>;
export declare function predict(input: Tensor, config: Config): Promise<FaceResult[]>;
export declare function load(config: any): Promise<[unknown, GraphModel | null, GraphModel | null]>;
export declare const triangulation: number[];
export declare const uvmap: number[][];

View File

@ -2,7 +2,7 @@
* BlazePose Module
*/
import { Tensor, GraphModel } from '../tfjs/types';
import { Body } from '../result';
import { BodyResult } from '../result';
import { Config } from '../config';
export declare function load(config: Config): Promise<GraphModel>;
export declare function predict(image: Tensor, config: Config): Promise<Body[]>;
export declare function predict(image: Tensor, config: Config): Promise<BodyResult[]>;

328
types/src/config.d.ts vendored
View File

@ -4,9 +4,169 @@
* Contains all configurable parameters
* @typedef Config
*/
/** Controlls and configures all face-specific options:
* - face detection, face mesh detection, age, gender, emotion detection and face description
* Parameters:
* - enabled: true/false
* - modelPath: path for each of face models
* - minConfidence: threshold for discarding a prediction
* - iouThreshold: ammount of overlap between two detected objects before one object is removed
* - maxDetected: maximum number of faces detected in the input, should be set to the minimum number for performance
* - rotation: use calculated rotated face image or just box with rotation as-is, false means higher performance, but incorrect mesh mapping on higher face angles
* - return: return extracted face as tensor for futher user processing, in which case user is reponsible for manually disposing the tensor
*/
export interface FaceConfig {
enabled: boolean;
detector: {
modelPath: string;
rotation: boolean;
maxDetected: number;
skipFrames: number;
minConfidence: number;
iouThreshold: number;
return: boolean;
};
mesh: {
enabled: boolean;
modelPath: string;
};
iris: {
enabled: boolean;
modelPath: string;
};
description: {
enabled: boolean;
modelPath: string;
skipFrames: number;
minConfidence: number;
};
emotion: {
enabled: boolean;
minConfidence: number;
skipFrames: number;
modelPath: string;
};
}
/** Controlls and configures all body detection specific options
* - enabled: true/false
* - modelPath: body pose model, can be absolute path or relative to modelBasePath
* - minConfidence: threshold for discarding a prediction
* - maxDetected: maximum number of people detected in the input, should be set to the minimum number for performance
*/
export interface BodyConfig {
enabled: boolean;
modelPath: string;
maxDetected: number;
minConfidence: number;
skipFrames: number;
}
/** Controlls and configures all hand detection specific options
* - enabled: true/false
* - landmarks: detect hand landmarks or just hand boundary box
* - modelPath: paths for hand detector and hand skeleton models, can be absolute path or relative to modelBasePath
* - minConfidence: threshold for discarding a prediction
* - iouThreshold: ammount of overlap between two detected objects before one object is removed
* - maxDetected: maximum number of hands detected in the input, should be set to the minimum number for performance
* - rotation: use best-guess rotated hand image or just box with rotation as-is, false means higher performance, but incorrect finger mapping if hand is inverted
*/
export interface HandConfig {
enabled: boolean;
rotation: boolean;
skipFrames: number;
minConfidence: number;
iouThreshold: number;
maxDetected: number;
landmarks: boolean;
detector: {
modelPath: string;
};
skeleton: {
modelPath: string;
};
}
/** Controlls and configures all object detection specific options
* - enabled: true/false
* - modelPath: object detection model, can be absolute path or relative to modelBasePath
* - minConfidence: minimum score that detection must have to return as valid object
* - iouThreshold: ammount of overlap between two detected objects before one object is removed
* - maxDetected: maximum number of detections to return
*/
export interface ObjectConfig {
enabled: boolean;
modelPath: string;
minConfidence: number;
iouThreshold: number;
maxDetected: number;
skipFrames: number;
}
/** Controlls and configures all body segmentation module
* removes background from input containing person
* if segmentation is enabled it will run as preprocessing task before any other model
* alternatively leave it disabled and use it on-demand using human.segmentation method which can
* remove background or replace it with user-provided background
*
* - enabled: true/false
* - modelPath: object detection model, can be absolute path or relative to modelBasePath
*/
export interface SegmentationConfig {
enabled: boolean;
modelPath: string;
}
/** Run input through image filters before inference
* - image filters run with near-zero latency as they are executed on the GPU
*/
export interface FilterConfig {
enabled: boolean;
/** Resize input width
* - if both width and height are set to 0, there is no resizing
* - if just one is set, second one is scaled automatically
* - if both are set, values are used as-is
*/
width: number;
/** Resize input height
* - if both width and height are set to 0, there is no resizing
* - if just one is set, second one is scaled automatically
* - if both are set, values are used as-is
*/
height: number;
/** Return processed canvas imagedata in result */
return: boolean;
/** Flip input as mirror image */
flip: boolean;
/** Range: -1 (darken) to 1 (lighten) */
brightness: number;
/** Range: -1 (reduce contrast) to 1 (increase contrast) */
contrast: number;
/** Range: 0 (no sharpening) to 1 (maximum sharpening) */
sharpness: number;
/** Range: 0 (no blur) to N (blur radius in pixels) */
blur: number;
/** Range: -1 (reduce saturation) to 1 (increase saturation) */
saturation: number;
/** Range: 0 (no change) to 360 (hue rotation in degrees) */
hue: number;
/** Image negative */
negative: boolean;
/** Image sepia colors */
sepia: boolean;
/** Image vintage colors */
vintage: boolean;
/** Image kodachrome colors */
kodachrome: boolean;
/** Image technicolor colors */
technicolor: boolean;
/** Image polaroid camera effect */
polaroid: boolean;
/** Range: 0 (no pixelate) to N (number of pixels to pixelate) */
pixelate: number;
}
/** Controlls gesture detection */
export interface GestureConfig {
enabled: boolean;
}
export interface Config {
/** Backend used for TFJS operations */
backend: '' | 'cpu' | 'wasm' | 'webgl' | 'humangl' | 'tensorflow' | 'webgpu' | null | string;
backend: string;
/** Path to *.wasm files if backend is set to `wasm` */
wasmPath: string;
/** Print debug statements to console */
@ -17,7 +177,7 @@ export interface Config {
* - warmup pre-initializes all models for faster inference but can take significant time on startup
* - only used for `webgl` and `humangl` backends
*/
warmup: 'none' | 'face' | 'full' | 'body' | string;
warmup: string;
/** Base model path (typically starting with file://, http:// or https://) for all models
* - individual modelPath values are relative to this path
*/
@ -35,163 +195,13 @@ export interface Config {
/** Run input through image filters before inference
* - image filters run with near-zero latency as they are executed on the GPU
*/
filter: {
enabled: boolean;
/** Resize input width
* - if both width and height are set to 0, there is no resizing
* - if just one is set, second one is scaled automatically
* - if both are set, values are used as-is
*/
width: number;
/** Resize input height
* - if both width and height are set to 0, there is no resizing
* - if just one is set, second one is scaled automatically
* - if both are set, values are used as-is
*/
height: number;
/** Return processed canvas imagedata in result */
return: boolean;
/** Flip input as mirror image */
flip: boolean;
/** Range: -1 (darken) to 1 (lighten) */
brightness: number;
/** Range: -1 (reduce contrast) to 1 (increase contrast) */
contrast: number;
/** Range: 0 (no sharpening) to 1 (maximum sharpening) */
sharpness: number;
/** Range: 0 (no blur) to N (blur radius in pixels) */
blur: number;
/** Range: -1 (reduce saturation) to 1 (increase saturation) */
saturation: number;
/** Range: 0 (no change) to 360 (hue rotation in degrees) */
hue: number;
/** Image negative */
negative: boolean;
/** Image sepia colors */
sepia: boolean;
/** Image vintage colors */
vintage: boolean;
/** Image kodachrome colors */
kodachrome: boolean;
/** Image technicolor colors */
technicolor: boolean;
/** Image polaroid camera effect */
polaroid: boolean;
/** Range: 0 (no pixelate) to N (number of pixels to pixelate) */
pixelate: number;
};
/** Controlls gesture detection */
gesture: {
enabled: boolean;
};
/** Controlls and configures all face-specific options:
* - face detection, face mesh detection, age, gender, emotion detection and face description
* Parameters:
* - enabled: true/false
* - modelPath: path for each of face models
* - minConfidence: threshold for discarding a prediction
* - iouThreshold: ammount of overlap between two detected objects before one object is removed
* - maxDetected: maximum number of faces detected in the input, should be set to the minimum number for performance
* - rotation: use calculated rotated face image or just box with rotation as-is, false means higher performance, but incorrect mesh mapping on higher face angles
* - return: return extracted face as tensor for futher user processing, in which case user is reponsible for manually disposing the tensor
*/
face: {
enabled: boolean;
detector: {
modelPath: string;
rotation: boolean;
maxDetected: number;
skipFrames: number;
minConfidence: number;
iouThreshold: number;
return: boolean;
};
mesh: {
enabled: boolean;
modelPath: string;
};
iris: {
enabled: boolean;
modelPath: string;
};
description: {
enabled: boolean;
modelPath: string;
skipFrames: number;
minConfidence: number;
};
emotion: {
enabled: boolean;
minConfidence: number;
skipFrames: number;
modelPath: string;
};
};
/** Controlls and configures all body detection specific options
* - enabled: true/false
* - modelPath: body pose model, can be absolute path or relative to modelBasePath
* - minConfidence: threshold for discarding a prediction
* - maxDetected: maximum number of people detected in the input, should be set to the minimum number for performance
*/
body: {
enabled: boolean;
modelPath: string;
maxDetected: number;
minConfidence: number;
skipFrames: number;
};
/** Controlls and configures all hand detection specific options
* - enabled: true/false
* - landmarks: detect hand landmarks or just hand boundary box
* - modelPath: paths for hand detector and hand skeleton models, can be absolute path or relative to modelBasePath
* - minConfidence: threshold for discarding a prediction
* - iouThreshold: ammount of overlap between two detected objects before one object is removed
* - maxDetected: maximum number of hands detected in the input, should be set to the minimum number for performance
* - rotation: use best-guess rotated hand image or just box with rotation as-is, false means higher performance, but incorrect finger mapping if hand is inverted
*/
hand: {
enabled: boolean;
rotation: boolean;
skipFrames: number;
minConfidence: number;
iouThreshold: number;
maxDetected: number;
landmarks: boolean;
detector: {
modelPath: string;
};
skeleton: {
modelPath: string;
};
};
/** Controlls and configures all object detection specific options
* - enabled: true/false
* - modelPath: object detection model, can be absolute path or relative to modelBasePath
* - minConfidence: minimum score that detection must have to return as valid object
* - iouThreshold: ammount of overlap between two detected objects before one object is removed
* - maxDetected: maximum number of detections to return
*/
object: {
enabled: boolean;
modelPath: string;
minConfidence: number;
iouThreshold: number;
maxDetected: number;
skipFrames: number;
};
/** Controlls and configures all body segmentation module
* removes background from input containing person
* if segmentation is enabled it will run as preprocessing task before any other model
* alternatively leave it disabled and use it on-demand using human.segmentation method which can
* remove background or replace it with user-provided background
*
* - enabled: true/false
* - modelPath: object detection model, can be absolute path or relative to modelBasePath
*/
segmentation: {
enabled: boolean;
modelPath: string;
};
filter: Partial<FilterConfig>;
gesture: Partial<GestureConfig>;
face: Partial<FaceConfig>;
body: Partial<BodyConfig>;
hand: Partial<HandConfig>;
object: Partial<ObjectConfig>;
segmentation: Partial<SegmentationConfig>;
}
declare const config: Config;
export { config as defaults };

View File

@ -1,7 +1,7 @@
/**
* Module that implements helper draw functions, exposed as human.draw
*/
import type { Result, Face, Body, Hand, Item, Gesture, Person } from '../result';
import type { Result, FaceResult, BodyResult, HandResult, ObjectResult, GestureResult, PersonResult } from '../result';
/**
* Draw Options
* Accessed via `human.draw.options` or provided per each draw method as the drawOptions optional parameter
@ -42,11 +42,11 @@ export interface DrawOptions {
bufferedOutput: boolean;
}
export declare const options: DrawOptions;
export declare function gesture(inCanvas: HTMLCanvasElement, result: Array<Gesture>, drawOptions?: DrawOptions): Promise<void>;
export declare function face(inCanvas: HTMLCanvasElement, result: Array<Face>, drawOptions?: DrawOptions): Promise<void>;
export declare function body(inCanvas: HTMLCanvasElement, result: Array<Body>, drawOptions?: DrawOptions): Promise<void>;
export declare function hand(inCanvas: HTMLCanvasElement, result: Array<Hand>, drawOptions?: DrawOptions): Promise<void>;
export declare function object(inCanvas: HTMLCanvasElement, result: Array<Item>, drawOptions?: DrawOptions): Promise<void>;
export declare function person(inCanvas: HTMLCanvasElement, result: Array<Person>, drawOptions?: DrawOptions): Promise<void>;
export declare function gesture(inCanvas: HTMLCanvasElement, result: Array<GestureResult>, drawOptions?: DrawOptions): Promise<void>;
export declare function face(inCanvas: HTMLCanvasElement, result: Array<FaceResult>, drawOptions?: DrawOptions): Promise<void>;
export declare function body(inCanvas: HTMLCanvasElement, result: Array<BodyResult>, drawOptions?: DrawOptions): Promise<void>;
export declare function hand(inCanvas: HTMLCanvasElement, result: Array<HandResult>, drawOptions?: DrawOptions): Promise<void>;
export declare function object(inCanvas: HTMLCanvasElement, result: Array<ObjectResult>, drawOptions?: DrawOptions): Promise<void>;
export declare function person(inCanvas: HTMLCanvasElement, result: Array<PersonResult>, drawOptions?: DrawOptions): Promise<void>;
export declare function canvas(inCanvas: HTMLCanvasElement, outCanvas: HTMLCanvasElement): Promise<void>;
export declare function all(inCanvas: HTMLCanvasElement, result: Result, drawOptions?: DrawOptions): Promise<[void, void, void, void, void] | null>;

View File

@ -1,8 +1,8 @@
/**
* EfficientPose Module
*/
import { Body } from '../result';
import { BodyResult } from '../result';
import { GraphModel, Tensor } from '../tfjs/types';
import { Config } from '../config';
export declare function load(config: Config): Promise<GraphModel>;
export declare function predict(image: Tensor, config: Config): Promise<Body[]>;
export declare function predict(image: Tensor, config: Config): Promise<BodyResult[]>;

4
types/src/face.d.ts vendored
View File

@ -2,6 +2,6 @@
* Module that analyzes person age
* Obsolete
*/
import { Face } from './result';
import { FaceResult } from './result';
import { Tensor } from './tfjs/types';
export declare const detectFace: (parent: any, input: Tensor) => Promise<Face[]>;
export declare const detectFace: (parent: any, input: Tensor) => Promise<FaceResult[]>;

View File

@ -1,7 +1,7 @@
/**
* Gesture detection module
*/
import { Gesture } from '../result';
import { GestureResult } from '../result';
/**
* @typedef FaceGesture
*/
@ -18,7 +18,7 @@ export declare type BodyGesture = `leaning ${'left' | 'right'}` | `raise ${'left
* @typedef BodyGesture
*/
export declare type HandGesture = `${'thumb' | 'index' | 'middle' | 'ring' | 'pinky'} forward` | `${'thumb' | 'index' | 'middle' | 'ring' | 'pinky'} up` | 'victory' | 'thumbs up';
export declare const body: (res: any) => Gesture[];
export declare const face: (res: any) => Gesture[];
export declare const iris: (res: any) => Gesture[];
export declare const hand: (res: any) => Gesture[];
export declare const body: (res: any) => GestureResult[];
export declare const face: (res: any) => GestureResult[];
export declare const iris: (res: any) => GestureResult[];
export declare const hand: (res: any) => GestureResult[];

View File

@ -1,8 +1,8 @@
/**
* HandPose module entry point
*/
import { Hand } from '../result';
import { HandResult } from '../result';
import { Tensor, GraphModel } from '../tfjs/types';
import { Config } from '../config';
export declare function predict(input: Tensor, config: Config): Promise<Hand[]>;
export declare function predict(input: Tensor, config: Config): Promise<HandResult[]>;
export declare function load(config: Config): Promise<[GraphModel | null, GraphModel | null]>;

16
types/src/human.d.ts vendored
View File

@ -2,14 +2,14 @@
* Human main module
*/
import { Config } from './config';
import { Result, Face, Hand, Body, Item, Gesture } from './result';
import { Result } from './result';
import * as tf from '../dist/tfjs.esm.js';
import * as facemesh from './blazeface/facemesh';
import * as image from './image/image';
import * as draw from './draw/draw';
import { Tensor, GraphModel } from './tfjs/types';
export { Config } from './config';
export type { Result, Face, Hand, Body, Item, Gesture, Person } from './result';
export * from './config';
export * from './result';
export type { DrawOptions } from './draw/draw';
/** Defines all possible input types for **Human** detection
* @typedef Input Type
@ -81,16 +81,6 @@ export declare class Human {
canvas: typeof draw.canvas;
all: typeof draw.all;
};
/** Types used by Human */
static Config: Config;
static Result: Result;
static Face: Face;
static Hand: Hand;
static Body: Body;
static Item: Item;
static Gesture: Gesture;
static Person: Gesture;
static DrawOptions: draw.DrawOptions;
/** @internal: Currently loaded models */
models: {
face: [unknown, GraphModel | null, GraphModel | null] | null;

View File

@ -1,8 +1,8 @@
/**
* EfficientPose Module
*/
import { Body } from '../result';
import { BodyResult } from '../result';
import { GraphModel, Tensor } from '../tfjs/types';
import { Config } from '../config';
export declare function load(config: Config): Promise<GraphModel>;
export declare function predict(image: Tensor, config: Config): Promise<Body[]>;
export declare function predict(image: Tensor, config: Config): Promise<BodyResult[]>;

View File

@ -1,8 +1,8 @@
/**
* CenterNet object detection module
*/
import { Item } from '../result';
import { ObjectResult } from '../result';
import { GraphModel, Tensor } from '../tfjs/types';
import { Config } from '../config';
export declare function load(config: Config): Promise<GraphModel>;
export declare function predict(input: Tensor, config: Config): Promise<Item[]>;
export declare function predict(input: Tensor, config: Config): Promise<ObjectResult[]>;

View File

@ -1,8 +1,8 @@
/**
* NanoDet object detection module
*/
import { Item } from '../result';
import { ObjectResult } from '../result';
import { GraphModel, Tensor } from '../tfjs/types';
import { Config } from '../config';
export declare function load(config: Config): Promise<GraphModel>;
export declare function predict(image: Tensor, config: Config): Promise<Item[]>;
export declare function predict(image: Tensor, config: Config): Promise<ObjectResult[]>;

View File

@ -1,5 +1,5 @@
/**
* Module that analyzes existing results and recombines them into a unified person object
*/
import { Face, Body, Hand, Gesture, Person } from './result';
export declare function join(faces: Array<Face>, bodies: Array<Body>, hands: Array<Hand>, gestures: Array<Gesture>, shape: Array<number> | undefined): Array<Person>;
import { FaceResult, BodyResult, HandResult, GestureResult, PersonResult } from './result';
export declare function join(faces: Array<FaceResult>, bodies: Array<BodyResult>, hands: Array<HandResult>, gestures: Array<GestureResult>, shape: Array<number> | undefined): Array<PersonResult>;

View File

@ -1,8 +1,8 @@
/**
* PoseNet module entry point
*/
import { Body } from '../result';
import { BodyResult } from '../result';
import { Tensor, GraphModel } from '../tfjs/types';
import { Config } from '../config';
export declare function predict(input: Tensor, config: Config): Promise<Body[]>;
export declare function predict(input: Tensor, config: Config): Promise<BodyResult[]>;
export declare function load(config: Config): Promise<GraphModel>;

View File

@ -1,8 +1,8 @@
import { Body } from '../result';
import { BodyResult } from '../result';
export declare function eitherPointDoesntMeetConfidence(a: number, b: number, minConfidence: number): boolean;
export declare function getAdjacentKeyPoints(keypoints: any, minConfidence: number): any[];
export declare function getBoundingBox(keypoints: any): [number, number, number, number];
export declare function scalePoses(poses: any, [height, width]: [any, any], [inputResolutionHeight, inputResolutionWidth]: [any, any]): Array<Body>;
export declare function scalePoses(poses: any, [height, width]: [any, any], [inputResolutionHeight, inputResolutionWidth]: [any, any]): Array<BodyResult>;
export declare class MaxHeap {
priorityQueue: Array<unknown>;
numberOfElements: number;

44
types/src/result.d.ts vendored
View File

@ -30,7 +30,7 @@ import { FaceGesture, BodyGesture, HandGesture, IrisGesture } from './gesture/ge
* - gaze: gaze direction as object with values for bearing in radians and relative strength
* - tensor: face tensor as Tensor object which contains detected face
*/
export interface Face {
export interface FaceResult {
id: number;
score: number;
boxScore: number;
@ -76,7 +76,7 @@ export interface Face {
* - score: body part score value
* - presence: body part presence value
*/
export interface Body {
export interface BodyResult {
id: number;
score: number;
box: [number, number, number, number];
@ -100,7 +100,7 @@ export interface Body {
* - annotations: annotated landmarks for each hand part with keypoints
* - landmarks: annotated landmarks for eachb hand part with logical curl and direction strings
*/
export interface Hand {
export interface HandResult {
id: number;
score: number;
box: [number, number, number, number];
@ -124,7 +124,7 @@ export interface Hand {
* - center: optional center point as array of [x, y], normalized to image resolution
* - centerRaw: optional center point as array of [x, y], normalized to range 0..1
*/
export interface Item {
export interface ObjectResult {
id: number;
score: number;
class: number;
@ -140,7 +140,7 @@ export interface Item {
* - part: part name and number where gesture was detected: face, iris, body, hand
* - gesture: gesture detected
*/
export declare type Gesture = {
export declare type GestureResult = {
'face': number;
gesture: FaceGesture;
} | {
@ -165,15 +165,15 @@ export declare type Gesture = {
* - box: bounding box: x, y, width, height normalized to input image resolution
* - boxRaw: bounding box: x, y, width, height normalized to 0..1
*/
export interface Person {
export interface PersonResult {
id: number;
face: Face;
body: Body | null;
face: FaceResult;
body: BodyResult | null;
hands: {
left: Hand | null;
right: Hand | null;
left: HandResult | null;
right: HandResult | null;
};
gestures: Array<Gesture>;
gestures: Array<GestureResult>;
box: [number, number, number, number];
boxRaw?: [number, number, number, number];
}
@ -183,16 +183,16 @@ export interface Person {
* Contains all possible detection results
*/
export interface Result {
/** {@link Face}: detection & analysis results */
face: Array<Face>;
/** {@link Body}: detection & analysis results */
body: Array<Body>;
/** {@link Hand}: detection & analysis results */
hand: Array<Hand>;
/** {@link Gesture}: detection & analysis results */
gesture: Array<Gesture>;
/** {@link Object}: detection & analysis results */
object: Array<Item>;
/** {@link FaceResult}: detection & analysis results */
face: Array<FaceResult>;
/** {@link BodyResult}: detection & analysis results */
body: Array<BodyResult>;
/** {@link HandResult}: detection & analysis results */
hand: Array<HandResult>;
/** {@link GestureResult}: detection & analysis results */
gesture: Array<GestureResult>;
/** {@link ItemResult}: detection & analysis results */
object: Array<ObjectResult>;
/** global performance object with timing values for each operation */
performance: Record<string, unknown>;
/** optional processed canvas that can be used to draw input on screen */
@ -200,5 +200,5 @@ export interface Result {
/** timestamp of detection representing the milliseconds elapsed since the UNIX epoch */
readonly timestamp: number;
/** getter property that returns unified persons object */
persons: Array<Person>;
persons: Array<PersonResult>;
}