improve error handling

pull/233/head
Vladimir Mandic 2021-11-14 11:22:52 -05:00
parent 6072553423
commit 343025a1f7
69 changed files with 2063 additions and 1670 deletions

View File

@ -9,11 +9,13 @@
## Changelog
### **HEAD -> main** 2021/11/13 mandic00@live.com
### **2.5.2** 2021/11/14 mandic00@live.com
### **origin/main** 2021/11/12 mandic00@live.com
### **origin/main** 2021/11/13 mandic00@live.com
- fix gear and ssrnet modules
- fix for face crop when mesh is disabled
- implement optional face masking
- add similarity score range normalization
- add faceid demo

View File

@ -56,3 +56,5 @@ Other:
- Improved `similarity` and `match` score range normalization
- Documentation overhaul
- Fixed optional `gear`, `ssrnet`, `mobilefacenet` modules
- Improved error handling
- Fix Firefox WebGPU compatibility issue

View File

@ -54,20 +54,20 @@ var __privateSet = (obj, member, value, setter) => {
};
// src/util/util.ts
function join(folder, file) {
const separator = folder.endsWith("/") ? "" : "/";
const skipJoin = file.startsWith(".") || file.startsWith("/") || file.startsWith("http:") || file.startsWith("https:") || file.startsWith("file:");
const path = skipJoin ? `${file}` : `${folder}${separator}${file}`;
if (!path.toLocaleLowerCase().includes(".json"))
throw new Error(`modelpath error: ${path} expecting json file`);
return path;
}
function log(...msg) {
const dt = new Date();
const ts = `${dt.getHours().toString().padStart(2, "0")}:${dt.getMinutes().toString().padStart(2, "0")}:${dt.getSeconds().toString().padStart(2, "0")}.${dt.getMilliseconds().toString().padStart(3, "0")}`;
if (msg)
console.log(ts, "Human:", ...msg);
}
function join(folder, file) {
const separator = folder.endsWith("/") ? "" : "/";
const skipJoin = file.startsWith(".") || file.startsWith("/") || file.startsWith("http:") || file.startsWith("https:") || file.startsWith("file:");
const path = skipJoin ? `${file}` : `${folder}${separator}${file}`;
if (!path.toLocaleLowerCase().includes(".json"))
throw new Error(`modelpath error: expecting json file: ${path}`);
return path;
}
var now = () => {
if (typeof performance !== "undefined")
return performance.now();
@ -382,21 +382,35 @@ var GLProgram = class {
__publicField(this, "id");
__publicField(this, "compile", (source, type) => {
const shader = this.gl.createShader(type);
if (!shader) {
log("filter: could not create shader");
return null;
}
this.gl.shaderSource(shader, source);
this.gl.compileShader(shader);
if (!this.gl.getShaderParameter(shader, this.gl.COMPILE_STATUS))
throw new Error(`filter: gl compile failed: ${this.gl.getShaderInfoLog(shader)}`);
if (!this.gl.getShaderParameter(shader, this.gl.COMPILE_STATUS)) {
log(`filter: gl compile failed: ${this.gl.getShaderInfoLog(shader)}`);
return null;
}
return shader;
});
this.gl = gl;
const vertexShader = this.compile(vertexSource, this.gl.VERTEX_SHADER);
const fragmentShader = this.compile(fragmentSource, this.gl.FRAGMENT_SHADER);
this.id = this.gl.createProgram();
if (!vertexShader || !fragmentShader)
return;
if (!this.id) {
log("filter: could not create webgl program");
return;
}
this.gl.attachShader(this.id, vertexShader);
this.gl.attachShader(this.id, fragmentShader);
this.gl.linkProgram(this.id);
if (!this.gl.getProgramParameter(this.id, this.gl.LINK_STATUS))
throw new Error(`filter: gl link failed: ${this.gl.getProgramInfoLog(this.id)}`);
if (!this.gl.getProgramParameter(this.id, this.gl.LINK_STATUS)) {
log(`filter: gl link failed: ${this.gl.getProgramInfoLog(this.id)}`);
return;
}
this.gl.useProgram(this.id);
collect(vertexSource, "attribute", this.attribute);
for (const a in this.attribute)
@ -420,8 +434,11 @@ function GLImageFilter() {
const shaderProgramCache = {};
const DRAW = { INTERMEDIATE: 1 };
const gl = fxcanvas.getContext("webgl");
if (!gl)
throw new Error("filter: cannot get webgl context");
this.gl = gl;
if (!gl) {
log("filter: cannot get webgl context");
return;
}
function resize(width, height) {
if (width === fxcanvas.width && height === fxcanvas.height)
return;
@ -488,6 +505,10 @@ function GLImageFilter() {
return currentProgram;
}
currentProgram = new GLProgram(gl, vertexIdentity, fragmentSource);
if (!currentProgram) {
log("filter: could not get webgl program");
return null;
}
const floatSize = Float32Array.BYTES_PER_ELEMENT;
const vertSize = 4 * floatSize;
gl.enableVertexAttribArray(currentProgram.attribute["pos"]);
@ -506,6 +527,8 @@ function GLImageFilter() {
m[19] /= 255;
const shader = m[18] === 1 && m[3] === 0 && m[8] === 0 && m[13] === 0 && m[15] === 0 && m[16] === 0 && m[17] === 0 && m[19] === 0 ? colorMatrixWithoutAlpha : colorMatrixWithAlpha;
const program = compileShader(shader);
if (!program)
return;
gl.uniform1fv(program.uniform["m"], m);
draw2();
},
@ -819,6 +842,8 @@ function GLImageFilter() {
const pixelSizeX = 1 / fxcanvas.width;
const pixelSizeY = 1 / fxcanvas.height;
const program = compileShader(convolution);
if (!program)
return;
gl.uniform1fv(program.uniform["m"], m);
gl.uniform2f(program.uniform["px"], pixelSizeX, pixelSizeY);
draw2();
@ -894,6 +919,8 @@ function GLImageFilter() {
const blurSizeX = size2 / 7 / fxcanvas.width;
const blurSizeY = size2 / 7 / fxcanvas.height;
const program = compileShader(blur);
if (!program)
return;
gl.uniform2f(program.uniform["px"], 0, blurSizeY);
draw2(DRAW.INTERMEDIATE);
gl.uniform2f(program.uniform["px"], blurSizeX, 0);
@ -903,6 +930,8 @@ function GLImageFilter() {
const blurSizeX = size2 / fxcanvas.width;
const blurSizeY = size2 / fxcanvas.height;
const program = compileShader(pixelate);
if (!program)
return;
gl.uniform2f(program.uniform["size"], blurSizeX, blurSizeY);
draw2();
}
@ -976,10 +1005,12 @@ function canvas(width, height) {
let c;
if (env.browser) {
if (env.worker) {
if (typeof OffscreenCanvas === "undefined")
throw new Error("canvas error: attempted to run in web worker but OffscreenCanvas is not supported");
c = new OffscreenCanvas(width, height);
} else {
if (typeof document === "undefined")
throw new Error("attempted to run in web worker but offscreenCanvas is not supported");
throw new Error("canvas error: attempted to run in browser but DOM is not defined");
c = document.createElement("canvas");
c.width = width;
c.height = height;
@ -1001,18 +1032,18 @@ function copy(input, output) {
async function process2(input, config3, getTensor = true) {
if (!input) {
if (config3.debug)
log("input is missing");
log("input error: input is missing");
return { tensor: null, canvas: null };
}
if (!(input instanceof Tensor) && !(typeof Image !== "undefined" && input instanceof Image) && !(typeof env.Canvas !== "undefined" && input instanceof env.Canvas) && !(typeof globalThis.Canvas !== "undefined" && input instanceof globalThis.Canvas) && !(typeof ImageData !== "undefined" && input instanceof ImageData) && !(typeof ImageBitmap !== "undefined" && input instanceof ImageBitmap) && !(typeof HTMLImageElement !== "undefined" && input instanceof HTMLImageElement) && !(typeof HTMLMediaElement !== "undefined" && input instanceof HTMLMediaElement) && !(typeof HTMLVideoElement !== "undefined" && input instanceof HTMLVideoElement) && !(typeof HTMLCanvasElement !== "undefined" && input instanceof HTMLCanvasElement) && !(typeof OffscreenCanvas !== "undefined" && input instanceof OffscreenCanvas)) {
throw new Error("input type is not recognized");
throw new Error("input error: type is not recognized");
}
if (input instanceof Tensor) {
let tensor3 = null;
if (input["isDisposedInternal"])
throw new Error("input tensor is disposed");
throw new Error("input error: attempted to use tensor but it is disposed");
if (!input["shape"])
throw new Error("input tensor has no shape");
throw new Error("input error: attempted to use tensor without a shape");
if (input.shape.length === 3) {
if (input.shape[2] === 3) {
tensor3 = tfjs_esm_exports.expandDims(input, 0);
@ -1029,7 +1060,7 @@ async function process2(input, config3, getTensor = true) {
}
}
if (tensor3 == null || tensor3.shape.length !== 4 || tensor3.shape[0] !== 1 || tensor3.shape[3] !== 3)
throw new Error(`could not process input tensor with shape: ${input["shape"]}`);
throw new Error(`input error: attempted to use tensor with unrecognized shape: ${input["shape"]}`);
if (tensor3.dtype === "int32") {
const cast5 = tfjs_esm_exports.cast(tensor3, "float32");
tfjs_esm_exports.dispose(tensor3);
@ -1068,7 +1099,7 @@ async function process2(input, config3, getTensor = true) {
else if ((config3.filter.width || 0) > 0)
targetHeight = originalHeight * ((config3.filter.width || 0) / originalWidth);
if (!targetWidth || !targetHeight)
throw new Error("input cannot determine dimension");
throw new Error("input error: cannot determine dimension");
if (!inCanvas || (inCanvas == null ? void 0 : inCanvas.width) !== targetWidth || (inCanvas == null ? void 0 : inCanvas.height) !== targetHeight)
inCanvas = canvas(targetWidth, targetHeight);
const inCtx = inCanvas.getContext("2d");
@ -1090,8 +1121,11 @@ async function process2(input, config3, getTensor = true) {
if (!fx)
fx = env.browser ? new GLImageFilter() : null;
env.filter = !!fx;
if (!fx)
if (!fx || !fx.add) {
if (config3.debug)
log("input process error: cannot initialize filters");
return { tensor: null, canvas: inCanvas };
}
fx.reset();
if (config3.filter.brightness !== 0)
fx.add("brightness", config3.filter.brightness);
@ -1134,7 +1168,7 @@ async function process2(input, config3, getTensor = true) {
if (!getTensor)
return { tensor: null, canvas: outCanvas };
if (!outCanvas)
throw new Error("cannot create output canvas");
throw new Error("canvas error: cannot create output");
let pixels;
let depth = 3;
if (typeof ImageData !== "undefined" && input instanceof ImageData || input["data"] && input["width"] && input["height"]) {
@ -1170,7 +1204,7 @@ async function process2(input, config3, getTensor = true) {
pixels = rgb3;
}
if (!pixels)
throw new Error("cannot create tensor from input");
throw new Error("input error: cannot create tensor");
const casted = tfjs_esm_exports.cast(pixels, "float32");
const tensor3 = config3.filter.equalization ? await histogramEqualization(casted) : tfjs_esm_exports.expandDims(casted, 0);
tfjs_esm_exports.dispose([pixels, casted]);
@ -1303,9 +1337,13 @@ var Env = class {
}
this.webgpu.supported = this.browser && typeof navigator["gpu"] !== "undefined";
this.webgpu.backend = this.backends.includes("webgpu");
if (this.webgpu.supported)
this.webgpu.adapter = (await navigator["gpu"].requestAdapter()).name;
this.kernels = tfjs_esm_exports.getKernelsForBackend(tfjs_esm_exports.getBackend()).map((kernel) => kernel.kernelName.toLowerCase());
try {
if (this.webgpu.supported)
this.webgpu.adapter = (await navigator["gpu"].requestAdapter()).name;
this.kernels = tfjs_esm_exports.getKernelsForBackend(tfjs_esm_exports.getBackend()).map((kernel) => kernel.kernelName.toLowerCase());
} catch (e) {
this.webgpu.supported = false;
}
}
async updateCPU() {
const cpu = { model: "", flags: [] };
@ -1333,7 +1371,7 @@ var Env = class {
var env = new Env();
// package.json
var version10 = "2.5.1";
var version10 = "2.5.2";
// src/gear/gear.ts
var model;
@ -10388,8 +10426,6 @@ async function load16(config3) {
model15 = await tfjs_esm_exports.loadGraphModel(join(config3.modelBasePath, config3.object.modelPath || ""));
const inputs = Object.values(model15.modelSignature["inputs"]);
model15.inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : null;
if (!model15.inputSize)
throw new Error(`cannot determine model inputSize: ${config3.object.modelPath}`);
if (!model15 || !model15.modelUrl)
log("load model failed:", config3.object.modelPath);
else if (config3.debug)
@ -11091,7 +11127,7 @@ async function register(instance) {
log("error: humangl:", e.type);
log("possible browser memory leak using webgl or conflict with multiple backend registrations");
instance.emit("error");
throw new Error("browser webgl error");
throw new Error("backend error: webgl context lost");
});
config2.canvas.addEventListener("webglcontextrestored", (e) => {
log("error: humangl context restored:", e);
@ -11214,7 +11250,7 @@ async function check(instance, force = false) {
if (typeof (tfjs_esm_exports == null ? void 0 : tfjs_esm_exports.setWasmPaths) !== "undefined")
await tfjs_esm_exports.setWasmPaths(instance.config.wasmPath);
else
throw new Error("wasm backend is not loaded");
throw new Error("backend error: attempting to use wasm backend but wasm path is not set");
const simd = await tfjs_esm_exports.env().getAsync("WASM_HAS_SIMD_SUPPORT");
const mt = await tfjs_esm_exports.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT");
if (instance.config.debug)
@ -11293,9 +11329,18 @@ var options2 = {
};
var drawTime = 0;
var getCanvasContext = (input) => {
if (input && input.getContext)
return input.getContext("2d");
throw new Error("invalid canvas");
if (!input)
log("draw error: invalid canvas");
else if (!input.getContext)
log("draw error: canvas context not defined");
else {
const ctx = input.getContext("2d");
if (!ctx)
log("draw error: cannot get canvas context");
else
return ctx;
}
return null;
};
var rad2deg = (theta) => Math.round(theta * 180 / Math.PI);
function point(ctx, x, y, z, localOptions) {
@ -11392,6 +11437,8 @@ async function gesture(inCanvas2, result, drawOptions) {
return;
if (localOptions.drawGestures) {
const ctx = getCanvasContext(inCanvas2);
if (!ctx)
return;
ctx.font = localOptions.font;
ctx.fillStyle = localOptions.color;
let i = 1;
@ -11419,6 +11466,8 @@ async function face(inCanvas2, result, drawOptions) {
if (!result || !inCanvas2)
return;
const ctx = getCanvasContext(inCanvas2);
if (!ctx)
return;
for (const f of result) {
ctx.font = localOptions.font;
ctx.strokeStyle = localOptions.color;
@ -11551,6 +11600,8 @@ async function body(inCanvas2, result, drawOptions) {
if (!result || !inCanvas2)
return;
const ctx = getCanvasContext(inCanvas2);
if (!ctx)
return;
ctx.lineJoin = "round";
for (let i = 0; i < result.length; i++) {
ctx.strokeStyle = localOptions.color;
@ -11594,6 +11645,8 @@ async function hand(inCanvas2, result, drawOptions) {
if (!result || !inCanvas2)
return;
const ctx = getCanvasContext(inCanvas2);
if (!ctx)
return;
ctx.lineJoin = "round";
ctx.font = localOptions.font;
for (const h of result) {
@ -11660,6 +11713,8 @@ async function object(inCanvas2, result, drawOptions) {
if (!result || !inCanvas2)
return;
const ctx = getCanvasContext(inCanvas2);
if (!ctx)
return;
ctx.lineJoin = "round";
ctx.font = localOptions.font;
for (const h of result) {
@ -11685,6 +11740,8 @@ async function person(inCanvas2, result, drawOptions) {
if (!result || !inCanvas2)
return;
const ctx = getCanvasContext(inCanvas2);
if (!ctx)
return;
ctx.lineJoin = "round";
ctx.font = localOptions.font;
for (let i = 0; i < result.length; i++) {
@ -11709,6 +11766,8 @@ async function canvas2(input, output) {
if (!input || !output)
return;
const ctx = getCanvasContext(output);
if (!ctx)
return;
ctx.drawImage(input, 0, 0);
}
async function all(inCanvas2, result, drawOptions) {
@ -11743,6 +11802,8 @@ function insidePoly(x, y, polygon) {
async function mask(face5) {
if (!face5.tensor)
return face5.tensor;
if (!face5.mesh || face5.mesh.length < 100)
return face5.tensor;
const width = face5.tensor.shape[2] || 0;
const height = face5.tensor.shape[1] || 0;
const buffer = await face5.tensor.buffer();
@ -11873,7 +11934,7 @@ var calculateFaceAngle = (face5, imageSize) => {
};
// src/face/face.ts
var detectFace = async (parent, input) => {
var detectFace = async (instance, input) => {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
let timeStamp;
let ageRes;
@ -11885,114 +11946,114 @@ var detectFace = async (parent, input) => {
let livenessRes;
let descRes;
const faceRes = [];
parent.state = "run:face";
instance.state = "run:face";
timeStamp = now();
const faces = await predict10(input, parent.config);
parent.performance.face = env.perfadd ? (parent.performance.face || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
const faces = await predict10(input, instance.config);
instance.performance.face = env.perfadd ? (instance.performance.face || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
if (!input.shape || input.shape.length !== 4)
return [];
if (!faces)
return [];
for (let i = 0; i < faces.length; i++) {
parent.analyze("Get Face");
instance.analyze("Get Face");
if (!faces[i].tensor || faces[i].tensor["isDisposedInternal"]) {
log("Face object is disposed:", faces[i].tensor);
continue;
}
if ((_a = parent.config.face.detector) == null ? void 0 : _a.mask) {
if ((_a = instance.config.face.detector) == null ? void 0 : _a.mask) {
const masked = await mask(faces[i]);
tfjs_esm_exports.dispose(faces[i].tensor);
faces[i].tensor = masked;
}
const rotation = faces[i].mesh && faces[i].mesh.length > 200 ? calculateFaceAngle(faces[i], [input.shape[2], input.shape[1]]) : null;
parent.analyze("Start Emotion:");
if (parent.config.async) {
emotionRes = ((_b = parent.config.face.emotion) == null ? void 0 : _b.enabled) ? predict8(faces[i].tensor || tfjs_esm_exports.tensor([]), parent.config, i, faces.length) : null;
instance.analyze("Start Emotion:");
if (instance.config.async) {
emotionRes = ((_b = instance.config.face.emotion) == null ? void 0 : _b.enabled) ? predict8(faces[i].tensor || tfjs_esm_exports.tensor([]), instance.config, i, faces.length) : null;
} else {
parent.state = "run:emotion";
instance.state = "run:emotion";
timeStamp = now();
emotionRes = ((_c = parent.config.face.emotion) == null ? void 0 : _c.enabled) ? await predict8(faces[i].tensor || tfjs_esm_exports.tensor([]), parent.config, i, faces.length) : null;
parent.performance.emotion = env.perfadd ? (parent.performance.emotion || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
emotionRes = ((_c = instance.config.face.emotion) == null ? void 0 : _c.enabled) ? await predict8(faces[i].tensor || tfjs_esm_exports.tensor([]), instance.config, i, faces.length) : null;
instance.performance.emotion = env.perfadd ? (instance.performance.emotion || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
parent.analyze("End Emotion:");
parent.analyze("Start AntiSpoof:");
if (parent.config.async) {
antispoofRes = ((_d = parent.config.face.antispoof) == null ? void 0 : _d.enabled) ? predict4(faces[i].tensor || tfjs_esm_exports.tensor([]), parent.config, i, faces.length) : null;
instance.analyze("End Emotion:");
instance.analyze("Start AntiSpoof:");
if (instance.config.async) {
antispoofRes = ((_d = instance.config.face.antispoof) == null ? void 0 : _d.enabled) ? predict4(faces[i].tensor || tfjs_esm_exports.tensor([]), instance.config, i, faces.length) : null;
} else {
parent.state = "run:antispoof";
instance.state = "run:antispoof";
timeStamp = now();
antispoofRes = ((_e = parent.config.face.antispoof) == null ? void 0 : _e.enabled) ? await predict4(faces[i].tensor || tfjs_esm_exports.tensor([]), parent.config, i, faces.length) : null;
parent.performance.antispoof = env.perfadd ? (parent.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
antispoofRes = ((_e = instance.config.face.antispoof) == null ? void 0 : _e.enabled) ? await predict4(faces[i].tensor || tfjs_esm_exports.tensor([]), instance.config, i, faces.length) : null;
instance.performance.antispoof = env.perfadd ? (instance.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
parent.analyze("End AntiSpoof:");
parent.analyze("Start Liveness:");
if (parent.config.async) {
livenessRes = ((_f = parent.config.face.liveness) == null ? void 0 : _f.enabled) ? predict14(faces[i].tensor || tfjs_esm_exports.tensor([]), parent.config, i, faces.length) : null;
instance.analyze("End AntiSpoof:");
instance.analyze("Start Liveness:");
if (instance.config.async) {
livenessRes = ((_f = instance.config.face.liveness) == null ? void 0 : _f.enabled) ? predict14(faces[i].tensor || tfjs_esm_exports.tensor([]), instance.config, i, faces.length) : null;
} else {
parent.state = "run:liveness";
instance.state = "run:liveness";
timeStamp = now();
livenessRes = ((_g = parent.config.face.liveness) == null ? void 0 : _g.enabled) ? await predict14(faces[i].tensor || tfjs_esm_exports.tensor([]), parent.config, i, faces.length) : null;
parent.performance.liveness = env.perfadd ? (parent.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
livenessRes = ((_g = instance.config.face.liveness) == null ? void 0 : _g.enabled) ? await predict14(faces[i].tensor || tfjs_esm_exports.tensor([]), instance.config, i, faces.length) : null;
instance.performance.liveness = env.perfadd ? (instance.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
parent.analyze("End Liveness:");
parent.analyze("Start GEAR:");
if (parent.config.async) {
gearRes = ((_h = parent.config.face["gear"]) == null ? void 0 : _h.enabled) ? predict(faces[i].tensor || tfjs_esm_exports.tensor([]), parent.config, i, faces.length) : {};
instance.analyze("End Liveness:");
instance.analyze("Start GEAR:");
if (instance.config.async) {
gearRes = ((_h = instance.config.face["gear"]) == null ? void 0 : _h.enabled) ? predict(faces[i].tensor || tfjs_esm_exports.tensor([]), instance.config, i, faces.length) : {};
} else {
parent.state = "run:gear";
instance.state = "run:gear";
timeStamp = now();
gearRes = ((_i = parent.config.face["gear"]) == null ? void 0 : _i.enabled) ? await predict(faces[i].tensor || tfjs_esm_exports.tensor([]), parent.config, i, faces.length) : {};
parent.performance.gear = Math.trunc(now() - timeStamp);
gearRes = ((_i = instance.config.face["gear"]) == null ? void 0 : _i.enabled) ? await predict(faces[i].tensor || tfjs_esm_exports.tensor([]), instance.config, i, faces.length) : {};
instance.performance.gear = Math.trunc(now() - timeStamp);
}
parent.analyze("End GEAR:");
parent.analyze("Start SSRNet:");
if (parent.config.async) {
ageRes = ((_j = parent.config.face["ssrnet"]) == null ? void 0 : _j.enabled) ? predict2(faces[i].tensor || tfjs_esm_exports.tensor([]), parent.config, i, faces.length) : {};
genderRes = ((_k = parent.config.face["ssrnet"]) == null ? void 0 : _k.enabled) ? predict3(faces[i].tensor || tfjs_esm_exports.tensor([]), parent.config, i, faces.length) : {};
instance.analyze("End GEAR:");
instance.analyze("Start SSRNet:");
if (instance.config.async) {
ageRes = ((_j = instance.config.face["ssrnet"]) == null ? void 0 : _j.enabled) ? predict2(faces[i].tensor || tfjs_esm_exports.tensor([]), instance.config, i, faces.length) : {};
genderRes = ((_k = instance.config.face["ssrnet"]) == null ? void 0 : _k.enabled) ? predict3(faces[i].tensor || tfjs_esm_exports.tensor([]), instance.config, i, faces.length) : {};
} else {
parent.state = "run:ssrnet";
instance.state = "run:ssrnet";
timeStamp = now();
ageRes = ((_l = parent.config.face["ssrnet"]) == null ? void 0 : _l.enabled) ? await predict2(faces[i].tensor || tfjs_esm_exports.tensor([]), parent.config, i, faces.length) : {};
genderRes = ((_m = parent.config.face["ssrnet"]) == null ? void 0 : _m.enabled) ? await predict3(faces[i].tensor || tfjs_esm_exports.tensor([]), parent.config, i, faces.length) : {};
parent.performance.ssrnet = Math.trunc(now() - timeStamp);
ageRes = ((_l = instance.config.face["ssrnet"]) == null ? void 0 : _l.enabled) ? await predict2(faces[i].tensor || tfjs_esm_exports.tensor([]), instance.config, i, faces.length) : {};
genderRes = ((_m = instance.config.face["ssrnet"]) == null ? void 0 : _m.enabled) ? await predict3(faces[i].tensor || tfjs_esm_exports.tensor([]), instance.config, i, faces.length) : {};
instance.performance.ssrnet = Math.trunc(now() - timeStamp);
}
parent.analyze("End SSRNet:");
parent.analyze("Start MobileFaceNet:");
if (parent.config.async) {
mobilefacenetRes = ((_n = parent.config.face["mobilefacenet"]) == null ? void 0 : _n.enabled) ? predict9(faces[i].tensor || tfjs_esm_exports.tensor([]), parent.config, i, faces.length) : {};
instance.analyze("End SSRNet:");
instance.analyze("Start MobileFaceNet:");
if (instance.config.async) {
mobilefacenetRes = ((_n = instance.config.face["mobilefacenet"]) == null ? void 0 : _n.enabled) ? predict9(faces[i].tensor || tfjs_esm_exports.tensor([]), instance.config, i, faces.length) : {};
} else {
parent.state = "run:mobilefacenet";
instance.state = "run:mobilefacenet";
timeStamp = now();
mobilefacenetRes = ((_o = parent.config.face["mobilefacenet"]) == null ? void 0 : _o.enabled) ? await predict9(faces[i].tensor || tfjs_esm_exports.tensor([]), parent.config, i, faces.length) : {};
parent.performance.mobilefacenet = Math.trunc(now() - timeStamp);
mobilefacenetRes = ((_o = instance.config.face["mobilefacenet"]) == null ? void 0 : _o.enabled) ? await predict9(faces[i].tensor || tfjs_esm_exports.tensor([]), instance.config, i, faces.length) : {};
instance.performance.mobilefacenet = Math.trunc(now() - timeStamp);
}
parent.analyze("End MobileFaceNet:");
parent.analyze("Start Description:");
if (parent.config.async) {
descRes = ((_p = parent.config.face.description) == null ? void 0 : _p.enabled) ? predict11(faces[i].tensor || tfjs_esm_exports.tensor([]), parent.config, i, faces.length) : null;
instance.analyze("End MobileFaceNet:");
instance.analyze("Start Description:");
if (instance.config.async) {
descRes = ((_p = instance.config.face.description) == null ? void 0 : _p.enabled) ? predict11(faces[i].tensor || tfjs_esm_exports.tensor([]), instance.config, i, faces.length) : null;
} else {
parent.state = "run:description";
instance.state = "run:description";
timeStamp = now();
descRes = ((_q = parent.config.face.description) == null ? void 0 : _q.enabled) ? await predict11(faces[i].tensor || tfjs_esm_exports.tensor([]), parent.config, i, faces.length) : null;
parent.performance.description = env.perfadd ? (parent.performance.description || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
descRes = ((_q = instance.config.face.description) == null ? void 0 : _q.enabled) ? await predict11(faces[i].tensor || tfjs_esm_exports.tensor([]), instance.config, i, faces.length) : null;
instance.performance.description = env.perfadd ? (instance.performance.description || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
parent.analyze("End Description:");
if (parent.config.async) {
instance.analyze("End Description:");
if (instance.config.async) {
[ageRes, genderRes, emotionRes, mobilefacenetRes, descRes, gearRes, antispoofRes, livenessRes] = await Promise.all([ageRes, genderRes, emotionRes, mobilefacenetRes, descRes, gearRes, antispoofRes, livenessRes]);
}
parent.analyze("Finish Face:");
if (((_r = parent.config.face["ssrnet"]) == null ? void 0 : _r.enabled) && ageRes && genderRes)
instance.analyze("Finish Face:");
if (((_r = instance.config.face["ssrnet"]) == null ? void 0 : _r.enabled) && ageRes && genderRes)
descRes = { age: ageRes.age, gender: genderRes.gender, genderScore: genderRes.genderScore };
if (((_s = parent.config.face["gear"]) == null ? void 0 : _s.enabled) && gearRes)
if (((_s = instance.config.face["gear"]) == null ? void 0 : _s.enabled) && gearRes)
descRes = { age: gearRes.age, gender: gearRes.gender, genderScore: gearRes.genderScore, race: gearRes.race };
if (((_t = parent.config.face["mobilefacenet"]) == null ? void 0 : _t.enabled) && mobilefacenetRes)
if (((_t = instance.config.face["mobilefacenet"]) == null ? void 0 : _t.enabled) && mobilefacenetRes)
descRes.descriptor = mobilefacenetRes;
if (!((_u = parent.config.face.iris) == null ? void 0 : _u.enabled) && ((_w = (_v = faces[i]) == null ? void 0 : _v.annotations) == null ? void 0 : _w.leftEyeIris) && ((_y = (_x = faces[i]) == null ? void 0 : _x.annotations) == null ? void 0 : _y.rightEyeIris)) {
if (!((_u = instance.config.face.iris) == null ? void 0 : _u.enabled) && ((_w = (_v = faces[i]) == null ? void 0 : _v.annotations) == null ? void 0 : _w.leftEyeIris) && ((_y = (_x = faces[i]) == null ? void 0 : _x.annotations) == null ? void 0 : _y.rightEyeIris)) {
delete faces[i].annotations.leftEyeIris;
delete faces[i].annotations.rightEyeIris;
}
const irisSize = faces[i].annotations && faces[i].annotations.leftEyeIris && faces[i].annotations.leftEyeIris[0] && faces[i].annotations.rightEyeIris && faces[i].annotations.rightEyeIris[0] && faces[i].annotations.leftEyeIris.length > 0 && faces[i].annotations.rightEyeIris.length > 0 && faces[i].annotations.leftEyeIris[0] !== null && faces[i].annotations.rightEyeIris[0] !== null ? Math.max(Math.abs(faces[i].annotations.leftEyeIris[3][0] - faces[i].annotations.leftEyeIris[1][0]), Math.abs(faces[i].annotations.rightEyeIris[4][1] - faces[i].annotations.rightEyeIris[2][1])) / input.shape[2] : 0;
const tensor3 = ((_z = parent.config.face.detector) == null ? void 0 : _z.return) ? tfjs_esm_exports.squeeze(faces[i].tensor) : null;
const tensor3 = ((_z = instance.config.face.detector) == null ? void 0 : _z.return) ? tfjs_esm_exports.squeeze(faces[i].tensor) : null;
tfjs_esm_exports.dispose(faces[i].tensor);
if (faces[i].tensor)
delete faces[i].tensor;
@ -12023,18 +12084,18 @@ var detectFace = async (parent, input) => {
if (tensor3)
res.tensor = tensor3;
faceRes.push(res);
parent.analyze("End Face");
instance.analyze("End Face");
}
parent.analyze("End FaceMesh:");
if (parent.config.async) {
if (parent.performance.face)
delete parent.performance.face;
if (parent.performance.age)
delete parent.performance.age;
if (parent.performance.gender)
delete parent.performance.gender;
if (parent.performance.emotion)
delete parent.performance.emotion;
instance.analyze("End FaceMesh:");
if (instance.config.async) {
if (instance.performance.face)
delete instance.performance.face;
if (instance.performance.age)
delete instance.performance.age;
if (instance.performance.gender)
delete instance.performance.gender;
if (instance.performance.emotion)
delete instance.performance.emotion;
}
return faceRes;
};
@ -12161,16 +12222,19 @@ var hand2 = (res) => {
};
// src/util/interpolate.ts
var bufferedResult = { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0 };
var bufferedResult = { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0, error: null };
var interpolateTime = 0;
function calc2(newResult, config3) {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A;
const t0 = now();
if (!newResult)
return { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0 };
return { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0, error: null };
const elapsed = Date.now() - newResult.timestamp;
const bufferedFactor = elapsed < 1e3 ? 8 - Math.log(elapsed + 1) : 1;
bufferedResult.canvas = newResult.canvas;
if (newResult.canvas)
bufferedResult.canvas = newResult.canvas;
if (newResult.error)
bufferedResult.error = newResult.error;
if (!bufferedResult.body || newResult.body.length !== bufferedResult.body.length) {
bufferedResult.body = JSON.parse(JSON.stringify(newResult.body));
} else {
@ -13192,7 +13256,7 @@ async function warmup(instance, userConfig) {
instance.state = "warmup";
if (userConfig)
instance.config = mergeDeep(instance.config, userConfig);
if (!instance.config.warmup || instance.config.warmup === "none")
if (!instance.config.warmup || instance.config.warmup.length === 0 || instance.config.warmup === "none")
return { error: "null" };
let res;
return new Promise(async (resolve) => {
@ -13292,7 +13356,7 @@ var Human = class {
person: (output, result, options3) => person(output, result, options3),
all: (output, result, options3) => all(output, result, options3)
};
this.result = { face: [], body: [], hand: [], gesture: [], object: [], performance: {}, timestamp: 0, persons: [] };
this.result = { face: [], body: [], hand: [], gesture: [], object: [], performance: {}, timestamp: 0, persons: [], error: null };
this.process = { tensor: null, canvas: null };
this.faceTriangulation = triangulation;
this.faceUVMap = uvmap;
@ -13401,7 +13465,8 @@ var Human = class {
const error = __privateGet(this, _sanity).call(this, input);
if (error) {
log(error, input);
resolve({ error });
this.emit("error");
resolve({ face: [], body: [], hand: [], gesture: [], object: [], performance: this.performance, timestamp: now(), persons: [], error });
}
const timeStart = now();
await check(this);
@ -13415,7 +13480,8 @@ var Human = class {
if (!img.tensor) {
if (this.config.debug)
log("could not convert input to tensor");
resolve({ error: "could not convert input to tensor" });
this.emit("error");
resolve({ face: [], body: [], hand: [], gesture: [], object: [], performance: this.performance, timestamp: now(), persons: [], error: "could not convert input to tensor" });
return;
}
this.emit("image");
@ -13534,6 +13600,7 @@ var Human = class {
performance: this.performance,
canvas: this.process.canvas,
timestamp: Date.now(),
error: null,
get persons() {
return join2(faceRes, bodyRes, handRes, gestureRes, shape);
}

File diff suppressed because one or more lines are too long

301
dist/human.esm.js vendored
View File

@ -43,20 +43,20 @@ var __privateSet = (obj, member, value, setter) => {
};
// src/util/util.ts
function join(folder, file) {
const separator = folder.endsWith("/") ? "" : "/";
const skipJoin = file.startsWith(".") || file.startsWith("/") || file.startsWith("http:") || file.startsWith("https:") || file.startsWith("file:");
const path = skipJoin ? `${file}` : `${folder}${separator}${file}`;
if (!path.toLocaleLowerCase().includes(".json"))
throw new Error(`modelpath error: ${path} expecting json file`);
return path;
}
function log(...msg) {
const dt = new Date();
const ts = `${dt.getHours().toString().padStart(2, "0")}:${dt.getMinutes().toString().padStart(2, "0")}:${dt.getSeconds().toString().padStart(2, "0")}.${dt.getMilliseconds().toString().padStart(3, "0")}`;
if (msg)
console.log(ts, "Human:", ...msg);
}
function join(folder, file) {
const separator = folder.endsWith("/") ? "" : "/";
const skipJoin = file.startsWith(".") || file.startsWith("/") || file.startsWith("http:") || file.startsWith("https:") || file.startsWith("file:");
const path = skipJoin ? `${file}` : `${folder}${separator}${file}`;
if (!path.toLocaleLowerCase().includes(".json"))
throw new Error(`modelpath error: expecting json file: ${path}`);
return path;
}
var now = () => {
if (typeof performance !== "undefined")
return performance.now();
@ -70707,21 +70707,35 @@ var GLProgram = class {
__publicField(this, "id");
__publicField(this, "compile", (source, type) => {
const shader = this.gl.createShader(type);
if (!shader) {
log("filter: could not create shader");
return null;
}
this.gl.shaderSource(shader, source);
this.gl.compileShader(shader);
if (!this.gl.getShaderParameter(shader, this.gl.COMPILE_STATUS))
throw new Error(`filter: gl compile failed: ${this.gl.getShaderInfoLog(shader)}`);
if (!this.gl.getShaderParameter(shader, this.gl.COMPILE_STATUS)) {
log(`filter: gl compile failed: ${this.gl.getShaderInfoLog(shader)}`);
return null;
}
return shader;
});
this.gl = gl;
const vertexShader = this.compile(vertexSource, this.gl.VERTEX_SHADER);
const fragmentShader = this.compile(fragmentSource, this.gl.FRAGMENT_SHADER);
this.id = this.gl.createProgram();
if (!vertexShader || !fragmentShader)
return;
if (!this.id) {
log("filter: could not create webgl program");
return;
}
this.gl.attachShader(this.id, vertexShader);
this.gl.attachShader(this.id, fragmentShader);
this.gl.linkProgram(this.id);
if (!this.gl.getProgramParameter(this.id, this.gl.LINK_STATUS))
throw new Error(`filter: gl link failed: ${this.gl.getProgramInfoLog(this.id)}`);
if (!this.gl.getProgramParameter(this.id, this.gl.LINK_STATUS)) {
log(`filter: gl link failed: ${this.gl.getProgramInfoLog(this.id)}`);
return;
}
this.gl.useProgram(this.id);
collect(vertexSource, "attribute", this.attribute);
for (const a in this.attribute)
@ -70745,8 +70759,11 @@ function GLImageFilter() {
const shaderProgramCache = {};
const DRAW = { INTERMEDIATE: 1 };
const gl = fxcanvas.getContext("webgl");
if (!gl)
throw new Error("filter: cannot get webgl context");
this.gl = gl;
if (!gl) {
log("filter: cannot get webgl context");
return;
}
function resize(width, height) {
if (width === fxcanvas.width && height === fxcanvas.height)
return;
@ -70813,6 +70830,10 @@ function GLImageFilter() {
return currentProgram;
}
currentProgram = new GLProgram(gl, vertexIdentity, fragmentSource);
if (!currentProgram) {
log("filter: could not get webgl program");
return null;
}
const floatSize = Float32Array.BYTES_PER_ELEMENT;
const vertSize = 4 * floatSize;
gl.enableVertexAttribArray(currentProgram.attribute["pos"]);
@ -70831,6 +70852,8 @@ function GLImageFilter() {
m[19] /= 255;
const shader = m[18] === 1 && m[3] === 0 && m[8] === 0 && m[13] === 0 && m[15] === 0 && m[16] === 0 && m[17] === 0 && m[19] === 0 ? colorMatrixWithoutAlpha : colorMatrixWithAlpha;
const program = compileShader(shader);
if (!program)
return;
gl.uniform1fv(program.uniform["m"], m);
draw2();
},
@ -71144,6 +71167,8 @@ function GLImageFilter() {
const pixelSizeX = 1 / fxcanvas.width;
const pixelSizeY = 1 / fxcanvas.height;
const program = compileShader(convolution);
if (!program)
return;
gl.uniform1fv(program.uniform["m"], m);
gl.uniform2f(program.uniform["px"], pixelSizeX, pixelSizeY);
draw2();
@ -71219,6 +71244,8 @@ function GLImageFilter() {
const blurSizeX = size2 / 7 / fxcanvas.width;
const blurSizeY = size2 / 7 / fxcanvas.height;
const program = compileShader(blur);
if (!program)
return;
gl.uniform2f(program.uniform["px"], 0, blurSizeY);
draw2(DRAW.INTERMEDIATE);
gl.uniform2f(program.uniform["px"], blurSizeX, 0);
@ -71228,6 +71255,8 @@ function GLImageFilter() {
const blurSizeX = size2 / fxcanvas.width;
const blurSizeY = size2 / fxcanvas.height;
const program = compileShader(pixelate);
if (!program)
return;
gl.uniform2f(program.uniform["size"], blurSizeX, blurSizeY);
draw2();
}
@ -71301,10 +71330,12 @@ function canvas(width, height) {
let c;
if (env2.browser) {
if (env2.worker) {
if (typeof OffscreenCanvas === "undefined")
throw new Error("canvas error: attempted to run in web worker but OffscreenCanvas is not supported");
c = new OffscreenCanvas(width, height);
} else {
if (typeof document === "undefined")
throw new Error("attempted to run in web worker but offscreenCanvas is not supported");
throw new Error("canvas error: attempted to run in browser but DOM is not defined");
c = document.createElement("canvas");
c.width = width;
c.height = height;
@ -71326,18 +71357,18 @@ function copy(input2, output) {
async function process2(input2, config3, getTensor2 = true) {
if (!input2) {
if (config3.debug)
log("input is missing");
log("input error: input is missing");
return { tensor: null, canvas: null };
}
if (!(input2 instanceof Tensor) && !(typeof Image !== "undefined" && input2 instanceof Image) && !(typeof env2.Canvas !== "undefined" && input2 instanceof env2.Canvas) && !(typeof globalThis.Canvas !== "undefined" && input2 instanceof globalThis.Canvas) && !(typeof ImageData !== "undefined" && input2 instanceof ImageData) && !(typeof ImageBitmap !== "undefined" && input2 instanceof ImageBitmap) && !(typeof HTMLImageElement !== "undefined" && input2 instanceof HTMLImageElement) && !(typeof HTMLMediaElement !== "undefined" && input2 instanceof HTMLMediaElement) && !(typeof HTMLVideoElement !== "undefined" && input2 instanceof HTMLVideoElement) && !(typeof HTMLCanvasElement !== "undefined" && input2 instanceof HTMLCanvasElement) && !(typeof OffscreenCanvas !== "undefined" && input2 instanceof OffscreenCanvas)) {
throw new Error("input type is not recognized");
throw new Error("input error: type is not recognized");
}
if (input2 instanceof Tensor) {
let tensor2 = null;
if (input2["isDisposedInternal"])
throw new Error("input tensor is disposed");
throw new Error("input error: attempted to use tensor but it is disposed");
if (!input2["shape"])
throw new Error("input tensor has no shape");
throw new Error("input error: attempted to use tensor without a shape");
if (input2.shape.length === 3) {
if (input2.shape[2] === 3) {
tensor2 = expandDims(input2, 0);
@ -71354,7 +71385,7 @@ async function process2(input2, config3, getTensor2 = true) {
}
}
if (tensor2 == null || tensor2.shape.length !== 4 || tensor2.shape[0] !== 1 || tensor2.shape[3] !== 3)
throw new Error(`could not process input tensor with shape: ${input2["shape"]}`);
throw new Error(`input error: attempted to use tensor with unrecognized shape: ${input2["shape"]}`);
if (tensor2.dtype === "int32") {
const cast7 = cast(tensor2, "float32");
dispose(tensor2);
@ -71393,7 +71424,7 @@ async function process2(input2, config3, getTensor2 = true) {
else if ((config3.filter.width || 0) > 0)
targetHeight = originalHeight * ((config3.filter.width || 0) / originalWidth);
if (!targetWidth || !targetHeight)
throw new Error("input cannot determine dimension");
throw new Error("input error: cannot determine dimension");
if (!inCanvas || (inCanvas == null ? void 0 : inCanvas.width) !== targetWidth || (inCanvas == null ? void 0 : inCanvas.height) !== targetHeight)
inCanvas = canvas(targetWidth, targetHeight);
const inCtx = inCanvas.getContext("2d");
@ -71415,8 +71446,11 @@ async function process2(input2, config3, getTensor2 = true) {
if (!fx)
fx = env2.browser ? new GLImageFilter() : null;
env2.filter = !!fx;
if (!fx)
if (!fx || !fx.add) {
if (config3.debug)
log("input process error: cannot initialize filters");
return { tensor: null, canvas: inCanvas };
}
fx.reset();
if (config3.filter.brightness !== 0)
fx.add("brightness", config3.filter.brightness);
@ -71459,7 +71493,7 @@ async function process2(input2, config3, getTensor2 = true) {
if (!getTensor2)
return { tensor: null, canvas: outCanvas };
if (!outCanvas)
throw new Error("cannot create output canvas");
throw new Error("canvas error: cannot create output");
let pixels;
let depth = 3;
if (typeof ImageData !== "undefined" && input2 instanceof ImageData || input2["data"] && input2["width"] && input2["height"]) {
@ -71495,7 +71529,7 @@ async function process2(input2, config3, getTensor2 = true) {
pixels = rgb3;
}
if (!pixels)
throw new Error("cannot create tensor from input");
throw new Error("input error: cannot create tensor");
const casted = cast(pixels, "float32");
const tensor2 = config3.filter.equalization ? await histogramEqualization(casted) : expandDims(casted, 0);
dispose([pixels, casted]);
@ -71628,9 +71662,13 @@ var Env = class {
}
this.webgpu.supported = this.browser && typeof navigator["gpu"] !== "undefined";
this.webgpu.backend = this.backends.includes("webgpu");
if (this.webgpu.supported)
this.webgpu.adapter = (await navigator["gpu"].requestAdapter()).name;
this.kernels = getKernelsForBackend(getBackend()).map((kernel) => kernel.kernelName.toLowerCase());
try {
if (this.webgpu.supported)
this.webgpu.adapter = (await navigator["gpu"].requestAdapter()).name;
this.kernels = getKernelsForBackend(getBackend()).map((kernel) => kernel.kernelName.toLowerCase());
} catch (e) {
this.webgpu.supported = false;
}
}
async updateCPU() {
const cpu = { model: "", flags: [] };
@ -71658,7 +71696,7 @@ var Env = class {
var env2 = new Env();
// package.json
var version = "2.5.1";
var version = "2.5.2";
// src/gear/gear.ts
var model2;
@ -80713,8 +80751,6 @@ async function load16(config3) {
model16 = await loadGraphModel(join(config3.modelBasePath, config3.object.modelPath || ""));
const inputs = Object.values(model16.modelSignature["inputs"]);
model16.inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : null;
if (!model16.inputSize)
throw new Error(`cannot determine model inputSize: ${config3.object.modelPath}`);
if (!model16 || !model16.modelUrl)
log("load model failed:", config3.object.modelPath);
else if (config3.debug)
@ -81416,7 +81452,7 @@ async function register(instance) {
log("error: humangl:", e.type);
log("possible browser memory leak using webgl or conflict with multiple backend registrations");
instance.emit("error");
throw new Error("browser webgl error");
throw new Error("backend error: webgl context lost");
});
config2.canvas.addEventListener("webglcontextrestored", (e) => {
log("error: humangl context restored:", e);
@ -81539,7 +81575,7 @@ async function check(instance, force = false) {
if (typeof (tfjs_esm_exports == null ? void 0 : tfjs_esm_exports.setWasmPaths) !== "undefined")
await setWasmPaths(instance.config.wasmPath);
else
throw new Error("wasm backend is not loaded");
throw new Error("backend error: attempting to use wasm backend but wasm path is not set");
const simd = await env().getAsync("WASM_HAS_SIMD_SUPPORT");
const mt = await env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT");
if (instance.config.debug)
@ -81618,9 +81654,18 @@ var options2 = {
};
var drawTime = 0;
var getCanvasContext = (input2) => {
if (input2 && input2.getContext)
return input2.getContext("2d");
throw new Error("invalid canvas");
if (!input2)
log("draw error: invalid canvas");
else if (!input2.getContext)
log("draw error: canvas context not defined");
else {
const ctx = input2.getContext("2d");
if (!ctx)
log("draw error: cannot get canvas context");
else
return ctx;
}
return null;
};
var rad2deg = (theta) => Math.round(theta * 180 / Math.PI);
function point(ctx, x, y, z, localOptions) {
@ -81717,6 +81762,8 @@ async function gesture(inCanvas2, result, drawOptions) {
return;
if (localOptions.drawGestures) {
const ctx = getCanvasContext(inCanvas2);
if (!ctx)
return;
ctx.font = localOptions.font;
ctx.fillStyle = localOptions.color;
let i = 1;
@ -81744,6 +81791,8 @@ async function face(inCanvas2, result, drawOptions) {
if (!result || !inCanvas2)
return;
const ctx = getCanvasContext(inCanvas2);
if (!ctx)
return;
for (const f of result) {
ctx.font = localOptions.font;
ctx.strokeStyle = localOptions.color;
@ -81876,6 +81925,8 @@ async function body(inCanvas2, result, drawOptions) {
if (!result || !inCanvas2)
return;
const ctx = getCanvasContext(inCanvas2);
if (!ctx)
return;
ctx.lineJoin = "round";
for (let i = 0; i < result.length; i++) {
ctx.strokeStyle = localOptions.color;
@ -81919,6 +81970,8 @@ async function hand(inCanvas2, result, drawOptions) {
if (!result || !inCanvas2)
return;
const ctx = getCanvasContext(inCanvas2);
if (!ctx)
return;
ctx.lineJoin = "round";
ctx.font = localOptions.font;
for (const h of result) {
@ -81985,6 +82038,8 @@ async function object(inCanvas2, result, drawOptions) {
if (!result || !inCanvas2)
return;
const ctx = getCanvasContext(inCanvas2);
if (!ctx)
return;
ctx.lineJoin = "round";
ctx.font = localOptions.font;
for (const h of result) {
@ -82010,6 +82065,8 @@ async function person(inCanvas2, result, drawOptions) {
if (!result || !inCanvas2)
return;
const ctx = getCanvasContext(inCanvas2);
if (!ctx)
return;
ctx.lineJoin = "round";
ctx.font = localOptions.font;
for (let i = 0; i < result.length; i++) {
@ -82034,6 +82091,8 @@ async function canvas2(input2, output) {
if (!input2 || !output)
return;
const ctx = getCanvasContext(output);
if (!ctx)
return;
ctx.drawImage(input2, 0, 0);
}
async function all5(inCanvas2, result, drawOptions) {
@ -82068,6 +82127,8 @@ function insidePoly(x, y, polygon) {
async function mask(face5) {
if (!face5.tensor)
return face5.tensor;
if (!face5.mesh || face5.mesh.length < 100)
return face5.tensor;
const width = face5.tensor.shape[2] || 0;
const height = face5.tensor.shape[1] || 0;
const buffer2 = await face5.tensor.buffer();
@ -82198,7 +82259,7 @@ var calculateFaceAngle = (face5, imageSize) => {
};
// src/face/face.ts
var detectFace = async (parent, input2) => {
var detectFace = async (instance, input2) => {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
let timeStamp;
let ageRes;
@ -82210,114 +82271,114 @@ var detectFace = async (parent, input2) => {
let livenessRes;
let descRes;
const faceRes = [];
parent.state = "run:face";
instance.state = "run:face";
timeStamp = now();
const faces = await predict10(input2, parent.config);
parent.performance.face = env2.perfadd ? (parent.performance.face || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
const faces = await predict10(input2, instance.config);
instance.performance.face = env2.perfadd ? (instance.performance.face || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
if (!input2.shape || input2.shape.length !== 4)
return [];
if (!faces)
return [];
for (let i = 0; i < faces.length; i++) {
parent.analyze("Get Face");
instance.analyze("Get Face");
if (!faces[i].tensor || faces[i].tensor["isDisposedInternal"]) {
log("Face object is disposed:", faces[i].tensor);
continue;
}
if ((_a = parent.config.face.detector) == null ? void 0 : _a.mask) {
if ((_a = instance.config.face.detector) == null ? void 0 : _a.mask) {
const masked = await mask(faces[i]);
dispose(faces[i].tensor);
faces[i].tensor = masked;
}
const rotation = faces[i].mesh && faces[i].mesh.length > 200 ? calculateFaceAngle(faces[i], [input2.shape[2], input2.shape[1]]) : null;
parent.analyze("Start Emotion:");
if (parent.config.async) {
emotionRes = ((_b = parent.config.face.emotion) == null ? void 0 : _b.enabled) ? predict8(faces[i].tensor || tensor([]), parent.config, i, faces.length) : null;
instance.analyze("Start Emotion:");
if (instance.config.async) {
emotionRes = ((_b = instance.config.face.emotion) == null ? void 0 : _b.enabled) ? predict8(faces[i].tensor || tensor([]), instance.config, i, faces.length) : null;
} else {
parent.state = "run:emotion";
instance.state = "run:emotion";
timeStamp = now();
emotionRes = ((_c = parent.config.face.emotion) == null ? void 0 : _c.enabled) ? await predict8(faces[i].tensor || tensor([]), parent.config, i, faces.length) : null;
parent.performance.emotion = env2.perfadd ? (parent.performance.emotion || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
emotionRes = ((_c = instance.config.face.emotion) == null ? void 0 : _c.enabled) ? await predict8(faces[i].tensor || tensor([]), instance.config, i, faces.length) : null;
instance.performance.emotion = env2.perfadd ? (instance.performance.emotion || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
parent.analyze("End Emotion:");
parent.analyze("Start AntiSpoof:");
if (parent.config.async) {
antispoofRes = ((_d = parent.config.face.antispoof) == null ? void 0 : _d.enabled) ? predict4(faces[i].tensor || tensor([]), parent.config, i, faces.length) : null;
instance.analyze("End Emotion:");
instance.analyze("Start AntiSpoof:");
if (instance.config.async) {
antispoofRes = ((_d = instance.config.face.antispoof) == null ? void 0 : _d.enabled) ? predict4(faces[i].tensor || tensor([]), instance.config, i, faces.length) : null;
} else {
parent.state = "run:antispoof";
instance.state = "run:antispoof";
timeStamp = now();
antispoofRes = ((_e = parent.config.face.antispoof) == null ? void 0 : _e.enabled) ? await predict4(faces[i].tensor || tensor([]), parent.config, i, faces.length) : null;
parent.performance.antispoof = env2.perfadd ? (parent.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
antispoofRes = ((_e = instance.config.face.antispoof) == null ? void 0 : _e.enabled) ? await predict4(faces[i].tensor || tensor([]), instance.config, i, faces.length) : null;
instance.performance.antispoof = env2.perfadd ? (instance.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
parent.analyze("End AntiSpoof:");
parent.analyze("Start Liveness:");
if (parent.config.async) {
livenessRes = ((_f = parent.config.face.liveness) == null ? void 0 : _f.enabled) ? predict14(faces[i].tensor || tensor([]), parent.config, i, faces.length) : null;
instance.analyze("End AntiSpoof:");
instance.analyze("Start Liveness:");
if (instance.config.async) {
livenessRes = ((_f = instance.config.face.liveness) == null ? void 0 : _f.enabled) ? predict14(faces[i].tensor || tensor([]), instance.config, i, faces.length) : null;
} else {
parent.state = "run:liveness";
instance.state = "run:liveness";
timeStamp = now();
livenessRes = ((_g = parent.config.face.liveness) == null ? void 0 : _g.enabled) ? await predict14(faces[i].tensor || tensor([]), parent.config, i, faces.length) : null;
parent.performance.liveness = env2.perfadd ? (parent.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
livenessRes = ((_g = instance.config.face.liveness) == null ? void 0 : _g.enabled) ? await predict14(faces[i].tensor || tensor([]), instance.config, i, faces.length) : null;
instance.performance.liveness = env2.perfadd ? (instance.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
parent.analyze("End Liveness:");
parent.analyze("Start GEAR:");
if (parent.config.async) {
gearRes = ((_h = parent.config.face["gear"]) == null ? void 0 : _h.enabled) ? predict(faces[i].tensor || tensor([]), parent.config, i, faces.length) : {};
instance.analyze("End Liveness:");
instance.analyze("Start GEAR:");
if (instance.config.async) {
gearRes = ((_h = instance.config.face["gear"]) == null ? void 0 : _h.enabled) ? predict(faces[i].tensor || tensor([]), instance.config, i, faces.length) : {};
} else {
parent.state = "run:gear";
instance.state = "run:gear";
timeStamp = now();
gearRes = ((_i = parent.config.face["gear"]) == null ? void 0 : _i.enabled) ? await predict(faces[i].tensor || tensor([]), parent.config, i, faces.length) : {};
parent.performance.gear = Math.trunc(now() - timeStamp);
gearRes = ((_i = instance.config.face["gear"]) == null ? void 0 : _i.enabled) ? await predict(faces[i].tensor || tensor([]), instance.config, i, faces.length) : {};
instance.performance.gear = Math.trunc(now() - timeStamp);
}
parent.analyze("End GEAR:");
parent.analyze("Start SSRNet:");
if (parent.config.async) {
ageRes = ((_j = parent.config.face["ssrnet"]) == null ? void 0 : _j.enabled) ? predict2(faces[i].tensor || tensor([]), parent.config, i, faces.length) : {};
genderRes = ((_k = parent.config.face["ssrnet"]) == null ? void 0 : _k.enabled) ? predict3(faces[i].tensor || tensor([]), parent.config, i, faces.length) : {};
instance.analyze("End GEAR:");
instance.analyze("Start SSRNet:");
if (instance.config.async) {
ageRes = ((_j = instance.config.face["ssrnet"]) == null ? void 0 : _j.enabled) ? predict2(faces[i].tensor || tensor([]), instance.config, i, faces.length) : {};
genderRes = ((_k = instance.config.face["ssrnet"]) == null ? void 0 : _k.enabled) ? predict3(faces[i].tensor || tensor([]), instance.config, i, faces.length) : {};
} else {
parent.state = "run:ssrnet";
instance.state = "run:ssrnet";
timeStamp = now();
ageRes = ((_l = parent.config.face["ssrnet"]) == null ? void 0 : _l.enabled) ? await predict2(faces[i].tensor || tensor([]), parent.config, i, faces.length) : {};
genderRes = ((_m = parent.config.face["ssrnet"]) == null ? void 0 : _m.enabled) ? await predict3(faces[i].tensor || tensor([]), parent.config, i, faces.length) : {};
parent.performance.ssrnet = Math.trunc(now() - timeStamp);
ageRes = ((_l = instance.config.face["ssrnet"]) == null ? void 0 : _l.enabled) ? await predict2(faces[i].tensor || tensor([]), instance.config, i, faces.length) : {};
genderRes = ((_m = instance.config.face["ssrnet"]) == null ? void 0 : _m.enabled) ? await predict3(faces[i].tensor || tensor([]), instance.config, i, faces.length) : {};
instance.performance.ssrnet = Math.trunc(now() - timeStamp);
}
parent.analyze("End SSRNet:");
parent.analyze("Start MobileFaceNet:");
if (parent.config.async) {
mobilefacenetRes = ((_n = parent.config.face["mobilefacenet"]) == null ? void 0 : _n.enabled) ? predict9(faces[i].tensor || tensor([]), parent.config, i, faces.length) : {};
instance.analyze("End SSRNet:");
instance.analyze("Start MobileFaceNet:");
if (instance.config.async) {
mobilefacenetRes = ((_n = instance.config.face["mobilefacenet"]) == null ? void 0 : _n.enabled) ? predict9(faces[i].tensor || tensor([]), instance.config, i, faces.length) : {};
} else {
parent.state = "run:mobilefacenet";
instance.state = "run:mobilefacenet";
timeStamp = now();
mobilefacenetRes = ((_o = parent.config.face["mobilefacenet"]) == null ? void 0 : _o.enabled) ? await predict9(faces[i].tensor || tensor([]), parent.config, i, faces.length) : {};
parent.performance.mobilefacenet = Math.trunc(now() - timeStamp);
mobilefacenetRes = ((_o = instance.config.face["mobilefacenet"]) == null ? void 0 : _o.enabled) ? await predict9(faces[i].tensor || tensor([]), instance.config, i, faces.length) : {};
instance.performance.mobilefacenet = Math.trunc(now() - timeStamp);
}
parent.analyze("End MobileFaceNet:");
parent.analyze("Start Description:");
if (parent.config.async) {
descRes = ((_p = parent.config.face.description) == null ? void 0 : _p.enabled) ? predict11(faces[i].tensor || tensor([]), parent.config, i, faces.length) : null;
instance.analyze("End MobileFaceNet:");
instance.analyze("Start Description:");
if (instance.config.async) {
descRes = ((_p = instance.config.face.description) == null ? void 0 : _p.enabled) ? predict11(faces[i].tensor || tensor([]), instance.config, i, faces.length) : null;
} else {
parent.state = "run:description";
instance.state = "run:description";
timeStamp = now();
descRes = ((_q = parent.config.face.description) == null ? void 0 : _q.enabled) ? await predict11(faces[i].tensor || tensor([]), parent.config, i, faces.length) : null;
parent.performance.description = env2.perfadd ? (parent.performance.description || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
descRes = ((_q = instance.config.face.description) == null ? void 0 : _q.enabled) ? await predict11(faces[i].tensor || tensor([]), instance.config, i, faces.length) : null;
instance.performance.description = env2.perfadd ? (instance.performance.description || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
parent.analyze("End Description:");
if (parent.config.async) {
instance.analyze("End Description:");
if (instance.config.async) {
[ageRes, genderRes, emotionRes, mobilefacenetRes, descRes, gearRes, antispoofRes, livenessRes] = await Promise.all([ageRes, genderRes, emotionRes, mobilefacenetRes, descRes, gearRes, antispoofRes, livenessRes]);
}
parent.analyze("Finish Face:");
if (((_r = parent.config.face["ssrnet"]) == null ? void 0 : _r.enabled) && ageRes && genderRes)
instance.analyze("Finish Face:");
if (((_r = instance.config.face["ssrnet"]) == null ? void 0 : _r.enabled) && ageRes && genderRes)
descRes = { age: ageRes.age, gender: genderRes.gender, genderScore: genderRes.genderScore };
if (((_s = parent.config.face["gear"]) == null ? void 0 : _s.enabled) && gearRes)
if (((_s = instance.config.face["gear"]) == null ? void 0 : _s.enabled) && gearRes)
descRes = { age: gearRes.age, gender: gearRes.gender, genderScore: gearRes.genderScore, race: gearRes.race };
if (((_t = parent.config.face["mobilefacenet"]) == null ? void 0 : _t.enabled) && mobilefacenetRes)
if (((_t = instance.config.face["mobilefacenet"]) == null ? void 0 : _t.enabled) && mobilefacenetRes)
descRes.descriptor = mobilefacenetRes;
if (!((_u = parent.config.face.iris) == null ? void 0 : _u.enabled) && ((_w = (_v = faces[i]) == null ? void 0 : _v.annotations) == null ? void 0 : _w.leftEyeIris) && ((_y = (_x = faces[i]) == null ? void 0 : _x.annotations) == null ? void 0 : _y.rightEyeIris)) {
if (!((_u = instance.config.face.iris) == null ? void 0 : _u.enabled) && ((_w = (_v = faces[i]) == null ? void 0 : _v.annotations) == null ? void 0 : _w.leftEyeIris) && ((_y = (_x = faces[i]) == null ? void 0 : _x.annotations) == null ? void 0 : _y.rightEyeIris)) {
delete faces[i].annotations.leftEyeIris;
delete faces[i].annotations.rightEyeIris;
}
const irisSize = faces[i].annotations && faces[i].annotations.leftEyeIris && faces[i].annotations.leftEyeIris[0] && faces[i].annotations.rightEyeIris && faces[i].annotations.rightEyeIris[0] && faces[i].annotations.leftEyeIris.length > 0 && faces[i].annotations.rightEyeIris.length > 0 && faces[i].annotations.leftEyeIris[0] !== null && faces[i].annotations.rightEyeIris[0] !== null ? Math.max(Math.abs(faces[i].annotations.leftEyeIris[3][0] - faces[i].annotations.leftEyeIris[1][0]), Math.abs(faces[i].annotations.rightEyeIris[4][1] - faces[i].annotations.rightEyeIris[2][1])) / input2.shape[2] : 0;
const tensor2 = ((_z = parent.config.face.detector) == null ? void 0 : _z.return) ? squeeze(faces[i].tensor) : null;
const tensor2 = ((_z = instance.config.face.detector) == null ? void 0 : _z.return) ? squeeze(faces[i].tensor) : null;
dispose(faces[i].tensor);
if (faces[i].tensor)
delete faces[i].tensor;
@ -82348,18 +82409,18 @@ var detectFace = async (parent, input2) => {
if (tensor2)
res.tensor = tensor2;
faceRes.push(res);
parent.analyze("End Face");
instance.analyze("End Face");
}
parent.analyze("End FaceMesh:");
if (parent.config.async) {
if (parent.performance.face)
delete parent.performance.face;
if (parent.performance.age)
delete parent.performance.age;
if (parent.performance.gender)
delete parent.performance.gender;
if (parent.performance.emotion)
delete parent.performance.emotion;
instance.analyze("End FaceMesh:");
if (instance.config.async) {
if (instance.performance.face)
delete instance.performance.face;
if (instance.performance.age)
delete instance.performance.age;
if (instance.performance.gender)
delete instance.performance.gender;
if (instance.performance.emotion)
delete instance.performance.emotion;
}
return faceRes;
};
@ -82486,16 +82547,19 @@ var hand2 = (res) => {
};
// src/util/interpolate.ts
var bufferedResult = { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0 };
var bufferedResult = { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0, error: null };
var interpolateTime = 0;
function calc2(newResult, config3) {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A;
const t0 = now();
if (!newResult)
return { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0 };
return { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0, error: null };
const elapsed = Date.now() - newResult.timestamp;
const bufferedFactor = elapsed < 1e3 ? 8 - Math.log(elapsed + 1) : 1;
bufferedResult.canvas = newResult.canvas;
if (newResult.canvas)
bufferedResult.canvas = newResult.canvas;
if (newResult.error)
bufferedResult.error = newResult.error;
if (!bufferedResult.body || newResult.body.length !== bufferedResult.body.length) {
bufferedResult.body = JSON.parse(JSON.stringify(newResult.body));
} else {
@ -83517,7 +83581,7 @@ async function warmup(instance, userConfig) {
instance.state = "warmup";
if (userConfig)
instance.config = mergeDeep(instance.config, userConfig);
if (!instance.config.warmup || instance.config.warmup === "none")
if (!instance.config.warmup || instance.config.warmup.length === 0 || instance.config.warmup === "none")
return { error: "null" };
let res;
return new Promise(async (resolve) => {
@ -83617,7 +83681,7 @@ var Human = class {
person: (output, result, options3) => person(output, result, options3),
all: (output, result, options3) => all5(output, result, options3)
};
this.result = { face: [], body: [], hand: [], gesture: [], object: [], performance: {}, timestamp: 0, persons: [] };
this.result = { face: [], body: [], hand: [], gesture: [], object: [], performance: {}, timestamp: 0, persons: [], error: null };
this.process = { tensor: null, canvas: null };
this.faceTriangulation = triangulation;
this.faceUVMap = uvmap;
@ -83726,7 +83790,8 @@ var Human = class {
const error = __privateGet(this, _sanity).call(this, input2);
if (error) {
log(error, input2);
resolve({ error });
this.emit("error");
resolve({ face: [], body: [], hand: [], gesture: [], object: [], performance: this.performance, timestamp: now(), persons: [], error });
}
const timeStart = now();
await check(this);
@ -83740,7 +83805,8 @@ var Human = class {
if (!img.tensor) {
if (this.config.debug)
log("could not convert input to tensor");
resolve({ error: "could not convert input to tensor" });
this.emit("error");
resolve({ face: [], body: [], hand: [], gesture: [], object: [], performance: this.performance, timestamp: now(), persons: [], error: "could not convert input to tensor" });
return;
}
this.emit("image");
@ -83859,6 +83925,7 @@ var Human = class {
performance: this.performance,
canvas: this.process.canvas,
timestamp: Date.now(),
error: null,
get persons() {
return join2(faceRes, bodyRes, handRes, gestureRes, shape);
}

File diff suppressed because one or more lines are too long

136
dist/human.js vendored

File diff suppressed because one or more lines are too long

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

@ -89,20 +89,20 @@ __export(exports, {
});
// src/util/util.ts
function join(folder, file) {
const separator = folder.endsWith("/") ? "" : "/";
const skipJoin = file.startsWith(".") || file.startsWith("/") || file.startsWith("http:") || file.startsWith("https:") || file.startsWith("file:");
const path = skipJoin ? `${file}` : `${folder}${separator}${file}`;
if (!path.toLocaleLowerCase().includes(".json"))
throw new Error(`modelpath error: ${path} expecting json file`);
return path;
}
function log(...msg) {
const dt = new Date();
const ts = `${dt.getHours().toString().padStart(2, "0")}:${dt.getMinutes().toString().padStart(2, "0")}:${dt.getSeconds().toString().padStart(2, "0")}.${dt.getMilliseconds().toString().padStart(3, "0")}`;
if (msg)
console.log(ts, "Human:", ...msg);
}
function join(folder, file) {
const separator = folder.endsWith("/") ? "" : "/";
const skipJoin = file.startsWith(".") || file.startsWith("/") || file.startsWith("http:") || file.startsWith("https:") || file.startsWith("file:");
const path = skipJoin ? `${file}` : `${folder}${separator}${file}`;
if (!path.toLocaleLowerCase().includes(".json"))
throw new Error(`modelpath error: expecting json file: ${path}`);
return path;
}
var now = () => {
if (typeof performance !== "undefined")
return performance.now();
@ -391,21 +391,35 @@ var GLProgram = class {
__publicField(this, "id");
__publicField(this, "compile", (source, type) => {
const shader = this.gl.createShader(type);
if (!shader) {
log("filter: could not create shader");
return null;
}
this.gl.shaderSource(shader, source);
this.gl.compileShader(shader);
if (!this.gl.getShaderParameter(shader, this.gl.COMPILE_STATUS))
throw new Error(`filter: gl compile failed: ${this.gl.getShaderInfoLog(shader)}`);
if (!this.gl.getShaderParameter(shader, this.gl.COMPILE_STATUS)) {
log(`filter: gl compile failed: ${this.gl.getShaderInfoLog(shader)}`);
return null;
}
return shader;
});
this.gl = gl;
const vertexShader = this.compile(vertexSource, this.gl.VERTEX_SHADER);
const fragmentShader = this.compile(fragmentSource, this.gl.FRAGMENT_SHADER);
this.id = this.gl.createProgram();
if (!vertexShader || !fragmentShader)
return;
if (!this.id) {
log("filter: could not create webgl program");
return;
}
this.gl.attachShader(this.id, vertexShader);
this.gl.attachShader(this.id, fragmentShader);
this.gl.linkProgram(this.id);
if (!this.gl.getProgramParameter(this.id, this.gl.LINK_STATUS))
throw new Error(`filter: gl link failed: ${this.gl.getProgramInfoLog(this.id)}`);
if (!this.gl.getProgramParameter(this.id, this.gl.LINK_STATUS)) {
log(`filter: gl link failed: ${this.gl.getProgramInfoLog(this.id)}`);
return;
}
this.gl.useProgram(this.id);
collect(vertexSource, "attribute", this.attribute);
for (const a in this.attribute)
@ -429,8 +443,11 @@ function GLImageFilter() {
const shaderProgramCache = {};
const DRAW = { INTERMEDIATE: 1 };
const gl = fxcanvas.getContext("webgl");
if (!gl)
throw new Error("filter: cannot get webgl context");
this.gl = gl;
if (!gl) {
log("filter: cannot get webgl context");
return;
}
function resize(width, height) {
if (width === fxcanvas.width && height === fxcanvas.height)
return;
@ -497,6 +514,10 @@ function GLImageFilter() {
return currentProgram;
}
currentProgram = new GLProgram(gl, vertexIdentity, fragmentSource);
if (!currentProgram) {
log("filter: could not get webgl program");
return null;
}
const floatSize = Float32Array.BYTES_PER_ELEMENT;
const vertSize = 4 * floatSize;
gl.enableVertexAttribArray(currentProgram.attribute["pos"]);
@ -515,6 +536,8 @@ function GLImageFilter() {
m[19] /= 255;
const shader = m[18] === 1 && m[3] === 0 && m[8] === 0 && m[13] === 0 && m[15] === 0 && m[16] === 0 && m[17] === 0 && m[19] === 0 ? colorMatrixWithoutAlpha : colorMatrixWithAlpha;
const program = compileShader(shader);
if (!program)
return;
gl.uniform1fv(program.uniform["m"], m);
draw2();
},
@ -828,6 +851,8 @@ function GLImageFilter() {
const pixelSizeX = 1 / fxcanvas.width;
const pixelSizeY = 1 / fxcanvas.height;
const program = compileShader(convolution);
if (!program)
return;
gl.uniform1fv(program.uniform["m"], m);
gl.uniform2f(program.uniform["px"], pixelSizeX, pixelSizeY);
draw2();
@ -903,6 +928,8 @@ function GLImageFilter() {
const blurSizeX = size2 / 7 / fxcanvas.width;
const blurSizeY = size2 / 7 / fxcanvas.height;
const program = compileShader(blur);
if (!program)
return;
gl.uniform2f(program.uniform["px"], 0, blurSizeY);
draw2(DRAW.INTERMEDIATE);
gl.uniform2f(program.uniform["px"], blurSizeX, 0);
@ -912,6 +939,8 @@ function GLImageFilter() {
const blurSizeX = size2 / fxcanvas.width;
const blurSizeY = size2 / fxcanvas.height;
const program = compileShader(pixelate);
if (!program)
return;
gl.uniform2f(program.uniform["size"], blurSizeX, blurSizeY);
draw2();
}
@ -986,10 +1015,12 @@ function canvas(width, height) {
let c;
if (env.browser) {
if (env.worker) {
if (typeof OffscreenCanvas === "undefined")
throw new Error("canvas error: attempted to run in web worker but OffscreenCanvas is not supported");
c = new OffscreenCanvas(width, height);
} else {
if (typeof document === "undefined")
throw new Error("attempted to run in web worker but offscreenCanvas is not supported");
throw new Error("canvas error: attempted to run in browser but DOM is not defined");
c = document.createElement("canvas");
c.width = width;
c.height = height;
@ -1011,18 +1042,18 @@ function copy(input, output) {
async function process2(input, config3, getTensor = true) {
if (!input) {
if (config3.debug)
log("input is missing");
log("input error: input is missing");
return { tensor: null, canvas: null };
}
if (!(input instanceof tf2.Tensor) && !(typeof Image !== "undefined" && input instanceof Image) && !(typeof env.Canvas !== "undefined" && input instanceof env.Canvas) && !(typeof globalThis.Canvas !== "undefined" && input instanceof globalThis.Canvas) && !(typeof ImageData !== "undefined" && input instanceof ImageData) && !(typeof ImageBitmap !== "undefined" && input instanceof ImageBitmap) && !(typeof HTMLImageElement !== "undefined" && input instanceof HTMLImageElement) && !(typeof HTMLMediaElement !== "undefined" && input instanceof HTMLMediaElement) && !(typeof HTMLVideoElement !== "undefined" && input instanceof HTMLVideoElement) && !(typeof HTMLCanvasElement !== "undefined" && input instanceof HTMLCanvasElement) && !(typeof OffscreenCanvas !== "undefined" && input instanceof OffscreenCanvas)) {
throw new Error("input type is not recognized");
throw new Error("input error: type is not recognized");
}
if (input instanceof tf2.Tensor) {
let tensor3 = null;
if (input["isDisposedInternal"])
throw new Error("input tensor is disposed");
throw new Error("input error: attempted to use tensor but it is disposed");
if (!input["shape"])
throw new Error("input tensor has no shape");
throw new Error("input error: attempted to use tensor without a shape");
if (input.shape.length === 3) {
if (input.shape[2] === 3) {
tensor3 = tf2.expandDims(input, 0);
@ -1039,7 +1070,7 @@ async function process2(input, config3, getTensor = true) {
}
}
if (tensor3 == null || tensor3.shape.length !== 4 || tensor3.shape[0] !== 1 || tensor3.shape[3] !== 3)
throw new Error(`could not process input tensor with shape: ${input["shape"]}`);
throw new Error(`input error: attempted to use tensor with unrecognized shape: ${input["shape"]}`);
if (tensor3.dtype === "int32") {
const cast5 = tf2.cast(tensor3, "float32");
tf2.dispose(tensor3);
@ -1078,7 +1109,7 @@ async function process2(input, config3, getTensor = true) {
else if ((config3.filter.width || 0) > 0)
targetHeight = originalHeight * ((config3.filter.width || 0) / originalWidth);
if (!targetWidth || !targetHeight)
throw new Error("input cannot determine dimension");
throw new Error("input error: cannot determine dimension");
if (!inCanvas || (inCanvas == null ? void 0 : inCanvas.width) !== targetWidth || (inCanvas == null ? void 0 : inCanvas.height) !== targetHeight)
inCanvas = canvas(targetWidth, targetHeight);
const inCtx = inCanvas.getContext("2d");
@ -1100,8 +1131,11 @@ async function process2(input, config3, getTensor = true) {
if (!fx)
fx = env.browser ? new GLImageFilter() : null;
env.filter = !!fx;
if (!fx)
if (!fx || !fx.add) {
if (config3.debug)
log("input process error: cannot initialize filters");
return { tensor: null, canvas: inCanvas };
}
fx.reset();
if (config3.filter.brightness !== 0)
fx.add("brightness", config3.filter.brightness);
@ -1144,7 +1178,7 @@ async function process2(input, config3, getTensor = true) {
if (!getTensor)
return { tensor: null, canvas: outCanvas };
if (!outCanvas)
throw new Error("cannot create output canvas");
throw new Error("canvas error: cannot create output");
let pixels;
let depth = 3;
if (typeof ImageData !== "undefined" && input instanceof ImageData || input["data"] && input["width"] && input["height"]) {
@ -1180,7 +1214,7 @@ async function process2(input, config3, getTensor = true) {
pixels = rgb3;
}
if (!pixels)
throw new Error("cannot create tensor from input");
throw new Error("input error: cannot create tensor");
const casted = tf2.cast(pixels, "float32");
const tensor3 = config3.filter.equalization ? await histogramEqualization(casted) : tf2.expandDims(casted, 0);
tf2.dispose([pixels, casted]);
@ -1313,9 +1347,13 @@ var Env = class {
}
this.webgpu.supported = this.browser && typeof navigator["gpu"] !== "undefined";
this.webgpu.backend = this.backends.includes("webgpu");
if (this.webgpu.supported)
this.webgpu.adapter = (await navigator["gpu"].requestAdapter()).name;
this.kernels = tf3.getKernelsForBackend(tf3.getBackend()).map((kernel) => kernel.kernelName.toLowerCase());
try {
if (this.webgpu.supported)
this.webgpu.adapter = (await navigator["gpu"].requestAdapter()).name;
this.kernels = tf3.getKernelsForBackend(tf3.getBackend()).map((kernel) => kernel.kernelName.toLowerCase());
} catch (e) {
this.webgpu.supported = false;
}
}
async updateCPU() {
const cpu = { model: "", flags: [] };
@ -1346,7 +1384,7 @@ var env = new Env();
var tf34 = __toModule(require_tfjs_esm());
// package.json
var version = "2.5.1";
var version = "2.5.2";
// src/tfjs/humangl.ts
var tf29 = __toModule(require_tfjs_esm());
@ -10445,8 +10483,6 @@ async function load16(config3) {
model15 = await tf26.loadGraphModel(join(config3.modelBasePath, config3.object.modelPath || ""));
const inputs = Object.values(model15.modelSignature["inputs"]);
model15.inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : null;
if (!model15.inputSize)
throw new Error(`cannot determine model inputSize: ${config3.object.modelPath}`);
if (!model15 || !model15.modelUrl)
log("load model failed:", config3.object.modelPath);
else if (config3.debug)
@ -11152,7 +11188,7 @@ async function register(instance) {
log("error: humangl:", e.type);
log("possible browser memory leak using webgl or conflict with multiple backend registrations");
instance.emit("error");
throw new Error("browser webgl error");
throw new Error("backend error: webgl context lost");
});
config2.canvas.addEventListener("webglcontextrestored", (e) => {
log("error: humangl context restored:", e);
@ -11276,7 +11312,7 @@ async function check(instance, force = false) {
if (typeof (tf30 == null ? void 0 : tf30.setWasmPaths) !== "undefined")
await tf30.setWasmPaths(instance.config.wasmPath);
else
throw new Error("wasm backend is not loaded");
throw new Error("backend error: attempting to use wasm backend but wasm path is not set");
const simd = await tf30.env().getAsync("WASM_HAS_SIMD_SUPPORT");
const mt = await tf30.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT");
if (instance.config.debug)
@ -11355,9 +11391,18 @@ var options2 = {
};
var drawTime = 0;
var getCanvasContext = (input) => {
if (input && input.getContext)
return input.getContext("2d");
throw new Error("invalid canvas");
if (!input)
log("draw error: invalid canvas");
else if (!input.getContext)
log("draw error: canvas context not defined");
else {
const ctx = input.getContext("2d");
if (!ctx)
log("draw error: cannot get canvas context");
else
return ctx;
}
return null;
};
var rad2deg = (theta) => Math.round(theta * 180 / Math.PI);
function point(ctx, x, y, z, localOptions) {
@ -11454,6 +11499,8 @@ async function gesture(inCanvas2, result, drawOptions) {
return;
if (localOptions.drawGestures) {
const ctx = getCanvasContext(inCanvas2);
if (!ctx)
return;
ctx.font = localOptions.font;
ctx.fillStyle = localOptions.color;
let i = 1;
@ -11481,6 +11528,8 @@ async function face(inCanvas2, result, drawOptions) {
if (!result || !inCanvas2)
return;
const ctx = getCanvasContext(inCanvas2);
if (!ctx)
return;
for (const f of result) {
ctx.font = localOptions.font;
ctx.strokeStyle = localOptions.color;
@ -11613,6 +11662,8 @@ async function body(inCanvas2, result, drawOptions) {
if (!result || !inCanvas2)
return;
const ctx = getCanvasContext(inCanvas2);
if (!ctx)
return;
ctx.lineJoin = "round";
for (let i = 0; i < result.length; i++) {
ctx.strokeStyle = localOptions.color;
@ -11656,6 +11707,8 @@ async function hand(inCanvas2, result, drawOptions) {
if (!result || !inCanvas2)
return;
const ctx = getCanvasContext(inCanvas2);
if (!ctx)
return;
ctx.lineJoin = "round";
ctx.font = localOptions.font;
for (const h of result) {
@ -11722,6 +11775,8 @@ async function object(inCanvas2, result, drawOptions) {
if (!result || !inCanvas2)
return;
const ctx = getCanvasContext(inCanvas2);
if (!ctx)
return;
ctx.lineJoin = "round";
ctx.font = localOptions.font;
for (const h of result) {
@ -11747,6 +11802,8 @@ async function person(inCanvas2, result, drawOptions) {
if (!result || !inCanvas2)
return;
const ctx = getCanvasContext(inCanvas2);
if (!ctx)
return;
ctx.lineJoin = "round";
ctx.font = localOptions.font;
for (let i = 0; i < result.length; i++) {
@ -11771,6 +11828,8 @@ async function canvas2(input, output) {
if (!input || !output)
return;
const ctx = getCanvasContext(output);
if (!ctx)
return;
ctx.drawImage(input, 0, 0);
}
async function all(inCanvas2, result, drawOptions) {
@ -11809,6 +11868,8 @@ function insidePoly(x, y, polygon) {
async function mask(face5) {
if (!face5.tensor)
return face5.tensor;
if (!face5.mesh || face5.mesh.length < 100)
return face5.tensor;
const width = face5.tensor.shape[2] || 0;
const height = face5.tensor.shape[1] || 0;
const buffer = await face5.tensor.buffer();
@ -11939,7 +12000,7 @@ var calculateFaceAngle = (face5, imageSize) => {
};
// src/face/face.ts
var detectFace = async (parent, input) => {
var detectFace = async (instance, input) => {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
let timeStamp;
let ageRes;
@ -11951,114 +12012,114 @@ var detectFace = async (parent, input) => {
let livenessRes;
let descRes;
const faceRes = [];
parent.state = "run:face";
instance.state = "run:face";
timeStamp = now();
const faces = await predict10(input, parent.config);
parent.performance.face = env.perfadd ? (parent.performance.face || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
const faces = await predict10(input, instance.config);
instance.performance.face = env.perfadd ? (instance.performance.face || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
if (!input.shape || input.shape.length !== 4)
return [];
if (!faces)
return [];
for (let i = 0; i < faces.length; i++) {
parent.analyze("Get Face");
instance.analyze("Get Face");
if (!faces[i].tensor || faces[i].tensor["isDisposedInternal"]) {
log("Face object is disposed:", faces[i].tensor);
continue;
}
if ((_a = parent.config.face.detector) == null ? void 0 : _a.mask) {
if ((_a = instance.config.face.detector) == null ? void 0 : _a.mask) {
const masked = await mask(faces[i]);
tf32.dispose(faces[i].tensor);
faces[i].tensor = masked;
}
const rotation = faces[i].mesh && faces[i].mesh.length > 200 ? calculateFaceAngle(faces[i], [input.shape[2], input.shape[1]]) : null;
parent.analyze("Start Emotion:");
if (parent.config.async) {
emotionRes = ((_b = parent.config.face.emotion) == null ? void 0 : _b.enabled) ? predict8(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : null;
instance.analyze("Start Emotion:");
if (instance.config.async) {
emotionRes = ((_b = instance.config.face.emotion) == null ? void 0 : _b.enabled) ? predict8(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : null;
} else {
parent.state = "run:emotion";
instance.state = "run:emotion";
timeStamp = now();
emotionRes = ((_c = parent.config.face.emotion) == null ? void 0 : _c.enabled) ? await predict8(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : null;
parent.performance.emotion = env.perfadd ? (parent.performance.emotion || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
emotionRes = ((_c = instance.config.face.emotion) == null ? void 0 : _c.enabled) ? await predict8(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : null;
instance.performance.emotion = env.perfadd ? (instance.performance.emotion || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
parent.analyze("End Emotion:");
parent.analyze("Start AntiSpoof:");
if (parent.config.async) {
antispoofRes = ((_d = parent.config.face.antispoof) == null ? void 0 : _d.enabled) ? predict4(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : null;
instance.analyze("End Emotion:");
instance.analyze("Start AntiSpoof:");
if (instance.config.async) {
antispoofRes = ((_d = instance.config.face.antispoof) == null ? void 0 : _d.enabled) ? predict4(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : null;
} else {
parent.state = "run:antispoof";
instance.state = "run:antispoof";
timeStamp = now();
antispoofRes = ((_e = parent.config.face.antispoof) == null ? void 0 : _e.enabled) ? await predict4(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : null;
parent.performance.antispoof = env.perfadd ? (parent.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
antispoofRes = ((_e = instance.config.face.antispoof) == null ? void 0 : _e.enabled) ? await predict4(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : null;
instance.performance.antispoof = env.perfadd ? (instance.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
parent.analyze("End AntiSpoof:");
parent.analyze("Start Liveness:");
if (parent.config.async) {
livenessRes = ((_f = parent.config.face.liveness) == null ? void 0 : _f.enabled) ? predict14(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : null;
instance.analyze("End AntiSpoof:");
instance.analyze("Start Liveness:");
if (instance.config.async) {
livenessRes = ((_f = instance.config.face.liveness) == null ? void 0 : _f.enabled) ? predict14(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : null;
} else {
parent.state = "run:liveness";
instance.state = "run:liveness";
timeStamp = now();
livenessRes = ((_g = parent.config.face.liveness) == null ? void 0 : _g.enabled) ? await predict14(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : null;
parent.performance.liveness = env.perfadd ? (parent.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
livenessRes = ((_g = instance.config.face.liveness) == null ? void 0 : _g.enabled) ? await predict14(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : null;
instance.performance.liveness = env.perfadd ? (instance.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
parent.analyze("End Liveness:");
parent.analyze("Start GEAR:");
if (parent.config.async) {
gearRes = ((_h = parent.config.face["gear"]) == null ? void 0 : _h.enabled) ? predict(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : {};
instance.analyze("End Liveness:");
instance.analyze("Start GEAR:");
if (instance.config.async) {
gearRes = ((_h = instance.config.face["gear"]) == null ? void 0 : _h.enabled) ? predict(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : {};
} else {
parent.state = "run:gear";
instance.state = "run:gear";
timeStamp = now();
gearRes = ((_i = parent.config.face["gear"]) == null ? void 0 : _i.enabled) ? await predict(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : {};
parent.performance.gear = Math.trunc(now() - timeStamp);
gearRes = ((_i = instance.config.face["gear"]) == null ? void 0 : _i.enabled) ? await predict(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : {};
instance.performance.gear = Math.trunc(now() - timeStamp);
}
parent.analyze("End GEAR:");
parent.analyze("Start SSRNet:");
if (parent.config.async) {
ageRes = ((_j = parent.config.face["ssrnet"]) == null ? void 0 : _j.enabled) ? predict2(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : {};
genderRes = ((_k = parent.config.face["ssrnet"]) == null ? void 0 : _k.enabled) ? predict3(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : {};
instance.analyze("End GEAR:");
instance.analyze("Start SSRNet:");
if (instance.config.async) {
ageRes = ((_j = instance.config.face["ssrnet"]) == null ? void 0 : _j.enabled) ? predict2(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : {};
genderRes = ((_k = instance.config.face["ssrnet"]) == null ? void 0 : _k.enabled) ? predict3(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : {};
} else {
parent.state = "run:ssrnet";
instance.state = "run:ssrnet";
timeStamp = now();
ageRes = ((_l = parent.config.face["ssrnet"]) == null ? void 0 : _l.enabled) ? await predict2(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : {};
genderRes = ((_m = parent.config.face["ssrnet"]) == null ? void 0 : _m.enabled) ? await predict3(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : {};
parent.performance.ssrnet = Math.trunc(now() - timeStamp);
ageRes = ((_l = instance.config.face["ssrnet"]) == null ? void 0 : _l.enabled) ? await predict2(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : {};
genderRes = ((_m = instance.config.face["ssrnet"]) == null ? void 0 : _m.enabled) ? await predict3(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : {};
instance.performance.ssrnet = Math.trunc(now() - timeStamp);
}
parent.analyze("End SSRNet:");
parent.analyze("Start MobileFaceNet:");
if (parent.config.async) {
mobilefacenetRes = ((_n = parent.config.face["mobilefacenet"]) == null ? void 0 : _n.enabled) ? predict9(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : {};
instance.analyze("End SSRNet:");
instance.analyze("Start MobileFaceNet:");
if (instance.config.async) {
mobilefacenetRes = ((_n = instance.config.face["mobilefacenet"]) == null ? void 0 : _n.enabled) ? predict9(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : {};
} else {
parent.state = "run:mobilefacenet";
instance.state = "run:mobilefacenet";
timeStamp = now();
mobilefacenetRes = ((_o = parent.config.face["mobilefacenet"]) == null ? void 0 : _o.enabled) ? await predict9(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : {};
parent.performance.mobilefacenet = Math.trunc(now() - timeStamp);
mobilefacenetRes = ((_o = instance.config.face["mobilefacenet"]) == null ? void 0 : _o.enabled) ? await predict9(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : {};
instance.performance.mobilefacenet = Math.trunc(now() - timeStamp);
}
parent.analyze("End MobileFaceNet:");
parent.analyze("Start Description:");
if (parent.config.async) {
descRes = ((_p = parent.config.face.description) == null ? void 0 : _p.enabled) ? predict11(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : null;
instance.analyze("End MobileFaceNet:");
instance.analyze("Start Description:");
if (instance.config.async) {
descRes = ((_p = instance.config.face.description) == null ? void 0 : _p.enabled) ? predict11(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : null;
} else {
parent.state = "run:description";
instance.state = "run:description";
timeStamp = now();
descRes = ((_q = parent.config.face.description) == null ? void 0 : _q.enabled) ? await predict11(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : null;
parent.performance.description = env.perfadd ? (parent.performance.description || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
descRes = ((_q = instance.config.face.description) == null ? void 0 : _q.enabled) ? await predict11(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : null;
instance.performance.description = env.perfadd ? (instance.performance.description || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
parent.analyze("End Description:");
if (parent.config.async) {
instance.analyze("End Description:");
if (instance.config.async) {
[ageRes, genderRes, emotionRes, mobilefacenetRes, descRes, gearRes, antispoofRes, livenessRes] = await Promise.all([ageRes, genderRes, emotionRes, mobilefacenetRes, descRes, gearRes, antispoofRes, livenessRes]);
}
parent.analyze("Finish Face:");
if (((_r = parent.config.face["ssrnet"]) == null ? void 0 : _r.enabled) && ageRes && genderRes)
instance.analyze("Finish Face:");
if (((_r = instance.config.face["ssrnet"]) == null ? void 0 : _r.enabled) && ageRes && genderRes)
descRes = { age: ageRes.age, gender: genderRes.gender, genderScore: genderRes.genderScore };
if (((_s = parent.config.face["gear"]) == null ? void 0 : _s.enabled) && gearRes)
if (((_s = instance.config.face["gear"]) == null ? void 0 : _s.enabled) && gearRes)
descRes = { age: gearRes.age, gender: gearRes.gender, genderScore: gearRes.genderScore, race: gearRes.race };
if (((_t = parent.config.face["mobilefacenet"]) == null ? void 0 : _t.enabled) && mobilefacenetRes)
if (((_t = instance.config.face["mobilefacenet"]) == null ? void 0 : _t.enabled) && mobilefacenetRes)
descRes.descriptor = mobilefacenetRes;
if (!((_u = parent.config.face.iris) == null ? void 0 : _u.enabled) && ((_w = (_v = faces[i]) == null ? void 0 : _v.annotations) == null ? void 0 : _w.leftEyeIris) && ((_y = (_x = faces[i]) == null ? void 0 : _x.annotations) == null ? void 0 : _y.rightEyeIris)) {
if (!((_u = instance.config.face.iris) == null ? void 0 : _u.enabled) && ((_w = (_v = faces[i]) == null ? void 0 : _v.annotations) == null ? void 0 : _w.leftEyeIris) && ((_y = (_x = faces[i]) == null ? void 0 : _x.annotations) == null ? void 0 : _y.rightEyeIris)) {
delete faces[i].annotations.leftEyeIris;
delete faces[i].annotations.rightEyeIris;
}
const irisSize = faces[i].annotations && faces[i].annotations.leftEyeIris && faces[i].annotations.leftEyeIris[0] && faces[i].annotations.rightEyeIris && faces[i].annotations.rightEyeIris[0] && faces[i].annotations.leftEyeIris.length > 0 && faces[i].annotations.rightEyeIris.length > 0 && faces[i].annotations.leftEyeIris[0] !== null && faces[i].annotations.rightEyeIris[0] !== null ? Math.max(Math.abs(faces[i].annotations.leftEyeIris[3][0] - faces[i].annotations.leftEyeIris[1][0]), Math.abs(faces[i].annotations.rightEyeIris[4][1] - faces[i].annotations.rightEyeIris[2][1])) / input.shape[2] : 0;
const tensor3 = ((_z = parent.config.face.detector) == null ? void 0 : _z.return) ? tf32.squeeze(faces[i].tensor) : null;
const tensor3 = ((_z = instance.config.face.detector) == null ? void 0 : _z.return) ? tf32.squeeze(faces[i].tensor) : null;
tf32.dispose(faces[i].tensor);
if (faces[i].tensor)
delete faces[i].tensor;
@ -12089,18 +12150,18 @@ var detectFace = async (parent, input) => {
if (tensor3)
res.tensor = tensor3;
faceRes.push(res);
parent.analyze("End Face");
instance.analyze("End Face");
}
parent.analyze("End FaceMesh:");
if (parent.config.async) {
if (parent.performance.face)
delete parent.performance.face;
if (parent.performance.age)
delete parent.performance.age;
if (parent.performance.gender)
delete parent.performance.gender;
if (parent.performance.emotion)
delete parent.performance.emotion;
instance.analyze("End FaceMesh:");
if (instance.config.async) {
if (instance.performance.face)
delete instance.performance.face;
if (instance.performance.age)
delete instance.performance.age;
if (instance.performance.gender)
delete instance.performance.gender;
if (instance.performance.emotion)
delete instance.performance.emotion;
}
return faceRes;
};
@ -12227,16 +12288,19 @@ var hand2 = (res) => {
};
// src/util/interpolate.ts
var bufferedResult = { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0 };
var bufferedResult = { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0, error: null };
var interpolateTime = 0;
function calc2(newResult, config3) {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A;
const t0 = now();
if (!newResult)
return { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0 };
return { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0, error: null };
const elapsed = Date.now() - newResult.timestamp;
const bufferedFactor = elapsed < 1e3 ? 8 - Math.log(elapsed + 1) : 1;
bufferedResult.canvas = newResult.canvas;
if (newResult.canvas)
bufferedResult.canvas = newResult.canvas;
if (newResult.error)
bufferedResult.error = newResult.error;
if (!bufferedResult.body || newResult.body.length !== bufferedResult.body.length) {
bufferedResult.body = JSON.parse(JSON.stringify(newResult.body));
} else {
@ -13259,7 +13323,7 @@ async function warmup(instance, userConfig) {
instance.state = "warmup";
if (userConfig)
instance.config = mergeDeep(instance.config, userConfig);
if (!instance.config.warmup || instance.config.warmup === "none")
if (!instance.config.warmup || instance.config.warmup.length === 0 || instance.config.warmup === "none")
return { error: "null" };
let res;
return new Promise(async (resolve) => {
@ -13359,7 +13423,7 @@ var Human = class {
person: (output, result, options3) => person(output, result, options3),
all: (output, result, options3) => all(output, result, options3)
};
this.result = { face: [], body: [], hand: [], gesture: [], object: [], performance: {}, timestamp: 0, persons: [] };
this.result = { face: [], body: [], hand: [], gesture: [], object: [], performance: {}, timestamp: 0, persons: [], error: null };
this.process = { tensor: null, canvas: null };
this.faceTriangulation = triangulation;
this.faceUVMap = uvmap;
@ -13468,7 +13532,8 @@ var Human = class {
const error = __privateGet(this, _sanity).call(this, input);
if (error) {
log(error, input);
resolve({ error });
this.emit("error");
resolve({ face: [], body: [], hand: [], gesture: [], object: [], performance: this.performance, timestamp: now(), persons: [], error });
}
const timeStart = now();
await check(this);
@ -13482,7 +13547,8 @@ var Human = class {
if (!img.tensor) {
if (this.config.debug)
log("could not convert input to tensor");
resolve({ error: "could not convert input to tensor" });
this.emit("error");
resolve({ face: [], body: [], hand: [], gesture: [], object: [], performance: this.performance, timestamp: now(), persons: [], error: "could not convert input to tensor" });
return;
}
this.emit("image");
@ -13601,6 +13667,7 @@ var Human = class {
performance: this.performance,
canvas: this.process.canvas,
timestamp: Date.now(),
error: null,
get persons() {
return join2(faceRes, bodyRes, handRes, gestureRes, shape);
}

View File

@ -90,20 +90,20 @@ __export(exports, {
});
// src/util/util.ts
function join(folder, file) {
const separator = folder.endsWith("/") ? "" : "/";
const skipJoin = file.startsWith(".") || file.startsWith("/") || file.startsWith("http:") || file.startsWith("https:") || file.startsWith("file:");
const path = skipJoin ? `${file}` : `${folder}${separator}${file}`;
if (!path.toLocaleLowerCase().includes(".json"))
throw new Error(`modelpath error: ${path} expecting json file`);
return path;
}
function log(...msg) {
const dt = new Date();
const ts = `${dt.getHours().toString().padStart(2, "0")}:${dt.getMinutes().toString().padStart(2, "0")}:${dt.getSeconds().toString().padStart(2, "0")}.${dt.getMilliseconds().toString().padStart(3, "0")}`;
if (msg)
console.log(ts, "Human:", ...msg);
}
function join(folder, file) {
const separator = folder.endsWith("/") ? "" : "/";
const skipJoin = file.startsWith(".") || file.startsWith("/") || file.startsWith("http:") || file.startsWith("https:") || file.startsWith("file:");
const path = skipJoin ? `${file}` : `${folder}${separator}${file}`;
if (!path.toLocaleLowerCase().includes(".json"))
throw new Error(`modelpath error: expecting json file: ${path}`);
return path;
}
var now = () => {
if (typeof performance !== "undefined")
return performance.now();
@ -392,21 +392,35 @@ var GLProgram = class {
__publicField(this, "id");
__publicField(this, "compile", (source, type) => {
const shader = this.gl.createShader(type);
if (!shader) {
log("filter: could not create shader");
return null;
}
this.gl.shaderSource(shader, source);
this.gl.compileShader(shader);
if (!this.gl.getShaderParameter(shader, this.gl.COMPILE_STATUS))
throw new Error(`filter: gl compile failed: ${this.gl.getShaderInfoLog(shader)}`);
if (!this.gl.getShaderParameter(shader, this.gl.COMPILE_STATUS)) {
log(`filter: gl compile failed: ${this.gl.getShaderInfoLog(shader)}`);
return null;
}
return shader;
});
this.gl = gl;
const vertexShader = this.compile(vertexSource, this.gl.VERTEX_SHADER);
const fragmentShader = this.compile(fragmentSource, this.gl.FRAGMENT_SHADER);
this.id = this.gl.createProgram();
if (!vertexShader || !fragmentShader)
return;
if (!this.id) {
log("filter: could not create webgl program");
return;
}
this.gl.attachShader(this.id, vertexShader);
this.gl.attachShader(this.id, fragmentShader);
this.gl.linkProgram(this.id);
if (!this.gl.getProgramParameter(this.id, this.gl.LINK_STATUS))
throw new Error(`filter: gl link failed: ${this.gl.getProgramInfoLog(this.id)}`);
if (!this.gl.getProgramParameter(this.id, this.gl.LINK_STATUS)) {
log(`filter: gl link failed: ${this.gl.getProgramInfoLog(this.id)}`);
return;
}
this.gl.useProgram(this.id);
collect(vertexSource, "attribute", this.attribute);
for (const a in this.attribute)
@ -430,8 +444,11 @@ function GLImageFilter() {
const shaderProgramCache = {};
const DRAW = { INTERMEDIATE: 1 };
const gl = fxcanvas.getContext("webgl");
if (!gl)
throw new Error("filter: cannot get webgl context");
this.gl = gl;
if (!gl) {
log("filter: cannot get webgl context");
return;
}
function resize(width, height) {
if (width === fxcanvas.width && height === fxcanvas.height)
return;
@ -498,6 +515,10 @@ function GLImageFilter() {
return currentProgram;
}
currentProgram = new GLProgram(gl, vertexIdentity, fragmentSource);
if (!currentProgram) {
log("filter: could not get webgl program");
return null;
}
const floatSize = Float32Array.BYTES_PER_ELEMENT;
const vertSize = 4 * floatSize;
gl.enableVertexAttribArray(currentProgram.attribute["pos"]);
@ -516,6 +537,8 @@ function GLImageFilter() {
m[19] /= 255;
const shader = m[18] === 1 && m[3] === 0 && m[8] === 0 && m[13] === 0 && m[15] === 0 && m[16] === 0 && m[17] === 0 && m[19] === 0 ? colorMatrixWithoutAlpha : colorMatrixWithAlpha;
const program = compileShader(shader);
if (!program)
return;
gl.uniform1fv(program.uniform["m"], m);
draw2();
},
@ -829,6 +852,8 @@ function GLImageFilter() {
const pixelSizeX = 1 / fxcanvas.width;
const pixelSizeY = 1 / fxcanvas.height;
const program = compileShader(convolution);
if (!program)
return;
gl.uniform1fv(program.uniform["m"], m);
gl.uniform2f(program.uniform["px"], pixelSizeX, pixelSizeY);
draw2();
@ -904,6 +929,8 @@ function GLImageFilter() {
const blurSizeX = size2 / 7 / fxcanvas.width;
const blurSizeY = size2 / 7 / fxcanvas.height;
const program = compileShader(blur);
if (!program)
return;
gl.uniform2f(program.uniform["px"], 0, blurSizeY);
draw2(DRAW.INTERMEDIATE);
gl.uniform2f(program.uniform["px"], blurSizeX, 0);
@ -913,6 +940,8 @@ function GLImageFilter() {
const blurSizeX = size2 / fxcanvas.width;
const blurSizeY = size2 / fxcanvas.height;
const program = compileShader(pixelate);
if (!program)
return;
gl.uniform2f(program.uniform["size"], blurSizeX, blurSizeY);
draw2();
}
@ -987,10 +1016,12 @@ function canvas(width, height) {
let c;
if (env.browser) {
if (env.worker) {
if (typeof OffscreenCanvas === "undefined")
throw new Error("canvas error: attempted to run in web worker but OffscreenCanvas is not supported");
c = new OffscreenCanvas(width, height);
} else {
if (typeof document === "undefined")
throw new Error("attempted to run in web worker but offscreenCanvas is not supported");
throw new Error("canvas error: attempted to run in browser but DOM is not defined");
c = document.createElement("canvas");
c.width = width;
c.height = height;
@ -1012,18 +1043,18 @@ function copy(input, output) {
async function process2(input, config3, getTensor = true) {
if (!input) {
if (config3.debug)
log("input is missing");
log("input error: input is missing");
return { tensor: null, canvas: null };
}
if (!(input instanceof tf2.Tensor) && !(typeof Image !== "undefined" && input instanceof Image) && !(typeof env.Canvas !== "undefined" && input instanceof env.Canvas) && !(typeof globalThis.Canvas !== "undefined" && input instanceof globalThis.Canvas) && !(typeof ImageData !== "undefined" && input instanceof ImageData) && !(typeof ImageBitmap !== "undefined" && input instanceof ImageBitmap) && !(typeof HTMLImageElement !== "undefined" && input instanceof HTMLImageElement) && !(typeof HTMLMediaElement !== "undefined" && input instanceof HTMLMediaElement) && !(typeof HTMLVideoElement !== "undefined" && input instanceof HTMLVideoElement) && !(typeof HTMLCanvasElement !== "undefined" && input instanceof HTMLCanvasElement) && !(typeof OffscreenCanvas !== "undefined" && input instanceof OffscreenCanvas)) {
throw new Error("input type is not recognized");
throw new Error("input error: type is not recognized");
}
if (input instanceof tf2.Tensor) {
let tensor3 = null;
if (input["isDisposedInternal"])
throw new Error("input tensor is disposed");
throw new Error("input error: attempted to use tensor but it is disposed");
if (!input["shape"])
throw new Error("input tensor has no shape");
throw new Error("input error: attempted to use tensor without a shape");
if (input.shape.length === 3) {
if (input.shape[2] === 3) {
tensor3 = tf2.expandDims(input, 0);
@ -1040,7 +1071,7 @@ async function process2(input, config3, getTensor = true) {
}
}
if (tensor3 == null || tensor3.shape.length !== 4 || tensor3.shape[0] !== 1 || tensor3.shape[3] !== 3)
throw new Error(`could not process input tensor with shape: ${input["shape"]}`);
throw new Error(`input error: attempted to use tensor with unrecognized shape: ${input["shape"]}`);
if (tensor3.dtype === "int32") {
const cast5 = tf2.cast(tensor3, "float32");
tf2.dispose(tensor3);
@ -1079,7 +1110,7 @@ async function process2(input, config3, getTensor = true) {
else if ((config3.filter.width || 0) > 0)
targetHeight = originalHeight * ((config3.filter.width || 0) / originalWidth);
if (!targetWidth || !targetHeight)
throw new Error("input cannot determine dimension");
throw new Error("input error: cannot determine dimension");
if (!inCanvas || (inCanvas == null ? void 0 : inCanvas.width) !== targetWidth || (inCanvas == null ? void 0 : inCanvas.height) !== targetHeight)
inCanvas = canvas(targetWidth, targetHeight);
const inCtx = inCanvas.getContext("2d");
@ -1101,8 +1132,11 @@ async function process2(input, config3, getTensor = true) {
if (!fx)
fx = env.browser ? new GLImageFilter() : null;
env.filter = !!fx;
if (!fx)
if (!fx || !fx.add) {
if (config3.debug)
log("input process error: cannot initialize filters");
return { tensor: null, canvas: inCanvas };
}
fx.reset();
if (config3.filter.brightness !== 0)
fx.add("brightness", config3.filter.brightness);
@ -1145,7 +1179,7 @@ async function process2(input, config3, getTensor = true) {
if (!getTensor)
return { tensor: null, canvas: outCanvas };
if (!outCanvas)
throw new Error("cannot create output canvas");
throw new Error("canvas error: cannot create output");
let pixels;
let depth = 3;
if (typeof ImageData !== "undefined" && input instanceof ImageData || input["data"] && input["width"] && input["height"]) {
@ -1181,7 +1215,7 @@ async function process2(input, config3, getTensor = true) {
pixels = rgb3;
}
if (!pixels)
throw new Error("cannot create tensor from input");
throw new Error("input error: cannot create tensor");
const casted = tf2.cast(pixels, "float32");
const tensor3 = config3.filter.equalization ? await histogramEqualization(casted) : tf2.expandDims(casted, 0);
tf2.dispose([pixels, casted]);
@ -1314,9 +1348,13 @@ var Env = class {
}
this.webgpu.supported = this.browser && typeof navigator["gpu"] !== "undefined";
this.webgpu.backend = this.backends.includes("webgpu");
if (this.webgpu.supported)
this.webgpu.adapter = (await navigator["gpu"].requestAdapter()).name;
this.kernels = tf3.getKernelsForBackend(tf3.getBackend()).map((kernel) => kernel.kernelName.toLowerCase());
try {
if (this.webgpu.supported)
this.webgpu.adapter = (await navigator["gpu"].requestAdapter()).name;
this.kernels = tf3.getKernelsForBackend(tf3.getBackend()).map((kernel) => kernel.kernelName.toLowerCase());
} catch (e) {
this.webgpu.supported = false;
}
}
async updateCPU() {
const cpu = { model: "", flags: [] };
@ -1347,7 +1385,7 @@ var env = new Env();
var tf34 = __toModule(require_tfjs_esm());
// package.json
var version = "2.5.1";
var version = "2.5.2";
// src/tfjs/humangl.ts
var tf29 = __toModule(require_tfjs_esm());
@ -10446,8 +10484,6 @@ async function load16(config3) {
model15 = await tf26.loadGraphModel(join(config3.modelBasePath, config3.object.modelPath || ""));
const inputs = Object.values(model15.modelSignature["inputs"]);
model15.inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : null;
if (!model15.inputSize)
throw new Error(`cannot determine model inputSize: ${config3.object.modelPath}`);
if (!model15 || !model15.modelUrl)
log("load model failed:", config3.object.modelPath);
else if (config3.debug)
@ -11153,7 +11189,7 @@ async function register(instance) {
log("error: humangl:", e.type);
log("possible browser memory leak using webgl or conflict with multiple backend registrations");
instance.emit("error");
throw new Error("browser webgl error");
throw new Error("backend error: webgl context lost");
});
config2.canvas.addEventListener("webglcontextrestored", (e) => {
log("error: humangl context restored:", e);
@ -11277,7 +11313,7 @@ async function check(instance, force = false) {
if (typeof (tf30 == null ? void 0 : tf30.setWasmPaths) !== "undefined")
await tf30.setWasmPaths(instance.config.wasmPath);
else
throw new Error("wasm backend is not loaded");
throw new Error("backend error: attempting to use wasm backend but wasm path is not set");
const simd = await tf30.env().getAsync("WASM_HAS_SIMD_SUPPORT");
const mt = await tf30.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT");
if (instance.config.debug)
@ -11356,9 +11392,18 @@ var options2 = {
};
var drawTime = 0;
var getCanvasContext = (input) => {
if (input && input.getContext)
return input.getContext("2d");
throw new Error("invalid canvas");
if (!input)
log("draw error: invalid canvas");
else if (!input.getContext)
log("draw error: canvas context not defined");
else {
const ctx = input.getContext("2d");
if (!ctx)
log("draw error: cannot get canvas context");
else
return ctx;
}
return null;
};
var rad2deg = (theta) => Math.round(theta * 180 / Math.PI);
function point(ctx, x, y, z, localOptions) {
@ -11455,6 +11500,8 @@ async function gesture(inCanvas2, result, drawOptions) {
return;
if (localOptions.drawGestures) {
const ctx = getCanvasContext(inCanvas2);
if (!ctx)
return;
ctx.font = localOptions.font;
ctx.fillStyle = localOptions.color;
let i = 1;
@ -11482,6 +11529,8 @@ async function face(inCanvas2, result, drawOptions) {
if (!result || !inCanvas2)
return;
const ctx = getCanvasContext(inCanvas2);
if (!ctx)
return;
for (const f of result) {
ctx.font = localOptions.font;
ctx.strokeStyle = localOptions.color;
@ -11614,6 +11663,8 @@ async function body(inCanvas2, result, drawOptions) {
if (!result || !inCanvas2)
return;
const ctx = getCanvasContext(inCanvas2);
if (!ctx)
return;
ctx.lineJoin = "round";
for (let i = 0; i < result.length; i++) {
ctx.strokeStyle = localOptions.color;
@ -11657,6 +11708,8 @@ async function hand(inCanvas2, result, drawOptions) {
if (!result || !inCanvas2)
return;
const ctx = getCanvasContext(inCanvas2);
if (!ctx)
return;
ctx.lineJoin = "round";
ctx.font = localOptions.font;
for (const h of result) {
@ -11723,6 +11776,8 @@ async function object(inCanvas2, result, drawOptions) {
if (!result || !inCanvas2)
return;
const ctx = getCanvasContext(inCanvas2);
if (!ctx)
return;
ctx.lineJoin = "round";
ctx.font = localOptions.font;
for (const h of result) {
@ -11748,6 +11803,8 @@ async function person(inCanvas2, result, drawOptions) {
if (!result || !inCanvas2)
return;
const ctx = getCanvasContext(inCanvas2);
if (!ctx)
return;
ctx.lineJoin = "round";
ctx.font = localOptions.font;
for (let i = 0; i < result.length; i++) {
@ -11772,6 +11829,8 @@ async function canvas2(input, output) {
if (!input || !output)
return;
const ctx = getCanvasContext(output);
if (!ctx)
return;
ctx.drawImage(input, 0, 0);
}
async function all(inCanvas2, result, drawOptions) {
@ -11810,6 +11869,8 @@ function insidePoly(x, y, polygon) {
async function mask(face5) {
if (!face5.tensor)
return face5.tensor;
if (!face5.mesh || face5.mesh.length < 100)
return face5.tensor;
const width = face5.tensor.shape[2] || 0;
const height = face5.tensor.shape[1] || 0;
const buffer = await face5.tensor.buffer();
@ -11940,7 +12001,7 @@ var calculateFaceAngle = (face5, imageSize) => {
};
// src/face/face.ts
var detectFace = async (parent, input) => {
var detectFace = async (instance, input) => {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
let timeStamp;
let ageRes;
@ -11952,114 +12013,114 @@ var detectFace = async (parent, input) => {
let livenessRes;
let descRes;
const faceRes = [];
parent.state = "run:face";
instance.state = "run:face";
timeStamp = now();
const faces = await predict10(input, parent.config);
parent.performance.face = env.perfadd ? (parent.performance.face || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
const faces = await predict10(input, instance.config);
instance.performance.face = env.perfadd ? (instance.performance.face || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
if (!input.shape || input.shape.length !== 4)
return [];
if (!faces)
return [];
for (let i = 0; i < faces.length; i++) {
parent.analyze("Get Face");
instance.analyze("Get Face");
if (!faces[i].tensor || faces[i].tensor["isDisposedInternal"]) {
log("Face object is disposed:", faces[i].tensor);
continue;
}
if ((_a = parent.config.face.detector) == null ? void 0 : _a.mask) {
if ((_a = instance.config.face.detector) == null ? void 0 : _a.mask) {
const masked = await mask(faces[i]);
tf32.dispose(faces[i].tensor);
faces[i].tensor = masked;
}
const rotation = faces[i].mesh && faces[i].mesh.length > 200 ? calculateFaceAngle(faces[i], [input.shape[2], input.shape[1]]) : null;
parent.analyze("Start Emotion:");
if (parent.config.async) {
emotionRes = ((_b = parent.config.face.emotion) == null ? void 0 : _b.enabled) ? predict8(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : null;
instance.analyze("Start Emotion:");
if (instance.config.async) {
emotionRes = ((_b = instance.config.face.emotion) == null ? void 0 : _b.enabled) ? predict8(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : null;
} else {
parent.state = "run:emotion";
instance.state = "run:emotion";
timeStamp = now();
emotionRes = ((_c = parent.config.face.emotion) == null ? void 0 : _c.enabled) ? await predict8(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : null;
parent.performance.emotion = env.perfadd ? (parent.performance.emotion || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
emotionRes = ((_c = instance.config.face.emotion) == null ? void 0 : _c.enabled) ? await predict8(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : null;
instance.performance.emotion = env.perfadd ? (instance.performance.emotion || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
parent.analyze("End Emotion:");
parent.analyze("Start AntiSpoof:");
if (parent.config.async) {
antispoofRes = ((_d = parent.config.face.antispoof) == null ? void 0 : _d.enabled) ? predict4(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : null;
instance.analyze("End Emotion:");
instance.analyze("Start AntiSpoof:");
if (instance.config.async) {
antispoofRes = ((_d = instance.config.face.antispoof) == null ? void 0 : _d.enabled) ? predict4(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : null;
} else {
parent.state = "run:antispoof";
instance.state = "run:antispoof";
timeStamp = now();
antispoofRes = ((_e = parent.config.face.antispoof) == null ? void 0 : _e.enabled) ? await predict4(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : null;
parent.performance.antispoof = env.perfadd ? (parent.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
antispoofRes = ((_e = instance.config.face.antispoof) == null ? void 0 : _e.enabled) ? await predict4(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : null;
instance.performance.antispoof = env.perfadd ? (instance.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
parent.analyze("End AntiSpoof:");
parent.analyze("Start Liveness:");
if (parent.config.async) {
livenessRes = ((_f = parent.config.face.liveness) == null ? void 0 : _f.enabled) ? predict14(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : null;
instance.analyze("End AntiSpoof:");
instance.analyze("Start Liveness:");
if (instance.config.async) {
livenessRes = ((_f = instance.config.face.liveness) == null ? void 0 : _f.enabled) ? predict14(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : null;
} else {
parent.state = "run:liveness";
instance.state = "run:liveness";
timeStamp = now();
livenessRes = ((_g = parent.config.face.liveness) == null ? void 0 : _g.enabled) ? await predict14(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : null;
parent.performance.liveness = env.perfadd ? (parent.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
livenessRes = ((_g = instance.config.face.liveness) == null ? void 0 : _g.enabled) ? await predict14(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : null;
instance.performance.liveness = env.perfadd ? (instance.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
parent.analyze("End Liveness:");
parent.analyze("Start GEAR:");
if (parent.config.async) {
gearRes = ((_h = parent.config.face["gear"]) == null ? void 0 : _h.enabled) ? predict(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : {};
instance.analyze("End Liveness:");
instance.analyze("Start GEAR:");
if (instance.config.async) {
gearRes = ((_h = instance.config.face["gear"]) == null ? void 0 : _h.enabled) ? predict(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : {};
} else {
parent.state = "run:gear";
instance.state = "run:gear";
timeStamp = now();
gearRes = ((_i = parent.config.face["gear"]) == null ? void 0 : _i.enabled) ? await predict(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : {};
parent.performance.gear = Math.trunc(now() - timeStamp);
gearRes = ((_i = instance.config.face["gear"]) == null ? void 0 : _i.enabled) ? await predict(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : {};
instance.performance.gear = Math.trunc(now() - timeStamp);
}
parent.analyze("End GEAR:");
parent.analyze("Start SSRNet:");
if (parent.config.async) {
ageRes = ((_j = parent.config.face["ssrnet"]) == null ? void 0 : _j.enabled) ? predict2(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : {};
genderRes = ((_k = parent.config.face["ssrnet"]) == null ? void 0 : _k.enabled) ? predict3(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : {};
instance.analyze("End GEAR:");
instance.analyze("Start SSRNet:");
if (instance.config.async) {
ageRes = ((_j = instance.config.face["ssrnet"]) == null ? void 0 : _j.enabled) ? predict2(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : {};
genderRes = ((_k = instance.config.face["ssrnet"]) == null ? void 0 : _k.enabled) ? predict3(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : {};
} else {
parent.state = "run:ssrnet";
instance.state = "run:ssrnet";
timeStamp = now();
ageRes = ((_l = parent.config.face["ssrnet"]) == null ? void 0 : _l.enabled) ? await predict2(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : {};
genderRes = ((_m = parent.config.face["ssrnet"]) == null ? void 0 : _m.enabled) ? await predict3(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : {};
parent.performance.ssrnet = Math.trunc(now() - timeStamp);
ageRes = ((_l = instance.config.face["ssrnet"]) == null ? void 0 : _l.enabled) ? await predict2(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : {};
genderRes = ((_m = instance.config.face["ssrnet"]) == null ? void 0 : _m.enabled) ? await predict3(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : {};
instance.performance.ssrnet = Math.trunc(now() - timeStamp);
}
parent.analyze("End SSRNet:");
parent.analyze("Start MobileFaceNet:");
if (parent.config.async) {
mobilefacenetRes = ((_n = parent.config.face["mobilefacenet"]) == null ? void 0 : _n.enabled) ? predict9(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : {};
instance.analyze("End SSRNet:");
instance.analyze("Start MobileFaceNet:");
if (instance.config.async) {
mobilefacenetRes = ((_n = instance.config.face["mobilefacenet"]) == null ? void 0 : _n.enabled) ? predict9(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : {};
} else {
parent.state = "run:mobilefacenet";
instance.state = "run:mobilefacenet";
timeStamp = now();
mobilefacenetRes = ((_o = parent.config.face["mobilefacenet"]) == null ? void 0 : _o.enabled) ? await predict9(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : {};
parent.performance.mobilefacenet = Math.trunc(now() - timeStamp);
mobilefacenetRes = ((_o = instance.config.face["mobilefacenet"]) == null ? void 0 : _o.enabled) ? await predict9(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : {};
instance.performance.mobilefacenet = Math.trunc(now() - timeStamp);
}
parent.analyze("End MobileFaceNet:");
parent.analyze("Start Description:");
if (parent.config.async) {
descRes = ((_p = parent.config.face.description) == null ? void 0 : _p.enabled) ? predict11(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : null;
instance.analyze("End MobileFaceNet:");
instance.analyze("Start Description:");
if (instance.config.async) {
descRes = ((_p = instance.config.face.description) == null ? void 0 : _p.enabled) ? predict11(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : null;
} else {
parent.state = "run:description";
instance.state = "run:description";
timeStamp = now();
descRes = ((_q = parent.config.face.description) == null ? void 0 : _q.enabled) ? await predict11(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : null;
parent.performance.description = env.perfadd ? (parent.performance.description || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
descRes = ((_q = instance.config.face.description) == null ? void 0 : _q.enabled) ? await predict11(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : null;
instance.performance.description = env.perfadd ? (instance.performance.description || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
parent.analyze("End Description:");
if (parent.config.async) {
instance.analyze("End Description:");
if (instance.config.async) {
[ageRes, genderRes, emotionRes, mobilefacenetRes, descRes, gearRes, antispoofRes, livenessRes] = await Promise.all([ageRes, genderRes, emotionRes, mobilefacenetRes, descRes, gearRes, antispoofRes, livenessRes]);
}
parent.analyze("Finish Face:");
if (((_r = parent.config.face["ssrnet"]) == null ? void 0 : _r.enabled) && ageRes && genderRes)
instance.analyze("Finish Face:");
if (((_r = instance.config.face["ssrnet"]) == null ? void 0 : _r.enabled) && ageRes && genderRes)
descRes = { age: ageRes.age, gender: genderRes.gender, genderScore: genderRes.genderScore };
if (((_s = parent.config.face["gear"]) == null ? void 0 : _s.enabled) && gearRes)
if (((_s = instance.config.face["gear"]) == null ? void 0 : _s.enabled) && gearRes)
descRes = { age: gearRes.age, gender: gearRes.gender, genderScore: gearRes.genderScore, race: gearRes.race };
if (((_t = parent.config.face["mobilefacenet"]) == null ? void 0 : _t.enabled) && mobilefacenetRes)
if (((_t = instance.config.face["mobilefacenet"]) == null ? void 0 : _t.enabled) && mobilefacenetRes)
descRes.descriptor = mobilefacenetRes;
if (!((_u = parent.config.face.iris) == null ? void 0 : _u.enabled) && ((_w = (_v = faces[i]) == null ? void 0 : _v.annotations) == null ? void 0 : _w.leftEyeIris) && ((_y = (_x = faces[i]) == null ? void 0 : _x.annotations) == null ? void 0 : _y.rightEyeIris)) {
if (!((_u = instance.config.face.iris) == null ? void 0 : _u.enabled) && ((_w = (_v = faces[i]) == null ? void 0 : _v.annotations) == null ? void 0 : _w.leftEyeIris) && ((_y = (_x = faces[i]) == null ? void 0 : _x.annotations) == null ? void 0 : _y.rightEyeIris)) {
delete faces[i].annotations.leftEyeIris;
delete faces[i].annotations.rightEyeIris;
}
const irisSize = faces[i].annotations && faces[i].annotations.leftEyeIris && faces[i].annotations.leftEyeIris[0] && faces[i].annotations.rightEyeIris && faces[i].annotations.rightEyeIris[0] && faces[i].annotations.leftEyeIris.length > 0 && faces[i].annotations.rightEyeIris.length > 0 && faces[i].annotations.leftEyeIris[0] !== null && faces[i].annotations.rightEyeIris[0] !== null ? Math.max(Math.abs(faces[i].annotations.leftEyeIris[3][0] - faces[i].annotations.leftEyeIris[1][0]), Math.abs(faces[i].annotations.rightEyeIris[4][1] - faces[i].annotations.rightEyeIris[2][1])) / input.shape[2] : 0;
const tensor3 = ((_z = parent.config.face.detector) == null ? void 0 : _z.return) ? tf32.squeeze(faces[i].tensor) : null;
const tensor3 = ((_z = instance.config.face.detector) == null ? void 0 : _z.return) ? tf32.squeeze(faces[i].tensor) : null;
tf32.dispose(faces[i].tensor);
if (faces[i].tensor)
delete faces[i].tensor;
@ -12090,18 +12151,18 @@ var detectFace = async (parent, input) => {
if (tensor3)
res.tensor = tensor3;
faceRes.push(res);
parent.analyze("End Face");
instance.analyze("End Face");
}
parent.analyze("End FaceMesh:");
if (parent.config.async) {
if (parent.performance.face)
delete parent.performance.face;
if (parent.performance.age)
delete parent.performance.age;
if (parent.performance.gender)
delete parent.performance.gender;
if (parent.performance.emotion)
delete parent.performance.emotion;
instance.analyze("End FaceMesh:");
if (instance.config.async) {
if (instance.performance.face)
delete instance.performance.face;
if (instance.performance.age)
delete instance.performance.age;
if (instance.performance.gender)
delete instance.performance.gender;
if (instance.performance.emotion)
delete instance.performance.emotion;
}
return faceRes;
};
@ -12228,16 +12289,19 @@ var hand2 = (res) => {
};
// src/util/interpolate.ts
var bufferedResult = { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0 };
var bufferedResult = { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0, error: null };
var interpolateTime = 0;
function calc2(newResult, config3) {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A;
const t0 = now();
if (!newResult)
return { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0 };
return { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0, error: null };
const elapsed = Date.now() - newResult.timestamp;
const bufferedFactor = elapsed < 1e3 ? 8 - Math.log(elapsed + 1) : 1;
bufferedResult.canvas = newResult.canvas;
if (newResult.canvas)
bufferedResult.canvas = newResult.canvas;
if (newResult.error)
bufferedResult.error = newResult.error;
if (!bufferedResult.body || newResult.body.length !== bufferedResult.body.length) {
bufferedResult.body = JSON.parse(JSON.stringify(newResult.body));
} else {
@ -13260,7 +13324,7 @@ async function warmup(instance, userConfig) {
instance.state = "warmup";
if (userConfig)
instance.config = mergeDeep(instance.config, userConfig);
if (!instance.config.warmup || instance.config.warmup === "none")
if (!instance.config.warmup || instance.config.warmup.length === 0 || instance.config.warmup === "none")
return { error: "null" };
let res;
return new Promise(async (resolve) => {
@ -13360,7 +13424,7 @@ var Human = class {
person: (output, result, options3) => person(output, result, options3),
all: (output, result, options3) => all(output, result, options3)
};
this.result = { face: [], body: [], hand: [], gesture: [], object: [], performance: {}, timestamp: 0, persons: [] };
this.result = { face: [], body: [], hand: [], gesture: [], object: [], performance: {}, timestamp: 0, persons: [], error: null };
this.process = { tensor: null, canvas: null };
this.faceTriangulation = triangulation;
this.faceUVMap = uvmap;
@ -13469,7 +13533,8 @@ var Human = class {
const error = __privateGet(this, _sanity).call(this, input);
if (error) {
log(error, input);
resolve({ error });
this.emit("error");
resolve({ face: [], body: [], hand: [], gesture: [], object: [], performance: this.performance, timestamp: now(), persons: [], error });
}
const timeStart = now();
await check(this);
@ -13483,7 +13548,8 @@ var Human = class {
if (!img.tensor) {
if (this.config.debug)
log("could not convert input to tensor");
resolve({ error: "could not convert input to tensor" });
this.emit("error");
resolve({ face: [], body: [], hand: [], gesture: [], object: [], performance: this.performance, timestamp: now(), persons: [], error: "could not convert input to tensor" });
return;
}
this.emit("image");
@ -13602,6 +13668,7 @@ var Human = class {
performance: this.performance,
canvas: this.process.canvas,
timestamp: Date.now(),
error: null,
get persons() {
return join2(faceRes, bodyRes, handRes, gestureRes, shape);
}

301
dist/human.node.js vendored
View File

@ -89,20 +89,20 @@ __export(exports, {
});
// src/util/util.ts
function join(folder, file) {
const separator = folder.endsWith("/") ? "" : "/";
const skipJoin = file.startsWith(".") || file.startsWith("/") || file.startsWith("http:") || file.startsWith("https:") || file.startsWith("file:");
const path = skipJoin ? `${file}` : `${folder}${separator}${file}`;
if (!path.toLocaleLowerCase().includes(".json"))
throw new Error(`modelpath error: ${path} expecting json file`);
return path;
}
function log(...msg) {
const dt = new Date();
const ts = `${dt.getHours().toString().padStart(2, "0")}:${dt.getMinutes().toString().padStart(2, "0")}:${dt.getSeconds().toString().padStart(2, "0")}.${dt.getMilliseconds().toString().padStart(3, "0")}`;
if (msg)
console.log(ts, "Human:", ...msg);
}
function join(folder, file) {
const separator = folder.endsWith("/") ? "" : "/";
const skipJoin = file.startsWith(".") || file.startsWith("/") || file.startsWith("http:") || file.startsWith("https:") || file.startsWith("file:");
const path = skipJoin ? `${file}` : `${folder}${separator}${file}`;
if (!path.toLocaleLowerCase().includes(".json"))
throw new Error(`modelpath error: expecting json file: ${path}`);
return path;
}
var now = () => {
if (typeof performance !== "undefined")
return performance.now();
@ -391,21 +391,35 @@ var GLProgram = class {
__publicField(this, "id");
__publicField(this, "compile", (source, type) => {
const shader = this.gl.createShader(type);
if (!shader) {
log("filter: could not create shader");
return null;
}
this.gl.shaderSource(shader, source);
this.gl.compileShader(shader);
if (!this.gl.getShaderParameter(shader, this.gl.COMPILE_STATUS))
throw new Error(`filter: gl compile failed: ${this.gl.getShaderInfoLog(shader)}`);
if (!this.gl.getShaderParameter(shader, this.gl.COMPILE_STATUS)) {
log(`filter: gl compile failed: ${this.gl.getShaderInfoLog(shader)}`);
return null;
}
return shader;
});
this.gl = gl;
const vertexShader = this.compile(vertexSource, this.gl.VERTEX_SHADER);
const fragmentShader = this.compile(fragmentSource, this.gl.FRAGMENT_SHADER);
this.id = this.gl.createProgram();
if (!vertexShader || !fragmentShader)
return;
if (!this.id) {
log("filter: could not create webgl program");
return;
}
this.gl.attachShader(this.id, vertexShader);
this.gl.attachShader(this.id, fragmentShader);
this.gl.linkProgram(this.id);
if (!this.gl.getProgramParameter(this.id, this.gl.LINK_STATUS))
throw new Error(`filter: gl link failed: ${this.gl.getProgramInfoLog(this.id)}`);
if (!this.gl.getProgramParameter(this.id, this.gl.LINK_STATUS)) {
log(`filter: gl link failed: ${this.gl.getProgramInfoLog(this.id)}`);
return;
}
this.gl.useProgram(this.id);
collect(vertexSource, "attribute", this.attribute);
for (const a in this.attribute)
@ -429,8 +443,11 @@ function GLImageFilter() {
const shaderProgramCache = {};
const DRAW = { INTERMEDIATE: 1 };
const gl = fxcanvas.getContext("webgl");
if (!gl)
throw new Error("filter: cannot get webgl context");
this.gl = gl;
if (!gl) {
log("filter: cannot get webgl context");
return;
}
function resize(width, height) {
if (width === fxcanvas.width && height === fxcanvas.height)
return;
@ -497,6 +514,10 @@ function GLImageFilter() {
return currentProgram;
}
currentProgram = new GLProgram(gl, vertexIdentity, fragmentSource);
if (!currentProgram) {
log("filter: could not get webgl program");
return null;
}
const floatSize = Float32Array.BYTES_PER_ELEMENT;
const vertSize = 4 * floatSize;
gl.enableVertexAttribArray(currentProgram.attribute["pos"]);
@ -515,6 +536,8 @@ function GLImageFilter() {
m[19] /= 255;
const shader = m[18] === 1 && m[3] === 0 && m[8] === 0 && m[13] === 0 && m[15] === 0 && m[16] === 0 && m[17] === 0 && m[19] === 0 ? colorMatrixWithoutAlpha : colorMatrixWithAlpha;
const program = compileShader(shader);
if (!program)
return;
gl.uniform1fv(program.uniform["m"], m);
draw2();
},
@ -828,6 +851,8 @@ function GLImageFilter() {
const pixelSizeX = 1 / fxcanvas.width;
const pixelSizeY = 1 / fxcanvas.height;
const program = compileShader(convolution);
if (!program)
return;
gl.uniform1fv(program.uniform["m"], m);
gl.uniform2f(program.uniform["px"], pixelSizeX, pixelSizeY);
draw2();
@ -903,6 +928,8 @@ function GLImageFilter() {
const blurSizeX = size2 / 7 / fxcanvas.width;
const blurSizeY = size2 / 7 / fxcanvas.height;
const program = compileShader(blur);
if (!program)
return;
gl.uniform2f(program.uniform["px"], 0, blurSizeY);
draw2(DRAW.INTERMEDIATE);
gl.uniform2f(program.uniform["px"], blurSizeX, 0);
@ -912,6 +939,8 @@ function GLImageFilter() {
const blurSizeX = size2 / fxcanvas.width;
const blurSizeY = size2 / fxcanvas.height;
const program = compileShader(pixelate);
if (!program)
return;
gl.uniform2f(program.uniform["size"], blurSizeX, blurSizeY);
draw2();
}
@ -986,10 +1015,12 @@ function canvas(width, height) {
let c;
if (env.browser) {
if (env.worker) {
if (typeof OffscreenCanvas === "undefined")
throw new Error("canvas error: attempted to run in web worker but OffscreenCanvas is not supported");
c = new OffscreenCanvas(width, height);
} else {
if (typeof document === "undefined")
throw new Error("attempted to run in web worker but offscreenCanvas is not supported");
throw new Error("canvas error: attempted to run in browser but DOM is not defined");
c = document.createElement("canvas");
c.width = width;
c.height = height;
@ -1011,18 +1042,18 @@ function copy(input, output) {
async function process2(input, config3, getTensor = true) {
if (!input) {
if (config3.debug)
log("input is missing");
log("input error: input is missing");
return { tensor: null, canvas: null };
}
if (!(input instanceof tf2.Tensor) && !(typeof Image !== "undefined" && input instanceof Image) && !(typeof env.Canvas !== "undefined" && input instanceof env.Canvas) && !(typeof globalThis.Canvas !== "undefined" && input instanceof globalThis.Canvas) && !(typeof ImageData !== "undefined" && input instanceof ImageData) && !(typeof ImageBitmap !== "undefined" && input instanceof ImageBitmap) && !(typeof HTMLImageElement !== "undefined" && input instanceof HTMLImageElement) && !(typeof HTMLMediaElement !== "undefined" && input instanceof HTMLMediaElement) && !(typeof HTMLVideoElement !== "undefined" && input instanceof HTMLVideoElement) && !(typeof HTMLCanvasElement !== "undefined" && input instanceof HTMLCanvasElement) && !(typeof OffscreenCanvas !== "undefined" && input instanceof OffscreenCanvas)) {
throw new Error("input type is not recognized");
throw new Error("input error: type is not recognized");
}
if (input instanceof tf2.Tensor) {
let tensor3 = null;
if (input["isDisposedInternal"])
throw new Error("input tensor is disposed");
throw new Error("input error: attempted to use tensor but it is disposed");
if (!input["shape"])
throw new Error("input tensor has no shape");
throw new Error("input error: attempted to use tensor without a shape");
if (input.shape.length === 3) {
if (input.shape[2] === 3) {
tensor3 = tf2.expandDims(input, 0);
@ -1039,7 +1070,7 @@ async function process2(input, config3, getTensor = true) {
}
}
if (tensor3 == null || tensor3.shape.length !== 4 || tensor3.shape[0] !== 1 || tensor3.shape[3] !== 3)
throw new Error(`could not process input tensor with shape: ${input["shape"]}`);
throw new Error(`input error: attempted to use tensor with unrecognized shape: ${input["shape"]}`);
if (tensor3.dtype === "int32") {
const cast5 = tf2.cast(tensor3, "float32");
tf2.dispose(tensor3);
@ -1078,7 +1109,7 @@ async function process2(input, config3, getTensor = true) {
else if ((config3.filter.width || 0) > 0)
targetHeight = originalHeight * ((config3.filter.width || 0) / originalWidth);
if (!targetWidth || !targetHeight)
throw new Error("input cannot determine dimension");
throw new Error("input error: cannot determine dimension");
if (!inCanvas || (inCanvas == null ? void 0 : inCanvas.width) !== targetWidth || (inCanvas == null ? void 0 : inCanvas.height) !== targetHeight)
inCanvas = canvas(targetWidth, targetHeight);
const inCtx = inCanvas.getContext("2d");
@ -1100,8 +1131,11 @@ async function process2(input, config3, getTensor = true) {
if (!fx)
fx = env.browser ? new GLImageFilter() : null;
env.filter = !!fx;
if (!fx)
if (!fx || !fx.add) {
if (config3.debug)
log("input process error: cannot initialize filters");
return { tensor: null, canvas: inCanvas };
}
fx.reset();
if (config3.filter.brightness !== 0)
fx.add("brightness", config3.filter.brightness);
@ -1144,7 +1178,7 @@ async function process2(input, config3, getTensor = true) {
if (!getTensor)
return { tensor: null, canvas: outCanvas };
if (!outCanvas)
throw new Error("cannot create output canvas");
throw new Error("canvas error: cannot create output");
let pixels;
let depth = 3;
if (typeof ImageData !== "undefined" && input instanceof ImageData || input["data"] && input["width"] && input["height"]) {
@ -1180,7 +1214,7 @@ async function process2(input, config3, getTensor = true) {
pixels = rgb3;
}
if (!pixels)
throw new Error("cannot create tensor from input");
throw new Error("input error: cannot create tensor");
const casted = tf2.cast(pixels, "float32");
const tensor3 = config3.filter.equalization ? await histogramEqualization(casted) : tf2.expandDims(casted, 0);
tf2.dispose([pixels, casted]);
@ -1313,9 +1347,13 @@ var Env = class {
}
this.webgpu.supported = this.browser && typeof navigator["gpu"] !== "undefined";
this.webgpu.backend = this.backends.includes("webgpu");
if (this.webgpu.supported)
this.webgpu.adapter = (await navigator["gpu"].requestAdapter()).name;
this.kernels = tf3.getKernelsForBackend(tf3.getBackend()).map((kernel) => kernel.kernelName.toLowerCase());
try {
if (this.webgpu.supported)
this.webgpu.adapter = (await navigator["gpu"].requestAdapter()).name;
this.kernels = tf3.getKernelsForBackend(tf3.getBackend()).map((kernel) => kernel.kernelName.toLowerCase());
} catch (e) {
this.webgpu.supported = false;
}
}
async updateCPU() {
const cpu = { model: "", flags: [] };
@ -1346,7 +1384,7 @@ var env = new Env();
var tf34 = __toModule(require_tfjs_esm());
// package.json
var version = "2.5.1";
var version = "2.5.2";
// src/tfjs/humangl.ts
var tf29 = __toModule(require_tfjs_esm());
@ -10445,8 +10483,6 @@ async function load16(config3) {
model15 = await tf26.loadGraphModel(join(config3.modelBasePath, config3.object.modelPath || ""));
const inputs = Object.values(model15.modelSignature["inputs"]);
model15.inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : null;
if (!model15.inputSize)
throw new Error(`cannot determine model inputSize: ${config3.object.modelPath}`);
if (!model15 || !model15.modelUrl)
log("load model failed:", config3.object.modelPath);
else if (config3.debug)
@ -11152,7 +11188,7 @@ async function register(instance) {
log("error: humangl:", e.type);
log("possible browser memory leak using webgl or conflict with multiple backend registrations");
instance.emit("error");
throw new Error("browser webgl error");
throw new Error("backend error: webgl context lost");
});
config2.canvas.addEventListener("webglcontextrestored", (e) => {
log("error: humangl context restored:", e);
@ -11276,7 +11312,7 @@ async function check(instance, force = false) {
if (typeof (tf30 == null ? void 0 : tf30.setWasmPaths) !== "undefined")
await tf30.setWasmPaths(instance.config.wasmPath);
else
throw new Error("wasm backend is not loaded");
throw new Error("backend error: attempting to use wasm backend but wasm path is not set");
const simd = await tf30.env().getAsync("WASM_HAS_SIMD_SUPPORT");
const mt = await tf30.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT");
if (instance.config.debug)
@ -11355,9 +11391,18 @@ var options2 = {
};
var drawTime = 0;
var getCanvasContext = (input) => {
if (input && input.getContext)
return input.getContext("2d");
throw new Error("invalid canvas");
if (!input)
log("draw error: invalid canvas");
else if (!input.getContext)
log("draw error: canvas context not defined");
else {
const ctx = input.getContext("2d");
if (!ctx)
log("draw error: cannot get canvas context");
else
return ctx;
}
return null;
};
var rad2deg = (theta) => Math.round(theta * 180 / Math.PI);
function point(ctx, x, y, z, localOptions) {
@ -11454,6 +11499,8 @@ async function gesture(inCanvas2, result, drawOptions) {
return;
if (localOptions.drawGestures) {
const ctx = getCanvasContext(inCanvas2);
if (!ctx)
return;
ctx.font = localOptions.font;
ctx.fillStyle = localOptions.color;
let i = 1;
@ -11481,6 +11528,8 @@ async function face(inCanvas2, result, drawOptions) {
if (!result || !inCanvas2)
return;
const ctx = getCanvasContext(inCanvas2);
if (!ctx)
return;
for (const f of result) {
ctx.font = localOptions.font;
ctx.strokeStyle = localOptions.color;
@ -11613,6 +11662,8 @@ async function body(inCanvas2, result, drawOptions) {
if (!result || !inCanvas2)
return;
const ctx = getCanvasContext(inCanvas2);
if (!ctx)
return;
ctx.lineJoin = "round";
for (let i = 0; i < result.length; i++) {
ctx.strokeStyle = localOptions.color;
@ -11656,6 +11707,8 @@ async function hand(inCanvas2, result, drawOptions) {
if (!result || !inCanvas2)
return;
const ctx = getCanvasContext(inCanvas2);
if (!ctx)
return;
ctx.lineJoin = "round";
ctx.font = localOptions.font;
for (const h of result) {
@ -11722,6 +11775,8 @@ async function object(inCanvas2, result, drawOptions) {
if (!result || !inCanvas2)
return;
const ctx = getCanvasContext(inCanvas2);
if (!ctx)
return;
ctx.lineJoin = "round";
ctx.font = localOptions.font;
for (const h of result) {
@ -11747,6 +11802,8 @@ async function person(inCanvas2, result, drawOptions) {
if (!result || !inCanvas2)
return;
const ctx = getCanvasContext(inCanvas2);
if (!ctx)
return;
ctx.lineJoin = "round";
ctx.font = localOptions.font;
for (let i = 0; i < result.length; i++) {
@ -11771,6 +11828,8 @@ async function canvas2(input, output) {
if (!input || !output)
return;
const ctx = getCanvasContext(output);
if (!ctx)
return;
ctx.drawImage(input, 0, 0);
}
async function all(inCanvas2, result, drawOptions) {
@ -11809,6 +11868,8 @@ function insidePoly(x, y, polygon) {
async function mask(face5) {
if (!face5.tensor)
return face5.tensor;
if (!face5.mesh || face5.mesh.length < 100)
return face5.tensor;
const width = face5.tensor.shape[2] || 0;
const height = face5.tensor.shape[1] || 0;
const buffer = await face5.tensor.buffer();
@ -11939,7 +12000,7 @@ var calculateFaceAngle = (face5, imageSize) => {
};
// src/face/face.ts
var detectFace = async (parent, input) => {
var detectFace = async (instance, input) => {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
let timeStamp;
let ageRes;
@ -11951,114 +12012,114 @@ var detectFace = async (parent, input) => {
let livenessRes;
let descRes;
const faceRes = [];
parent.state = "run:face";
instance.state = "run:face";
timeStamp = now();
const faces = await predict10(input, parent.config);
parent.performance.face = env.perfadd ? (parent.performance.face || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
const faces = await predict10(input, instance.config);
instance.performance.face = env.perfadd ? (instance.performance.face || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
if (!input.shape || input.shape.length !== 4)
return [];
if (!faces)
return [];
for (let i = 0; i < faces.length; i++) {
parent.analyze("Get Face");
instance.analyze("Get Face");
if (!faces[i].tensor || faces[i].tensor["isDisposedInternal"]) {
log("Face object is disposed:", faces[i].tensor);
continue;
}
if ((_a = parent.config.face.detector) == null ? void 0 : _a.mask) {
if ((_a = instance.config.face.detector) == null ? void 0 : _a.mask) {
const masked = await mask(faces[i]);
tf32.dispose(faces[i].tensor);
faces[i].tensor = masked;
}
const rotation = faces[i].mesh && faces[i].mesh.length > 200 ? calculateFaceAngle(faces[i], [input.shape[2], input.shape[1]]) : null;
parent.analyze("Start Emotion:");
if (parent.config.async) {
emotionRes = ((_b = parent.config.face.emotion) == null ? void 0 : _b.enabled) ? predict8(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : null;
instance.analyze("Start Emotion:");
if (instance.config.async) {
emotionRes = ((_b = instance.config.face.emotion) == null ? void 0 : _b.enabled) ? predict8(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : null;
} else {
parent.state = "run:emotion";
instance.state = "run:emotion";
timeStamp = now();
emotionRes = ((_c = parent.config.face.emotion) == null ? void 0 : _c.enabled) ? await predict8(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : null;
parent.performance.emotion = env.perfadd ? (parent.performance.emotion || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
emotionRes = ((_c = instance.config.face.emotion) == null ? void 0 : _c.enabled) ? await predict8(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : null;
instance.performance.emotion = env.perfadd ? (instance.performance.emotion || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
parent.analyze("End Emotion:");
parent.analyze("Start AntiSpoof:");
if (parent.config.async) {
antispoofRes = ((_d = parent.config.face.antispoof) == null ? void 0 : _d.enabled) ? predict4(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : null;
instance.analyze("End Emotion:");
instance.analyze("Start AntiSpoof:");
if (instance.config.async) {
antispoofRes = ((_d = instance.config.face.antispoof) == null ? void 0 : _d.enabled) ? predict4(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : null;
} else {
parent.state = "run:antispoof";
instance.state = "run:antispoof";
timeStamp = now();
antispoofRes = ((_e = parent.config.face.antispoof) == null ? void 0 : _e.enabled) ? await predict4(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : null;
parent.performance.antispoof = env.perfadd ? (parent.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
antispoofRes = ((_e = instance.config.face.antispoof) == null ? void 0 : _e.enabled) ? await predict4(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : null;
instance.performance.antispoof = env.perfadd ? (instance.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
parent.analyze("End AntiSpoof:");
parent.analyze("Start Liveness:");
if (parent.config.async) {
livenessRes = ((_f = parent.config.face.liveness) == null ? void 0 : _f.enabled) ? predict14(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : null;
instance.analyze("End AntiSpoof:");
instance.analyze("Start Liveness:");
if (instance.config.async) {
livenessRes = ((_f = instance.config.face.liveness) == null ? void 0 : _f.enabled) ? predict14(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : null;
} else {
parent.state = "run:liveness";
instance.state = "run:liveness";
timeStamp = now();
livenessRes = ((_g = parent.config.face.liveness) == null ? void 0 : _g.enabled) ? await predict14(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : null;
parent.performance.liveness = env.perfadd ? (parent.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
livenessRes = ((_g = instance.config.face.liveness) == null ? void 0 : _g.enabled) ? await predict14(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : null;
instance.performance.liveness = env.perfadd ? (instance.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
parent.analyze("End Liveness:");
parent.analyze("Start GEAR:");
if (parent.config.async) {
gearRes = ((_h = parent.config.face["gear"]) == null ? void 0 : _h.enabled) ? predict(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : {};
instance.analyze("End Liveness:");
instance.analyze("Start GEAR:");
if (instance.config.async) {
gearRes = ((_h = instance.config.face["gear"]) == null ? void 0 : _h.enabled) ? predict(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : {};
} else {
parent.state = "run:gear";
instance.state = "run:gear";
timeStamp = now();
gearRes = ((_i = parent.config.face["gear"]) == null ? void 0 : _i.enabled) ? await predict(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : {};
parent.performance.gear = Math.trunc(now() - timeStamp);
gearRes = ((_i = instance.config.face["gear"]) == null ? void 0 : _i.enabled) ? await predict(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : {};
instance.performance.gear = Math.trunc(now() - timeStamp);
}
parent.analyze("End GEAR:");
parent.analyze("Start SSRNet:");
if (parent.config.async) {
ageRes = ((_j = parent.config.face["ssrnet"]) == null ? void 0 : _j.enabled) ? predict2(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : {};
genderRes = ((_k = parent.config.face["ssrnet"]) == null ? void 0 : _k.enabled) ? predict3(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : {};
instance.analyze("End GEAR:");
instance.analyze("Start SSRNet:");
if (instance.config.async) {
ageRes = ((_j = instance.config.face["ssrnet"]) == null ? void 0 : _j.enabled) ? predict2(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : {};
genderRes = ((_k = instance.config.face["ssrnet"]) == null ? void 0 : _k.enabled) ? predict3(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : {};
} else {
parent.state = "run:ssrnet";
instance.state = "run:ssrnet";
timeStamp = now();
ageRes = ((_l = parent.config.face["ssrnet"]) == null ? void 0 : _l.enabled) ? await predict2(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : {};
genderRes = ((_m = parent.config.face["ssrnet"]) == null ? void 0 : _m.enabled) ? await predict3(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : {};
parent.performance.ssrnet = Math.trunc(now() - timeStamp);
ageRes = ((_l = instance.config.face["ssrnet"]) == null ? void 0 : _l.enabled) ? await predict2(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : {};
genderRes = ((_m = instance.config.face["ssrnet"]) == null ? void 0 : _m.enabled) ? await predict3(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : {};
instance.performance.ssrnet = Math.trunc(now() - timeStamp);
}
parent.analyze("End SSRNet:");
parent.analyze("Start MobileFaceNet:");
if (parent.config.async) {
mobilefacenetRes = ((_n = parent.config.face["mobilefacenet"]) == null ? void 0 : _n.enabled) ? predict9(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : {};
instance.analyze("End SSRNet:");
instance.analyze("Start MobileFaceNet:");
if (instance.config.async) {
mobilefacenetRes = ((_n = instance.config.face["mobilefacenet"]) == null ? void 0 : _n.enabled) ? predict9(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : {};
} else {
parent.state = "run:mobilefacenet";
instance.state = "run:mobilefacenet";
timeStamp = now();
mobilefacenetRes = ((_o = parent.config.face["mobilefacenet"]) == null ? void 0 : _o.enabled) ? await predict9(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : {};
parent.performance.mobilefacenet = Math.trunc(now() - timeStamp);
mobilefacenetRes = ((_o = instance.config.face["mobilefacenet"]) == null ? void 0 : _o.enabled) ? await predict9(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : {};
instance.performance.mobilefacenet = Math.trunc(now() - timeStamp);
}
parent.analyze("End MobileFaceNet:");
parent.analyze("Start Description:");
if (parent.config.async) {
descRes = ((_p = parent.config.face.description) == null ? void 0 : _p.enabled) ? predict11(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : null;
instance.analyze("End MobileFaceNet:");
instance.analyze("Start Description:");
if (instance.config.async) {
descRes = ((_p = instance.config.face.description) == null ? void 0 : _p.enabled) ? predict11(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : null;
} else {
parent.state = "run:description";
instance.state = "run:description";
timeStamp = now();
descRes = ((_q = parent.config.face.description) == null ? void 0 : _q.enabled) ? await predict11(faces[i].tensor || tf32.tensor([]), parent.config, i, faces.length) : null;
parent.performance.description = env.perfadd ? (parent.performance.description || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
descRes = ((_q = instance.config.face.description) == null ? void 0 : _q.enabled) ? await predict11(faces[i].tensor || tf32.tensor([]), instance.config, i, faces.length) : null;
instance.performance.description = env.perfadd ? (instance.performance.description || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
parent.analyze("End Description:");
if (parent.config.async) {
instance.analyze("End Description:");
if (instance.config.async) {
[ageRes, genderRes, emotionRes, mobilefacenetRes, descRes, gearRes, antispoofRes, livenessRes] = await Promise.all([ageRes, genderRes, emotionRes, mobilefacenetRes, descRes, gearRes, antispoofRes, livenessRes]);
}
parent.analyze("Finish Face:");
if (((_r = parent.config.face["ssrnet"]) == null ? void 0 : _r.enabled) && ageRes && genderRes)
instance.analyze("Finish Face:");
if (((_r = instance.config.face["ssrnet"]) == null ? void 0 : _r.enabled) && ageRes && genderRes)
descRes = { age: ageRes.age, gender: genderRes.gender, genderScore: genderRes.genderScore };
if (((_s = parent.config.face["gear"]) == null ? void 0 : _s.enabled) && gearRes)
if (((_s = instance.config.face["gear"]) == null ? void 0 : _s.enabled) && gearRes)
descRes = { age: gearRes.age, gender: gearRes.gender, genderScore: gearRes.genderScore, race: gearRes.race };
if (((_t = parent.config.face["mobilefacenet"]) == null ? void 0 : _t.enabled) && mobilefacenetRes)
if (((_t = instance.config.face["mobilefacenet"]) == null ? void 0 : _t.enabled) && mobilefacenetRes)
descRes.descriptor = mobilefacenetRes;
if (!((_u = parent.config.face.iris) == null ? void 0 : _u.enabled) && ((_w = (_v = faces[i]) == null ? void 0 : _v.annotations) == null ? void 0 : _w.leftEyeIris) && ((_y = (_x = faces[i]) == null ? void 0 : _x.annotations) == null ? void 0 : _y.rightEyeIris)) {
if (!((_u = instance.config.face.iris) == null ? void 0 : _u.enabled) && ((_w = (_v = faces[i]) == null ? void 0 : _v.annotations) == null ? void 0 : _w.leftEyeIris) && ((_y = (_x = faces[i]) == null ? void 0 : _x.annotations) == null ? void 0 : _y.rightEyeIris)) {
delete faces[i].annotations.leftEyeIris;
delete faces[i].annotations.rightEyeIris;
}
const irisSize = faces[i].annotations && faces[i].annotations.leftEyeIris && faces[i].annotations.leftEyeIris[0] && faces[i].annotations.rightEyeIris && faces[i].annotations.rightEyeIris[0] && faces[i].annotations.leftEyeIris.length > 0 && faces[i].annotations.rightEyeIris.length > 0 && faces[i].annotations.leftEyeIris[0] !== null && faces[i].annotations.rightEyeIris[0] !== null ? Math.max(Math.abs(faces[i].annotations.leftEyeIris[3][0] - faces[i].annotations.leftEyeIris[1][0]), Math.abs(faces[i].annotations.rightEyeIris[4][1] - faces[i].annotations.rightEyeIris[2][1])) / input.shape[2] : 0;
const tensor3 = ((_z = parent.config.face.detector) == null ? void 0 : _z.return) ? tf32.squeeze(faces[i].tensor) : null;
const tensor3 = ((_z = instance.config.face.detector) == null ? void 0 : _z.return) ? tf32.squeeze(faces[i].tensor) : null;
tf32.dispose(faces[i].tensor);
if (faces[i].tensor)
delete faces[i].tensor;
@ -12089,18 +12150,18 @@ var detectFace = async (parent, input) => {
if (tensor3)
res.tensor = tensor3;
faceRes.push(res);
parent.analyze("End Face");
instance.analyze("End Face");
}
parent.analyze("End FaceMesh:");
if (parent.config.async) {
if (parent.performance.face)
delete parent.performance.face;
if (parent.performance.age)
delete parent.performance.age;
if (parent.performance.gender)
delete parent.performance.gender;
if (parent.performance.emotion)
delete parent.performance.emotion;
instance.analyze("End FaceMesh:");
if (instance.config.async) {
if (instance.performance.face)
delete instance.performance.face;
if (instance.performance.age)
delete instance.performance.age;
if (instance.performance.gender)
delete instance.performance.gender;
if (instance.performance.emotion)
delete instance.performance.emotion;
}
return faceRes;
};
@ -12227,16 +12288,19 @@ var hand2 = (res) => {
};
// src/util/interpolate.ts
var bufferedResult = { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0 };
var bufferedResult = { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0, error: null };
var interpolateTime = 0;
function calc2(newResult, config3) {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A;
const t0 = now();
if (!newResult)
return { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0 };
return { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0, error: null };
const elapsed = Date.now() - newResult.timestamp;
const bufferedFactor = elapsed < 1e3 ? 8 - Math.log(elapsed + 1) : 1;
bufferedResult.canvas = newResult.canvas;
if (newResult.canvas)
bufferedResult.canvas = newResult.canvas;
if (newResult.error)
bufferedResult.error = newResult.error;
if (!bufferedResult.body || newResult.body.length !== bufferedResult.body.length) {
bufferedResult.body = JSON.parse(JSON.stringify(newResult.body));
} else {
@ -13259,7 +13323,7 @@ async function warmup(instance, userConfig) {
instance.state = "warmup";
if (userConfig)
instance.config = mergeDeep(instance.config, userConfig);
if (!instance.config.warmup || instance.config.warmup === "none")
if (!instance.config.warmup || instance.config.warmup.length === 0 || instance.config.warmup === "none")
return { error: "null" };
let res;
return new Promise(async (resolve) => {
@ -13359,7 +13423,7 @@ var Human = class {
person: (output, result, options3) => person(output, result, options3),
all: (output, result, options3) => all(output, result, options3)
};
this.result = { face: [], body: [], hand: [], gesture: [], object: [], performance: {}, timestamp: 0, persons: [] };
this.result = { face: [], body: [], hand: [], gesture: [], object: [], performance: {}, timestamp: 0, persons: [], error: null };
this.process = { tensor: null, canvas: null };
this.faceTriangulation = triangulation;
this.faceUVMap = uvmap;
@ -13468,7 +13532,8 @@ var Human = class {
const error = __privateGet(this, _sanity).call(this, input);
if (error) {
log(error, input);
resolve({ error });
this.emit("error");
resolve({ face: [], body: [], hand: [], gesture: [], object: [], performance: this.performance, timestamp: now(), persons: [], error });
}
const timeStart = now();
await check(this);
@ -13482,7 +13547,8 @@ var Human = class {
if (!img.tensor) {
if (this.config.debug)
log("could not convert input to tensor");
resolve({ error: "could not convert input to tensor" });
this.emit("error");
resolve({ face: [], body: [], hand: [], gesture: [], object: [], performance: this.performance, timestamp: now(), persons: [], error: "could not convert input to tensor" });
return;
}
this.emit("image");
@ -13601,6 +13667,7 @@ var Human = class {
performance: this.performance,
canvas: this.process.canvas,
timestamp: Date.now(),
error: null,
get persons() {
return join2(faceRes, bodyRes, handRes, gestureRes, shape);
}

View File

@ -190,6 +190,9 @@ export interface GestureConfig {
enabled: boolean,
}
export type BackendType = ['cpu', 'wasm', 'webgl', 'humangl', 'tensorflow', 'webgpu'];
export type WarmupType = ['' | 'none' | 'face' | 'full' | 'body'];
/**
* Configuration interface definition for **Human** library
*
@ -231,7 +234,7 @@ export interface Config {
*
* default: `full`
*/
warmup: 'none' | 'face' | 'full' | 'body',
warmup: '' | 'none' | 'face' | 'full' | 'body',
// warmup: string;
/** Base model path (typically starting with file://, http:// or https://) for all models

View File

@ -21,7 +21,7 @@ import type { Tensor } from '../tfjs/types';
import type { Human } from '../human';
import { calculateFaceAngle } from './angles';
export const detectFace = async (parent: Human /* instance of human */, input: Tensor): Promise<FaceResult[]> => {
export const detectFace = async (instance: Human /* instance of human */, input: Tensor): Promise<FaceResult[]> => {
// run facemesh, includes blazeface and iris
// eslint-disable-next-line no-async-promise-executor
let timeStamp;
@ -34,16 +34,16 @@ export const detectFace = async (parent: Human /* instance of human */, input: T
let livenessRes;
let descRes;
const faceRes: Array<FaceResult> = [];
parent.state = 'run:face';
instance.state = 'run:face';
timeStamp = now();
const faces = await facemesh.predict(input, parent.config);
parent.performance.face = env.perfadd ? (parent.performance.face || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
const faces = await facemesh.predict(input, instance.config);
instance.performance.face = env.perfadd ? (instance.performance.face || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
if (!input.shape || input.shape.length !== 4) return [];
if (!faces) return [];
// for (const face of faces) {
for (let i = 0; i < faces.length; i++) {
parent.analyze('Get Face');
instance.analyze('Get Face');
// is something went wrong, skip the face
// @ts-ignore possibly undefied
@ -53,7 +53,7 @@ export const detectFace = async (parent: Human /* instance of human */, input: T
}
// optional face mask
if (parent.config.face.detector?.mask) {
if (instance.config.face.detector?.mask) {
const masked = await mask.mask(faces[i]);
tf.dispose(faces[i].tensor);
faces[i].tensor = masked as Tensor;
@ -63,106 +63,106 @@ export const detectFace = async (parent: Human /* instance of human */, input: T
const rotation = faces[i].mesh && (faces[i].mesh.length > 200) ? calculateFaceAngle(faces[i], [input.shape[2], input.shape[1]]) : null;
// run emotion, inherits face from blazeface
parent.analyze('Start Emotion:');
if (parent.config.async) {
emotionRes = parent.config.face.emotion?.enabled ? emotion.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : null;
instance.analyze('Start Emotion:');
if (instance.config.async) {
emotionRes = instance.config.face.emotion?.enabled ? emotion.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : null;
} else {
parent.state = 'run:emotion';
instance.state = 'run:emotion';
timeStamp = now();
emotionRes = parent.config.face.emotion?.enabled ? await emotion.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : null;
parent.performance.emotion = env.perfadd ? (parent.performance.emotion || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
emotionRes = instance.config.face.emotion?.enabled ? await emotion.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : null;
instance.performance.emotion = env.perfadd ? (instance.performance.emotion || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
parent.analyze('End Emotion:');
instance.analyze('End Emotion:');
// run antispoof, inherits face from blazeface
parent.analyze('Start AntiSpoof:');
if (parent.config.async) {
antispoofRes = parent.config.face.antispoof?.enabled ? antispoof.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : null;
instance.analyze('Start AntiSpoof:');
if (instance.config.async) {
antispoofRes = instance.config.face.antispoof?.enabled ? antispoof.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : null;
} else {
parent.state = 'run:antispoof';
instance.state = 'run:antispoof';
timeStamp = now();
antispoofRes = parent.config.face.antispoof?.enabled ? await antispoof.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : null;
parent.performance.antispoof = env.perfadd ? (parent.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
antispoofRes = instance.config.face.antispoof?.enabled ? await antispoof.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : null;
instance.performance.antispoof = env.perfadd ? (instance.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
parent.analyze('End AntiSpoof:');
instance.analyze('End AntiSpoof:');
// run liveness, inherits face from blazeface
parent.analyze('Start Liveness:');
if (parent.config.async) {
livenessRes = parent.config.face.liveness?.enabled ? liveness.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : null;
instance.analyze('Start Liveness:');
if (instance.config.async) {
livenessRes = instance.config.face.liveness?.enabled ? liveness.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : null;
} else {
parent.state = 'run:liveness';
instance.state = 'run:liveness';
timeStamp = now();
livenessRes = parent.config.face.liveness?.enabled ? await liveness.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : null;
parent.performance.liveness = env.perfadd ? (parent.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
livenessRes = instance.config.face.liveness?.enabled ? await liveness.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : null;
instance.performance.liveness = env.perfadd ? (instance.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
parent.analyze('End Liveness:');
instance.analyze('End Liveness:');
// run gear, inherits face from blazeface
parent.analyze('Start GEAR:');
if (parent.config.async) {
gearRes = parent.config.face['gear']?.enabled ? gear.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : {};
instance.analyze('Start GEAR:');
if (instance.config.async) {
gearRes = instance.config.face['gear']?.enabled ? gear.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : {};
} else {
parent.state = 'run:gear';
instance.state = 'run:gear';
timeStamp = now();
gearRes = parent.config.face['gear']?.enabled ? await gear.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : {};
parent.performance.gear = Math.trunc(now() - timeStamp);
gearRes = instance.config.face['gear']?.enabled ? await gear.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : {};
instance.performance.gear = Math.trunc(now() - timeStamp);
}
parent.analyze('End GEAR:');
instance.analyze('End GEAR:');
// run gear, inherits face from blazeface
parent.analyze('Start SSRNet:');
if (parent.config.async) {
ageRes = parent.config.face['ssrnet']?.enabled ? ssrnetAge.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : {};
genderRes = parent.config.face['ssrnet']?.enabled ? ssrnetGender.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : {};
instance.analyze('Start SSRNet:');
if (instance.config.async) {
ageRes = instance.config.face['ssrnet']?.enabled ? ssrnetAge.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : {};
genderRes = instance.config.face['ssrnet']?.enabled ? ssrnetGender.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : {};
} else {
parent.state = 'run:ssrnet';
instance.state = 'run:ssrnet';
timeStamp = now();
ageRes = parent.config.face['ssrnet']?.enabled ? await ssrnetAge.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : {};
genderRes = parent.config.face['ssrnet']?.enabled ? await ssrnetGender.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : {};
parent.performance.ssrnet = Math.trunc(now() - timeStamp);
ageRes = instance.config.face['ssrnet']?.enabled ? await ssrnetAge.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : {};
genderRes = instance.config.face['ssrnet']?.enabled ? await ssrnetGender.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : {};
instance.performance.ssrnet = Math.trunc(now() - timeStamp);
}
parent.analyze('End SSRNet:');
instance.analyze('End SSRNet:');
// run gear, inherits face from blazeface
parent.analyze('Start MobileFaceNet:');
if (parent.config.async) {
mobilefacenetRes = parent.config.face['mobilefacenet']?.enabled ? mobilefacenet.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : {};
instance.analyze('Start MobileFaceNet:');
if (instance.config.async) {
mobilefacenetRes = instance.config.face['mobilefacenet']?.enabled ? mobilefacenet.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : {};
} else {
parent.state = 'run:mobilefacenet';
instance.state = 'run:mobilefacenet';
timeStamp = now();
mobilefacenetRes = parent.config.face['mobilefacenet']?.enabled ? await mobilefacenet.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : {};
parent.performance.mobilefacenet = Math.trunc(now() - timeStamp);
mobilefacenetRes = instance.config.face['mobilefacenet']?.enabled ? await mobilefacenet.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : {};
instance.performance.mobilefacenet = Math.trunc(now() - timeStamp);
}
parent.analyze('End MobileFaceNet:');
instance.analyze('End MobileFaceNet:');
// run emotion, inherits face from blazeface
parent.analyze('Start Description:');
if (parent.config.async) {
descRes = parent.config.face.description?.enabled ? faceres.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : null;
instance.analyze('Start Description:');
if (instance.config.async) {
descRes = instance.config.face.description?.enabled ? faceres.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : null;
} else {
parent.state = 'run:description';
instance.state = 'run:description';
timeStamp = now();
descRes = parent.config.face.description?.enabled ? await faceres.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : null;
parent.performance.description = env.perfadd ? (parent.performance.description || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
descRes = instance.config.face.description?.enabled ? await faceres.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : null;
instance.performance.description = env.perfadd ? (instance.performance.description || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
parent.analyze('End Description:');
instance.analyze('End Description:');
// if async wait for results
if (parent.config.async) {
if (instance.config.async) {
[ageRes, genderRes, emotionRes, mobilefacenetRes, descRes, gearRes, antispoofRes, livenessRes] = await Promise.all([ageRes, genderRes, emotionRes, mobilefacenetRes, descRes, gearRes, antispoofRes, livenessRes]);
}
parent.analyze('Finish Face:');
instance.analyze('Finish Face:');
// override age/gender if alternative models are used
if (parent.config.face['ssrnet']?.enabled && ageRes && genderRes) descRes = { age: ageRes.age, gender: genderRes.gender, genderScore: genderRes.genderScore };
if (parent.config.face['gear']?.enabled && gearRes) descRes = { age: gearRes.age, gender: gearRes.gender, genderScore: gearRes.genderScore, race: gearRes.race };
if (instance.config.face['ssrnet']?.enabled && ageRes && genderRes) descRes = { age: ageRes.age, gender: genderRes.gender, genderScore: genderRes.genderScore };
if (instance.config.face['gear']?.enabled && gearRes) descRes = { age: gearRes.age, gender: gearRes.gender, genderScore: gearRes.genderScore, race: gearRes.race };
// override descriptor if embedding model is used
if (parent.config.face['mobilefacenet']?.enabled && mobilefacenetRes) descRes.descriptor = mobilefacenetRes;
if (instance.config.face['mobilefacenet']?.enabled && mobilefacenetRes) descRes.descriptor = mobilefacenetRes;
// calculate iris distance
// iris: array[ center, left, top, right, bottom]
if (!parent.config.face.iris?.enabled && faces[i]?.annotations?.leftEyeIris && faces[i]?.annotations?.rightEyeIris) {
if (!instance.config.face.iris?.enabled && faces[i]?.annotations?.leftEyeIris && faces[i]?.annotations?.rightEyeIris) {
delete faces[i].annotations.leftEyeIris;
delete faces[i].annotations.rightEyeIris;
}
@ -173,7 +173,7 @@ export const detectFace = async (parent: Human /* instance of human */, input: T
: 0; // note: average human iris size is 11.7mm
// optionally return tensor
const tensor = parent.config.face.detector?.return ? tf.squeeze(faces[i].tensor) : null;
const tensor = instance.config.face.detector?.return ? tf.squeeze(faces[i].tensor) : null;
// dispose original face tensor
tf.dispose(faces[i].tensor);
// delete temp face image
@ -195,14 +195,14 @@ export const detectFace = async (parent: Human /* instance of human */, input: T
if (rotation) res.rotation = rotation;
if (tensor) res.tensor = tensor;
faceRes.push(res);
parent.analyze('End Face');
instance.analyze('End Face');
}
parent.analyze('End FaceMesh:');
if (parent.config.async) {
if (parent.performance.face) delete parent.performance.face;
if (parent.performance.age) delete parent.performance.age;
if (parent.performance.gender) delete parent.performance.gender;
if (parent.performance.emotion) delete parent.performance.emotion;
instance.analyze('End FaceMesh:');
if (instance.config.async) {
if (instance.performance.face) delete instance.performance.face;
if (instance.performance.age) delete instance.performance.age;
if (instance.performance.gender) delete instance.performance.gender;
if (instance.performance.emotion) delete instance.performance.emotion;
}
return faceRes;
};

View File

@ -18,6 +18,7 @@ function insidePoly(x: number, y: number, polygon: Array<{ x: number, y: number
export async function mask(face: FaceResult): Promise<Tensor | undefined> {
if (!face.tensor) return face.tensor;
if (!face.mesh || face.mesh.length < 100) return face.tensor;
const width = face.tensor.shape[2] || 0;
const height = face.tensor.shape[1] || 0;
const buffer = await face.tensor.buffer();

View File

@ -36,7 +36,7 @@ import * as posenet from './body/posenet';
import * as segmentation from './segmentation/segmentation';
import * as warmups from './warmup';
// type definitions
import type { Input, Tensor, DrawOptions, Config, Result, FaceResult, HandResult, BodyResult, ObjectResult, GestureResult, PersonResult } from './exports';
import type { Input, Tensor, DrawOptions, Config, Result, FaceResult, HandResult, BodyResult, ObjectResult, GestureResult, PersonResult, AnyCanvas } from './exports';
// type exports
export * from './exports';
@ -46,12 +46,6 @@ export * from './exports';
*/
export type TensorFlow = typeof tf;
/** Error message */
export type Error = {
/** @property error message */
error: string,
};
/** **Human** library main class
*
* All methods and properties are available only as members of Human class
@ -84,7 +78,7 @@ export class Human {
state: string;
/** currenty processed image tensor and canvas */
process: { tensor: Tensor | null, canvas: OffscreenCanvas | HTMLCanvasElement | null };
process: { tensor: Tensor | null, canvas: AnyCanvas | null };
/** Instance of TensorFlow/JS used by Human
* - Can be embedded or externally provided
@ -161,16 +155,16 @@ export class Human {
// reexport draw methods
this.draw = {
options: draw.options as DrawOptions,
canvas: (input: HTMLCanvasElement | OffscreenCanvas | HTMLImageElement | HTMLMediaElement | HTMLVideoElement, output: HTMLCanvasElement) => draw.canvas(input, output),
face: (output: HTMLCanvasElement | OffscreenCanvas, result: FaceResult[], options?: Partial<DrawOptions>) => draw.face(output, result, options),
body: (output: HTMLCanvasElement | OffscreenCanvas, result: BodyResult[], options?: Partial<DrawOptions>) => draw.body(output, result, options),
hand: (output: HTMLCanvasElement | OffscreenCanvas, result: HandResult[], options?: Partial<DrawOptions>) => draw.hand(output, result, options),
gesture: (output: HTMLCanvasElement | OffscreenCanvas, result: GestureResult[], options?: Partial<DrawOptions>) => draw.gesture(output, result, options),
object: (output: HTMLCanvasElement | OffscreenCanvas, result: ObjectResult[], options?: Partial<DrawOptions>) => draw.object(output, result, options),
person: (output: HTMLCanvasElement | OffscreenCanvas, result: PersonResult[], options?: Partial<DrawOptions>) => draw.person(output, result, options),
all: (output: HTMLCanvasElement | OffscreenCanvas, result: Result, options?: Partial<DrawOptions>) => draw.all(output, result, options),
canvas: (input: AnyCanvas | HTMLImageElement | HTMLMediaElement | HTMLVideoElement, output: AnyCanvas) => draw.canvas(input, output),
face: (output: AnyCanvas, result: FaceResult[], options?: Partial<DrawOptions>) => draw.face(output, result, options),
body: (output: AnyCanvas, result: BodyResult[], options?: Partial<DrawOptions>) => draw.body(output, result, options),
hand: (output: AnyCanvas, result: HandResult[], options?: Partial<DrawOptions>) => draw.hand(output, result, options),
gesture: (output: AnyCanvas, result: GestureResult[], options?: Partial<DrawOptions>) => draw.gesture(output, result, options),
object: (output: AnyCanvas, result: ObjectResult[], options?: Partial<DrawOptions>) => draw.object(output, result, options),
person: (output: AnyCanvas, result: PersonResult[], options?: Partial<DrawOptions>) => draw.person(output, result, options),
all: (output: AnyCanvas, result: Result, options?: Partial<DrawOptions>) => draw.all(output, result, options),
};
this.result = { face: [], body: [], hand: [], gesture: [], object: [], performance: {}, timestamp: 0, persons: [] };
this.result = { face: [], body: [], hand: [], gesture: [], object: [], performance: {}, timestamp: 0, persons: [], error: null };
// export access to image processing
// @ts-ignore eslint-typescript cannot correctly infer type in anonymous function
this.process = { tensor: null, canvas: null };
@ -253,7 +247,7 @@ export class Human {
* - `canvas` as canvas which is input image filtered with segementation data and optionally merged with background image. canvas alpha values are set to segmentation values for easy merging
* - `alpha` as grayscale canvas that represents segmentation alpha values
*/
async segmentation(input: Input, background?: Input): Promise<{ data: number[] | Tensor, canvas: HTMLCanvasElement | OffscreenCanvas | null, alpha: HTMLCanvasElement | OffscreenCanvas | null }> {
async segmentation(input: Input, background?: Input): Promise<{ data: number[] | Tensor, canvas: AnyCanvas | null, alpha: AnyCanvas | null }> {
return segmentation.process(input, background, this.config);
}
@ -389,7 +383,7 @@ export class Human {
* @param userConfig?: {@link Config}
* @returns result: {@link Result}
*/
async detect(input: Input, userConfig?: Partial<Config>): Promise<Result | Error> {
async detect(input: Input, userConfig?: Partial<Config>): Promise<Result> {
// detection happens inside a promise
this.state = 'detect';
return new Promise(async (resolve) => {
@ -404,7 +398,8 @@ export class Human {
const error = this.#sanity(input);
if (error) {
log(error, input);
resolve({ error });
this.emit('error');
resolve({ face: [], body: [], hand: [], gesture: [], object: [], performance: this.performance, timestamp: now(), persons: [], error });
}
const timeStart = now();
@ -417,14 +412,15 @@ export class Human {
timeStamp = now();
this.state = 'image';
const img = await image.process(input, this.config) as { canvas: HTMLCanvasElement | OffscreenCanvas, tensor: Tensor };
const img = await image.process(input, this.config) as { canvas: AnyCanvas, tensor: Tensor };
this.process = img;
this.performance.inputProcess = this.env.perfadd ? (this.performance.inputProcess || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
this.analyze('Get Image:');
if (!img.tensor) {
if (this.config.debug) log('could not convert input to tensor');
resolve({ error: 'could not convert input to tensor' });
this.emit('error');
resolve({ face: [], body: [], hand: [], gesture: [], object: [], performance: this.performance, timestamp: now(), persons: [], error: 'could not convert input to tensor' });
return;
}
this.emit('image');
@ -534,6 +530,7 @@ export class Human {
performance: this.performance,
canvas: this.process.canvas,
timestamp: Date.now(),
error: null,
get persons() { return persons.join(faceRes as FaceResult[], bodyRes as BodyResult[], handRes as HandResult[], gestureRes, shape); },
};

View File

@ -28,9 +28,10 @@ export function canvas(width, height): AnyCanvas {
let c;
if (env.browser) { // browser defines canvas object
if (env.worker) { // if runing in web worker use OffscreenCanvas
if (typeof OffscreenCanvas === 'undefined') throw new Error('canvas error: attempted to run in web worker but OffscreenCanvas is not supported');
c = new OffscreenCanvas(width, height);
} else { // otherwise use DOM canvas
if (typeof document === 'undefined') throw new Error('attempted to run in web worker but offscreenCanvas is not supported');
if (typeof document === 'undefined') throw new Error('canvas error: attempted to run in browser but DOM is not defined');
c = document.createElement('canvas');
c.width = width;
c.height = height;
@ -39,8 +40,8 @@ export function canvas(width, height): AnyCanvas {
// @ts-ignore // env.canvas is an external monkey-patch
if (typeof env.Canvas !== 'undefined') c = new env.Canvas(width, height);
else if (typeof globalThis.Canvas !== 'undefined') c = new globalThis.Canvas(width, height);
// else throw new Error('canvas error: attempted to use canvas in nodejs without canvas support installed');
}
// if (!c) throw new Error('cannot create canvas');
return c;
}
@ -58,7 +59,7 @@ export function copy(input: AnyCanvas, output?: AnyCanvas) {
export async function process(input: Input, config: Config, getTensor: boolean = true): Promise<{ tensor: Tensor | null, canvas: AnyCanvas | null }> {
if (!input) {
// throw new Error('input is missing');
if (config.debug) log('input is missing');
if (config.debug) log('input error: input is missing');
return { tensor: null, canvas: null }; // video may become temporarily unavailable due to onresize
}
// sanity checks since different browsers do not implement all dom elements
@ -75,12 +76,12 @@ export async function process(input: Input, config: Config, getTensor: boolean =
&& !(typeof HTMLCanvasElement !== 'undefined' && input instanceof HTMLCanvasElement)
&& !(typeof OffscreenCanvas !== 'undefined' && input instanceof OffscreenCanvas)
) {
throw new Error('input type is not recognized');
throw new Error('input error: type is not recognized');
}
if (input instanceof tf.Tensor) { // if input is tensor use as-is without filters but correct shape as needed
let tensor: Tensor | null = null;
if ((input as Tensor)['isDisposedInternal']) throw new Error('input tensor is disposed');
if (!(input as Tensor)['shape']) throw new Error('input tensor has no shape');
if ((input as Tensor)['isDisposedInternal']) throw new Error('input error: attempted to use tensor but it is disposed');
if (!(input as Tensor)['shape']) throw new Error('input error: attempted to use tensor without a shape');
if ((input as Tensor).shape.length === 3) { // [height, width, 3 || 4]
if ((input as Tensor).shape[2] === 3) { // [height, width, 3] so add batch
tensor = tf.expandDims(input, 0);
@ -97,7 +98,7 @@ export async function process(input: Input, config: Config, getTensor: boolean =
}
}
// at the end shape must be [1, height, width, 3]
if (tensor == null || tensor.shape.length !== 4 || tensor.shape[0] !== 1 || tensor.shape[3] !== 3) throw new Error(`could not process input tensor with shape: ${input['shape']}`);
if (tensor == null || tensor.shape.length !== 4 || tensor.shape[0] !== 1 || tensor.shape[3] !== 3) throw new Error(`input error: attempted to use tensor with unrecognized shape: ${input['shape']}`);
if ((tensor as Tensor).dtype === 'int32') {
const cast = tf.cast(tensor, 'float32');
tf.dispose(tensor);
@ -132,7 +133,7 @@ export async function process(input: Input, config: Config, getTensor: boolean =
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('input cannot determine dimension');
if (!targetWidth || !targetHeight) throw new Error('input error: cannot determine dimension');
if (!inCanvas || (inCanvas?.width !== targetWidth) || (inCanvas?.height !== targetHeight)) inCanvas = canvas(targetWidth, targetHeight);
// draw input to our canvas
@ -156,7 +157,10 @@ export async function process(input: Input, config: Config, getTensor: boolean =
if (config.filter.enabled && env.webgl.supported) {
if (!fx) fx = env.browser ? new fxImage.GLImageFilter() : null; // && (typeof document !== 'undefined')
env.filter = !!fx;
if (!fx) return { tensor: null, canvas: inCanvas };
if (!fx || !fx.add) {
if (config.debug) log('input process error: cannot initialize filters');
return { tensor: null, canvas: inCanvas };
}
fx.reset();
if (config.filter.brightness !== 0) fx.add('brightness', config.filter.brightness);
if (config.filter.contrast !== 0) fx.add('contrast', config.filter.contrast);
@ -181,7 +185,7 @@ export async function process(input: Input, config: Config, getTensor: boolean =
}
if (!getTensor) return { tensor: null, canvas: outCanvas }; // just canvas was requested
if (!outCanvas) throw new Error('cannot create output canvas');
if (!outCanvas) throw new Error('canvas error: cannot create output');
// create tensor from image unless input was a tensor already
let pixels;
@ -218,7 +222,7 @@ export async function process(input: Input, config: Config, getTensor: boolean =
tf.dispose(pixels);
pixels = rgb;
}
if (!pixels) throw new Error('cannot create tensor from input');
if (!pixels) throw new Error('input error: cannot create tensor');
const casted = tf.cast(pixels, 'float32');
const tensor = config.filter.equalization ? await enhance.histogramEqualization(casted) : tf.expandDims(casted, 0);
tf.dispose([pixels, casted]);

View File

@ -5,6 +5,7 @@
import * as shaders from './imagefxshaders';
import { canvas } from './image';
import { log } from '../util/util';
const collect = (source, prefix, collection) => {
const r = new RegExp('\\b' + prefix + ' \\w+ (\\w+)', 'ig');
@ -19,15 +20,24 @@ class GLProgram {
attribute = {};
gl: WebGLRenderingContext;
id: WebGLProgram;
constructor(gl, vertexSource, fragmentSource) {
this.gl = gl;
const vertexShader = this.compile(vertexSource, this.gl.VERTEX_SHADER);
const fragmentShader = this.compile(fragmentSource, this.gl.FRAGMENT_SHADER);
this.id = this.gl.createProgram() as WebGLProgram;
if (!vertexShader || !fragmentShader) return;
if (!this.id) {
log('filter: could not create webgl program');
return;
}
this.gl.attachShader(this.id, vertexShader);
this.gl.attachShader(this.id, fragmentShader);
this.gl.linkProgram(this.id);
if (!this.gl.getProgramParameter(this.id, this.gl.LINK_STATUS)) throw new Error(`filter: gl link failed: ${this.gl.getProgramInfoLog(this.id)}`);
if (!this.gl.getProgramParameter(this.id, this.gl.LINK_STATUS)) {
log(`filter: gl link failed: ${this.gl.getProgramInfoLog(this.id)}`);
return;
}
this.gl.useProgram(this.id);
collect(vertexSource, 'attribute', this.attribute); // Collect attributes
for (const a in this.attribute) this.attribute[a] = this.gl.getAttribLocation(this.id, a);
@ -36,11 +46,18 @@ class GLProgram {
for (const u in this.uniform) this.uniform[u] = this.gl.getUniformLocation(this.id, u);
}
compile = (source, type): WebGLShader => {
compile = (source, type): WebGLShader | null => {
const shader = this.gl.createShader(type) as WebGLShader;
if (!shader) {
log('filter: could not create shader');
return null;
}
this.gl.shaderSource(shader, source);
this.gl.compileShader(shader);
if (!this.gl.getShaderParameter(shader, this.gl.COMPILE_STATUS)) throw new Error(`filter: gl compile failed: ${this.gl.getShaderInfoLog(shader)}`);
if (!this.gl.getShaderParameter(shader, this.gl.COMPILE_STATUS)) {
log(`filter: gl compile failed: ${this.gl.getShaderInfoLog(shader)}`);
return null;
}
return shader;
};
}
@ -67,7 +84,12 @@ export function GLImageFilter() {
const shaderProgramCache = { }; // key is the shader program source, value is the compiled program
const DRAW = { INTERMEDIATE: 1 };
const gl = fxcanvas.getContext('webgl') as WebGLRenderingContext;
if (!gl) throw new Error('filter: cannot get webgl context');
// @ts-ignore used for sanity checks outside of imagefx
this.gl = gl;
if (!gl) {
log('filter: cannot get webgl context');
return;
}
function resize(width, height) {
if (width === fxcanvas.width && height === fxcanvas.height) return; // Same width/height? Nothing to do here
@ -102,7 +124,7 @@ export function GLImageFilter() {
return { fbo, texture };
}
function getTempFramebuffer(index) {
function getTempFramebuffer(index): { fbo: WebGLFramebuffer | null, texture: WebGLTexture | null } {
tempFramebuffers[index] = tempFramebuffers[index] || createFramebufferTexture(fxcanvas.width, fxcanvas.height);
return tempFramebuffers[index] as { fbo: WebGLFramebuffer, texture: WebGLTexture };
}
@ -128,13 +150,17 @@ export function GLImageFilter() {
gl.drawArrays(gl.TRIANGLES, 0, 6);
}
function compileShader(fragmentSource) {
function compileShader(fragmentSource): GLProgram | null {
if (shaderProgramCache[fragmentSource]) {
currentProgram = shaderProgramCache[fragmentSource];
gl.useProgram((currentProgram ? currentProgram.id : null) || null);
return currentProgram as GLProgram;
}
currentProgram = new GLProgram(gl, shaders.vertexIdentity, fragmentSource);
if (!currentProgram) {
log('filter: could not get webgl program');
return null;
}
const floatSize = Float32Array.BYTES_PER_ELEMENT;
const vertSize = 4 * floatSize;
gl.enableVertexAttribArray(currentProgram.attribute['pos']);
@ -156,6 +182,7 @@ export function GLImageFilter() {
? shaders.colorMatrixWithoutAlpha
: shaders.colorMatrixWithAlpha;
const program = compileShader(shader);
if (!program) return;
gl.uniform1fv(program.uniform['m'], m);
draw();
},
@ -292,6 +319,7 @@ export function GLImageFilter() {
const pixelSizeX = 1 / fxcanvas.width;
const pixelSizeY = 1 / fxcanvas.height;
const program = compileShader(shaders.convolution);
if (!program) return;
gl.uniform1fv(program.uniform['m'], m);
gl.uniform2f(program.uniform['px'], pixelSizeX, pixelSizeY);
draw();
@ -348,6 +376,7 @@ export function GLImageFilter() {
const blurSizeX = (size / 7) / fxcanvas.width;
const blurSizeY = (size / 7) / fxcanvas.height;
const program = compileShader(shaders.blur);
if (!program) return;
// Vertical
gl.uniform2f(program.uniform['px'], 0, blurSizeY);
draw(DRAW.INTERMEDIATE);
@ -360,6 +389,7 @@ export function GLImageFilter() {
const blurSizeX = (size) / fxcanvas.width;
const blurSizeY = (size) / fxcanvas.height;
const program = compileShader(shaders.pixelate);
if (!program) return;
gl.uniform2f(program.uniform['size'], blurSizeX, blurSizeY);
draw();
},

View File

@ -24,7 +24,6 @@ export async function load(config: Config): Promise<GraphModel> {
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(`cannot determine model inputSize: ${config.object.modelPath}`);
if (!model || !model.modelUrl) log('load model failed:', config.object.modelPath);
else if (config.debug) log('load model:', model.modelUrl);
} else if (config.debug) log('cached model:', model.modelUrl);

View File

@ -4,6 +4,7 @@
import type { Tensor } from './tfjs/types';
import type { FaceGesture, BodyGesture, HandGesture, IrisGesture } from './gesture/gesture';
import type { AnyCanvas } from './exports';
/** generic box as [x, y, width, height] */
export type Box = [number, number, number, number];
@ -185,9 +186,11 @@ export interface Result {
/** global performance object with timing values for each operation */
performance: Record<string, number>,
/** optional processed canvas that can be used to draw input on screen */
canvas?: OffscreenCanvas | HTMLCanvasElement | null | undefined,
canvas?: AnyCanvas | null,
/** timestamp of detection representing the milliseconds elapsed since the UNIX epoch */
readonly timestamp: number,
/** getter property that returns unified persons object */
persons: Array<PersonResult>,
/** @property Last known error message */
error: string | null;
}

View File

@ -82,7 +82,7 @@ export async function process(input: Input, background: Input | undefined, confi
for (let i = 0; i < width * height; i++) compositeData.data[4 * i + 3] = alphaData.data[4 * i + 0]; // copy original alpha value to new composite canvas
compositeCtx.putImageData(compositeData, 0, 0);
let mergedCanvas: HTMLCanvasElement | OffscreenCanvas | null = null;
let mergedCanvas: AnyCanvas | null = null;
if (background && compositeCanvas) { // draw background with segmentation as overlay if background is present
mergedCanvas = image.canvas(width, height);
const bgImage = await image.process(background, config);

View File

@ -77,7 +77,7 @@ export async function check(instance: Human, force = false) {
if (instance.config.backend === 'wasm') {
if (instance.config.debug) log('wasm path:', instance.config.wasmPath);
if (typeof tf?.setWasmPaths !== 'undefined') await tf.setWasmPaths(instance.config.wasmPath);
else throw new Error('wasm backend is not loaded');
else throw new Error('backend error: attempting to use wasm backend but wasm path is not set');
const simd = await tf.env().getAsync('WASM_HAS_SIMD_SUPPORT');
const mt = await tf.env().getAsync('WASM_HAS_MULTITHREAD_SUPPORT');
if (instance.config.debug) log(`wasm execution: ${simd ? 'SIMD' : 'no SIMD'} ${mt ? 'multithreaded' : 'singlethreaded'}`);

View File

@ -5,12 +5,13 @@ import { log } from '../util/util';
import * as tf from '../../dist/tfjs.esm.js';
import * as image from '../image/image';
import * as models from '../models';
import type { AnyCanvas } from '../exports';
// import { env } from '../env';
export const config = {
name: 'humangl',
priority: 999,
canvas: <null | OffscreenCanvas | HTMLCanvasElement>null,
canvas: <null | AnyCanvas>null,
gl: <null | WebGL2RenderingContext>null,
extensions: <string[]> [],
webGLattr: { // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.2
@ -71,10 +72,9 @@ export async function register(instance: Human): Promise<void> {
if (config.canvas) {
config.canvas.addEventListener('webglcontextlost', async (e) => {
log('error: humangl:', e.type);
// log('gpu memory usage:', instance.tf.engine().backendInstance.numBytesInGPU);
log('possible browser memory leak using webgl or conflict with multiple backend registrations');
instance.emit('error');
throw new Error('browser webgl error');
throw new Error('backend error: webgl context lost');
// log('resetting humangl backend');
// env.initial = true;
// models.reset(instance);

View File

@ -3,7 +3,7 @@
*/
import { TRI468 as triangulation } from '../face/facemeshcoords';
import { mergeDeep, now } from './util';
import { mergeDeep, now, log } from './util';
import { env } from './env';
import type { Result, FaceResult, BodyResult, HandResult, ObjectResult, GestureResult, PersonResult, Point } from '../result';
import type { AnyCanvas } from '../exports';
@ -71,8 +71,14 @@ export const options: DrawOptions = {
let drawTime = 0;
const getCanvasContext = (input) => {
if (input && input.getContext) return input.getContext('2d');
throw new Error('invalid canvas');
if (!input) log('draw error: invalid canvas');
else if (!input.getContext) log('draw error: canvas context not defined');
else {
const ctx = input.getContext('2d');
if (!ctx) log('draw error: cannot get canvas context');
else return ctx;
}
return null;
};
const rad2deg = (theta) => Math.round((theta * 180) / Math.PI);
@ -174,6 +180,7 @@ export async function gesture(inCanvas: AnyCanvas, result: Array<GestureResult>,
if (!result || !inCanvas) return;
if (localOptions.drawGestures) {
const ctx = getCanvasContext(inCanvas);
if (!ctx) return;
ctx.font = localOptions.font;
ctx.fillStyle = localOptions.color;
let i = 1;
@ -201,6 +208,7 @@ export async function face(inCanvas: AnyCanvas, result: Array<FaceResult>, drawO
const localOptions = mergeDeep(options, drawOptions);
if (!result || !inCanvas) return;
const ctx = getCanvasContext(inCanvas);
if (!ctx) return;
for (const f of result) {
ctx.font = localOptions.font;
ctx.strokeStyle = localOptions.color;
@ -324,6 +332,7 @@ export async function body(inCanvas: AnyCanvas, result: Array<BodyResult>, drawO
const localOptions = mergeDeep(options, drawOptions);
if (!result || !inCanvas) return;
const ctx = getCanvasContext(inCanvas);
if (!ctx) return;
ctx.lineJoin = 'round';
for (let i = 0; i < result.length; i++) {
ctx.strokeStyle = localOptions.color;
@ -367,6 +376,7 @@ export async function hand(inCanvas: AnyCanvas, result: Array<HandResult>, drawO
const localOptions = mergeDeep(options, drawOptions);
if (!result || !inCanvas) return;
const ctx = getCanvasContext(inCanvas);
if (!ctx) return;
ctx.lineJoin = 'round';
ctx.font = localOptions.font;
for (const h of result) {
@ -433,6 +443,7 @@ export async function object(inCanvas: AnyCanvas, result: Array<ObjectResult>, d
const localOptions = mergeDeep(options, drawOptions);
if (!result || !inCanvas) return;
const ctx = getCanvasContext(inCanvas);
if (!ctx) return;
ctx.lineJoin = 'round';
ctx.font = localOptions.font;
for (const h of result) {
@ -459,6 +470,7 @@ export async function person(inCanvas: AnyCanvas, result: Array<PersonResult>, d
const localOptions = mergeDeep(options, drawOptions);
if (!result || !inCanvas) return;
const ctx = getCanvasContext(inCanvas);
if (!ctx) return;
ctx.lineJoin = 'round';
ctx.font = localOptions.font;
@ -482,9 +494,10 @@ export async function person(inCanvas: AnyCanvas, result: Array<PersonResult>, d
}
/** draw processed canvas */
export async function canvas(input: AnyCanvas | HTMLImageElement | HTMLMediaElement | HTMLVideoElement, output: HTMLCanvasElement) {
export async function canvas(input: AnyCanvas | HTMLImageElement | HTMLMediaElement | HTMLVideoElement, output: AnyCanvas) {
if (!input || !output) return;
const ctx = getCanvasContext(output);
if (!ctx) return;
ctx.drawImage(input, 0, 0);
}

View File

@ -134,9 +134,13 @@ export class Env {
}
this.webgpu.supported = this.browser && typeof navigator['gpu'] !== 'undefined';
this.webgpu.backend = this.backends.includes('webgpu');
if (this.webgpu.supported) this.webgpu.adapter = (await navigator['gpu'].requestAdapter()).name;
// enumerate kernels
this.kernels = tf.getKernelsForBackend(tf.getBackend()).map((kernel) => kernel.kernelName.toLowerCase());
try {
if (this.webgpu.supported) this.webgpu.adapter = (await navigator['gpu'].requestAdapter()).name;
// enumerate kernels
this.kernels = tf.getKernelsForBackend(tf.getBackend()).map((kernel) => kernel.kernelName.toLowerCase());
} catch {
this.webgpu.supported = false;
}
}
async updateCPU() {

View File

@ -11,12 +11,12 @@ import * as efficientPoseCoords from '../body/efficientposecoords';
import { now } from './util';
import { env } from './env';
const bufferedResult: Result = { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0 };
const bufferedResult: Result = { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0, error: null };
let interpolateTime = 0;
export function calc(newResult: Result, config: Config): Result {
const t0 = now();
if (!newResult) return { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0 };
if (!newResult) return { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0, error: null };
// each record is only updated using deep clone when number of detected record changes, otherwise it will converge by itself
// otherwise bufferedResult is a shallow clone of result plus updated local calculated values
// thus mixing by-reference and by-value assignments to minimize memory operations
@ -31,7 +31,8 @@ export function calc(newResult: Result, config: Config): Result {
// - at 1sec delay buffer = 1 which means live data is used
const bufferedFactor = elapsed < 1000 ? 8 - Math.log(elapsed + 1) : 1;
bufferedResult.canvas = newResult.canvas;
if (newResult.canvas) bufferedResult.canvas = newResult.canvas;
if (newResult.error) bufferedResult.error = newResult.error;
// interpolate body results
if (!bufferedResult.body || (newResult.body.length !== bufferedResult.body.length)) {

View File

@ -2,15 +2,6 @@
* Simple helper functions used accross codebase
*/
// helper function: join two paths
export function join(folder: string, file: string): string {
const separator = folder.endsWith('/') ? '' : '/';
const skipJoin = file.startsWith('.') || file.startsWith('/') || file.startsWith('http:') || file.startsWith('https:') || file.startsWith('file:');
const path = skipJoin ? `${file}` : `${folder}${separator}${file}`;
if (!path.toLocaleLowerCase().includes('.json')) throw new Error(`modelpath error: ${path} expecting json file`);
return path;
}
// helper function: wrapper around console output
export function log(...msg): void {
const dt = new Date();
@ -19,6 +10,15 @@ export function log(...msg): void {
if (msg) console.log(ts, 'Human:', ...msg);
}
// helper function: join two paths
export function join(folder: string, file: string): string {
const separator = folder.endsWith('/') ? '' : '/';
const skipJoin = file.startsWith('.') || file.startsWith('/') || file.startsWith('http:') || file.startsWith('https:') || file.startsWith('file:');
const path = skipJoin ? `${file}` : `${folder}${separator}${file}`;
if (!path.toLocaleLowerCase().includes('.json')) throw new Error(`modelpath error: expecting json file: ${path}`);
return path;
}
// helper function: gets elapsed time on both browser and nodejs
export const now = () => {
if (typeof performance !== 'undefined') return performance.now();

View File

@ -107,7 +107,7 @@ export async function warmup(instance: Human, userConfig?: Partial<Config>): Pro
const t0 = now();
instance.state = 'warmup';
if (userConfig) instance.config = mergeDeep(instance.config, userConfig) as Config;
if (!instance.config.warmup || instance.config.warmup === 'none') return { error: 'null' };
if (!instance.config.warmup || instance.config.warmup.length === 0 || instance.config.warmup === 'none') return { error: 'null' };
let res;
return new Promise(async (resolve) => {
if (typeof createImageBitmap === 'function') res = await warmupBitmap(instance);

View File

@ -1,26 +1,26 @@
2021-11-13 17:19:22 INFO:  @vladmandic/human version 2.5.1
2021-11-13 17:19:22 INFO:  User: vlado Platform: linux Arch: x64 Node: v17.0.1
2021-11-13 17:19:22 INFO:  Application: {"name":"@vladmandic/human","version":"2.5.1"}
2021-11-13 17:19:22 INFO:  Environment: {"profile":"production","config":".build.json","package":"package.json","tsconfig":true,"eslintrc":true,"git":true}
2021-11-13 17:19:22 INFO:  Toolchain: {"build":"0.6.3","esbuild":"0.13.13","typescript":"4.4.4","typedoc":"0.22.8","eslint":"8.2.0"}
2021-11-13 17:19:22 INFO:  Build: {"profile":"production","steps":["clean","compile","typings","typedoc","lint","changelog"]}
2021-11-13 17:19:22 STATE: Clean: {"locations":["dist/*","types/*","typedoc/*"]}
2021-11-13 17:19:22 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":1275}
2021-11-13 17:19:23 STATE: Compile: {"name":"human/nodejs/cpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node.js","files":61,"inputBytes":543749,"outputBytes":460526}
2021-11-13 17:19:23 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":1283}
2021-11-13 17:19:23 STATE: Compile: {"name":"human/nodejs/gpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-gpu.js","files":61,"inputBytes":543757,"outputBytes":460530}
2021-11-13 17:19:23 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":1350}
2021-11-13 17:19:23 STATE: Compile: {"name":"human/nodejs/wasm","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-wasm.js","files":61,"inputBytes":543824,"outputBytes":460602}
2021-11-13 17:19:23 STATE: Compile: {"name":"tfjs/browser/version","format":"esm","platform":"browser","input":"tfjs/tf-version.ts","output":"dist/tfjs.version.js","files":1,"inputBytes":1063,"outputBytes":1652}
2021-11-13 17:19:23 STATE: Compile: {"name":"tfjs/browser/esm/nobundle","format":"esm","platform":"browser","input":"tfjs/tf-browser.ts","output":"dist/tfjs.esm.js","files":2,"inputBytes":2326,"outputBytes":912}
2021-11-13 17:19:23 STATE: Compile: {"name":"human/browser/esm/nobundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm-nobundle.js","files":61,"inputBytes":543386,"outputBytes":462792}
2021-11-13 17:19:23 STATE: Compile: {"name":"tfjs/browser/esm/custom","format":"esm","platform":"browser","input":"tfjs/tf-custom.ts","output":"dist/tfjs.esm.js","files":2,"inputBytes":2562703,"outputBytes":2497652}
2021-11-13 17:19:24 STATE: Compile: {"name":"human/browser/iife/bundle","format":"iife","platform":"browser","input":"src/human.ts","output":"dist/human.js","files":61,"inputBytes":3040126,"outputBytes":1622880}
2021-11-13 17:19:24 STATE: Compile: {"name":"human/browser/esm/bundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm.js","files":61,"inputBytes":3040126,"outputBytes":2965877}
2021-11-13 17:19:50 STATE: Typings: {"input":"src/human.ts","output":"types","files":53}
2021-11-13 17:20:02 STATE: TypeDoc: {"input":"src/human.ts","output":"typedoc","objects":50,"generated":true}
2021-11-13 17:20:02 STATE: Compile: {"name":"demo/typescript","format":"esm","platform":"browser","input":"demo/typescript/index.ts","output":"demo/typescript/index.js","files":1,"inputBytes":5801,"outputBytes":3822}
2021-11-13 17:20:02 STATE: Compile: {"name":"demo/faceid","format":"esm","platform":"browser","input":"demo/faceid/index.ts","output":"demo/faceid/index.js","files":2,"inputBytes":15166,"outputBytes":11786}
2021-11-13 17:20:44 STATE: Lint: {"locations":["*.json","src/**/*.ts","test/**/*.js","demo/**/*.js"],"files":92,"errors":0,"warnings":0}
2021-11-13 17:20:44 STATE: ChangeLog: {"repository":"https://github.com/vladmandic/human","branch":"main","output":"CHANGELOG.md"}
2021-11-13 17:20:44 INFO:  Done...
2021-11-14 11:00:44 INFO:  @vladmandic/human version 2.5.2
2021-11-14 11:00:44 INFO:  User: vlado Platform: linux Arch: x64 Node: v17.0.1
2021-11-14 11:00:44 INFO:  Application: {"name":"@vladmandic/human","version":"2.5.2"}
2021-11-14 11:00:44 INFO:  Environment: {"profile":"production","config":".build.json","package":"package.json","tsconfig":true,"eslintrc":true,"git":true}
2021-11-14 11:00:44 INFO:  Toolchain: {"build":"0.6.4","esbuild":"0.13.13","typescript":"4.4.4","typedoc":"0.22.8","eslint":"8.2.0"}
2021-11-14 11:00:44 INFO:  Build: {"profile":"production","steps":["clean","compile","typings","typedoc","lint","changelog"]}
2021-11-14 11:00:44 STATE: Clean: {"locations":["dist/*","types/*","typedoc/*"]}
2021-11-14 11:00:44 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":1275}
2021-11-14 11:00:44 STATE: Compile: {"name":"human/nodejs/cpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node.js","files":61,"inputBytes":545664,"outputBytes":462580}
2021-11-14 11:00:44 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":1283}
2021-11-14 11:00:44 STATE: Compile: {"name":"human/nodejs/gpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-gpu.js","files":61,"inputBytes":545672,"outputBytes":462584}
2021-11-14 11:00:44 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":1350}
2021-11-14 11:00:44 STATE: Compile: {"name":"human/nodejs/wasm","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-wasm.js","files":61,"inputBytes":545739,"outputBytes":462656}
2021-11-14 11:00:44 STATE: Compile: {"name":"tfjs/browser/version","format":"esm","platform":"browser","input":"tfjs/tf-version.ts","output":"dist/tfjs.version.js","files":1,"inputBytes":1063,"outputBytes":1652}
2021-11-14 11:00:44 STATE: Compile: {"name":"tfjs/browser/esm/nobundle","format":"esm","platform":"browser","input":"tfjs/tf-browser.ts","output":"dist/tfjs.esm.js","files":2,"inputBytes":2326,"outputBytes":912}
2021-11-14 11:00:44 STATE: Compile: {"name":"human/browser/esm/nobundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm-nobundle.js","files":61,"inputBytes":545301,"outputBytes":464846}
2021-11-14 11:00:44 STATE: Compile: {"name":"tfjs/browser/esm/custom","format":"esm","platform":"browser","input":"tfjs/tf-custom.ts","output":"dist/tfjs.esm.js","files":2,"inputBytes":2562703,"outputBytes":2497652}
2021-11-14 11:00:45 STATE: Compile: {"name":"human/browser/iife/bundle","format":"iife","platform":"browser","input":"src/human.ts","output":"dist/human.js","files":61,"inputBytes":3042041,"outputBytes":1624010}
2021-11-14 11:00:45 STATE: Compile: {"name":"human/browser/esm/bundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm.js","files":61,"inputBytes":3042041,"outputBytes":2967931}
2021-11-14 11:01:06 STATE: Typings: {"input":"src/human.ts","output":"types","files":53}
2021-11-14 11:01:13 STATE: TypeDoc: {"input":"src/human.ts","output":"typedoc","objects":51,"generated":true}
2021-11-14 11:01:13 STATE: Compile: {"name":"demo/typescript","format":"esm","platform":"browser","input":"demo/typescript/index.ts","output":"demo/typescript/index.js","files":1,"inputBytes":5801,"outputBytes":3822}
2021-11-14 11:01:13 STATE: Compile: {"name":"demo/faceid","format":"esm","platform":"browser","input":"demo/faceid/index.ts","output":"demo/faceid/index.js","files":2,"inputBytes":15166,"outputBytes":11786}
2021-11-14 11:01:51 STATE: Lint: {"locations":["*.json","src/**/*.ts","test/**/*.js","demo/**/*.js"],"files":92,"errors":0,"warnings":0}
2021-11-14 11:01:52 STATE: ChangeLog: {"repository":"https://github.com/vladmandic/human","branch":"main","output":"CHANGELOG.md"}
2021-11-14 11:01:52 INFO:  Done...

View File

@ -104,8 +104,8 @@ async function testAll() {
log.info('demos:', demos);
// for (const demo of demos) await runDemo(demo);
for (const test of tests) await runTest(test);
log.info();
log.info('failed', failedMessages);
log.info('all tests complete');
log.info('failed:', { count: failedMessages.length, messages: failedMessages });
log.info('status:', status);
}

View File

@ -314,7 +314,7 @@ async function test(Human, inputConfig) {
log('info', 'test: image null');
res = await human.detect(null);
if (!res || !res.error) log('error', 'failed: invalid input', res);
else log('state', 'passed: invalid input', res);
else log('state', 'passed: invalid input', res.error || res);
// test face similarity
log('info', 'test face similarity');

File diff suppressed because it is too large Load Diff

View File

@ -33,7 +33,7 @@
"noUncheckedIndexedAccess": false,
"noUnusedLocals": false,
"noUnusedParameters": true,
"preserveConstEnums": false,
"preserveConstEnums": true,
"pretty": true,
"removeComments": false,
"resolveJsonModule": true,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Models | @vladmandic/human - v2.5.1</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.1"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.1</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.5.1</a></li><li><a href="Models.html">Models</a></li></ul><h1>Class Models</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">
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Models | @vladmandic/human - v2.5.2</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.2"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.2</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.5.2</a></li><li><a href="Models.html">Models</a></li></ul><h1>Class Models</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>Instances of all possible TFJS Graph Models used by Human</p>
<ul>
<li>loaded as needed based on configuration</li>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Tensor | @vladmandic/human - v2.5.1</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.1"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.1</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.5.1</a></li><li><a href="Tensor.html">Tensor</a></li></ul><h1>Class Tensor&lt;R&gt;</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">
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Tensor | @vladmandic/human - v2.5.2</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.2"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.2</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.5.2</a></li><li><a href="Tensor.html">Tensor</a></li></ul><h1>Class Tensor&lt;R&gt;</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>A <code>tf.Tensor</code> object represents an immutable, multidimensional array of
numbers that has a shape and a data type.</p>
</div><div><p>For performance reasons, functions that create tensors do not necessarily

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>BodyConfig | @vladmandic/human - v2.5.1</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.1"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.1</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.5.1</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">
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>BodyConfig | @vladmandic/human - v2.5.2</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.2"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.2</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.5.2</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>Configures all body detection specific options</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><a href="GenericConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">GenericConfig</a><ul class="tsd-hierarchy"><li><span class="target">BodyConfig</span></li></ul></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#detector" class="tsd-kind-icon">detector</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><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 tsd-is-inherited"><a href="BodyConfig.html#modelPath-1" class="tsd-kind-icon">model<wbr/>Path</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="BodyConfig.html#skipFrames" class="tsd-kind-icon">skip<wbr/>Frames</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="BodyConfig.html#skipTime" class="tsd-kind-icon">skip<wbr/>Time</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 id="detector" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> 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#L81">src/config.ts:81</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><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>property</dt><dd><p>path to optional body detector model json file</p>
</dd></dl></div></li></ul></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="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"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#enabled">enabled</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L7">src/config.ts:7</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>property</dt><dd><p>is module enabled?</p>

View File

@ -1,9 +1,9 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>BodyKeypoint | @vladmandic/human - v2.5.1</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.1"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.1</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.5.1</a></li><li><a href="BodyKeypoint.html">BodyKeypoint</a></li></ul><h1>Interface BodyKeypoint</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">BodyKeypoint</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="BodyKeypoint.html#part" class="tsd-kind-icon">part</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyKeypoint.html#position" class="tsd-kind-icon">position</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyKeypoint.html#positionRaw" class="tsd-kind-icon">position<wbr/>Raw</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyKeypoint.html#score" class="tsd-kind-icon">score</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 id="part" class="tsd-anchor"></a><h3>part</h3><div class="tsd-signature tsd-kind-icon">part<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/result.ts#L66">src/result.ts:66</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>BodyKeypoint | @vladmandic/human - v2.5.2</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.2"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.2</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.5.2</a></li><li><a href="BodyKeypoint.html">BodyKeypoint</a></li></ul><h1>Interface BodyKeypoint</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">BodyKeypoint</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="BodyKeypoint.html#part" class="tsd-kind-icon">part</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyKeypoint.html#position" class="tsd-kind-icon">position</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyKeypoint.html#positionRaw" class="tsd-kind-icon">position<wbr/>Raw</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyKeypoint.html#score" class="tsd-kind-icon">score</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 id="part" class="tsd-anchor"></a><h3>part</h3><div class="tsd-signature tsd-kind-icon">part<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/result.ts#L67">src/result.ts:67</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>body part name</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="position" class="tsd-anchor"></a><h3>position</h3><div class="tsd-signature tsd-kind-icon">position<span class="tsd-signature-symbol">:</span> <a href="../index.html#Point" class="tsd-signature-type" data-tsd-kind="Type alias">Point</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L68">src/result.ts:68</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="position" class="tsd-anchor"></a><h3>position</h3><div class="tsd-signature tsd-kind-icon">position<span class="tsd-signature-symbol">:</span> <a href="../index.html#Point" class="tsd-signature-type" data-tsd-kind="Type alias">Point</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L69">src/result.ts:69</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>body part position</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="positionRaw" class="tsd-anchor"></a><h3>position<wbr/>Raw</h3><div class="tsd-signature tsd-kind-icon">position<wbr/>Raw<span class="tsd-signature-symbol">:</span> <a href="../index.html#Point" class="tsd-signature-type" data-tsd-kind="Type alias">Point</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L70">src/result.ts:70</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="positionRaw" class="tsd-anchor"></a><h3>position<wbr/>Raw</h3><div class="tsd-signature tsd-kind-icon">position<wbr/>Raw<span class="tsd-signature-symbol">:</span> <a href="../index.html#Point" class="tsd-signature-type" data-tsd-kind="Type alias">Point</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L71">src/result.ts:71</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>body part position normalized to 0..1</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="score" class="tsd-anchor"></a><h3>score</h3><div class="tsd-signature tsd-kind-icon">score<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/result.ts#L72">src/result.ts:72</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="score" class="tsd-anchor"></a><h3>score</h3><div class="tsd-signature tsd-kind-icon">score<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/result.ts#L73">src/result.ts:73</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>body part detection score</p>
</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><li class=" tsd-kind-namespace"><a href="../modules/Tensor.html">Tensor</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-interface"><a href="BodyKeypoint.html" class="tsd-kind-icon">Body<wbr/>Keypoint</a><ul><li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyKeypoint.html#part" class="tsd-kind-icon">part</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyKeypoint.html#position" class="tsd-kind-icon">position</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyKeypoint.html#positionRaw" class="tsd-kind-icon">position<wbr/>Raw</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyKeypoint.html#score" class="tsd-kind-icon">score</a></li></ul></li></ul></nav></div></div></div><footer class=""><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><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="overlay"></div><script src="../assets/main.js"></script></body></html>

View File

@ -1,15 +1,15 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>BodyResult | @vladmandic/human - v2.5.1</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.1"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.1</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.5.1</a></li><li><a href="BodyResult.html">BodyResult</a></li></ul><h1>Interface BodyResult</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">
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>BodyResult | @vladmandic/human - v2.5.2</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.2"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.2</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.5.2</a></li><li><a href="BodyResult.html">BodyResult</a></li></ul><h1>Interface BodyResult</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>Body results</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">BodyResult</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="BodyResult.html#annotations" class="tsd-kind-icon">annotations</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></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 id="annotations" class="tsd-anchor"></a><h3>annotations</h3><div class="tsd-signature tsd-kind-icon">annotations<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">string</span><span class="tsd-signature-symbol">, </span><a href="../index.html#Point" class="tsd-signature-type" data-tsd-kind="Type alias">Point</a><span class="tsd-signature-symbol">[]</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#L88">src/result.ts:88</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">BodyResult</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="BodyResult.html#annotations" class="tsd-kind-icon">annotations</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></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 id="annotations" class="tsd-anchor"></a><h3>annotations</h3><div class="tsd-signature tsd-kind-icon">annotations<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">string</span><span class="tsd-signature-symbol">, </span><a href="../index.html#Point" class="tsd-signature-type" data-tsd-kind="Type alias">Point</a><span class="tsd-signature-symbol">[]</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#L89">src/result.ts:89</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>detected body keypoints combined into annotated parts</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="box" class="tsd-anchor"></a><h3>box</h3><div class="tsd-signature tsd-kind-icon">box<span class="tsd-signature-symbol">:</span> <a href="../index.html#Box" class="tsd-signature-type" data-tsd-kind="Type alias">Box</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L82">src/result.ts:82</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="box" class="tsd-anchor"></a><h3>box</h3><div class="tsd-signature tsd-kind-icon">box<span class="tsd-signature-symbol">:</span> <a href="../index.html#Box" class="tsd-signature-type" data-tsd-kind="Type alias">Box</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L83">src/result.ts:83</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>detected body box</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="boxRaw" class="tsd-anchor"></a><h3>box<wbr/>Raw</h3><div class="tsd-signature tsd-kind-icon">box<wbr/>Raw<span class="tsd-signature-symbol">:</span> <a href="../index.html#Box" class="tsd-signature-type" data-tsd-kind="Type alias">Box</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L84">src/result.ts:84</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="boxRaw" class="tsd-anchor"></a><h3>box<wbr/>Raw</h3><div class="tsd-signature tsd-kind-icon">box<wbr/>Raw<span class="tsd-signature-symbol">:</span> <a href="../index.html#Box" class="tsd-signature-type" data-tsd-kind="Type alias">Box</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L85">src/result.ts:85</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>detected body box normalized to 0..1</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="id" class="tsd-anchor"></a><h3>id</h3><div class="tsd-signature tsd-kind-icon">id<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/result.ts#L78">src/result.ts:78</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="id" class="tsd-anchor"></a><h3>id</h3><div class="tsd-signature tsd-kind-icon">id<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/result.ts#L79">src/result.ts:79</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>body id</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="keypoints" class="tsd-anchor"></a><h3>keypoints</h3><div class="tsd-signature tsd-kind-icon">keypoints<span class="tsd-signature-symbol">:</span> <a href="BodyKeypoint.html" class="tsd-signature-type" data-tsd-kind="Interface">BodyKeypoint</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#L86">src/result.ts:86</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="keypoints" class="tsd-anchor"></a><h3>keypoints</h3><div class="tsd-signature tsd-kind-icon">keypoints<span class="tsd-signature-symbol">:</span> <a href="BodyKeypoint.html" class="tsd-signature-type" data-tsd-kind="Interface">BodyKeypoint</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#L87">src/result.ts:87</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>detected body keypoints</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="score" class="tsd-anchor"></a><h3>score</h3><div class="tsd-signature tsd-kind-icon">score<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/result.ts#L80">src/result.ts:80</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="score" class="tsd-anchor"></a><h3>score</h3><div class="tsd-signature tsd-kind-icon">score<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/result.ts#L81">src/result.ts:81</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>body detection score</p>
</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><li class=" tsd-kind-namespace"><a href="../modules/Tensor.html">Tensor</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-interface"><a href="BodyResult.html" class="tsd-kind-icon">Body<wbr/>Result</a><ul><li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyResult.html#annotations" class="tsd-kind-icon">annotations</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></li></ul></nav></div></div></div><footer class=""><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><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="overlay"></div><script src="../assets/main.js"></script></body></html>

View File

@ -1,10 +1,10 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Config | @vladmandic/human - v2.5.1</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.1"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.1</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.5.1</a></li><li><a href="Config.html">Config</a></li></ul><h1>Interface Config</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">
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Config | @vladmandic/human - v2.5.2</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.2"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.2</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.5.2</a></li><li><a href="Config.html">Config</a></li></ul><h1>Interface Config</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>Configuration interface definition for <strong>Human</strong> library</p>
</div><div><p>Contains all configurable parameters</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">Config</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="Config.html#async" class="tsd-kind-icon">async</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#backend" class="tsd-kind-icon">backend</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#body" class="tsd-kind-icon">body</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#cacheSensitivity" class="tsd-kind-icon">cache<wbr/>Sensitivity</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#deallocate" class="tsd-kind-icon">deallocate</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#debug" class="tsd-kind-icon">debug</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#face" class="tsd-kind-icon">face</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#filter" class="tsd-kind-icon">filter</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#gesture" class="tsd-kind-icon">gesture</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#hand" class="tsd-kind-icon">hand</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#modelBasePath" class="tsd-kind-icon">model<wbr/>Base<wbr/>Path</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#object" class="tsd-kind-icon">object</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#segmentation" class="tsd-kind-icon">segmentation</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#skipAllowed" class="tsd-kind-icon">skip<wbr/>Allowed</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#warmup" class="tsd-kind-icon">warmup</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#wasmPath" class="tsd-kind-icon">wasm<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 id="async" class="tsd-anchor"></a><h3>async</h3><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#L226">src/config.ts:226</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">Config</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="Config.html#async" class="tsd-kind-icon">async</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#backend" class="tsd-kind-icon">backend</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#body" class="tsd-kind-icon">body</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#cacheSensitivity" class="tsd-kind-icon">cache<wbr/>Sensitivity</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#deallocate" class="tsd-kind-icon">deallocate</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#debug" class="tsd-kind-icon">debug</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#face" class="tsd-kind-icon">face</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#filter" class="tsd-kind-icon">filter</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#gesture" class="tsd-kind-icon">gesture</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#hand" class="tsd-kind-icon">hand</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#modelBasePath" class="tsd-kind-icon">model<wbr/>Base<wbr/>Path</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#object" class="tsd-kind-icon">object</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#segmentation" class="tsd-kind-icon">segmentation</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#skipAllowed" class="tsd-kind-icon">skip<wbr/>Allowed</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#warmup" class="tsd-kind-icon">warmup</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#wasmPath" class="tsd-kind-icon">wasm<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 id="async" class="tsd-anchor"></a><h3>async</h3><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#L229">src/config.ts:229</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Perform model loading and inference concurrently or sequentially</p>
</div><div><p>default: <code>true</code></p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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">&quot;&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;cpu&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;wasm&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;webgl&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;humangl&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;tensorflow&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;webgpu&quot;</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L208">src/config.ts:208</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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">&quot;&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;cpu&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;wasm&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;webgl&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;humangl&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;tensorflow&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;webgpu&quot;</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L211">src/config.ts:211</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Backend used for TFJS operations
valid build-in backends are:</p>
<ul>
@ -12,48 +12,48 @@ valid build-in backends are:</p>
<li>NodeJS: <code>cpu</code>, <code>wasm</code>, <code>tensorflow</code>
default: <code>humangl</code> for browser and <code>tensorflow</code> for nodejs</li>
</ul>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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">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#L268">src/config.ts:268</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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">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#L271">src/config.ts:271</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p><a href="BodyConfig.html">BodyConfig</a></p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="cacheSensitivity" class="tsd-anchor"></a><h3>cache<wbr/>Sensitivity</h3><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#L250">src/config.ts:250</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="cacheSensitivity" class="tsd-anchor"></a><h3>cache<wbr/>Sensitivity</h3><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#L253">src/config.ts:253</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Cache sensitivity</p>
<ul>
<li>values 0..1 where 0.01 means reset cache if input changed more than 1%</li>
<li>set to 0 to disable caching</li>
</ul>
</div><div><p>default: 0.7</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="deallocate" class="tsd-anchor"></a><h3>deallocate</h3><div class="tsd-signature tsd-kind-icon">deallocate<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#L253">src/config.ts:253</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="deallocate" class="tsd-anchor"></a><h3>deallocate</h3><div class="tsd-signature tsd-kind-icon">deallocate<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#L256">src/config.ts:256</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Perform immediate garbage collection on deallocated tensors instead of caching them</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="debug" class="tsd-anchor"></a><h3>debug</h3><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#L220">src/config.ts:220</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="debug" class="tsd-anchor"></a><h3>debug</h3><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#L223">src/config.ts:223</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Print debug statements to console</p>
</div><div><p>default: <code>true</code></p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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-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#L265">src/config.ts:265</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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-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#L268">src/config.ts:268</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p><a href="FaceConfig.html">FaceConfig</a></p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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-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#L259">src/config.ts:259</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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-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#L262">src/config.ts:262</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p><a href="FilterConfig.html">FilterConfig</a></p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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-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#L262">src/config.ts:262</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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-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#L265">src/config.ts:265</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p><a href="GestureConfig.html">GestureConfig</a></p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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-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#L271">src/config.ts:271</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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-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#L274">src/config.ts:274</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p><a href="HandConfig.html">HandConfig</a></p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="modelBasePath" class="tsd-anchor"></a><h3>model<wbr/>Base<wbr/>Path</h3><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#L242">src/config.ts:242</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="modelBasePath" class="tsd-anchor"></a><h3>model<wbr/>Base<wbr/>Path</h3><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#L245">src/config.ts:245</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Base model path (typically starting with file://, http:// or https://) for all models</p>
<ul>
<li>individual modelPath values are relative to this path</li>
</ul>
</div><div><p>default: <code>../models/</code> for browsers and <code>file://models/</code> for nodejs</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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-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#L274">src/config.ts:274</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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-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#L277">src/config.ts:277</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p><a href="ObjectConfig.html">ObjectConfig</a></p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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-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#L277">src/config.ts:277</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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-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#L280">src/config.ts:280</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p><a href="SegmentationConfig.html">SegmentationConfig</a></p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="skipAllowed" class="tsd-anchor"></a><h3>skip<wbr/>Allowed</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Allowed<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#L256">src/config.ts:256</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="skipAllowed" class="tsd-anchor"></a><h3>skip<wbr/>Allowed</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Allowed<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#L259">src/config.ts:259</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Internal Variable</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="warmup" class="tsd-anchor"></a><h3>warmup</h3><div class="tsd-signature tsd-kind-icon">warmup<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">&quot;face&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;body&quot;</span><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></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L234">src/config.ts:234</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="warmup" class="tsd-anchor"></a><h3>warmup</h3><div class="tsd-signature tsd-kind-icon">warmup<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">&quot;&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;face&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;body&quot;</span><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></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L237">src/config.ts:237</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>What to use for <code>human.warmup()</code></p>
<ul>
<li>warmup pre-initializes all models for faster inference but can take significant time on startup</li>
<li>used by <code>webgl</code>, <code>humangl</code> and <code>webgpu</code> backends</li>
</ul>
</div><div><p>default: <code>full</code></p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="wasmPath" class="tsd-anchor"></a><h3>wasm<wbr/>Path</h3><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#L214">src/config.ts:214</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="wasmPath" class="tsd-anchor"></a><h3>wasm<wbr/>Path</h3><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#L217">src/config.ts:217</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Path to *.wasm files if backend is set to <code>wasm</code></p>
</div><div><p>default: auto-detects to link to CDN <code>jsdelivr</code> when running in browser</p>
</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><li class=" tsd-kind-namespace"><a href="../modules/Tensor.html">Tensor</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-interface"><a href="Config.html" class="tsd-kind-icon">Config</a><ul><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#async" class="tsd-kind-icon">async</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#backend" class="tsd-kind-icon">backend</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#body" class="tsd-kind-icon">body</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#cacheSensitivity" class="tsd-kind-icon">cache<wbr/>Sensitivity</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#deallocate" class="tsd-kind-icon">deallocate</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#debug" class="tsd-kind-icon">debug</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#face" class="tsd-kind-icon">face</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#filter" class="tsd-kind-icon">filter</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#gesture" class="tsd-kind-icon">gesture</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#hand" class="tsd-kind-icon">hand</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#modelBasePath" class="tsd-kind-icon">model<wbr/>Base<wbr/>Path</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#object" class="tsd-kind-icon">object</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#segmentation" class="tsd-kind-icon">segmentation</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#skipAllowed" class="tsd-kind-icon">skip<wbr/>Allowed</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#warmup" class="tsd-kind-icon">warmup</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#wasmPath" class="tsd-kind-icon">wasm<wbr/>Path</a></li></ul></li></ul></nav></div></div></div><footer class=""><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><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="overlay"></div><script src="../assets/main.js"></script></body></html>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FaceAntiSpoofConfig | @vladmandic/human - v2.5.1</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.1"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.1</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.5.1</a></li><li><a href="FaceAntiSpoofConfig.html">FaceAntiSpoofConfig</a></li></ul><h1>Interface FaceAntiSpoofConfig</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">
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FaceAntiSpoofConfig | @vladmandic/human - v2.5.2</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.2"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.2</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.5.2</a></li><li><a href="FaceAntiSpoofConfig.html">FaceAntiSpoofConfig</a></li></ul><h1>Interface FaceAntiSpoofConfig</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>Anti-spoofing part of face configuration</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><a href="GenericConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">GenericConfig</a><ul class="tsd-hierarchy"><li><span class="target">FaceAntiSpoofConfig</span></li></ul></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 tsd-is-inherited"><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceAntiSpoofConfig.html#enabled" class="tsd-kind-icon">enabled</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceAntiSpoofConfig.html#modelPath" class="tsd-kind-icon">model<wbr/>Path</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceAntiSpoofConfig.html#skipFrames" class="tsd-kind-icon">skip<wbr/>Frames</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceAntiSpoofConfig.html#skipTime" class="tsd-kind-icon">skip<wbr/>Time</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group tsd-is-inherited"><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="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"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#enabled">enabled</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L7">src/config.ts:7</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>property</dt><dd><p>is module enabled?</p>
</dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="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"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#modelPath">modelPath</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L9">src/config.ts:9</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>property</dt><dd><p>path to model json file</p>

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FaceDescriptionConfig | @vladmandic/human - v2.5.1</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.1"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.1</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.5.1</a></li><li><a href="FaceDescriptionConfig.html">FaceDescriptionConfig</a></li></ul><h1>Interface FaceDescriptionConfig</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">
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FaceDescriptionConfig | @vladmandic/human - v2.5.2</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.2"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.2</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.5.2</a></li><li><a href="FaceDescriptionConfig.html">FaceDescriptionConfig</a></li></ul><h1>Interface FaceDescriptionConfig</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>Description or face embedding part of face configuration</p>
<ul>
<li>also used by age and gender detection</li>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FaceDetectorConfig | @vladmandic/human - v2.5.1</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.1"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.1</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.5.1</a></li><li><a href="FaceDetectorConfig.html">FaceDetectorConfig</a></li></ul><h1>Interface FaceDetectorConfig</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">
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FaceDetectorConfig | @vladmandic/human - v2.5.2</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.2"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.2</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.5.2</a></li><li><a href="FaceDetectorConfig.html">FaceDetectorConfig</a></li></ul><h1>Interface FaceDetectorConfig</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>Dectector part of face configuration</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><a href="GenericConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">GenericConfig</a><ul class="tsd-hierarchy"><li><span class="target">FaceDetectorConfig</span></li></ul></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="FaceDetectorConfig.html#cropFactor" class="tsd-kind-icon">crop<wbr/>Factor</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceDetectorConfig.html#enabled" class="tsd-kind-icon">enabled</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceDetectorConfig.html#iouThreshold" class="tsd-kind-icon">iou<wbr/>Threshold</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceDetectorConfig.html#mask" class="tsd-kind-icon">mask</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceDetectorConfig.html#maxDetected" class="tsd-kind-icon">max<wbr/>Detected</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceDetectorConfig.html#minConfidence" class="tsd-kind-icon">min<wbr/>Confidence</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceDetectorConfig.html#modelPath" class="tsd-kind-icon">model<wbr/>Path</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceDetectorConfig.html#return" class="tsd-kind-icon">return</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceDetectorConfig.html#rotation" class="tsd-kind-icon">rotation</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceDetectorConfig.html#skipFrames" class="tsd-kind-icon">skip<wbr/>Frames</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceDetectorConfig.html#skipTime" class="tsd-kind-icon">skip<wbr/>Time</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 id="cropFactor" class="tsd-anchor"></a><h3>crop<wbr/>Factor</h3><div class="tsd-signature tsd-kind-icon">crop<wbr/>Factor<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#L31">src/config.ts:31</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>property</dt><dd><p>factor used to expand detected face before further analysis</p>
<ul>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FaceEmotionConfig | @vladmandic/human - v2.5.1</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.1"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.1</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.5.1</a></li><li><a href="FaceEmotionConfig.html">FaceEmotionConfig</a></li></ul><h1>Interface FaceEmotionConfig</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">
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FaceEmotionConfig | @vladmandic/human - v2.5.2</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.2"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.2</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.5.2</a></li><li><a href="FaceEmotionConfig.html">FaceEmotionConfig</a></li></ul><h1>Interface FaceEmotionConfig</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>Emotion part of face configuration</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><a href="GenericConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">GenericConfig</a><ul class="tsd-hierarchy"><li><span class="target">FaceEmotionConfig</span></li></ul></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 tsd-is-inherited"><a href="FaceEmotionConfig.html#enabled" class="tsd-kind-icon">enabled</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceEmotionConfig.html#minConfidence" class="tsd-kind-icon">min<wbr/>Confidence</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceEmotionConfig.html#modelPath" class="tsd-kind-icon">model<wbr/>Path</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceEmotionConfig.html#skipFrames" class="tsd-kind-icon">skip<wbr/>Frames</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceEmotionConfig.html#skipTime" class="tsd-kind-icon">skip<wbr/>Time</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 tsd-is-inherited"><a id="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"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#enabled">enabled</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L7">src/config.ts:7</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>property</dt><dd><p>is module enabled?</p>
</dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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#L55">src/config.ts:55</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>property</dt><dd><p>minimum confidence for a detected face before results are discarded</p>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FaceIrisConfig | @vladmandic/human - v2.5.1</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.1"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.1</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.5.1</a></li><li><a href="FaceIrisConfig.html">FaceIrisConfig</a></li></ul><h1>Interface FaceIrisConfig</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">
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FaceIrisConfig | @vladmandic/human - v2.5.2</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.2"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.2</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.5.2</a></li><li><a href="FaceIrisConfig.html">FaceIrisConfig</a></li></ul><h1>Interface FaceIrisConfig</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>Iris part of face configuration</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><a href="GenericConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">GenericConfig</a><ul class="tsd-hierarchy"><li><span class="target">FaceIrisConfig</span></li></ul></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 tsd-is-inherited"><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceIrisConfig.html#enabled" class="tsd-kind-icon">enabled</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceIrisConfig.html#modelPath" class="tsd-kind-icon">model<wbr/>Path</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceIrisConfig.html#skipFrames" class="tsd-kind-icon">skip<wbr/>Frames</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceIrisConfig.html#skipTime" class="tsd-kind-icon">skip<wbr/>Time</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group tsd-is-inherited"><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="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"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#enabled">enabled</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L7">src/config.ts:7</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>property</dt><dd><p>is module enabled?</p>
</dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="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"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#modelPath">modelPath</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L9">src/config.ts:9</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>property</dt><dd><p>path to model json file</p>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FaceLivenessConfig | @vladmandic/human - v2.5.1</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.1"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.1</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.5.1</a></li><li><a href="FaceLivenessConfig.html">FaceLivenessConfig</a></li></ul><h1>Interface FaceLivenessConfig</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">
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FaceLivenessConfig | @vladmandic/human - v2.5.2</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.2"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.2</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.5.2</a></li><li><a href="FaceLivenessConfig.html">FaceLivenessConfig</a></li></ul><h1>Interface FaceLivenessConfig</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>Liveness part of face configuration</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><a href="GenericConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">GenericConfig</a><ul class="tsd-hierarchy"><li><span class="target">FaceLivenessConfig</span></li></ul></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 tsd-is-inherited"><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceLivenessConfig.html#enabled" class="tsd-kind-icon">enabled</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceLivenessConfig.html#modelPath" class="tsd-kind-icon">model<wbr/>Path</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceLivenessConfig.html#skipFrames" class="tsd-kind-icon">skip<wbr/>Frames</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceLivenessConfig.html#skipTime" class="tsd-kind-icon">skip<wbr/>Time</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group tsd-is-inherited"><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="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"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#enabled">enabled</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L7">src/config.ts:7</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>property</dt><dd><p>is module enabled?</p>
</dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="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"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#modelPath">modelPath</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L9">src/config.ts:9</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>property</dt><dd><p>path to model json file</p>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FaceMeshConfig | @vladmandic/human - v2.5.1</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.1"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.1</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.5.1</a></li><li><a href="FaceMeshConfig.html">FaceMeshConfig</a></li></ul><h1>Interface FaceMeshConfig</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">
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FaceMeshConfig | @vladmandic/human - v2.5.2</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.2"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.2</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.5.2</a></li><li><a href="FaceMeshConfig.html">FaceMeshConfig</a></li></ul><h1>Interface FaceMeshConfig</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>Mesh part of face configuration</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><a href="GenericConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">GenericConfig</a><ul class="tsd-hierarchy"><li><span class="target">FaceMeshConfig</span></li></ul></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 tsd-is-inherited"><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceMeshConfig.html#enabled" class="tsd-kind-icon">enabled</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceMeshConfig.html#modelPath" class="tsd-kind-icon">model<wbr/>Path</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceMeshConfig.html#skipFrames" class="tsd-kind-icon">skip<wbr/>Frames</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceMeshConfig.html#skipTime" class="tsd-kind-icon">skip<wbr/>Time</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group tsd-is-inherited"><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="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"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#enabled">enabled</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L7">src/config.ts:7</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>property</dt><dd><p>is module enabled?</p>
</dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="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"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#modelPath">modelPath</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L9">src/config.ts:9</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>property</dt><dd><p>path to model json file</p>

View File

@ -1,47 +1,47 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FaceResult | @vladmandic/human - v2.5.1</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.1"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.1</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.5.1</a></li><li><a href="FaceResult.html">FaceResult</a></li></ul><h1>Interface FaceResult</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">
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FaceResult | @vladmandic/human - v2.5.2</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.2"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.2</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.5.2</a></li><li><a href="FaceResult.html">FaceResult</a></li></ul><h1>Interface FaceResult</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>Face results</p>
<ul>
<li>Combined results of face detector, face mesh, age, gender, emotion, embedding, iris models</li>
<li>Some values may be null if specific model is not enabled</li>
</ul>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">FaceResult</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="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#live" class="tsd-kind-icon">live</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#race" class="tsd-kind-icon">race</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceResult.html#real" class="tsd-kind-icon">real</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></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 id="age" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> age</h3><div class="tsd-signature tsd-kind-icon">age<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/result.ts#L37">src/result.ts:37</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">FaceResult</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="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#live" class="tsd-kind-icon">live</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#race" class="tsd-kind-icon">race</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceResult.html#real" class="tsd-kind-icon">real</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></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 id="age" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> age</h3><div class="tsd-signature tsd-kind-icon">age<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/result.ts#L38">src/result.ts:38</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>detected age</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="annotations" class="tsd-anchor"></a><h3>annotations</h3><div class="tsd-signature tsd-kind-icon">annotations<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">string</span><span class="tsd-signature-symbol">, </span><a href="../index.html#Point" class="tsd-signature-type" data-tsd-kind="Type alias">Point</a><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#L35">src/result.ts:35</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="annotations" class="tsd-anchor"></a><h3>annotations</h3><div class="tsd-signature tsd-kind-icon">annotations<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">string</span><span class="tsd-signature-symbol">, </span><a href="../index.html#Point" class="tsd-signature-type" data-tsd-kind="Type alias">Point</a><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#L36">src/result.ts:36</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>mesh keypoints combined into annotated results</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="box" class="tsd-anchor"></a><h3>box</h3><div class="tsd-signature tsd-kind-icon">box<span class="tsd-signature-symbol">:</span> <a href="../index.html#Box" class="tsd-signature-type" data-tsd-kind="Type alias">Box</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L27">src/result.ts:27</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="box" class="tsd-anchor"></a><h3>box</h3><div class="tsd-signature tsd-kind-icon">box<span class="tsd-signature-symbol">:</span> <a href="../index.html#Box" class="tsd-signature-type" data-tsd-kind="Type alias">Box</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L28">src/result.ts:28</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>detected face box</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="boxRaw" class="tsd-anchor"></a><h3>box<wbr/>Raw</h3><div class="tsd-signature tsd-kind-icon">box<wbr/>Raw<span class="tsd-signature-symbol">:</span> <a href="../index.html#Box" class="tsd-signature-type" data-tsd-kind="Type alias">Box</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L29">src/result.ts:29</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="boxRaw" class="tsd-anchor"></a><h3>box<wbr/>Raw</h3><div class="tsd-signature tsd-kind-icon">box<wbr/>Raw<span class="tsd-signature-symbol">:</span> <a href="../index.html#Box" class="tsd-signature-type" data-tsd-kind="Type alias">Box</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L30">src/result.ts:30</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>detected face box normalized to 0..1</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="boxScore" class="tsd-anchor"></a><h3>box<wbr/>Score</h3><div class="tsd-signature tsd-kind-icon">box<wbr/>Score<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/result.ts#L23">src/result.ts:23</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="boxScore" class="tsd-anchor"></a><h3>box<wbr/>Score</h3><div class="tsd-signature tsd-kind-icon">box<wbr/>Score<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/result.ts#L24">src/result.ts:24</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>detection score</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="embedding" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> embedding</h3><div class="tsd-signature tsd-kind-icon">embedding<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#L47">src/result.ts:47</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="embedding" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> embedding</h3><div class="tsd-signature tsd-kind-icon">embedding<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#L48">src/result.ts:48</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>face descriptor</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="emotion" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> emotion</h3><div class="tsd-signature tsd-kind-icon">emotion<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">{ </span>emotion<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>score<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></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L43">src/result.ts:43</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="emotion" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> emotion</h3><div class="tsd-signature tsd-kind-icon">emotion<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">{ </span>emotion<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>score<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></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L44">src/result.ts:44</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>detected emotions</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="faceScore" class="tsd-anchor"></a><h3>face<wbr/>Score</h3><div class="tsd-signature tsd-kind-icon">face<wbr/>Score<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/result.ts#L25">src/result.ts:25</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="faceScore" class="tsd-anchor"></a><h3>face<wbr/>Score</h3><div class="tsd-signature tsd-kind-icon">face<wbr/>Score<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/result.ts#L26">src/result.ts:26</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>mesh score</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="gender" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> gender</h3><div class="tsd-signature tsd-kind-icon">gender<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/result.ts#L39">src/result.ts:39</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="gender" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> gender</h3><div class="tsd-signature tsd-kind-icon">gender<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/result.ts#L40">src/result.ts:40</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>detected gender</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="genderScore" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> gender<wbr/>Score</h3><div class="tsd-signature tsd-kind-icon">gender<wbr/>Score<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/result.ts#L41">src/result.ts:41</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="genderScore" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> gender<wbr/>Score</h3><div class="tsd-signature tsd-kind-icon">gender<wbr/>Score<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/result.ts#L42">src/result.ts:42</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>gender detection score</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="id" class="tsd-anchor"></a><h3>id</h3><div class="tsd-signature tsd-kind-icon">id<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/result.ts#L19">src/result.ts:19</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="id" class="tsd-anchor"></a><h3>id</h3><div class="tsd-signature tsd-kind-icon">id<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/result.ts#L20">src/result.ts:20</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>face id</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="iris" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> iris</h3><div class="tsd-signature tsd-kind-icon">iris<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/result.ts#L49">src/result.ts:49</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="iris" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> iris</h3><div class="tsd-signature tsd-kind-icon">iris<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/result.ts#L50">src/result.ts:50</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>face iris distance from camera</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="live" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> live</h3><div class="tsd-signature tsd-kind-icon">live<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/result.ts#L53">src/result.ts:53</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="live" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> live</h3><div class="tsd-signature tsd-kind-icon">live<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/result.ts#L54">src/result.ts:54</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>face liveness result confidence</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="mesh" class="tsd-anchor"></a><h3>mesh</h3><div class="tsd-signature tsd-kind-icon">mesh<span class="tsd-signature-symbol">:</span> <a href="../index.html#Point" class="tsd-signature-type" data-tsd-kind="Type alias">Point</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#L31">src/result.ts:31</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="mesh" class="tsd-anchor"></a><h3>mesh</h3><div class="tsd-signature tsd-kind-icon">mesh<span class="tsd-signature-symbol">:</span> <a href="../index.html#Point" class="tsd-signature-type" data-tsd-kind="Type alias">Point</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#L32">src/result.ts:32</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>detected face mesh</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="meshRaw" class="tsd-anchor"></a><h3>mesh<wbr/>Raw</h3><div class="tsd-signature tsd-kind-icon">mesh<wbr/>Raw<span class="tsd-signature-symbol">:</span> <a href="../index.html#Point" class="tsd-signature-type" data-tsd-kind="Type alias">Point</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#L33">src/result.ts:33</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="meshRaw" class="tsd-anchor"></a><h3>mesh<wbr/>Raw</h3><div class="tsd-signature tsd-kind-icon">mesh<wbr/>Raw<span class="tsd-signature-symbol">:</span> <a href="../index.html#Point" class="tsd-signature-type" data-tsd-kind="Type alias">Point</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#L34">src/result.ts:34</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>detected face mesh normalized to 0..1</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="race" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> race</h3><div class="tsd-signature tsd-kind-icon">race<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">{ </span>race<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>score<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></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L45">src/result.ts:45</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="race" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> race</h3><div class="tsd-signature tsd-kind-icon">race<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">{ </span>race<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>score<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></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L46">src/result.ts:46</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>detected race</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="real" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> real</h3><div class="tsd-signature tsd-kind-icon">real<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/result.ts#L51">src/result.ts:51</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="real" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> real</h3><div class="tsd-signature tsd-kind-icon">real<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/result.ts#L52">src/result.ts:52</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>face anti-spoofing result confidence</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="rotation" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> rotation</h3><div class="tsd-signature tsd-kind-icon">rotation<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">{ </span>angle<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>pitch<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>roll<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>yaw<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>gaze<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>bearing<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>strength<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>matrix<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">number</span><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></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L55">src/result.ts:55</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="rotation" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> rotation</h3><div class="tsd-signature tsd-kind-icon">rotation<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">{ </span>angle<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>pitch<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>roll<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>yaw<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>gaze<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>bearing<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>strength<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>matrix<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">number</span><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></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L56">src/result.ts:56</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>face rotation details</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="score" class="tsd-anchor"></a><h3>score</h3><div class="tsd-signature tsd-kind-icon">score<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/result.ts#L21">src/result.ts:21</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="score" class="tsd-anchor"></a><h3>score</h3><div class="tsd-signature tsd-kind-icon">score<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/result.ts#L22">src/result.ts:22</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>overall face score</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="tensor" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> tensor</h3><div class="tsd-signature tsd-kind-icon">tensor<span class="tsd-signature-symbol">?:</span> <a href="../classes/Tensor.html" class="tsd-signature-type" data-tsd-kind="Class">Tensor</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Rank</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#L61">src/result.ts:61</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="tensor" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> tensor</h3><div class="tsd-signature tsd-kind-icon">tensor<span class="tsd-signature-symbol">?:</span> <a href="../classes/Tensor.html" class="tsd-signature-type" data-tsd-kind="Class">Tensor</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Rank</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#L62">src/result.ts:62</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>detected face as tensor that can be used in further pipelines</p>
</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><li class=" tsd-kind-namespace"><a href="../modules/Tensor.html">Tensor</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-interface"><a href="FaceResult.html" class="tsd-kind-icon">Face<wbr/>Result</a><ul><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#live" class="tsd-kind-icon">live</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#race" class="tsd-kind-icon">race</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceResult.html#real" class="tsd-kind-icon">real</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></li></ul></nav></div></div></div><footer class=""><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><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="overlay"></div><script src="../assets/main.js"></script></body></html>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FilterConfig | @vladmandic/human - v2.5.1</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.1"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.1</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.5.1</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">
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FilterConfig | @vladmandic/human - v2.5.2</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.2"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.2</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.5.2</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>available only in Browser environments</li>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>GenericConfig | @vladmandic/human - v2.5.1</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.1"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.1</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.5.1</a></li><li><a href="GenericConfig.html">GenericConfig</a></li></ul><h1>Interface GenericConfig</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">
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>GenericConfig | @vladmandic/human - v2.5.2</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.2"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.2</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.5.2</a></li><li><a href="GenericConfig.html">GenericConfig</a></li></ul><h1>Interface GenericConfig</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>Generic config type inherited by all module types</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">GenericConfig</span><ul class="tsd-hierarchy"><li><a href="FaceDetectorConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">FaceDetectorConfig</a></li><li><a href="FaceMeshConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">FaceMeshConfig</a></li><li><a href="FaceIrisConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">FaceIrisConfig</a></li><li><a href="FaceDescriptionConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">FaceDescriptionConfig</a></li><li><a href="FaceEmotionConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">FaceEmotionConfig</a></li><li><a href="FaceAntiSpoofConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">FaceAntiSpoofConfig</a></li><li><a href="FaceLivenessConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">FaceLivenessConfig</a></li><li><a href="FaceConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">FaceConfig</a></li><li><a href="BodyConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">BodyConfig</a></li><li><a href="HandConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">HandConfig</a></li><li><a href="ObjectConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">ObjectConfig</a></li><li><a href="SegmentationConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">SegmentationConfig</a></li></ul></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="GenericConfig.html#enabled" class="tsd-kind-icon">enabled</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="GenericConfig.html#modelPath" class="tsd-kind-icon">model<wbr/>Path</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="GenericConfig.html#skipFrames" class="tsd-kind-icon">skip<wbr/>Frames</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="GenericConfig.html#skipTime" class="tsd-kind-icon">skip<wbr/>Time</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 id="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#L7">src/config.ts:7</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>property</dt><dd><p>is module enabled?</p>
</dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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#L9">src/config.ts:9</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>property</dt><dd><p>path to model json file</p>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>GestureConfig | @vladmandic/human - v2.5.1</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.1"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.1</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.5.1</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">
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>GestureConfig | @vladmandic/human - v2.5.2</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.2"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.2</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.5.2</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 id="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#L190">src/config.ts:190</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>property</dt><dd><p>is gesture detection enabled?</p>
</dd></dl></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><li class=" tsd-kind-namespace"><a href="../modules/Tensor.html">Tensor</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><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></nav></div></div></div><footer class=""><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><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="overlay"></div><script src="../assets/main.js"></script></body></html>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>HandConfig | @vladmandic/human - v2.5.1</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.1"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.1</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.5.1</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">
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>HandConfig | @vladmandic/human - v2.5.2</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.2"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.2</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.5.2</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>Configures all hand detection specific options</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><a href="GenericConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">GenericConfig</a><ul class="tsd-hierarchy"><li><span class="target">HandConfig</span></li></ul></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 tsd-is-inherited"><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 tsd-is-inherited"><a href="HandConfig.html#modelPath-1" class="tsd-kind-icon">model<wbr/>Path</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 tsd-is-inherited"><a href="HandConfig.html#skipFrames" class="tsd-kind-icon">skip<wbr/>Frames</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="HandConfig.html#skipTime" class="tsd-kind-icon">skip<wbr/>Time</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 id="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#L99">src/config.ts:99</a></li></ul></aside><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-flag ts-flagOptional">Optional</span> model<wbr/>Path<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>property</dt><dd><p>path to hand detector model json</p>
</dd></dl></div></li></ul></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="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"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#enabled">enabled</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L7">src/config.ts:7</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>property</dt><dd><p>is module enabled?</p>

View File

@ -1,23 +1,23 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>HandResult | @vladmandic/human - v2.5.1</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.1"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.1</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.5.1</a></li><li><a href="HandResult.html">HandResult</a></li></ul><h1>Interface HandResult</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">
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>HandResult | @vladmandic/human - v2.5.2</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.2"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.2</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.5.2</a></li><li><a href="HandResult.html">HandResult</a></li></ul><h1>Interface HandResult</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>Hand results</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">HandResult</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="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#boxScore" class="tsd-kind-icon">box<wbr/>Score</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandResult.html#fingerScore" class="tsd-kind-icon">finger<wbr/>Score</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#label" class="tsd-kind-icon">label</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></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 id="annotations" class="tsd-anchor"></a><h3>annotations</h3><div class="tsd-signature tsd-kind-icon">annotations<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-type">&quot;palm&quot;</span><span class="tsd-signature-symbol">, </span><a href="../index.html#Point" class="tsd-signature-type" data-tsd-kind="Type alias">Point</a><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#L110">src/result.ts:110</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">HandResult</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="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#boxScore" class="tsd-kind-icon">box<wbr/>Score</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandResult.html#fingerScore" class="tsd-kind-icon">finger<wbr/>Score</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#label" class="tsd-kind-icon">label</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></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 id="annotations" class="tsd-anchor"></a><h3>annotations</h3><div class="tsd-signature tsd-kind-icon">annotations<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-type">&quot;palm&quot;</span><span class="tsd-signature-symbol">, </span><a href="../index.html#Point" class="tsd-signature-type" data-tsd-kind="Type alias">Point</a><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#L111">src/result.ts:111</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>detected hand keypoints combined into annotated parts</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="box" class="tsd-anchor"></a><h3>box</h3><div class="tsd-signature tsd-kind-icon">box<span class="tsd-signature-symbol">:</span> <a href="../index.html#Box" class="tsd-signature-type" data-tsd-kind="Type alias">Box</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L102">src/result.ts:102</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="box" class="tsd-anchor"></a><h3>box</h3><div class="tsd-signature tsd-kind-icon">box<span class="tsd-signature-symbol">:</span> <a href="../index.html#Box" class="tsd-signature-type" data-tsd-kind="Type alias">Box</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L103">src/result.ts:103</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>detected hand box</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="boxRaw" class="tsd-anchor"></a><h3>box<wbr/>Raw</h3><div class="tsd-signature tsd-kind-icon">box<wbr/>Raw<span class="tsd-signature-symbol">:</span> <a href="../index.html#Box" class="tsd-signature-type" data-tsd-kind="Type alias">Box</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L104">src/result.ts:104</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="boxRaw" class="tsd-anchor"></a><h3>box<wbr/>Raw</h3><div class="tsd-signature tsd-kind-icon">box<wbr/>Raw<span class="tsd-signature-symbol">:</span> <a href="../index.html#Box" class="tsd-signature-type" data-tsd-kind="Type alias">Box</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L105">src/result.ts:105</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>detected hand box normalized to 0..1</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="boxScore" class="tsd-anchor"></a><h3>box<wbr/>Score</h3><div class="tsd-signature tsd-kind-icon">box<wbr/>Score<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/result.ts#L98">src/result.ts:98</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="boxScore" class="tsd-anchor"></a><h3>box<wbr/>Score</h3><div class="tsd-signature tsd-kind-icon">box<wbr/>Score<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/result.ts#L99">src/result.ts:99</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>hand detection score</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="fingerScore" class="tsd-anchor"></a><h3>finger<wbr/>Score</h3><div class="tsd-signature tsd-kind-icon">finger<wbr/>Score<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/result.ts#L100">src/result.ts:100</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="fingerScore" class="tsd-anchor"></a><h3>finger<wbr/>Score</h3><div class="tsd-signature tsd-kind-icon">finger<wbr/>Score<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/result.ts#L101">src/result.ts:101</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>hand skelton score</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="id" class="tsd-anchor"></a><h3>id</h3><div class="tsd-signature tsd-kind-icon">id<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/result.ts#L94">src/result.ts:94</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="id" class="tsd-anchor"></a><h3>id</h3><div class="tsd-signature tsd-kind-icon">id<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/result.ts#L95">src/result.ts:95</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>hand id</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="keypoints" class="tsd-anchor"></a><h3>keypoints</h3><div class="tsd-signature tsd-kind-icon">keypoints<span class="tsd-signature-symbol">:</span> <a href="../index.html#Point" class="tsd-signature-type" data-tsd-kind="Type alias">Point</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#L106">src/result.ts:106</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="keypoints" class="tsd-anchor"></a><h3>keypoints</h3><div class="tsd-signature tsd-kind-icon">keypoints<span class="tsd-signature-symbol">:</span> <a href="../index.html#Point" class="tsd-signature-type" data-tsd-kind="Type alias">Point</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#L107">src/result.ts:107</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>detected hand keypoints</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="label" class="tsd-anchor"></a><h3>label</h3><div class="tsd-signature tsd-kind-icon">label<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/result.ts#L108">src/result.ts:108</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="label" class="tsd-anchor"></a><h3>label</h3><div class="tsd-signature tsd-kind-icon">label<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/result.ts#L109">src/result.ts:109</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>detected hand class</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L115">src/result.ts:115</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L116">src/result.ts:116</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>detected hand parts annotated with part gestures</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="score" class="tsd-anchor"></a><h3>score</h3><div class="tsd-signature tsd-kind-icon">score<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/result.ts#L96">src/result.ts:96</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="score" class="tsd-anchor"></a><h3>score</h3><div class="tsd-signature tsd-kind-icon">score<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/result.ts#L97">src/result.ts:97</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>hand overal score</p>
</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><li class=" tsd-kind-namespace"><a href="../modules/Tensor.html">Tensor</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-interface"><a href="HandResult.html" class="tsd-kind-icon">Hand<wbr/>Result</a><ul><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#boxScore" class="tsd-kind-icon">box<wbr/>Score</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandResult.html#fingerScore" class="tsd-kind-icon">finger<wbr/>Score</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#label" class="tsd-kind-icon">label</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></li></ul></nav></div></div></div><footer class=""><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><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="overlay"></div><script src="../assets/main.js"></script></body></html>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>ObjectConfig | @vladmandic/human - v2.5.1</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.1"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.1</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.5.1</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">
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>ObjectConfig | @vladmandic/human - v2.5.2</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.2"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.2</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.5.2</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>Configures all object detection specific options</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><a href="GenericConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">GenericConfig</a><ul class="tsd-hierarchy"><li><span class="target">ObjectConfig</span></li></ul></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 tsd-is-inherited"><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 tsd-is-inherited"><a href="ObjectConfig.html#modelPath" class="tsd-kind-icon">model<wbr/>Path</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="ObjectConfig.html#skipFrames" class="tsd-kind-icon">skip<wbr/>Frames</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="ObjectConfig.html#skipTime" class="tsd-kind-icon">skip<wbr/>Time</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 tsd-is-inherited"><a id="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"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#enabled">enabled</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L7">src/config.ts:7</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>property</dt><dd><p>is module enabled?</p>
</dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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#L114">src/config.ts:114</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>property</dt><dd><p>minimum overlap between two detected objects before one is discarded</p>

View File

@ -1,15 +1,15 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>ObjectResult | @vladmandic/human - v2.5.1</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.1"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.1</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.5.1</a></li><li><a href="ObjectResult.html">ObjectResult</a></li></ul><h1>Interface ObjectResult</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">
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>ObjectResult | @vladmandic/human - v2.5.2</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.2"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.2</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.5.2</a></li><li><a href="ObjectResult.html">ObjectResult</a></li></ul><h1>Interface ObjectResult</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>Object results</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">ObjectResult</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="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></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 id="box" class="tsd-anchor"></a><h3>box</h3><div class="tsd-signature tsd-kind-icon">box<span class="tsd-signature-symbol">:</span> <a href="../index.html#Box" class="tsd-signature-type" data-tsd-kind="Type alias">Box</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L132">src/result.ts:132</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">ObjectResult</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="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></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 id="box" class="tsd-anchor"></a><h3>box</h3><div class="tsd-signature tsd-kind-icon">box<span class="tsd-signature-symbol">:</span> <a href="../index.html#Box" class="tsd-signature-type" data-tsd-kind="Type alias">Box</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L133">src/result.ts:133</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>detected object box</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="boxRaw" class="tsd-anchor"></a><h3>box<wbr/>Raw</h3><div class="tsd-signature tsd-kind-icon">box<wbr/>Raw<span class="tsd-signature-symbol">:</span> <a href="../index.html#Box" class="tsd-signature-type" data-tsd-kind="Type alias">Box</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L134">src/result.ts:134</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="boxRaw" class="tsd-anchor"></a><h3>box<wbr/>Raw</h3><div class="tsd-signature tsd-kind-icon">box<wbr/>Raw<span class="tsd-signature-symbol">:</span> <a href="../index.html#Box" class="tsd-signature-type" data-tsd-kind="Type alias">Box</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L135">src/result.ts:135</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>detected object box normalized to 0..1</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="class" class="tsd-anchor"></a><h3>class</h3><div class="tsd-signature tsd-kind-icon">class<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/result.ts#L128">src/result.ts:128</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="class" class="tsd-anchor"></a><h3>class</h3><div class="tsd-signature tsd-kind-icon">class<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/result.ts#L129">src/result.ts:129</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>detected object class id</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="id" class="tsd-anchor"></a><h3>id</h3><div class="tsd-signature tsd-kind-icon">id<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/result.ts#L124">src/result.ts:124</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="id" class="tsd-anchor"></a><h3>id</h3><div class="tsd-signature tsd-kind-icon">id<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/result.ts#L125">src/result.ts:125</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>object id</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="label" class="tsd-anchor"></a><h3>label</h3><div class="tsd-signature tsd-kind-icon">label<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/result.ts#L130">src/result.ts:130</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="label" class="tsd-anchor"></a><h3>label</h3><div class="tsd-signature tsd-kind-icon">label<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/result.ts#L131">src/result.ts:131</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>detected object class name</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="score" class="tsd-anchor"></a><h3>score</h3><div class="tsd-signature tsd-kind-icon">score<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/result.ts#L126">src/result.ts:126</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="score" class="tsd-anchor"></a><h3>score</h3><div class="tsd-signature tsd-kind-icon">score<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/result.ts#L127">src/result.ts:127</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>object detection score</p>
</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><li class=" tsd-kind-namespace"><a href="../modules/Tensor.html">Tensor</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-interface"><a href="ObjectResult.html" class="tsd-kind-icon">Object<wbr/>Result</a><ul><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></li></ul></nav></div></div></div><footer class=""><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><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="overlay"></div><script src="../assets/main.js"></script></body></html>

View File

@ -1,20 +1,20 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>PersonResult | @vladmandic/human - v2.5.1</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.1"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.1</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.5.1</a></li><li><a href="PersonResult.html">PersonResult</a></li></ul><h1>Interface PersonResult</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">
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>PersonResult | @vladmandic/human - v2.5.2</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.2"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.2</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.5.2</a></li><li><a href="PersonResult.html">PersonResult</a></li></ul><h1>Interface PersonResult</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>Person getter</p>
<ul>
<li>Triggers combining all individual results into a virtual person object</li>
</ul>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">PersonResult</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="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></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 id="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="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#L158">src/result.ts:158</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">PersonResult</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="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></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 id="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="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#L159">src/result.ts:159</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>body result that belongs to this person</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="box" class="tsd-anchor"></a><h3>box</h3><div class="tsd-signature tsd-kind-icon">box<span class="tsd-signature-symbol">:</span> <a href="../index.html#Box" class="tsd-signature-type" data-tsd-kind="Type alias">Box</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L164">src/result.ts:164</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="box" class="tsd-anchor"></a><h3>box</h3><div class="tsd-signature tsd-kind-icon">box<span class="tsd-signature-symbol">:</span> <a href="../index.html#Box" class="tsd-signature-type" data-tsd-kind="Type alias">Box</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L165">src/result.ts:165</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>box that defines the person</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="boxRaw" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> box<wbr/>Raw</h3><div class="tsd-signature tsd-kind-icon">box<wbr/>Raw<span class="tsd-signature-symbol">?:</span> <a href="../index.html#Box" class="tsd-signature-type" data-tsd-kind="Type alias">Box</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L166">src/result.ts:166</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="boxRaw" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> box<wbr/>Raw</h3><div class="tsd-signature tsd-kind-icon">box<wbr/>Raw<span class="tsd-signature-symbol">?:</span> <a href="../index.html#Box" class="tsd-signature-type" data-tsd-kind="Type alias">Box</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L167">src/result.ts:167</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>box that defines the person normalized to 0..1</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="face" class="tsd-anchor"></a><h3>face</h3><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#L156">src/result.ts:156</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="face" class="tsd-anchor"></a><h3>face</h3><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#L157">src/result.ts:157</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>face result that belongs to this person</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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#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#L162">src/result.ts:162</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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#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#L163">src/result.ts:163</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>detected gestures specific to this person</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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="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#L160">src/result.ts:160</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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="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#L161">src/result.ts:161</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>left and right hand results that belong to this person</p>
</div></div><div class="tsd-type-declaration"><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="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="HandResult.html" class="tsd-signature-type" data-tsd-kind="Interface">HandResult</a></h5></li></ul></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="id" class="tsd-anchor"></a><h3>id</h3><div class="tsd-signature tsd-kind-icon">id<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/result.ts#L154">src/result.ts:154</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div><div class="tsd-type-declaration"><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="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="HandResult.html" class="tsd-signature-type" data-tsd-kind="Interface">HandResult</a></h5></li></ul></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="id" class="tsd-anchor"></a><h3>id</h3><div class="tsd-signature tsd-kind-icon">id<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/result.ts#L155">src/result.ts:155</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>person id</p>
</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><li class=" tsd-kind-namespace"><a href="../modules/Tensor.html">Tensor</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-interface"><a href="PersonResult.html" class="tsd-kind-icon">Person<wbr/>Result</a><ul><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></li></ul></nav></div></div></div><footer class=""><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><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="overlay"></div><script src="../assets/main.js"></script></body></html>

View File

@ -1,22 +1,23 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Result | @vladmandic/human - v2.5.1</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.1"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.1</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.5.1</a></li><li><a href="Result.html">Result</a></li></ul><h1>Interface Result</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">
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Result | @vladmandic/human - v2.5.2</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.2"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.2</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.5.2</a></li><li><a href="Result.html">Result</a></li></ul><h1>Interface Result</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>Result interface definition for <strong>Human</strong> library</p>
</div><div><p>Contains all possible detection results</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">Result</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="Result.html#body" class="tsd-kind-icon">body</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#canvas" class="tsd-kind-icon">canvas</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#face" class="tsd-kind-icon">face</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#gesture" class="tsd-kind-icon">gesture</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#hand" class="tsd-kind-icon">hand</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#object" class="tsd-kind-icon">object</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#performance" class="tsd-kind-icon">performance</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#persons" class="tsd-kind-icon">persons</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#timestamp" class="tsd-kind-icon">timestamp</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 id="body" class="tsd-anchor"></a><h3>body</h3><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#L178">src/result.ts:178</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">Result</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="Result.html#body" class="tsd-kind-icon">body</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#canvas" class="tsd-kind-icon">canvas</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#error" class="tsd-kind-icon">error</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#face" class="tsd-kind-icon">face</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#gesture" class="tsd-kind-icon">gesture</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#hand" class="tsd-kind-icon">hand</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#object" class="tsd-kind-icon">object</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#performance" class="tsd-kind-icon">performance</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#persons" class="tsd-kind-icon">persons</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#timestamp" class="tsd-kind-icon">timestamp</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 id="body" class="tsd-anchor"></a><h3>body</h3><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">src/result.ts:179</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p><a href="BodyResult.html">BodyResult</a>: detection &amp; analysis results</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="canvas" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> canvas</h3><div class="tsd-signature tsd-kind-icon">canvas<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">OffscreenCanvas</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLCanvasElement</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L188">src/result.ts:188</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="canvas" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> canvas</h3><div class="tsd-signature tsd-kind-icon">canvas<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="../index.html#AnyCanvas" class="tsd-signature-type" data-tsd-kind="Type alias">AnyCanvas</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L189">src/result.ts:189</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>optional processed canvas that can be used to draw input on screen</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="face" class="tsd-anchor"></a><h3>face</h3><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#L176">src/result.ts:176</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="error" class="tsd-anchor"></a><h3>error</h3><div class="tsd-signature tsd-kind-icon">error<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><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L195">src/result.ts:195</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>property</dt><dd><p>Last known error message</p>
</dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="face" class="tsd-anchor"></a><h3>face</h3><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">src/result.ts:177</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<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 id="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#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#L182">src/result.ts:182</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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#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">src/result.ts:183</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<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 id="hand" class="tsd-anchor"></a><h3>hand</h3><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#L180">src/result.ts:180</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="hand" class="tsd-anchor"></a><h3>hand</h3><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">src/result.ts:181</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<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 id="object" class="tsd-anchor"></a><h3>object</h3><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#L184">src/result.ts:184</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="object" class="tsd-anchor"></a><h3>object</h3><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">src/result.ts:185</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p><a href="ObjectResult.html">ObjectResult</a>: detection &amp; analysis results</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="performance" class="tsd-anchor"></a><h3>performance</h3><div class="tsd-signature tsd-kind-icon">performance<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">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">number</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#L186">src/result.ts:186</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="performance" class="tsd-anchor"></a><h3>performance</h3><div class="tsd-signature tsd-kind-icon">performance<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">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">number</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#L187">src/result.ts:187</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>global performance object with timing values for each operation</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="persons" class="tsd-anchor"></a><h3>persons</h3><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#L192">src/result.ts:192</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="persons" class="tsd-anchor"></a><h3>persons</h3><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">src/result.ts:193</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>getter property that returns unified persons object</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="timestamp" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagReadonly">Readonly</span> timestamp</h3><div class="tsd-signature tsd-kind-icon">timestamp<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/result.ts#L190">src/result.ts:190</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="timestamp" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagReadonly">Readonly</span> timestamp</h3><div class="tsd-signature tsd-kind-icon">timestamp<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/result.ts#L191">src/result.ts:191</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>timestamp of detection representing the milliseconds elapsed since the UNIX epoch</p>
</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><li class=" tsd-kind-namespace"><a href="../modules/Tensor.html">Tensor</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-interface"><a href="Result.html" class="tsd-kind-icon">Result</a><ul><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#body" class="tsd-kind-icon">body</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#canvas" class="tsd-kind-icon">canvas</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#face" class="tsd-kind-icon">face</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#gesture" class="tsd-kind-icon">gesture</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#hand" class="tsd-kind-icon">hand</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#object" class="tsd-kind-icon">object</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#performance" class="tsd-kind-icon">performance</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#persons" class="tsd-kind-icon">persons</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#timestamp" class="tsd-kind-icon">timestamp</a></li></ul></li></ul></nav></div></div></div><footer class=""><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><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="overlay"></div><script src="../assets/main.js"></script></body></html>
</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><li class=" tsd-kind-namespace"><a href="../modules/Tensor.html">Tensor</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-interface"><a href="Result.html" class="tsd-kind-icon">Result</a><ul><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#body" class="tsd-kind-icon">body</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#canvas" class="tsd-kind-icon">canvas</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#error" class="tsd-kind-icon">error</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#face" class="tsd-kind-icon">face</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#gesture" class="tsd-kind-icon">gesture</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#hand" class="tsd-kind-icon">hand</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#object" class="tsd-kind-icon">object</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#performance" class="tsd-kind-icon">performance</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#persons" class="tsd-kind-icon">persons</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#timestamp" class="tsd-kind-icon">timestamp</a></li></ul></li></ul></nav></div></div></div><footer class=""><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><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="overlay"></div><script src="../assets/main.js"></script></body></html>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>SegmentationConfig | @vladmandic/human - v2.5.1</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.1"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.1</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.5.1</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">
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>SegmentationConfig | @vladmandic/human - v2.5.2</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.2"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.2</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.5.2</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>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

View File

@ -1 +1 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Tensor | @vladmandic/human - v2.5.1</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.1"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.1</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.5.1</a></li><li><a href="Tensor.html">Tensor</a></li></ul><h1>Namespace Tensor</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"></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><li class="current tsd-kind-namespace"><a href="Tensor.html">Tensor</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul></ul></nav></div></div></div><footer class=""><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><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="overlay"></div><script src="../assets/main.js"></script></body></html>
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Tensor | @vladmandic/human - v2.5.2</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.2"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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.5.2</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.5.2</a></li><li><a href="Tensor.html">Tensor</a></li></ul><h1>Namespace Tensor</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"></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><li class="current tsd-kind-namespace"><a href="Tensor.html">Tensor</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul></ul></nav></div></div></div><footer class=""><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><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="overlay"></div><script src="../assets/main.js"></script></body></html>

View File

@ -176,6 +176,8 @@ export interface GestureConfig {
/** @property is gesture detection enabled? */
enabled: boolean;
}
export declare type BackendType = ['cpu', 'wasm', 'webgl', 'humangl', 'tensorflow', 'webgpu'];
export declare type WarmupType = ['' | 'none' | 'face' | 'full' | 'body'];
/**
* Configuration interface definition for **Human** library
*
@ -213,7 +215,7 @@ export interface Config {
*
* default: `full`
*/
warmup: 'none' | 'face' | 'full' | 'body';
warmup: '' | 'none' | 'face' | 'full' | 'body';
/** Base model path (typically starting with file://, http:// or https://) for all models
* - individual modelPath values are relative to this path
*

View File

@ -5,4 +5,4 @@
import type { FaceResult } from '../result';
import type { Tensor } from '../tfjs/types';
import type { Human } from '../human';
export declare const detectFace: (parent: Human, input: Tensor) => Promise<FaceResult[]>;
export declare const detectFace: (instance: Human, input: Tensor) => Promise<FaceResult[]>;

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

@ -12,18 +12,13 @@ import * as draw from './util/draw';
import * as facemesh from './face/facemesh';
import * as match from './face/match';
import * as models from './models';
import type { Input, Tensor, DrawOptions, Config, Result } from './exports';
import type { Input, Tensor, DrawOptions, Config, Result, AnyCanvas } from './exports';
export * from './exports';
/** Instance of TensorFlow/JS used by Human
* - Can be TFJS that is bundled with `Human` or a manually imported TFJS library
* @external [API](https://js.tensorflow.org/api/latest/)
*/
export declare type TensorFlow = typeof tf;
/** Error message */
export declare type Error = {
/** @property error message */
error: string;
};
/** **Human** library main class
*
* All methods and properties are available only as members of Human class
@ -55,7 +50,7 @@ export declare class Human {
/** currenty processed image tensor and canvas */
process: {
tensor: Tensor | null;
canvas: OffscreenCanvas | HTMLCanvasElement | null;
canvas: AnyCanvas | null;
};
/** Instance of TensorFlow/JS used by Human
* - Can be embedded or externally provided
@ -134,7 +129,7 @@ export declare class Human {
*/
image(input: Input, getTensor?: boolean): Promise<{
tensor: Tensor<import("@tensorflow/tfjs-core").Rank> | null;
canvas: import("./exports").AnyCanvas | null;
canvas: AnyCanvas | null;
}>;
/** Segmentation method takes any input and returns processed canvas with body segmentation
* - Segmentation is not triggered as part of detect process
@ -151,8 +146,8 @@ export declare class Human {
*/
segmentation(input: Input, background?: Input): Promise<{
data: number[] | Tensor;
canvas: HTMLCanvasElement | OffscreenCanvas | null;
alpha: HTMLCanvasElement | OffscreenCanvas | null;
canvas: AnyCanvas | null;
alpha: AnyCanvas | null;
}>;
/** Enhance method performs additional enhacements to face image previously detected for futher processing
*
@ -217,7 +212,7 @@ export declare class Human {
* @param userConfig?: {@link Config}
* @returns result: {@link Result}
*/
detect(input: Input, userConfig?: Partial<Config>): Promise<Result | Error>;
detect(input: Input, userConfig?: Partial<Config>): Promise<Result>;
}
/** Class Human as default export */
export { Human as default };

View File

@ -3,6 +3,7 @@
*/
import type { Tensor } from './tfjs/types';
import type { FaceGesture, BodyGesture, HandGesture, IrisGesture } from './gesture/gesture';
import type { AnyCanvas } from './exports';
/** generic box as [x, y, width, height] */
export declare type Box = [number, number, number, number];
/** generic point as [x, y, z?] */
@ -196,9 +197,11 @@ export interface Result {
/** global performance object with timing values for each operation */
performance: Record<string, number>;
/** optional processed canvas that can be used to draw input on screen */
canvas?: OffscreenCanvas | HTMLCanvasElement | null | undefined;
canvas?: AnyCanvas | null;
/** timestamp of detection representing the milliseconds elapsed since the UNIX epoch */
readonly timestamp: number;
/** getter property that returns unified persons object */
persons: Array<PersonResult>;
/** @property Last known error message */
error: string | null;
}

View File

@ -1,9 +1,10 @@
/** TFJS custom backend registration */
import type { Human } from '../human';
import type { AnyCanvas } from '../exports';
export declare const config: {
name: string;
priority: number;
canvas: HTMLCanvasElement | OffscreenCanvas | null;
canvas: AnyCanvas | null;
gl: WebGL2RenderingContext | null;
extensions: string[];
webGLattr: {

View File

@ -56,7 +56,7 @@ export declare function object(inCanvas: AnyCanvas, result: Array<ObjectResult>,
/** draw combined person results instead of individual detection result objects */
export declare function person(inCanvas: AnyCanvas, result: Array<PersonResult>, drawOptions?: Partial<DrawOptions>): Promise<void>;
/** draw processed canvas */
export declare function canvas(input: AnyCanvas | HTMLImageElement | HTMLMediaElement | HTMLVideoElement, output: HTMLCanvasElement): Promise<void>;
export declare function canvas(input: AnyCanvas | HTMLImageElement | HTMLMediaElement | HTMLVideoElement, output: AnyCanvas): Promise<void>;
/** meta-function that performs draw for: canvas, face, body, hand
* @returns {Promise}
*/

View File

@ -1,8 +1,8 @@
/**
* Simple helper functions used accross codebase
*/
export declare function join(folder: string, file: string): string;
export declare function log(...msg: any[]): void;
export declare function join(folder: string, file: string): string;
export declare const now: () => number;
export declare function validate(defaults: any, config: any, parent?: string, msgs?: Array<{
reason: string;

2
wiki

@ -1 +1 @@
Subproject commit e26b155506e7981fa8187be228b5651de77ee8c6
Subproject commit e0e2b9a2ac15a4569abc1e8281e7636de2c45aef