Vladimir Mandic 2021-12-28 11:39:54 -05:00
parent e0f9c3b2af
commit 3f41077362
45 changed files with 1838 additions and 1671 deletions

View File

@ -9,11 +9,14 @@
## Changelog
### **HEAD -> main** 2021/12/28 mandic00@live.com
- fix samples
- fix(src): typo
- change on how face box is calculated
### **2.5.7** 2021/12/27 mandic00@live.com
### **origin/main** 2021/12/22 mandic00@live.com
- fix posenet
### **release: 2.5.6** 2021/12/15 mandic00@live.com

19
dist/human.d.ts vendored
View File

@ -37,7 +37,7 @@ export declare type BodyAnnotationEfficientPose = 'leftLeg' | 'rightLeg' | 'tors
/** Configures all body detection specific options */
export declare interface BodyConfig extends GenericConfig {
/** maximum numboer of detected bodies */
/** maximum number of detected bodies */
maxDetected: number;
/** minimum confidence for a detected body before results are discarded */
minConfidence: number;
@ -502,9 +502,11 @@ export declare interface FaceDescriptionConfig extends GenericConfig {
minConfidence: number;
}
/** Dectector part of face configuration */
/** Detector part of face configuration */
export declare interface FaceDetectorConfig extends GenericConfig {
/** is face rotation correction performed after detecting face? */
/** is face rotation correction performed after detecting face?
* used to correctly analyze faces under high angles
*/
rotation: boolean;
/** maximum number of detected faces */
maxDetected: number;
@ -514,7 +516,8 @@ export declare interface FaceDetectorConfig extends GenericConfig {
iouThreshold: number;
/** should child models perform on masked image of a face */
mask: boolean;
/** should face detection return face tensor to be used in some other extenrnal model? */
/** should face detection return processed and cropped face tensor that can with an external model for addtional processing?
* if enabled it must be manually deallocated to avoid memory leak */
return: boolean;
}
@ -695,11 +698,13 @@ export declare type Gender = 'male' | 'female' | 'unknown';
export declare interface GenericConfig {
/** is module enabled? */
enabled: boolean;
/** path to model json file */
/** path to model json file (relative to `modelBasePath` */
modelPath: string;
/** how many max frames to go without re-running model if cached results are acceptable */
/** how many max frames to go without re-running model if cached results are acceptable
* for two-phase models such as face and hand caching applies to bounding boxes detection only */
skipFrames: number;
/** how many max miliseconds to go without re-running model if cached results are acceptable */
/** how many max milliseconds to go without re-running model if cached results are acceptable
* for two-phase models such as face and hand caching applies to bounding boxes detection only */
skipTime: number;
}

View File

@ -37,7 +37,7 @@ export declare type BodyAnnotationEfficientPose = 'leftLeg' | 'rightLeg' | 'tors
/** Configures all body detection specific options */
export declare interface BodyConfig extends GenericConfig {
/** maximum numboer of detected bodies */
/** maximum number of detected bodies */
maxDetected: number;
/** minimum confidence for a detected body before results are discarded */
minConfidence: number;
@ -502,9 +502,11 @@ export declare interface FaceDescriptionConfig extends GenericConfig {
minConfidence: number;
}
/** Dectector part of face configuration */
/** Detector part of face configuration */
export declare interface FaceDetectorConfig extends GenericConfig {
/** is face rotation correction performed after detecting face? */
/** is face rotation correction performed after detecting face?
* used to correctly analyze faces under high angles
*/
rotation: boolean;
/** maximum number of detected faces */
maxDetected: number;
@ -514,7 +516,8 @@ export declare interface FaceDetectorConfig extends GenericConfig {
iouThreshold: number;
/** should child models perform on masked image of a face */
mask: boolean;
/** should face detection return face tensor to be used in some other extenrnal model? */
/** should face detection return processed and cropped face tensor that can with an external model for addtional processing?
* if enabled it must be manually deallocated to avoid memory leak */
return: boolean;
}
@ -695,11 +698,13 @@ export declare type Gender = 'male' | 'female' | 'unknown';
export declare interface GenericConfig {
/** is module enabled? */
enabled: boolean;
/** path to model json file */
/** path to model json file (relative to `modelBasePath` */
modelPath: string;
/** how many max frames to go without re-running model if cached results are acceptable */
/** how many max frames to go without re-running model if cached results are acceptable
* for two-phase models such as face and hand caching applies to bounding boxes detection only */
skipFrames: number;
/** how many max miliseconds to go without re-running model if cached results are acceptable */
/** how many max milliseconds to go without re-running model if cached results are acceptable
* for two-phase models such as face and hand caching applies to bounding boxes detection only */
skipTime: number;
}

View File

@ -962,8 +962,8 @@ function GLImageFilter() {
// src/image/enhance.ts
async function histogramEqualization(inputImage) {
const squeeze10 = inputImage.shape.length === 4 ? tfjs_esm_exports.squeeze(inputImage) : inputImage;
const channels = tfjs_esm_exports.split(squeeze10, 3, 2);
const squeeze11 = inputImage.shape.length === 4 ? tfjs_esm_exports.squeeze(inputImage) : inputImage;
const channels = tfjs_esm_exports.split(squeeze11, 3, 2);
const min2 = [tfjs_esm_exports.min(channels[0]), tfjs_esm_exports.min(channels[1]), tfjs_esm_exports.min(channels[2])];
const max4 = [tfjs_esm_exports.max(channels[0]), tfjs_esm_exports.max(channels[1]), tfjs_esm_exports.max(channels[2])];
const absMax = await Promise.all(max4.map((channel) => channel.data()));
@ -973,8 +973,8 @@ async function histogramEqualization(inputImage) {
const fact = [tfjs_esm_exports.div(maxValue, range[0]), tfjs_esm_exports.div(maxValue, range[1]), tfjs_esm_exports.div(maxValue, range[2])];
const enh = [tfjs_esm_exports.mul(sub10[0], fact[0]), tfjs_esm_exports.mul(sub10[1], fact[1]), tfjs_esm_exports.mul(sub10[2], fact[2])];
const rgb2 = tfjs_esm_exports.stack([enh[0], enh[1], enh[2]], 2);
const reshape8 = tfjs_esm_exports.reshape(rgb2, [1, squeeze10.shape[0], squeeze10.shape[1], 3]);
tfjs_esm_exports.dispose([...channels, ...min2, ...max4, ...sub10, ...range, ...fact, ...enh, rgb2, squeeze10]);
const reshape8 = tfjs_esm_exports.reshape(rgb2, [1, squeeze11.shape[0], squeeze11.shape[1], 3]);
tfjs_esm_exports.dispose([...channels, ...min2, ...max4, ...sub10, ...range, ...fact, ...enh, rgb2, squeeze11]);
return reshape8;
}
@ -4961,13 +4961,13 @@ var invertTransformMatrix = (matrix) => {
return [rotationComponent[0].concat(invertedTranslation[0]), rotationComponent[1].concat(invertedTranslation[1]), [0, 0, 1]];
};
var rotatePoint = (homogeneousCoordinate, rotationMatrix) => [dot(homogeneousCoordinate, rotationMatrix[0]), dot(homogeneousCoordinate, rotationMatrix[1])];
function generateAnchors(inputSize9) {
const spec = { strides: [inputSize9 / 16, inputSize9 / 8], anchors: [2, 6] };
function generateAnchors(inputSize10) {
const spec = { strides: [inputSize10 / 16, inputSize10 / 8], anchors: [2, 6] };
const anchors4 = [];
for (let i = 0; i < spec.strides.length; i++) {
const stride = spec.strides[i];
const gridRows = Math.floor((inputSize9 + stride - 1) / stride);
const gridCols = Math.floor((inputSize9 + stride - 1) / stride);
const gridRows = Math.floor((inputSize10 + stride - 1) / stride);
const gridCols = Math.floor((inputSize10 + stride - 1) / stride);
const anchorsNum = spec.anchors[i];
for (let gridY = 0; gridY < gridRows; gridY++) {
const anchorY = stride * (gridY + 0.5);
@ -4980,11 +4980,11 @@ function generateAnchors(inputSize9) {
}
return anchors4;
}
function transformRawCoords(coordsRaw, box5, angle, rotationMatrix, inputSize9) {
function transformRawCoords(coordsRaw, box5, angle, rotationMatrix, inputSize10) {
const boxSize = getBoxSize(box5);
const coordsScaled = coordsRaw.map((coord) => [
boxSize[0] / inputSize9 * (coord[0] - inputSize9 / 2),
boxSize[1] / inputSize9 * (coord[1] - inputSize9 / 2),
boxSize[0] / inputSize10 * (coord[0] - inputSize10 / 2),
boxSize[1] / inputSize10 * (coord[1] - inputSize10 / 2),
coord[2] || 0
]);
const largeAngle = angle && angle !== 0 && Math.abs(angle) > 0.2;
@ -4999,7 +4999,7 @@ function transformRawCoords(coordsRaw, box5, angle, rotationMatrix, inputSize9)
Math.trunc(coord[2] || 0)
]);
}
function correctFaceRotation(rotate, box5, input, inputSize9) {
function correctFaceRotation(rotate, box5, input, inputSize10) {
const symmetryLine = box5.landmarks.length >= meshLandmarks.count ? meshLandmarks.symmetryLine : blazeFaceLandmarks.symmetryLine;
let angle = 0;
let rotationMatrix = fixedRotationMatrix;
@ -5012,13 +5012,13 @@ function correctFaceRotation(rotate, box5, input, inputSize9) {
const centerRaw = [center[0] / input.shape[2], center[1] / input.shape[1]];
const rotated = tfjs_esm_exports.image.rotateWithOffset(input, angle, 0, centerRaw);
rotationMatrix = buildRotationMatrix(-angle, center);
face5 = cutAndResize(box5, rotated, [inputSize9, inputSize9]);
face5 = cutAndResize(box5, rotated, [inputSize10, inputSize10]);
tfjs_esm_exports.dispose(rotated);
} else {
face5 = cutAndResize(box5, input, [inputSize9, inputSize9]);
face5 = cutAndResize(box5, input, [inputSize10, inputSize10]);
}
} else {
face5 = cutAndResize(box5, input, [inputSize9, inputSize9]);
face5 = cutAndResize(box5, input, [inputSize10, inputSize10]);
}
return [angle, rotationMatrix, face5];
}
@ -5121,7 +5121,7 @@ async function getBoxes(inputImage, config3) {
confidence
};
const scaledBox = scaleBoxCoordinates(rawBox, [(inputImage.shape[2] || 0) / inputSize, (inputImage.shape[1] || 0) / inputSize]);
const enlargedBox = enlargeBox(scaledBox, faceBoxScaleFactor);
const enlargedBox = enlargeBox(scaledBox, config3.face["scale"] || faceBoxScaleFactor);
const squaredBox = squarifyBox(enlargedBox);
boxes.push(squaredBox);
Object.keys(b).forEach((tensor3) => tfjs_esm_exports.dispose(b[tensor3]));
@ -5531,7 +5531,7 @@ async function process3(res, outputShape, config3) {
t.scores = tfjs_esm_exports.squeeze(arr[4]);
t.classes = tfjs_esm_exports.squeeze(arr[5]);
tfjs_esm_exports.dispose([res, ...arr]);
t.nms = await tfjs_esm_exports.image.nonMaxSuppressionAsync(t.boxes, t.scores, config3.object.maxDetected, config3.object.iouThreshold, config3.object.minConfidence);
t.nms = await tfjs_esm_exports.image.nonMaxSuppressionAsync(t.boxes, t.scores, config3.object.maxDetected, config3.object.iouThreshold, config3.object.minConfidence || 0);
const nms = await t.nms.data();
let i = 0;
for (const id of Array.from(nms)) {
@ -5568,7 +5568,7 @@ async function predict6(input, config3) {
}
skipped6 = 0;
return new Promise(async (resolve) => {
const outputSize2 = [input.shape[2], input.shape[1]];
const outputSize2 = [input.shape[2] || 0, input.shape[1] || 0];
const resize = tfjs_esm_exports.image.resizeBilinear(input, [inputSize4, inputSize4]);
const objectT = config3.object.enabled ? model6 == null ? void 0 : model6.execute(resize, ["tower_0/detections"]) : null;
lastTime6 = now();
@ -5672,10 +5672,10 @@ async function predict7(image29, config3) {
tfjs_esm_exports.dispose(tensor3);
if (resT) {
cache2.keypoints.length = 0;
const squeeze10 = resT.squeeze();
const squeeze11 = resT.squeeze();
tfjs_esm_exports.dispose(resT);
const stack5 = squeeze10.unstack(2);
tfjs_esm_exports.dispose(squeeze10);
const stack5 = squeeze11.unstack(2);
tfjs_esm_exports.dispose(squeeze11);
for (let id = 0; id < stack5.length; id++) {
const [x2, y2, partScore] = await max2d(stack5[id], config3.body.minConfidence);
if (partScore > (((_a = config3.body) == null ? void 0 : _a.minConfidence) || 0)) {
@ -5763,8 +5763,8 @@ async function predict8(image29, config3, idx, count2) {
const obj = [];
if ((_a2 = config3.face.emotion) == null ? void 0 : _a2.enabled) {
const t = {};
const inputSize9 = (model8 == null ? void 0 : model8.inputs[0].shape) ? model8.inputs[0].shape[2] : 0;
t.resize = tfjs_esm_exports.image.resizeBilinear(image29, [inputSize9, inputSize9], false);
const inputSize10 = (model8 == null ? void 0 : model8.inputs[0].shape) ? model8.inputs[0].shape[2] : 0;
t.resize = tfjs_esm_exports.image.resizeBilinear(image29, [inputSize10, inputSize10], false);
t.channels = tfjs_esm_exports.mul(t.resize, constants.rgb);
t.grayscale = tfjs_esm_exports.sum(t.channels, 3, true);
t.grayscaleSub = tfjs_esm_exports.sub(t.grayscale, constants.tf05);
@ -10287,7 +10287,7 @@ function jitter(keypoints) {
}
return keypoints;
}
function padInput(input, inputSize9) {
function padInput(input, inputSize10) {
const t = {};
if (!input.shape || !input.shape[1] || !input.shape[2])
return input;
@ -10298,7 +10298,7 @@ function padInput(input, inputSize9) {
[0, 0]
];
t.pad = tfjs_esm_exports.pad(input, cache5.padding);
t.resize = tfjs_esm_exports.image.resizeBilinear(t.pad, [inputSize9, inputSize9]);
t.resize = tfjs_esm_exports.image.resizeBilinear(t.pad, [inputSize10, inputSize10]);
const final = tfjs_esm_exports.cast(t.resize, "int32");
Object.keys(t).forEach((tensor3) => tfjs_esm_exports.dispose(t[tensor3]));
return final;
@ -10457,36 +10457,36 @@ var model15;
var last9 = [];
var lastTime14 = 0;
var skipped14 = Number.MAX_SAFE_INTEGER;
var inputSize9 = 0;
var scaleBox = 2.5;
async function load16(config3) {
if (!model15 || env.initial) {
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 || !model15.modelUrl)
inputSize9 = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : 0;
if (!model15 || !model15["modelUrl"])
log("load model failed:", config3.object.modelPath);
else if (config3.debug)
log("load model:", model15.modelUrl);
log("load model:", model15["modelUrl"]);
} else if (config3.debug)
log("cached model:", model15.modelUrl);
log("cached model:", model15["modelUrl"]);
return model15;
}
async function process4(res, inputSize9, outputShape, config3) {
async function process4(res, outputShape, config3) {
let id = 0;
let results = [];
for (const strideSize of [1, 2, 4]) {
tfjs_esm_exports.tidy(async () => {
var _a, _b;
const baseSize = strideSize * 13;
const scoresT = (_a = res.find((a) => a.shape[1] === baseSize ** 2 && a.shape[2] === labels.length)) == null ? void 0 : _a.squeeze();
const featuresT = (_b = res.find((a) => a.shape[1] === baseSize ** 2 && a.shape[2] < labels.length)) == null ? void 0 : _b.squeeze();
const scoresT = tfjs_esm_exports.squeeze(res.find((a) => a.shape[1] === baseSize ** 2 && (a.shape[2] || 0) === labels.length));
const featuresT = tfjs_esm_exports.squeeze(res.find((a) => a.shape[1] === baseSize ** 2 && (a.shape[2] || 0) < labels.length));
const boxesMax = featuresT.reshape([-1, 4, featuresT.shape[1] / 4]);
const boxIdx = await boxesMax.argMax(2).array();
const scores = await scoresT.array();
for (let i = 0; i < scoresT.shape[0]; i++) {
for (let j = 0; j < scoresT.shape[1]; j++) {
const score = scores[i][j];
if (score > config3.object.minConfidence && j !== 61) {
if (score > (config3.object.minConfidence || 0) && j !== 61) {
const cx = (0.5 + Math.trunc(i % baseSize)) / baseSize;
const cy = (0.5 + Math.trunc(i / baseSize)) / baseSize;
const boxOffset = boxIdx[i].map((a) => a * (baseSize / strideSize / inputSize9));
@ -10543,8 +10543,8 @@ async function predict16(image29, config3) {
if (!env.kernels.includes("mod") || !env.kernels.includes("sparsetodense"))
return last9;
return new Promise(async (resolve) => {
const outputSize2 = [image29.shape[2], image29.shape[1]];
const resize = tfjs_esm_exports.image.resizeBilinear(image29, [model15.inputSize, model15.inputSize], false);
const outputSize2 = [image29.shape[2] || 0, image29.shape[1] || 0];
const resize = tfjs_esm_exports.image.resizeBilinear(image29, [inputSize9, inputSize9], false);
const norm = tfjs_esm_exports.div(resize, constants.tf255);
const transpose = norm.transpose([0, 3, 1, 2]);
tfjs_esm_exports.dispose(norm);
@ -10554,7 +10554,7 @@ async function predict16(image29, config3) {
objectT = model15.execute(transpose);
lastTime14 = now();
tfjs_esm_exports.dispose(transpose);
const obj = await process4(objectT, model15.inputSize, outputSize2, config3);
const obj = await process4(objectT, outputSize2, config3);
last9 = obj;
resolve(obj);
});
@ -10951,6 +10951,7 @@ async function process5(input, background, config3) {
return { data, canvas: null, alpha: null };
}
const alphaCanvas = canvas(width, height);
if (tfjs_esm_exports.browser)
await tfjs_esm_exports.browser.toPixels(t.data, alphaCanvas);
const alphaCtx = alphaCanvas.getContext("2d");
if (config3.segmentation.blur && config3.segmentation.blur > 0)
@ -11867,7 +11868,7 @@ var calculateGaze = (face5) => {
return { bearing: 0, strength: 0 };
const offsetIris = [0, -0.1];
const eyeRatio = 1;
const left = face5.mesh[33][2] > face5.mesh[263][2];
const left = (face5.mesh[33][2] || 0) > (face5.mesh[263][2] || 0);
const irisCenter = left ? face5.mesh[473] : face5.mesh[468];
const eyeCenter = left ? [(face5.mesh[133][0] + face5.mesh[33][0]) / 2, (face5.mesh[133][1] + face5.mesh[33][1]) / 2] : [(face5.mesh[263][0] + face5.mesh[362][0]) / 2, (face5.mesh[263][1] + face5.mesh[362][1]) / 2];
const eyeSize = left ? [face5.mesh[133][0] - face5.mesh[33][0], face5.mesh[23][1] - face5.mesh[27][1]] : [face5.mesh[263][0] - face5.mesh[362][0], face5.mesh[253][1] - face5.mesh[257][1]];
@ -11956,7 +11957,7 @@ var calculateFaceAngle = (face5, imageSize) => {
// src/face/face.ts
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;
let timeStamp;
let timeStamp = now();
let ageRes;
let gearRes;
let genderRes;
@ -11967,7 +11968,6 @@ var detectFace = async (instance, input) => {
let descRes;
const faceRes = [];
instance.state = "run:face";
timeStamp = now();
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)
@ -11988,63 +11988,63 @@ var detectFace = async (instance, input) => {
const rotation = faces[i].mesh && faces[i].mesh.length > 200 ? calculateFaceAngle(faces[i], [input.shape[2], input.shape[1]]) : 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;
emotionRes = ((_b = instance.config.face.emotion) == null ? void 0 : _b.enabled) ? predict8(faces[i].tensor || tfjs_esm_exports.tensor([]), instance.config, i, faces.length) : [];
} else {
instance.state = "run:emotion";
timeStamp = now();
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;
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) : [];
instance.performance.emotion = env.perfadd ? (instance.performance.emotion || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
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;
antispoofRes = ((_d = instance.config.face.antispoof) == null ? void 0 : _d.enabled) ? predict4(faces[i].tensor || tfjs_esm_exports.tensor([]), instance.config, i, faces.length) : 0;
} else {
instance.state = "run:antispoof";
timeStamp = now();
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;
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) : 0;
instance.performance.antispoof = env.perfadd ? (instance.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
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;
livenessRes = ((_f = instance.config.face.liveness) == null ? void 0 : _f.enabled) ? predict14(faces[i].tensor || tfjs_esm_exports.tensor([]), instance.config, i, faces.length) : 0;
} else {
instance.state = "run:liveness";
timeStamp = now();
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;
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) : 0;
instance.performance.liveness = env.perfadd ? (instance.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
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) : {};
gearRes = ((_h = instance.config.face["gear"]) == null ? void 0 : _h.enabled) ? predict(faces[i].tensor || tfjs_esm_exports.tensor([]), instance.config, i, faces.length) : null;
} else {
instance.state = "run:gear";
timeStamp = now();
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) : {};
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) : null;
instance.performance.gear = Math.trunc(now() - timeStamp);
}
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) : {};
ageRes = ((_j = instance.config.face["ssrnet"]) == null ? void 0 : _j.enabled) ? predict2(faces[i].tensor || tfjs_esm_exports.tensor([]), instance.config, i, faces.length) : null;
genderRes = ((_k = instance.config.face["ssrnet"]) == null ? void 0 : _k.enabled) ? predict3(faces[i].tensor || tfjs_esm_exports.tensor([]), instance.config, i, faces.length) : null;
} else {
instance.state = "run:ssrnet";
timeStamp = now();
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) : {};
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) : null;
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) : null;
instance.performance.ssrnet = Math.trunc(now() - timeStamp);
}
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) : {};
mobilefacenetRes = ((_n = instance.config.face["mobilefacenet"]) == null ? void 0 : _n.enabled) ? predict9(faces[i].tensor || tfjs_esm_exports.tensor([]), instance.config, i, faces.length) : null;
} else {
instance.state = "run:mobilefacenet";
timeStamp = now();
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) : {};
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) : null;
instance.performance.mobilefacenet = Math.trunc(now() - timeStamp);
}
instance.analyze("End MobileFaceNet:");
@ -12062,12 +12062,26 @@ var detectFace = async (instance, input) => {
[ageRes, genderRes, emotionRes, mobilefacenetRes, descRes, gearRes, antispoofRes, livenessRes] = await Promise.all([ageRes, genderRes, emotionRes, mobilefacenetRes, descRes, gearRes, antispoofRes, livenessRes]);
}
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 = 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 = instance.config.face["mobilefacenet"]) == null ? void 0 : _t.enabled) && mobilefacenetRes)
if (((_r = instance.config.face["ssrnet"]) == null ? void 0 : _r.enabled) && ageRes && genderRes) {
descRes = {
...descRes,
age: ageRes.age,
gender: genderRes.gender,
genderScore: genderRes.genderScore
};
}
if (((_s = instance.config.face["gear"]) == null ? void 0 : _s.enabled) && gearRes) {
descRes = {
...descRes,
age: gearRes.age,
gender: gearRes.gender,
genderScore: gearRes.genderScore,
race: gearRes.race
};
}
if (((_t = instance.config.face["mobilefacenet"]) == null ? void 0 : _t.enabled) && mobilefacenetRes) {
descRes.descriptor = mobilefacenetRes;
}
if (!((_u = instance.config.face.iris) == null ? void 0 : _u.enabled)) {
}
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;

File diff suppressed because one or more lines are too long

19
dist/human.esm.d.ts vendored
View File

@ -37,7 +37,7 @@ export declare type BodyAnnotationEfficientPose = 'leftLeg' | 'rightLeg' | 'tors
/** Configures all body detection specific options */
export declare interface BodyConfig extends GenericConfig {
/** maximum numboer of detected bodies */
/** maximum number of detected bodies */
maxDetected: number;
/** minimum confidence for a detected body before results are discarded */
minConfidence: number;
@ -502,9 +502,11 @@ export declare interface FaceDescriptionConfig extends GenericConfig {
minConfidence: number;
}
/** Dectector part of face configuration */
/** Detector part of face configuration */
export declare interface FaceDetectorConfig extends GenericConfig {
/** is face rotation correction performed after detecting face? */
/** is face rotation correction performed after detecting face?
* used to correctly analyze faces under high angles
*/
rotation: boolean;
/** maximum number of detected faces */
maxDetected: number;
@ -514,7 +516,8 @@ export declare interface FaceDetectorConfig extends GenericConfig {
iouThreshold: number;
/** should child models perform on masked image of a face */
mask: boolean;
/** should face detection return face tensor to be used in some other extenrnal model? */
/** should face detection return processed and cropped face tensor that can with an external model for addtional processing?
* if enabled it must be manually deallocated to avoid memory leak */
return: boolean;
}
@ -695,11 +698,13 @@ export declare type Gender = 'male' | 'female' | 'unknown';
export declare interface GenericConfig {
/** is module enabled? */
enabled: boolean;
/** path to model json file */
/** path to model json file (relative to `modelBasePath` */
modelPath: string;
/** how many max frames to go without re-running model if cached results are acceptable */
/** how many max frames to go without re-running model if cached results are acceptable
* for two-phase models such as face and hand caching applies to bounding boxes detection only */
skipFrames: number;
/** how many max miliseconds to go without re-running model if cached results are acceptable */
/** how many max milliseconds to go without re-running model if cached results are acceptable
* for two-phase models such as face and hand caching applies to bounding boxes detection only */
skipTime: number;
}

148
dist/human.esm.js vendored
View File

@ -16132,15 +16132,15 @@ function getSparseReshapeEmptyTensorZeroOutputDimErrorMessage() {
return "reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero";
}
function getSparseReshapeInputOutputMultipleErrorMessage(inputShape, outputShape) {
const inputSize9 = sizeFromShape(inputShape);
const inputSize10 = sizeFromShape(inputShape);
const outputSize2 = sizeFromShape(outputShape);
return `Input to reshape is a SparseTensor with ${inputSize9}
return `Input to reshape is a SparseTensor with ${inputSize10}
dense values, but the requested shape requires a multiple of ${outputSize2}. inputShape=${inputShape} outputShape= ${outputShape}`;
}
function getSparseReshapeInputOutputMismatchErrorMessage(inputShape, outputShape) {
const inputSize9 = sizeFromShape(inputShape);
const inputSize10 = sizeFromShape(inputShape);
const outputSize2 = sizeFromShape(outputShape);
return `Input to reshape is a tensor with ${inputSize9} dense values, but the requested shape has ${outputSize2}. inputShape=${inputShape} outputShape=${outputShape}`;
return `Input to reshape is a tensor with ${inputSize10} dense values, but the requested shape has ${outputSize2}. inputShape=${inputShape} outputShape=${outputShape}`;
}
function getSparseSegmentReductionNegativeSegmentIdsErrorMessage() {
return `segment ids must be >= 0`;
@ -43418,17 +43418,17 @@ function fftBatch(input2, inverse, cpuBackend) {
return result;
}
function fftImpl(input2, inverse, cpuBackend) {
const inputSize9 = util_exports.sizeFromShape(input2.shape);
const inputSize10 = util_exports.sizeFromShape(input2.shape);
const inputVals = cpuBackend.data.get(input2.dataId);
const realVals = cpuBackend.data.get(inputVals.complexTensorInfos.real.dataId).values;
const imagVals = cpuBackend.data.get(inputVals.complexTensorInfos.imag.dataId).values;
if (isExponentOf2(inputSize9)) {
const result = fftRadix2(realVals, imagVals, inputSize9, inverse, cpuBackend);
if (isExponentOf2(inputSize10)) {
const result = fftRadix2(realVals, imagVals, inputSize10, inverse, cpuBackend);
const resultShape = [input2.shape[0], input2.shape[1]];
if (inverse) {
const realInfo = cpuBackend.makeTensorInfo(resultShape, "float32", result.real);
const imagInfo = cpuBackend.makeTensorInfo(resultShape, "float32", result.imag);
const sizeInfo = cpuBackend.makeTensorInfo([], "float32", util_exports.createScalarValue(inputSize9, "float32"));
const sizeInfo = cpuBackend.makeTensorInfo([], "float32", util_exports.createScalarValue(inputSize10, "float32"));
const sizeInfoCopy = identity2({ inputs: { x: sizeInfo }, backend: cpuBackend });
const divRealInfo = realDivConfig.kernelFunc({ inputs: { a: realInfo, b: sizeInfo }, backend: cpuBackend });
const divImagInfo = realDivConfig.kernelFunc({ inputs: { a: imagInfo, b: sizeInfoCopy }, backend: cpuBackend });
@ -43445,7 +43445,7 @@ function fftImpl(input2, inverse, cpuBackend) {
return result;
} else {
const data = backend_util_exports.mergeRealAndImagArrays(realVals, imagVals);
const rawOutput = fourierTransformByMatmul(data, inputSize9, inverse);
const rawOutput = fourierTransformByMatmul(data, inputSize10, inverse);
return backend_util_exports.splitRealAndImagArrays(rawOutput);
}
}
@ -43567,9 +43567,9 @@ function fourierTransformByMatmul(data, size2, inverse) {
function fft2(args) {
const { inputs, backend: backend22 } = args;
const { input: input2 } = inputs;
const inputSize9 = util_exports.sizeFromShape(input2.shape);
const inputSize10 = util_exports.sizeFromShape(input2.shape);
const innerDimensionSize = input2.shape[input2.shape.length - 1];
const batch = inputSize9 / innerDimensionSize;
const batch = inputSize10 / innerDimensionSize;
const input2D = reshape3({
inputs: { x: input2 },
backend: backend22,
@ -43790,9 +43790,9 @@ var gatherV2Config = {
function ifft2(args) {
const { inputs, backend: backend22 } = args;
const { input: input2 } = inputs;
const inputSize9 = util_exports.sizeFromShape(input2.shape);
const inputSize10 = util_exports.sizeFromShape(input2.shape);
const innerDimensionSize = input2.shape[input2.shape.length - 1];
const batch = inputSize9 / innerDimensionSize;
const batch = inputSize10 / innerDimensionSize;
const input2D = reshape3({
inputs: { x: input2 },
backend: backend22,
@ -55477,9 +55477,9 @@ var FFTProgram = class {
};
function fftImpl2(x, inverse, backend22) {
const xData = backend22.texData.get(x.dataId);
const inputSize9 = util_exports.sizeFromShape(x.shape);
const inputSize10 = util_exports.sizeFromShape(x.shape);
const innerDimensionSize = x.shape[x.shape.length - 1];
const batch = inputSize9 / innerDimensionSize;
const batch = inputSize10 / innerDimensionSize;
const input2D = reshape4({ inputs: { x }, backend: backend22, attrs: { shape: [batch, innerDimensionSize] } });
const xShape = input2D.shape;
const realProgram = new FFTProgram("real", xShape, inverse);
@ -75725,13 +75725,13 @@ var invertTransformMatrix = (matrix) => {
return [rotationComponent[0].concat(invertedTranslation[0]), rotationComponent[1].concat(invertedTranslation[1]), [0, 0, 1]];
};
var rotatePoint = (homogeneousCoordinate, rotationMatrix) => [dot4(homogeneousCoordinate, rotationMatrix[0]), dot4(homogeneousCoordinate, rotationMatrix[1])];
function generateAnchors(inputSize9) {
const spec = { strides: [inputSize9 / 16, inputSize9 / 8], anchors: [2, 6] };
function generateAnchors(inputSize10) {
const spec = { strides: [inputSize10 / 16, inputSize10 / 8], anchors: [2, 6] };
const anchors4 = [];
for (let i = 0; i < spec.strides.length; i++) {
const stride = spec.strides[i];
const gridRows = Math.floor((inputSize9 + stride - 1) / stride);
const gridCols = Math.floor((inputSize9 + stride - 1) / stride);
const gridRows = Math.floor((inputSize10 + stride - 1) / stride);
const gridCols = Math.floor((inputSize10 + stride - 1) / stride);
const anchorsNum = spec.anchors[i];
for (let gridY = 0; gridY < gridRows; gridY++) {
const anchorY = stride * (gridY + 0.5);
@ -75744,11 +75744,11 @@ function generateAnchors(inputSize9) {
}
return anchors4;
}
function transformRawCoords(coordsRaw, box5, angle, rotationMatrix, inputSize9) {
function transformRawCoords(coordsRaw, box5, angle, rotationMatrix, inputSize10) {
const boxSize = getBoxSize(box5);
const coordsScaled = coordsRaw.map((coord) => [
boxSize[0] / inputSize9 * (coord[0] - inputSize9 / 2),
boxSize[1] / inputSize9 * (coord[1] - inputSize9 / 2),
boxSize[0] / inputSize10 * (coord[0] - inputSize10 / 2),
boxSize[1] / inputSize10 * (coord[1] - inputSize10 / 2),
coord[2] || 0
]);
const largeAngle = angle && angle !== 0 && Math.abs(angle) > 0.2;
@ -75763,7 +75763,7 @@ function transformRawCoords(coordsRaw, box5, angle, rotationMatrix, inputSize9)
Math.trunc(coord[2] || 0)
]);
}
function correctFaceRotation(rotate, box5, input2, inputSize9) {
function correctFaceRotation(rotate, box5, input2, inputSize10) {
const symmetryLine = box5.landmarks.length >= meshLandmarks.count ? meshLandmarks.symmetryLine : blazeFaceLandmarks.symmetryLine;
let angle = 0;
let rotationMatrix = fixedRotationMatrix;
@ -75776,13 +75776,13 @@ function correctFaceRotation(rotate, box5, input2, inputSize9) {
const centerRaw = [center[0] / input2.shape[2], center[1] / input2.shape[1]];
const rotated = image.rotateWithOffset(input2, angle, 0, centerRaw);
rotationMatrix = buildRotationMatrix(-angle, center);
face5 = cutAndResize(box5, rotated, [inputSize9, inputSize9]);
face5 = cutAndResize(box5, rotated, [inputSize10, inputSize10]);
dispose(rotated);
} else {
face5 = cutAndResize(box5, input2, [inputSize9, inputSize9]);
face5 = cutAndResize(box5, input2, [inputSize10, inputSize10]);
}
} else {
face5 = cutAndResize(box5, input2, [inputSize9, inputSize9]);
face5 = cutAndResize(box5, input2, [inputSize10, inputSize10]);
}
return [angle, rotationMatrix, face5];
}
@ -75885,7 +75885,7 @@ async function getBoxes(inputImage, config3) {
confidence
};
const scaledBox = scaleBoxCoordinates(rawBox, [(inputImage.shape[2] || 0) / inputSize, (inputImage.shape[1] || 0) / inputSize]);
const enlargedBox = enlargeBox(scaledBox, faceBoxScaleFactor);
const enlargedBox = enlargeBox(scaledBox, config3.face["scale"] || faceBoxScaleFactor);
const squaredBox = squarifyBox(enlargedBox);
boxes.push(squaredBox);
Object.keys(b).forEach((tensor2) => dispose(b[tensor2]));
@ -76295,7 +76295,7 @@ async function process3(res, outputShape, config3) {
t.scores = squeeze(arr[4]);
t.classes = squeeze(arr[5]);
dispose([res, ...arr]);
t.nms = await image.nonMaxSuppressionAsync(t.boxes, t.scores, config3.object.maxDetected, config3.object.iouThreshold, config3.object.minConfidence);
t.nms = await image.nonMaxSuppressionAsync(t.boxes, t.scores, config3.object.maxDetected, config3.object.iouThreshold, config3.object.minConfidence || 0);
const nms = await t.nms.data();
let i = 0;
for (const id of Array.from(nms)) {
@ -76332,7 +76332,7 @@ async function predict6(input2, config3) {
}
skipped6 = 0;
return new Promise(async (resolve) => {
const outputSize2 = [input2.shape[2], input2.shape[1]];
const outputSize2 = [input2.shape[2] || 0, input2.shape[1] || 0];
const resize = image.resizeBilinear(input2, [inputSize4, inputSize4]);
const objectT = config3.object.enabled ? model7 == null ? void 0 : model7.execute(resize, ["tower_0/detections"]) : null;
lastTime6 = now();
@ -76527,8 +76527,8 @@ async function predict8(image7, config3, idx, count3) {
const obj = [];
if ((_a2 = config3.face.emotion) == null ? void 0 : _a2.enabled) {
const t = {};
const inputSize9 = (model9 == null ? void 0 : model9.inputs[0].shape) ? model9.inputs[0].shape[2] : 0;
t.resize = image.resizeBilinear(image7, [inputSize9, inputSize9], false);
const inputSize10 = (model9 == null ? void 0 : model9.inputs[0].shape) ? model9.inputs[0].shape[2] : 0;
t.resize = image.resizeBilinear(image7, [inputSize10, inputSize10], false);
t.channels = mul(t.resize, constants.rgb);
t.grayscale = sum2(t.channels, 3, true);
t.grayscaleSub = sub(t.grayscale, constants.tf05);
@ -81051,7 +81051,7 @@ function jitter(keypoints) {
}
return keypoints;
}
function padInput(input2, inputSize9) {
function padInput(input2, inputSize10) {
const t = {};
if (!input2.shape || !input2.shape[1] || !input2.shape[2])
return input2;
@ -81062,7 +81062,7 @@ function padInput(input2, inputSize9) {
[0, 0]
];
t.pad = pad(input2, cache5.padding);
t.resize = image.resizeBilinear(t.pad, [inputSize9, inputSize9]);
t.resize = image.resizeBilinear(t.pad, [inputSize10, inputSize10]);
const final = cast(t.resize, "int32");
Object.keys(t).forEach((tensor2) => dispose(t[tensor2]));
return final;
@ -81221,36 +81221,36 @@ var model16;
var last9 = [];
var lastTime14 = 0;
var skipped14 = Number.MAX_SAFE_INTEGER;
var inputSize9 = 0;
var scaleBox = 2.5;
async function load16(config3) {
if (!model16 || env2.initial) {
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 || !model16.modelUrl)
inputSize9 = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : 0;
if (!model16 || !model16["modelUrl"])
log("load model failed:", config3.object.modelPath);
else if (config3.debug)
log("load model:", model16.modelUrl);
log("load model:", model16["modelUrl"]);
} else if (config3.debug)
log("cached model:", model16.modelUrl);
log("cached model:", model16["modelUrl"]);
return model16;
}
async function process4(res, inputSize9, outputShape, config3) {
async function process4(res, outputShape, config3) {
let id = 0;
let results = [];
for (const strideSize of [1, 2, 4]) {
tidy(async () => {
var _a, _b;
const baseSize = strideSize * 13;
const scoresT = (_a = res.find((a) => a.shape[1] === baseSize ** 2 && a.shape[2] === labels.length)) == null ? void 0 : _a.squeeze();
const featuresT = (_b = res.find((a) => a.shape[1] === baseSize ** 2 && a.shape[2] < labels.length)) == null ? void 0 : _b.squeeze();
const scoresT = squeeze(res.find((a) => a.shape[1] === baseSize ** 2 && (a.shape[2] || 0) === labels.length));
const featuresT = squeeze(res.find((a) => a.shape[1] === baseSize ** 2 && (a.shape[2] || 0) < labels.length));
const boxesMax = featuresT.reshape([-1, 4, featuresT.shape[1] / 4]);
const boxIdx = await boxesMax.argMax(2).array();
const scores = await scoresT.array();
for (let i = 0; i < scoresT.shape[0]; i++) {
for (let j = 0; j < scoresT.shape[1]; j++) {
const score = scores[i][j];
if (score > config3.object.minConfidence && j !== 61) {
if (score > (config3.object.minConfidence || 0) && j !== 61) {
const cx = (0.5 + Math.trunc(i % baseSize)) / baseSize;
const cy = (0.5 + Math.trunc(i / baseSize)) / baseSize;
const boxOffset = boxIdx[i].map((a) => a * (baseSize / strideSize / inputSize9));
@ -81307,8 +81307,8 @@ async function predict16(image7, config3) {
if (!env2.kernels.includes("mod") || !env2.kernels.includes("sparsetodense"))
return last9;
return new Promise(async (resolve) => {
const outputSize2 = [image7.shape[2], image7.shape[1]];
const resize = image.resizeBilinear(image7, [model16.inputSize, model16.inputSize], false);
const outputSize2 = [image7.shape[2] || 0, image7.shape[1] || 0];
const resize = image.resizeBilinear(image7, [inputSize9, inputSize9], false);
const norm2 = div(resize, constants.tf255);
const transpose6 = norm2.transpose([0, 3, 1, 2]);
dispose(norm2);
@ -81318,7 +81318,7 @@ async function predict16(image7, config3) {
objectT = model16.execute(transpose6);
lastTime14 = now();
dispose(transpose6);
const obj = await process4(objectT, model16.inputSize, outputSize2, config3);
const obj = await process4(objectT, outputSize2, config3);
last9 = obj;
resolve(obj);
});
@ -81715,6 +81715,7 @@ async function process5(input2, background, config3) {
return { data, canvas: null, alpha: null };
}
const alphaCanvas = canvas(width, height);
if (browser_exports)
await browser_exports.toPixels(t.data, alphaCanvas);
const alphaCtx = alphaCanvas.getContext("2d");
if (config3.segmentation.blur && config3.segmentation.blur > 0)
@ -82631,7 +82632,7 @@ var calculateGaze = (face5) => {
return { bearing: 0, strength: 0 };
const offsetIris = [0, -0.1];
const eyeRatio = 1;
const left = face5.mesh[33][2] > face5.mesh[263][2];
const left = (face5.mesh[33][2] || 0) > (face5.mesh[263][2] || 0);
const irisCenter = left ? face5.mesh[473] : face5.mesh[468];
const eyeCenter = left ? [(face5.mesh[133][0] + face5.mesh[33][0]) / 2, (face5.mesh[133][1] + face5.mesh[33][1]) / 2] : [(face5.mesh[263][0] + face5.mesh[362][0]) / 2, (face5.mesh[263][1] + face5.mesh[362][1]) / 2];
const eyeSize = left ? [face5.mesh[133][0] - face5.mesh[33][0], face5.mesh[23][1] - face5.mesh[27][1]] : [face5.mesh[263][0] - face5.mesh[362][0], face5.mesh[253][1] - face5.mesh[257][1]];
@ -82720,7 +82721,7 @@ var calculateFaceAngle = (face5, imageSize) => {
// src/face/face.ts
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;
let timeStamp;
let timeStamp = now();
let ageRes;
let gearRes;
let genderRes;
@ -82731,7 +82732,6 @@ var detectFace = async (instance, input2) => {
let descRes;
const faceRes = [];
instance.state = "run:face";
timeStamp = now();
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)
@ -82752,63 +82752,63 @@ var detectFace = async (instance, input2) => {
const rotation = faces[i].mesh && faces[i].mesh.length > 200 ? calculateFaceAngle(faces[i], [input2.shape[2], input2.shape[1]]) : 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;
emotionRes = ((_b = instance.config.face.emotion) == null ? void 0 : _b.enabled) ? predict8(faces[i].tensor || tensor([]), instance.config, i, faces.length) : [];
} else {
instance.state = "run:emotion";
timeStamp = now();
emotionRes = ((_c = instance.config.face.emotion) == null ? void 0 : _c.enabled) ? await predict8(faces[i].tensor || tensor([]), instance.config, i, faces.length) : null;
emotionRes = ((_c = instance.config.face.emotion) == null ? void 0 : _c.enabled) ? await predict8(faces[i].tensor || tensor([]), instance.config, i, faces.length) : [];
instance.performance.emotion = env2.perfadd ? (instance.performance.emotion || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
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;
antispoofRes = ((_d = instance.config.face.antispoof) == null ? void 0 : _d.enabled) ? predict4(faces[i].tensor || tensor([]), instance.config, i, faces.length) : 0;
} else {
instance.state = "run:antispoof";
timeStamp = now();
antispoofRes = ((_e = instance.config.face.antispoof) == null ? void 0 : _e.enabled) ? await predict4(faces[i].tensor || tensor([]), instance.config, i, faces.length) : null;
antispoofRes = ((_e = instance.config.face.antispoof) == null ? void 0 : _e.enabled) ? await predict4(faces[i].tensor || tensor([]), instance.config, i, faces.length) : 0;
instance.performance.antispoof = env2.perfadd ? (instance.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
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;
livenessRes = ((_f = instance.config.face.liveness) == null ? void 0 : _f.enabled) ? predict14(faces[i].tensor || tensor([]), instance.config, i, faces.length) : 0;
} else {
instance.state = "run:liveness";
timeStamp = now();
livenessRes = ((_g = instance.config.face.liveness) == null ? void 0 : _g.enabled) ? await predict14(faces[i].tensor || tensor([]), instance.config, i, faces.length) : null;
livenessRes = ((_g = instance.config.face.liveness) == null ? void 0 : _g.enabled) ? await predict14(faces[i].tensor || tensor([]), instance.config, i, faces.length) : 0;
instance.performance.liveness = env2.perfadd ? (instance.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
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) : {};
gearRes = ((_h = instance.config.face["gear"]) == null ? void 0 : _h.enabled) ? predict(faces[i].tensor || tensor([]), instance.config, i, faces.length) : null;
} else {
instance.state = "run:gear";
timeStamp = now();
gearRes = ((_i = instance.config.face["gear"]) == null ? void 0 : _i.enabled) ? await predict(faces[i].tensor || tensor([]), instance.config, i, faces.length) : {};
gearRes = ((_i = instance.config.face["gear"]) == null ? void 0 : _i.enabled) ? await predict(faces[i].tensor || tensor([]), instance.config, i, faces.length) : null;
instance.performance.gear = Math.trunc(now() - timeStamp);
}
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) : {};
ageRes = ((_j = instance.config.face["ssrnet"]) == null ? void 0 : _j.enabled) ? predict2(faces[i].tensor || tensor([]), instance.config, i, faces.length) : null;
genderRes = ((_k = instance.config.face["ssrnet"]) == null ? void 0 : _k.enabled) ? predict3(faces[i].tensor || tensor([]), instance.config, i, faces.length) : null;
} else {
instance.state = "run:ssrnet";
timeStamp = now();
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) : {};
ageRes = ((_l = instance.config.face["ssrnet"]) == null ? void 0 : _l.enabled) ? await predict2(faces[i].tensor || tensor([]), instance.config, i, faces.length) : null;
genderRes = ((_m = instance.config.face["ssrnet"]) == null ? void 0 : _m.enabled) ? await predict3(faces[i].tensor || tensor([]), instance.config, i, faces.length) : null;
instance.performance.ssrnet = Math.trunc(now() - timeStamp);
}
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) : {};
mobilefacenetRes = ((_n = instance.config.face["mobilefacenet"]) == null ? void 0 : _n.enabled) ? predict9(faces[i].tensor || tensor([]), instance.config, i, faces.length) : null;
} else {
instance.state = "run:mobilefacenet";
timeStamp = now();
mobilefacenetRes = ((_o = instance.config.face["mobilefacenet"]) == null ? void 0 : _o.enabled) ? await predict9(faces[i].tensor || tensor([]), instance.config, i, faces.length) : {};
mobilefacenetRes = ((_o = instance.config.face["mobilefacenet"]) == null ? void 0 : _o.enabled) ? await predict9(faces[i].tensor || tensor([]), instance.config, i, faces.length) : null;
instance.performance.mobilefacenet = Math.trunc(now() - timeStamp);
}
instance.analyze("End MobileFaceNet:");
@ -82826,12 +82826,26 @@ var detectFace = async (instance, input2) => {
[ageRes, genderRes, emotionRes, mobilefacenetRes, descRes, gearRes, antispoofRes, livenessRes] = await Promise.all([ageRes, genderRes, emotionRes, mobilefacenetRes, descRes, gearRes, antispoofRes, livenessRes]);
}
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 = 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 = instance.config.face["mobilefacenet"]) == null ? void 0 : _t.enabled) && mobilefacenetRes)
if (((_r = instance.config.face["ssrnet"]) == null ? void 0 : _r.enabled) && ageRes && genderRes) {
descRes = {
...descRes,
age: ageRes.age,
gender: genderRes.gender,
genderScore: genderRes.genderScore
};
}
if (((_s = instance.config.face["gear"]) == null ? void 0 : _s.enabled) && gearRes) {
descRes = {
...descRes,
age: gearRes.age,
gender: gearRes.gender,
genderScore: gearRes.genderScore,
race: gearRes.race
};
}
if (((_t = instance.config.face["mobilefacenet"]) == null ? void 0 : _t.enabled) && mobilefacenetRes) {
descRes.descriptor = mobilefacenetRes;
}
if (!((_u = instance.config.face.iris) == null ? void 0 : _u.enabled)) {
}
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;

File diff suppressed because one or more lines are too long

774
dist/human.js vendored

File diff suppressed because one or more lines are too long

View File

@ -37,7 +37,7 @@ export declare type BodyAnnotationEfficientPose = 'leftLeg' | 'rightLeg' | 'tors
/** Configures all body detection specific options */
export declare interface BodyConfig extends GenericConfig {
/** maximum numboer of detected bodies */
/** maximum number of detected bodies */
maxDetected: number;
/** minimum confidence for a detected body before results are discarded */
minConfidence: number;
@ -502,9 +502,11 @@ export declare interface FaceDescriptionConfig extends GenericConfig {
minConfidence: number;
}
/** Dectector part of face configuration */
/** Detector part of face configuration */
export declare interface FaceDetectorConfig extends GenericConfig {
/** is face rotation correction performed after detecting face? */
/** is face rotation correction performed after detecting face?
* used to correctly analyze faces under high angles
*/
rotation: boolean;
/** maximum number of detected faces */
maxDetected: number;
@ -514,7 +516,8 @@ export declare interface FaceDetectorConfig extends GenericConfig {
iouThreshold: number;
/** should child models perform on masked image of a face */
mask: boolean;
/** should face detection return face tensor to be used in some other extenrnal model? */
/** should face detection return processed and cropped face tensor that can with an external model for addtional processing?
* if enabled it must be manually deallocated to avoid memory leak */
return: boolean;
}
@ -695,11 +698,13 @@ export declare type Gender = 'male' | 'female' | 'unknown';
export declare interface GenericConfig {
/** is module enabled? */
enabled: boolean;
/** path to model json file */
/** path to model json file (relative to `modelBasePath` */
modelPath: string;
/** how many max frames to go without re-running model if cached results are acceptable */
/** how many max frames to go without re-running model if cached results are acceptable
* for two-phase models such as face and hand caching applies to bounding boxes detection only */
skipFrames: number;
/** how many max miliseconds to go without re-running model if cached results are acceptable */
/** how many max milliseconds to go without re-running model if cached results are acceptable
* for two-phase models such as face and hand caching applies to bounding boxes detection only */
skipTime: number;
}

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

@ -979,8 +979,8 @@ function GLImageFilter() {
// src/image/enhance.ts
var tf = __toModule(require_tfjs_esm());
async function histogramEqualization(inputImage) {
const squeeze10 = inputImage.shape.length === 4 ? tf.squeeze(inputImage) : inputImage;
const channels = tf.split(squeeze10, 3, 2);
const squeeze11 = inputImage.shape.length === 4 ? tf.squeeze(inputImage) : inputImage;
const channels = tf.split(squeeze11, 3, 2);
const min2 = [tf.min(channels[0]), tf.min(channels[1]), tf.min(channels[2])];
const max4 = [tf.max(channels[0]), tf.max(channels[1]), tf.max(channels[2])];
const absMax = await Promise.all(max4.map((channel) => channel.data()));
@ -990,8 +990,8 @@ async function histogramEqualization(inputImage) {
const fact = [tf.div(maxValue, range[0]), tf.div(maxValue, range[1]), tf.div(maxValue, range[2])];
const enh = [tf.mul(sub10[0], fact[0]), tf.mul(sub10[1], fact[1]), tf.mul(sub10[2], fact[2])];
const rgb2 = tf.stack([enh[0], enh[1], enh[2]], 2);
const reshape8 = tf.reshape(rgb2, [1, squeeze10.shape[0], squeeze10.shape[1], 3]);
tf.dispose([...channels, ...min2, ...max4, ...sub10, ...range, ...fact, ...enh, rgb2, squeeze10]);
const reshape8 = tf.reshape(rgb2, [1, squeeze11.shape[0], squeeze11.shape[1], 3]);
tf.dispose([...channels, ...min2, ...max4, ...sub10, ...range, ...fact, ...enh, rgb2, squeeze11]);
return reshape8;
}
@ -4997,13 +4997,13 @@ var invertTransformMatrix = (matrix) => {
return [rotationComponent[0].concat(invertedTranslation[0]), rotationComponent[1].concat(invertedTranslation[1]), [0, 0, 1]];
};
var rotatePoint = (homogeneousCoordinate, rotationMatrix) => [dot(homogeneousCoordinate, rotationMatrix[0]), dot(homogeneousCoordinate, rotationMatrix[1])];
function generateAnchors(inputSize9) {
const spec = { strides: [inputSize9 / 16, inputSize9 / 8], anchors: [2, 6] };
function generateAnchors(inputSize10) {
const spec = { strides: [inputSize10 / 16, inputSize10 / 8], anchors: [2, 6] };
const anchors4 = [];
for (let i = 0; i < spec.strides.length; i++) {
const stride = spec.strides[i];
const gridRows = Math.floor((inputSize9 + stride - 1) / stride);
const gridCols = Math.floor((inputSize9 + stride - 1) / stride);
const gridRows = Math.floor((inputSize10 + stride - 1) / stride);
const gridCols = Math.floor((inputSize10 + stride - 1) / stride);
const anchorsNum = spec.anchors[i];
for (let gridY = 0; gridY < gridRows; gridY++) {
const anchorY = stride * (gridY + 0.5);
@ -5016,11 +5016,11 @@ function generateAnchors(inputSize9) {
}
return anchors4;
}
function transformRawCoords(coordsRaw, box5, angle, rotationMatrix, inputSize9) {
function transformRawCoords(coordsRaw, box5, angle, rotationMatrix, inputSize10) {
const boxSize = getBoxSize(box5);
const coordsScaled = coordsRaw.map((coord) => [
boxSize[0] / inputSize9 * (coord[0] - inputSize9 / 2),
boxSize[1] / inputSize9 * (coord[1] - inputSize9 / 2),
boxSize[0] / inputSize10 * (coord[0] - inputSize10 / 2),
boxSize[1] / inputSize10 * (coord[1] - inputSize10 / 2),
coord[2] || 0
]);
const largeAngle = angle && angle !== 0 && Math.abs(angle) > 0.2;
@ -5035,7 +5035,7 @@ function transformRawCoords(coordsRaw, box5, angle, rotationMatrix, inputSize9)
Math.trunc(coord[2] || 0)
]);
}
function correctFaceRotation(rotate, box5, input, inputSize9) {
function correctFaceRotation(rotate, box5, input, inputSize10) {
const symmetryLine = box5.landmarks.length >= meshLandmarks.count ? meshLandmarks.symmetryLine : blazeFaceLandmarks.symmetryLine;
let angle = 0;
let rotationMatrix = fixedRotationMatrix;
@ -5048,13 +5048,13 @@ function correctFaceRotation(rotate, box5, input, inputSize9) {
const centerRaw = [center[0] / input.shape[2], center[1] / input.shape[1]];
const rotated = tf9.image.rotateWithOffset(input, angle, 0, centerRaw);
rotationMatrix = buildRotationMatrix(-angle, center);
face5 = cutAndResize(box5, rotated, [inputSize9, inputSize9]);
face5 = cutAndResize(box5, rotated, [inputSize10, inputSize10]);
tf9.dispose(rotated);
} else {
face5 = cutAndResize(box5, input, [inputSize9, inputSize9]);
face5 = cutAndResize(box5, input, [inputSize10, inputSize10]);
}
} else {
face5 = cutAndResize(box5, input, [inputSize9, inputSize9]);
face5 = cutAndResize(box5, input, [inputSize10, inputSize10]);
}
return [angle, rotationMatrix, face5];
}
@ -5157,7 +5157,7 @@ async function getBoxes(inputImage, config3) {
confidence
};
const scaledBox = scaleBoxCoordinates(rawBox, [(inputImage.shape[2] || 0) / inputSize, (inputImage.shape[1] || 0) / inputSize]);
const enlargedBox = enlargeBox(scaledBox, faceBoxScaleFactor);
const enlargedBox = enlargeBox(scaledBox, config3.face["scale"] || faceBoxScaleFactor);
const squaredBox = squarifyBox(enlargedBox);
boxes.push(squaredBox);
Object.keys(b).forEach((tensor3) => tf10.dispose(b[tensor3]));
@ -5574,7 +5574,7 @@ async function process3(res, outputShape, config3) {
t.scores = tf13.squeeze(arr[4]);
t.classes = tf13.squeeze(arr[5]);
tf13.dispose([res, ...arr]);
t.nms = await tf13.image.nonMaxSuppressionAsync(t.boxes, t.scores, config3.object.maxDetected, config3.object.iouThreshold, config3.object.minConfidence);
t.nms = await tf13.image.nonMaxSuppressionAsync(t.boxes, t.scores, config3.object.maxDetected, config3.object.iouThreshold, config3.object.minConfidence || 0);
const nms = await t.nms.data();
let i = 0;
for (const id of Array.from(nms)) {
@ -5611,7 +5611,7 @@ async function predict6(input, config3) {
}
skipped6 = 0;
return new Promise(async (resolve) => {
const outputSize2 = [input.shape[2], input.shape[1]];
const outputSize2 = [input.shape[2] || 0, input.shape[1] || 0];
const resize = tf13.image.resizeBilinear(input, [inputSize4, inputSize4]);
const objectT = config3.object.enabled ? model6 == null ? void 0 : model6.execute(resize, ["tower_0/detections"]) : null;
lastTime6 = now();
@ -5718,10 +5718,10 @@ async function predict7(image29, config3) {
tf14.dispose(tensor3);
if (resT) {
cache2.keypoints.length = 0;
const squeeze10 = resT.squeeze();
const squeeze11 = resT.squeeze();
tf14.dispose(resT);
const stack5 = squeeze10.unstack(2);
tf14.dispose(squeeze10);
const stack5 = squeeze11.unstack(2);
tf14.dispose(squeeze11);
for (let id = 0; id < stack5.length; id++) {
const [x2, y2, partScore] = await max2d(stack5[id], config3.body.minConfidence);
if (partScore > (((_a = config3.body) == null ? void 0 : _a.minConfidence) || 0)) {
@ -5810,8 +5810,8 @@ async function predict8(image29, config3, idx, count2) {
const obj = [];
if ((_a2 = config3.face.emotion) == null ? void 0 : _a2.enabled) {
const t = {};
const inputSize9 = (model8 == null ? void 0 : model8.inputs[0].shape) ? model8.inputs[0].shape[2] : 0;
t.resize = tf15.image.resizeBilinear(image29, [inputSize9, inputSize9], false);
const inputSize10 = (model8 == null ? void 0 : model8.inputs[0].shape) ? model8.inputs[0].shape[2] : 0;
t.resize = tf15.image.resizeBilinear(image29, [inputSize10, inputSize10], false);
t.channels = tf15.mul(t.resize, constants.rgb);
t.grayscale = tf15.sum(t.channels, 3, true);
t.grayscaleSub = tf15.sub(t.grayscale, constants.tf05);
@ -10354,7 +10354,7 @@ function jitter(keypoints) {
}
return keypoints;
}
function padInput(input, inputSize9) {
function padInput(input, inputSize10) {
const t = {};
if (!input.shape || !input.shape[1] || !input.shape[2])
return input;
@ -10365,7 +10365,7 @@ function padInput(input, inputSize9) {
[0, 0]
];
t.pad = tf26.pad(input, cache5.padding);
t.resize = tf26.image.resizeBilinear(t.pad, [inputSize9, inputSize9]);
t.resize = tf26.image.resizeBilinear(t.pad, [inputSize10, inputSize10]);
const final = tf26.cast(t.resize, "int32");
Object.keys(t).forEach((tensor3) => tf26.dispose(t[tensor3]));
return final;
@ -10525,36 +10525,36 @@ var model15;
var last9 = [];
var lastTime14 = 0;
var skipped14 = Number.MAX_SAFE_INTEGER;
var inputSize9 = 0;
var scaleBox = 2.5;
async function load16(config3) {
if (!model15 || env.initial) {
model15 = await tf28.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 || !model15.modelUrl)
inputSize9 = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : 0;
if (!model15 || !model15["modelUrl"])
log("load model failed:", config3.object.modelPath);
else if (config3.debug)
log("load model:", model15.modelUrl);
log("load model:", model15["modelUrl"]);
} else if (config3.debug)
log("cached model:", model15.modelUrl);
log("cached model:", model15["modelUrl"]);
return model15;
}
async function process4(res, inputSize9, outputShape, config3) {
async function process4(res, outputShape, config3) {
let id = 0;
let results = [];
for (const strideSize of [1, 2, 4]) {
tf28.tidy(async () => {
var _a, _b;
const baseSize = strideSize * 13;
const scoresT = (_a = res.find((a) => a.shape[1] === baseSize ** 2 && a.shape[2] === labels.length)) == null ? void 0 : _a.squeeze();
const featuresT = (_b = res.find((a) => a.shape[1] === baseSize ** 2 && a.shape[2] < labels.length)) == null ? void 0 : _b.squeeze();
const scoresT = tf28.squeeze(res.find((a) => a.shape[1] === baseSize ** 2 && (a.shape[2] || 0) === labels.length));
const featuresT = tf28.squeeze(res.find((a) => a.shape[1] === baseSize ** 2 && (a.shape[2] || 0) < labels.length));
const boxesMax = featuresT.reshape([-1, 4, featuresT.shape[1] / 4]);
const boxIdx = await boxesMax.argMax(2).array();
const scores = await scoresT.array();
for (let i = 0; i < scoresT.shape[0]; i++) {
for (let j = 0; j < scoresT.shape[1]; j++) {
const score = scores[i][j];
if (score > config3.object.minConfidence && j !== 61) {
if (score > (config3.object.minConfidence || 0) && j !== 61) {
const cx = (0.5 + Math.trunc(i % baseSize)) / baseSize;
const cy = (0.5 + Math.trunc(i / baseSize)) / baseSize;
const boxOffset = boxIdx[i].map((a) => a * (baseSize / strideSize / inputSize9));
@ -10611,8 +10611,8 @@ async function predict16(image29, config3) {
if (!env.kernels.includes("mod") || !env.kernels.includes("sparsetodense"))
return last9;
return new Promise(async (resolve) => {
const outputSize2 = [image29.shape[2], image29.shape[1]];
const resize = tf28.image.resizeBilinear(image29, [model15.inputSize, model15.inputSize], false);
const outputSize2 = [image29.shape[2] || 0, image29.shape[1] || 0];
const resize = tf28.image.resizeBilinear(image29, [inputSize9, inputSize9], false);
const norm = tf28.div(resize, constants.tf255);
const transpose = norm.transpose([0, 3, 1, 2]);
tf28.dispose(norm);
@ -10622,7 +10622,7 @@ async function predict16(image29, config3) {
objectT = model15.execute(transpose);
lastTime14 = now();
tf28.dispose(transpose);
const obj = await process4(objectT, model15.inputSize, outputSize2, config3);
const obj = await process4(objectT, outputSize2, config3);
last9 = obj;
resolve(obj);
});
@ -11023,6 +11023,7 @@ async function process5(input, background, config3) {
return { data, canvas: null, alpha: null };
}
const alphaCanvas = canvas(width, height);
if (tf30.browser)
await tf30.browser.toPixels(t.data, alphaCanvas);
const alphaCtx = alphaCanvas.getContext("2d");
if (config3.segmentation.blur && config3.segmentation.blur > 0)
@ -11944,7 +11945,7 @@ var calculateGaze = (face5) => {
return { bearing: 0, strength: 0 };
const offsetIris = [0, -0.1];
const eyeRatio = 1;
const left = face5.mesh[33][2] > face5.mesh[263][2];
const left = (face5.mesh[33][2] || 0) > (face5.mesh[263][2] || 0);
const irisCenter = left ? face5.mesh[473] : face5.mesh[468];
const eyeCenter = left ? [(face5.mesh[133][0] + face5.mesh[33][0]) / 2, (face5.mesh[133][1] + face5.mesh[33][1]) / 2] : [(face5.mesh[263][0] + face5.mesh[362][0]) / 2, (face5.mesh[263][1] + face5.mesh[362][1]) / 2];
const eyeSize = left ? [face5.mesh[133][0] - face5.mesh[33][0], face5.mesh[23][1] - face5.mesh[27][1]] : [face5.mesh[263][0] - face5.mesh[362][0], face5.mesh[253][1] - face5.mesh[257][1]];
@ -12033,7 +12034,7 @@ var calculateFaceAngle = (face5, imageSize) => {
// src/face/face.ts
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;
let timeStamp;
let timeStamp = now();
let ageRes;
let gearRes;
let genderRes;
@ -12044,7 +12045,6 @@ var detectFace = async (instance, input) => {
let descRes;
const faceRes = [];
instance.state = "run:face";
timeStamp = now();
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)
@ -12065,63 +12065,63 @@ var detectFace = async (instance, input) => {
const rotation = faces[i].mesh && faces[i].mesh.length > 200 ? calculateFaceAngle(faces[i], [input.shape[2], input.shape[1]]) : null;
instance.analyze("Start Emotion:");
if (instance.config.async) {
emotionRes = ((_b = instance.config.face.emotion) == null ? void 0 : _b.enabled) ? predict8(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
emotionRes = ((_b = instance.config.face.emotion) == null ? void 0 : _b.enabled) ? predict8(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : [];
} else {
instance.state = "run:emotion";
timeStamp = now();
emotionRes = ((_c = instance.config.face.emotion) == null ? void 0 : _c.enabled) ? await predict8(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
emotionRes = ((_c = instance.config.face.emotion) == null ? void 0 : _c.enabled) ? await predict8(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : [];
instance.performance.emotion = env.perfadd ? (instance.performance.emotion || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
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 || tf34.tensor([]), instance.config, i, faces.length) : null;
antispoofRes = ((_d = instance.config.face.antispoof) == null ? void 0 : _d.enabled) ? predict4(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : 0;
} else {
instance.state = "run:antispoof";
timeStamp = now();
antispoofRes = ((_e = instance.config.face.antispoof) == null ? void 0 : _e.enabled) ? await predict4(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
antispoofRes = ((_e = instance.config.face.antispoof) == null ? void 0 : _e.enabled) ? await predict4(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : 0;
instance.performance.antispoof = env.perfadd ? (instance.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
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 || tf34.tensor([]), instance.config, i, faces.length) : null;
livenessRes = ((_f = instance.config.face.liveness) == null ? void 0 : _f.enabled) ? predict14(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : 0;
} else {
instance.state = "run:liveness";
timeStamp = now();
livenessRes = ((_g = instance.config.face.liveness) == null ? void 0 : _g.enabled) ? await predict14(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
livenessRes = ((_g = instance.config.face.liveness) == null ? void 0 : _g.enabled) ? await predict14(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : 0;
instance.performance.liveness = env.perfadd ? (instance.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
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 || tf34.tensor([]), instance.config, i, faces.length) : {};
gearRes = ((_h = instance.config.face["gear"]) == null ? void 0 : _h.enabled) ? predict(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
} else {
instance.state = "run:gear";
timeStamp = now();
gearRes = ((_i = instance.config.face["gear"]) == null ? void 0 : _i.enabled) ? await predict(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : {};
gearRes = ((_i = instance.config.face["gear"]) == null ? void 0 : _i.enabled) ? await predict(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
instance.performance.gear = Math.trunc(now() - timeStamp);
}
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 || tf34.tensor([]), instance.config, i, faces.length) : {};
genderRes = ((_k = instance.config.face["ssrnet"]) == null ? void 0 : _k.enabled) ? predict3(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : {};
ageRes = ((_j = instance.config.face["ssrnet"]) == null ? void 0 : _j.enabled) ? predict2(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
genderRes = ((_k = instance.config.face["ssrnet"]) == null ? void 0 : _k.enabled) ? predict3(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
} else {
instance.state = "run:ssrnet";
timeStamp = now();
ageRes = ((_l = instance.config.face["ssrnet"]) == null ? void 0 : _l.enabled) ? await predict2(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : {};
genderRes = ((_m = instance.config.face["ssrnet"]) == null ? void 0 : _m.enabled) ? await predict3(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : {};
ageRes = ((_l = instance.config.face["ssrnet"]) == null ? void 0 : _l.enabled) ? await predict2(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
genderRes = ((_m = instance.config.face["ssrnet"]) == null ? void 0 : _m.enabled) ? await predict3(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
instance.performance.ssrnet = Math.trunc(now() - timeStamp);
}
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 || tf34.tensor([]), instance.config, i, faces.length) : {};
mobilefacenetRes = ((_n = instance.config.face["mobilefacenet"]) == null ? void 0 : _n.enabled) ? predict9(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
} else {
instance.state = "run:mobilefacenet";
timeStamp = now();
mobilefacenetRes = ((_o = instance.config.face["mobilefacenet"]) == null ? void 0 : _o.enabled) ? await predict9(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : {};
mobilefacenetRes = ((_o = instance.config.face["mobilefacenet"]) == null ? void 0 : _o.enabled) ? await predict9(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
instance.performance.mobilefacenet = Math.trunc(now() - timeStamp);
}
instance.analyze("End MobileFaceNet:");
@ -12139,12 +12139,26 @@ var detectFace = async (instance, input) => {
[ageRes, genderRes, emotionRes, mobilefacenetRes, descRes, gearRes, antispoofRes, livenessRes] = await Promise.all([ageRes, genderRes, emotionRes, mobilefacenetRes, descRes, gearRes, antispoofRes, livenessRes]);
}
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 = 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 = instance.config.face["mobilefacenet"]) == null ? void 0 : _t.enabled) && mobilefacenetRes)
if (((_r = instance.config.face["ssrnet"]) == null ? void 0 : _r.enabled) && ageRes && genderRes) {
descRes = {
...descRes,
age: ageRes.age,
gender: genderRes.gender,
genderScore: genderRes.genderScore
};
}
if (((_s = instance.config.face["gear"]) == null ? void 0 : _s.enabled) && gearRes) {
descRes = {
...descRes,
age: gearRes.age,
gender: gearRes.gender,
genderScore: gearRes.genderScore,
race: gearRes.race
};
}
if (((_t = instance.config.face["mobilefacenet"]) == null ? void 0 : _t.enabled) && mobilefacenetRes) {
descRes.descriptor = mobilefacenetRes;
}
if (!((_u = instance.config.face.iris) == null ? void 0 : _u.enabled)) {
}
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;

View File

@ -37,7 +37,7 @@ export declare type BodyAnnotationEfficientPose = 'leftLeg' | 'rightLeg' | 'tors
/** Configures all body detection specific options */
export declare interface BodyConfig extends GenericConfig {
/** maximum numboer of detected bodies */
/** maximum number of detected bodies */
maxDetected: number;
/** minimum confidence for a detected body before results are discarded */
minConfidence: number;
@ -502,9 +502,11 @@ export declare interface FaceDescriptionConfig extends GenericConfig {
minConfidence: number;
}
/** Dectector part of face configuration */
/** Detector part of face configuration */
export declare interface FaceDetectorConfig extends GenericConfig {
/** is face rotation correction performed after detecting face? */
/** is face rotation correction performed after detecting face?
* used to correctly analyze faces under high angles
*/
rotation: boolean;
/** maximum number of detected faces */
maxDetected: number;
@ -514,7 +516,8 @@ export declare interface FaceDetectorConfig extends GenericConfig {
iouThreshold: number;
/** should child models perform on masked image of a face */
mask: boolean;
/** should face detection return face tensor to be used in some other extenrnal model? */
/** should face detection return processed and cropped face tensor that can with an external model for addtional processing?
* if enabled it must be manually deallocated to avoid memory leak */
return: boolean;
}
@ -695,11 +698,13 @@ export declare type Gender = 'male' | 'female' | 'unknown';
export declare interface GenericConfig {
/** is module enabled? */
enabled: boolean;
/** path to model json file */
/** path to model json file (relative to `modelBasePath` */
modelPath: string;
/** how many max frames to go without re-running model if cached results are acceptable */
/** how many max frames to go without re-running model if cached results are acceptable
* for two-phase models such as face and hand caching applies to bounding boxes detection only */
skipFrames: number;
/** how many max miliseconds to go without re-running model if cached results are acceptable */
/** how many max milliseconds to go without re-running model if cached results are acceptable
* for two-phase models such as face and hand caching applies to bounding boxes detection only */
skipTime: number;
}

View File

@ -980,8 +980,8 @@ function GLImageFilter() {
// src/image/enhance.ts
var tf = __toModule(require_tfjs_esm());
async function histogramEqualization(inputImage) {
const squeeze10 = inputImage.shape.length === 4 ? tf.squeeze(inputImage) : inputImage;
const channels = tf.split(squeeze10, 3, 2);
const squeeze11 = inputImage.shape.length === 4 ? tf.squeeze(inputImage) : inputImage;
const channels = tf.split(squeeze11, 3, 2);
const min2 = [tf.min(channels[0]), tf.min(channels[1]), tf.min(channels[2])];
const max4 = [tf.max(channels[0]), tf.max(channels[1]), tf.max(channels[2])];
const absMax = await Promise.all(max4.map((channel) => channel.data()));
@ -991,8 +991,8 @@ async function histogramEqualization(inputImage) {
const fact = [tf.div(maxValue, range[0]), tf.div(maxValue, range[1]), tf.div(maxValue, range[2])];
const enh = [tf.mul(sub10[0], fact[0]), tf.mul(sub10[1], fact[1]), tf.mul(sub10[2], fact[2])];
const rgb2 = tf.stack([enh[0], enh[1], enh[2]], 2);
const reshape8 = tf.reshape(rgb2, [1, squeeze10.shape[0], squeeze10.shape[1], 3]);
tf.dispose([...channels, ...min2, ...max4, ...sub10, ...range, ...fact, ...enh, rgb2, squeeze10]);
const reshape8 = tf.reshape(rgb2, [1, squeeze11.shape[0], squeeze11.shape[1], 3]);
tf.dispose([...channels, ...min2, ...max4, ...sub10, ...range, ...fact, ...enh, rgb2, squeeze11]);
return reshape8;
}
@ -4998,13 +4998,13 @@ var invertTransformMatrix = (matrix) => {
return [rotationComponent[0].concat(invertedTranslation[0]), rotationComponent[1].concat(invertedTranslation[1]), [0, 0, 1]];
};
var rotatePoint = (homogeneousCoordinate, rotationMatrix) => [dot(homogeneousCoordinate, rotationMatrix[0]), dot(homogeneousCoordinate, rotationMatrix[1])];
function generateAnchors(inputSize9) {
const spec = { strides: [inputSize9 / 16, inputSize9 / 8], anchors: [2, 6] };
function generateAnchors(inputSize10) {
const spec = { strides: [inputSize10 / 16, inputSize10 / 8], anchors: [2, 6] };
const anchors4 = [];
for (let i = 0; i < spec.strides.length; i++) {
const stride = spec.strides[i];
const gridRows = Math.floor((inputSize9 + stride - 1) / stride);
const gridCols = Math.floor((inputSize9 + stride - 1) / stride);
const gridRows = Math.floor((inputSize10 + stride - 1) / stride);
const gridCols = Math.floor((inputSize10 + stride - 1) / stride);
const anchorsNum = spec.anchors[i];
for (let gridY = 0; gridY < gridRows; gridY++) {
const anchorY = stride * (gridY + 0.5);
@ -5017,11 +5017,11 @@ function generateAnchors(inputSize9) {
}
return anchors4;
}
function transformRawCoords(coordsRaw, box5, angle, rotationMatrix, inputSize9) {
function transformRawCoords(coordsRaw, box5, angle, rotationMatrix, inputSize10) {
const boxSize = getBoxSize(box5);
const coordsScaled = coordsRaw.map((coord) => [
boxSize[0] / inputSize9 * (coord[0] - inputSize9 / 2),
boxSize[1] / inputSize9 * (coord[1] - inputSize9 / 2),
boxSize[0] / inputSize10 * (coord[0] - inputSize10 / 2),
boxSize[1] / inputSize10 * (coord[1] - inputSize10 / 2),
coord[2] || 0
]);
const largeAngle = angle && angle !== 0 && Math.abs(angle) > 0.2;
@ -5036,7 +5036,7 @@ function transformRawCoords(coordsRaw, box5, angle, rotationMatrix, inputSize9)
Math.trunc(coord[2] || 0)
]);
}
function correctFaceRotation(rotate, box5, input, inputSize9) {
function correctFaceRotation(rotate, box5, input, inputSize10) {
const symmetryLine = box5.landmarks.length >= meshLandmarks.count ? meshLandmarks.symmetryLine : blazeFaceLandmarks.symmetryLine;
let angle = 0;
let rotationMatrix = fixedRotationMatrix;
@ -5049,13 +5049,13 @@ function correctFaceRotation(rotate, box5, input, inputSize9) {
const centerRaw = [center[0] / input.shape[2], center[1] / input.shape[1]];
const rotated = tf9.image.rotateWithOffset(input, angle, 0, centerRaw);
rotationMatrix = buildRotationMatrix(-angle, center);
face5 = cutAndResize(box5, rotated, [inputSize9, inputSize9]);
face5 = cutAndResize(box5, rotated, [inputSize10, inputSize10]);
tf9.dispose(rotated);
} else {
face5 = cutAndResize(box5, input, [inputSize9, inputSize9]);
face5 = cutAndResize(box5, input, [inputSize10, inputSize10]);
}
} else {
face5 = cutAndResize(box5, input, [inputSize9, inputSize9]);
face5 = cutAndResize(box5, input, [inputSize10, inputSize10]);
}
return [angle, rotationMatrix, face5];
}
@ -5158,7 +5158,7 @@ async function getBoxes(inputImage, config3) {
confidence
};
const scaledBox = scaleBoxCoordinates(rawBox, [(inputImage.shape[2] || 0) / inputSize, (inputImage.shape[1] || 0) / inputSize]);
const enlargedBox = enlargeBox(scaledBox, faceBoxScaleFactor);
const enlargedBox = enlargeBox(scaledBox, config3.face["scale"] || faceBoxScaleFactor);
const squaredBox = squarifyBox(enlargedBox);
boxes.push(squaredBox);
Object.keys(b).forEach((tensor3) => tf10.dispose(b[tensor3]));
@ -5575,7 +5575,7 @@ async function process3(res, outputShape, config3) {
t.scores = tf13.squeeze(arr[4]);
t.classes = tf13.squeeze(arr[5]);
tf13.dispose([res, ...arr]);
t.nms = await tf13.image.nonMaxSuppressionAsync(t.boxes, t.scores, config3.object.maxDetected, config3.object.iouThreshold, config3.object.minConfidence);
t.nms = await tf13.image.nonMaxSuppressionAsync(t.boxes, t.scores, config3.object.maxDetected, config3.object.iouThreshold, config3.object.minConfidence || 0);
const nms = await t.nms.data();
let i = 0;
for (const id of Array.from(nms)) {
@ -5612,7 +5612,7 @@ async function predict6(input, config3) {
}
skipped6 = 0;
return new Promise(async (resolve) => {
const outputSize2 = [input.shape[2], input.shape[1]];
const outputSize2 = [input.shape[2] || 0, input.shape[1] || 0];
const resize = tf13.image.resizeBilinear(input, [inputSize4, inputSize4]);
const objectT = config3.object.enabled ? model6 == null ? void 0 : model6.execute(resize, ["tower_0/detections"]) : null;
lastTime6 = now();
@ -5719,10 +5719,10 @@ async function predict7(image29, config3) {
tf14.dispose(tensor3);
if (resT) {
cache2.keypoints.length = 0;
const squeeze10 = resT.squeeze();
const squeeze11 = resT.squeeze();
tf14.dispose(resT);
const stack5 = squeeze10.unstack(2);
tf14.dispose(squeeze10);
const stack5 = squeeze11.unstack(2);
tf14.dispose(squeeze11);
for (let id = 0; id < stack5.length; id++) {
const [x2, y2, partScore] = await max2d(stack5[id], config3.body.minConfidence);
if (partScore > (((_a = config3.body) == null ? void 0 : _a.minConfidence) || 0)) {
@ -5811,8 +5811,8 @@ async function predict8(image29, config3, idx, count2) {
const obj = [];
if ((_a2 = config3.face.emotion) == null ? void 0 : _a2.enabled) {
const t = {};
const inputSize9 = (model8 == null ? void 0 : model8.inputs[0].shape) ? model8.inputs[0].shape[2] : 0;
t.resize = tf15.image.resizeBilinear(image29, [inputSize9, inputSize9], false);
const inputSize10 = (model8 == null ? void 0 : model8.inputs[0].shape) ? model8.inputs[0].shape[2] : 0;
t.resize = tf15.image.resizeBilinear(image29, [inputSize10, inputSize10], false);
t.channels = tf15.mul(t.resize, constants.rgb);
t.grayscale = tf15.sum(t.channels, 3, true);
t.grayscaleSub = tf15.sub(t.grayscale, constants.tf05);
@ -10355,7 +10355,7 @@ function jitter(keypoints) {
}
return keypoints;
}
function padInput(input, inputSize9) {
function padInput(input, inputSize10) {
const t = {};
if (!input.shape || !input.shape[1] || !input.shape[2])
return input;
@ -10366,7 +10366,7 @@ function padInput(input, inputSize9) {
[0, 0]
];
t.pad = tf26.pad(input, cache5.padding);
t.resize = tf26.image.resizeBilinear(t.pad, [inputSize9, inputSize9]);
t.resize = tf26.image.resizeBilinear(t.pad, [inputSize10, inputSize10]);
const final = tf26.cast(t.resize, "int32");
Object.keys(t).forEach((tensor3) => tf26.dispose(t[tensor3]));
return final;
@ -10526,36 +10526,36 @@ var model15;
var last9 = [];
var lastTime14 = 0;
var skipped14 = Number.MAX_SAFE_INTEGER;
var inputSize9 = 0;
var scaleBox = 2.5;
async function load16(config3) {
if (!model15 || env.initial) {
model15 = await tf28.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 || !model15.modelUrl)
inputSize9 = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : 0;
if (!model15 || !model15["modelUrl"])
log("load model failed:", config3.object.modelPath);
else if (config3.debug)
log("load model:", model15.modelUrl);
log("load model:", model15["modelUrl"]);
} else if (config3.debug)
log("cached model:", model15.modelUrl);
log("cached model:", model15["modelUrl"]);
return model15;
}
async function process4(res, inputSize9, outputShape, config3) {
async function process4(res, outputShape, config3) {
let id = 0;
let results = [];
for (const strideSize of [1, 2, 4]) {
tf28.tidy(async () => {
var _a, _b;
const baseSize = strideSize * 13;
const scoresT = (_a = res.find((a) => a.shape[1] === baseSize ** 2 && a.shape[2] === labels.length)) == null ? void 0 : _a.squeeze();
const featuresT = (_b = res.find((a) => a.shape[1] === baseSize ** 2 && a.shape[2] < labels.length)) == null ? void 0 : _b.squeeze();
const scoresT = tf28.squeeze(res.find((a) => a.shape[1] === baseSize ** 2 && (a.shape[2] || 0) === labels.length));
const featuresT = tf28.squeeze(res.find((a) => a.shape[1] === baseSize ** 2 && (a.shape[2] || 0) < labels.length));
const boxesMax = featuresT.reshape([-1, 4, featuresT.shape[1] / 4]);
const boxIdx = await boxesMax.argMax(2).array();
const scores = await scoresT.array();
for (let i = 0; i < scoresT.shape[0]; i++) {
for (let j = 0; j < scoresT.shape[1]; j++) {
const score = scores[i][j];
if (score > config3.object.minConfidence && j !== 61) {
if (score > (config3.object.minConfidence || 0) && j !== 61) {
const cx = (0.5 + Math.trunc(i % baseSize)) / baseSize;
const cy = (0.5 + Math.trunc(i / baseSize)) / baseSize;
const boxOffset = boxIdx[i].map((a) => a * (baseSize / strideSize / inputSize9));
@ -10612,8 +10612,8 @@ async function predict16(image29, config3) {
if (!env.kernels.includes("mod") || !env.kernels.includes("sparsetodense"))
return last9;
return new Promise(async (resolve) => {
const outputSize2 = [image29.shape[2], image29.shape[1]];
const resize = tf28.image.resizeBilinear(image29, [model15.inputSize, model15.inputSize], false);
const outputSize2 = [image29.shape[2] || 0, image29.shape[1] || 0];
const resize = tf28.image.resizeBilinear(image29, [inputSize9, inputSize9], false);
const norm = tf28.div(resize, constants.tf255);
const transpose = norm.transpose([0, 3, 1, 2]);
tf28.dispose(norm);
@ -10623,7 +10623,7 @@ async function predict16(image29, config3) {
objectT = model15.execute(transpose);
lastTime14 = now();
tf28.dispose(transpose);
const obj = await process4(objectT, model15.inputSize, outputSize2, config3);
const obj = await process4(objectT, outputSize2, config3);
last9 = obj;
resolve(obj);
});
@ -11024,6 +11024,7 @@ async function process5(input, background, config3) {
return { data, canvas: null, alpha: null };
}
const alphaCanvas = canvas(width, height);
if (tf30.browser)
await tf30.browser.toPixels(t.data, alphaCanvas);
const alphaCtx = alphaCanvas.getContext("2d");
if (config3.segmentation.blur && config3.segmentation.blur > 0)
@ -11945,7 +11946,7 @@ var calculateGaze = (face5) => {
return { bearing: 0, strength: 0 };
const offsetIris = [0, -0.1];
const eyeRatio = 1;
const left = face5.mesh[33][2] > face5.mesh[263][2];
const left = (face5.mesh[33][2] || 0) > (face5.mesh[263][2] || 0);
const irisCenter = left ? face5.mesh[473] : face5.mesh[468];
const eyeCenter = left ? [(face5.mesh[133][0] + face5.mesh[33][0]) / 2, (face5.mesh[133][1] + face5.mesh[33][1]) / 2] : [(face5.mesh[263][0] + face5.mesh[362][0]) / 2, (face5.mesh[263][1] + face5.mesh[362][1]) / 2];
const eyeSize = left ? [face5.mesh[133][0] - face5.mesh[33][0], face5.mesh[23][1] - face5.mesh[27][1]] : [face5.mesh[263][0] - face5.mesh[362][0], face5.mesh[253][1] - face5.mesh[257][1]];
@ -12034,7 +12035,7 @@ var calculateFaceAngle = (face5, imageSize) => {
// src/face/face.ts
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;
let timeStamp;
let timeStamp = now();
let ageRes;
let gearRes;
let genderRes;
@ -12045,7 +12046,6 @@ var detectFace = async (instance, input) => {
let descRes;
const faceRes = [];
instance.state = "run:face";
timeStamp = now();
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)
@ -12066,63 +12066,63 @@ var detectFace = async (instance, input) => {
const rotation = faces[i].mesh && faces[i].mesh.length > 200 ? calculateFaceAngle(faces[i], [input.shape[2], input.shape[1]]) : null;
instance.analyze("Start Emotion:");
if (instance.config.async) {
emotionRes = ((_b = instance.config.face.emotion) == null ? void 0 : _b.enabled) ? predict8(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
emotionRes = ((_b = instance.config.face.emotion) == null ? void 0 : _b.enabled) ? predict8(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : [];
} else {
instance.state = "run:emotion";
timeStamp = now();
emotionRes = ((_c = instance.config.face.emotion) == null ? void 0 : _c.enabled) ? await predict8(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
emotionRes = ((_c = instance.config.face.emotion) == null ? void 0 : _c.enabled) ? await predict8(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : [];
instance.performance.emotion = env.perfadd ? (instance.performance.emotion || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
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 || tf34.tensor([]), instance.config, i, faces.length) : null;
antispoofRes = ((_d = instance.config.face.antispoof) == null ? void 0 : _d.enabled) ? predict4(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : 0;
} else {
instance.state = "run:antispoof";
timeStamp = now();
antispoofRes = ((_e = instance.config.face.antispoof) == null ? void 0 : _e.enabled) ? await predict4(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
antispoofRes = ((_e = instance.config.face.antispoof) == null ? void 0 : _e.enabled) ? await predict4(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : 0;
instance.performance.antispoof = env.perfadd ? (instance.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
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 || tf34.tensor([]), instance.config, i, faces.length) : null;
livenessRes = ((_f = instance.config.face.liveness) == null ? void 0 : _f.enabled) ? predict14(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : 0;
} else {
instance.state = "run:liveness";
timeStamp = now();
livenessRes = ((_g = instance.config.face.liveness) == null ? void 0 : _g.enabled) ? await predict14(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
livenessRes = ((_g = instance.config.face.liveness) == null ? void 0 : _g.enabled) ? await predict14(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : 0;
instance.performance.liveness = env.perfadd ? (instance.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
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 || tf34.tensor([]), instance.config, i, faces.length) : {};
gearRes = ((_h = instance.config.face["gear"]) == null ? void 0 : _h.enabled) ? predict(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
} else {
instance.state = "run:gear";
timeStamp = now();
gearRes = ((_i = instance.config.face["gear"]) == null ? void 0 : _i.enabled) ? await predict(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : {};
gearRes = ((_i = instance.config.face["gear"]) == null ? void 0 : _i.enabled) ? await predict(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
instance.performance.gear = Math.trunc(now() - timeStamp);
}
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 || tf34.tensor([]), instance.config, i, faces.length) : {};
genderRes = ((_k = instance.config.face["ssrnet"]) == null ? void 0 : _k.enabled) ? predict3(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : {};
ageRes = ((_j = instance.config.face["ssrnet"]) == null ? void 0 : _j.enabled) ? predict2(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
genderRes = ((_k = instance.config.face["ssrnet"]) == null ? void 0 : _k.enabled) ? predict3(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
} else {
instance.state = "run:ssrnet";
timeStamp = now();
ageRes = ((_l = instance.config.face["ssrnet"]) == null ? void 0 : _l.enabled) ? await predict2(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : {};
genderRes = ((_m = instance.config.face["ssrnet"]) == null ? void 0 : _m.enabled) ? await predict3(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : {};
ageRes = ((_l = instance.config.face["ssrnet"]) == null ? void 0 : _l.enabled) ? await predict2(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
genderRes = ((_m = instance.config.face["ssrnet"]) == null ? void 0 : _m.enabled) ? await predict3(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
instance.performance.ssrnet = Math.trunc(now() - timeStamp);
}
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 || tf34.tensor([]), instance.config, i, faces.length) : {};
mobilefacenetRes = ((_n = instance.config.face["mobilefacenet"]) == null ? void 0 : _n.enabled) ? predict9(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
} else {
instance.state = "run:mobilefacenet";
timeStamp = now();
mobilefacenetRes = ((_o = instance.config.face["mobilefacenet"]) == null ? void 0 : _o.enabled) ? await predict9(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : {};
mobilefacenetRes = ((_o = instance.config.face["mobilefacenet"]) == null ? void 0 : _o.enabled) ? await predict9(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
instance.performance.mobilefacenet = Math.trunc(now() - timeStamp);
}
instance.analyze("End MobileFaceNet:");
@ -12140,12 +12140,26 @@ var detectFace = async (instance, input) => {
[ageRes, genderRes, emotionRes, mobilefacenetRes, descRes, gearRes, antispoofRes, livenessRes] = await Promise.all([ageRes, genderRes, emotionRes, mobilefacenetRes, descRes, gearRes, antispoofRes, livenessRes]);
}
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 = 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 = instance.config.face["mobilefacenet"]) == null ? void 0 : _t.enabled) && mobilefacenetRes)
if (((_r = instance.config.face["ssrnet"]) == null ? void 0 : _r.enabled) && ageRes && genderRes) {
descRes = {
...descRes,
age: ageRes.age,
gender: genderRes.gender,
genderScore: genderRes.genderScore
};
}
if (((_s = instance.config.face["gear"]) == null ? void 0 : _s.enabled) && gearRes) {
descRes = {
...descRes,
age: gearRes.age,
gender: gearRes.gender,
genderScore: gearRes.genderScore,
race: gearRes.race
};
}
if (((_t = instance.config.face["mobilefacenet"]) == null ? void 0 : _t.enabled) && mobilefacenetRes) {
descRes.descriptor = mobilefacenetRes;
}
if (!((_u = instance.config.face.iris) == null ? void 0 : _u.enabled)) {
}
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;

19
dist/human.node.d.ts vendored
View File

@ -37,7 +37,7 @@ export declare type BodyAnnotationEfficientPose = 'leftLeg' | 'rightLeg' | 'tors
/** Configures all body detection specific options */
export declare interface BodyConfig extends GenericConfig {
/** maximum numboer of detected bodies */
/** maximum number of detected bodies */
maxDetected: number;
/** minimum confidence for a detected body before results are discarded */
minConfidence: number;
@ -502,9 +502,11 @@ export declare interface FaceDescriptionConfig extends GenericConfig {
minConfidence: number;
}
/** Dectector part of face configuration */
/** Detector part of face configuration */
export declare interface FaceDetectorConfig extends GenericConfig {
/** is face rotation correction performed after detecting face? */
/** is face rotation correction performed after detecting face?
* used to correctly analyze faces under high angles
*/
rotation: boolean;
/** maximum number of detected faces */
maxDetected: number;
@ -514,7 +516,8 @@ export declare interface FaceDetectorConfig extends GenericConfig {
iouThreshold: number;
/** should child models perform on masked image of a face */
mask: boolean;
/** should face detection return face tensor to be used in some other extenrnal model? */
/** should face detection return processed and cropped face tensor that can with an external model for addtional processing?
* if enabled it must be manually deallocated to avoid memory leak */
return: boolean;
}
@ -695,11 +698,13 @@ export declare type Gender = 'male' | 'female' | 'unknown';
export declare interface GenericConfig {
/** is module enabled? */
enabled: boolean;
/** path to model json file */
/** path to model json file (relative to `modelBasePath` */
modelPath: string;
/** how many max frames to go without re-running model if cached results are acceptable */
/** how many max frames to go without re-running model if cached results are acceptable
* for two-phase models such as face and hand caching applies to bounding boxes detection only */
skipFrames: number;
/** how many max miliseconds to go without re-running model if cached results are acceptable */
/** how many max milliseconds to go without re-running model if cached results are acceptable
* for two-phase models such as face and hand caching applies to bounding boxes detection only */
skipTime: number;
}

132
dist/human.node.js vendored
View File

@ -979,8 +979,8 @@ function GLImageFilter() {
// src/image/enhance.ts
var tf = __toModule(require_tfjs_esm());
async function histogramEqualization(inputImage) {
const squeeze10 = inputImage.shape.length === 4 ? tf.squeeze(inputImage) : inputImage;
const channels = tf.split(squeeze10, 3, 2);
const squeeze11 = inputImage.shape.length === 4 ? tf.squeeze(inputImage) : inputImage;
const channels = tf.split(squeeze11, 3, 2);
const min2 = [tf.min(channels[0]), tf.min(channels[1]), tf.min(channels[2])];
const max4 = [tf.max(channels[0]), tf.max(channels[1]), tf.max(channels[2])];
const absMax = await Promise.all(max4.map((channel) => channel.data()));
@ -990,8 +990,8 @@ async function histogramEqualization(inputImage) {
const fact = [tf.div(maxValue, range[0]), tf.div(maxValue, range[1]), tf.div(maxValue, range[2])];
const enh = [tf.mul(sub10[0], fact[0]), tf.mul(sub10[1], fact[1]), tf.mul(sub10[2], fact[2])];
const rgb2 = tf.stack([enh[0], enh[1], enh[2]], 2);
const reshape8 = tf.reshape(rgb2, [1, squeeze10.shape[0], squeeze10.shape[1], 3]);
tf.dispose([...channels, ...min2, ...max4, ...sub10, ...range, ...fact, ...enh, rgb2, squeeze10]);
const reshape8 = tf.reshape(rgb2, [1, squeeze11.shape[0], squeeze11.shape[1], 3]);
tf.dispose([...channels, ...min2, ...max4, ...sub10, ...range, ...fact, ...enh, rgb2, squeeze11]);
return reshape8;
}
@ -4997,13 +4997,13 @@ var invertTransformMatrix = (matrix) => {
return [rotationComponent[0].concat(invertedTranslation[0]), rotationComponent[1].concat(invertedTranslation[1]), [0, 0, 1]];
};
var rotatePoint = (homogeneousCoordinate, rotationMatrix) => [dot(homogeneousCoordinate, rotationMatrix[0]), dot(homogeneousCoordinate, rotationMatrix[1])];
function generateAnchors(inputSize9) {
const spec = { strides: [inputSize9 / 16, inputSize9 / 8], anchors: [2, 6] };
function generateAnchors(inputSize10) {
const spec = { strides: [inputSize10 / 16, inputSize10 / 8], anchors: [2, 6] };
const anchors4 = [];
for (let i = 0; i < spec.strides.length; i++) {
const stride = spec.strides[i];
const gridRows = Math.floor((inputSize9 + stride - 1) / stride);
const gridCols = Math.floor((inputSize9 + stride - 1) / stride);
const gridRows = Math.floor((inputSize10 + stride - 1) / stride);
const gridCols = Math.floor((inputSize10 + stride - 1) / stride);
const anchorsNum = spec.anchors[i];
for (let gridY = 0; gridY < gridRows; gridY++) {
const anchorY = stride * (gridY + 0.5);
@ -5016,11 +5016,11 @@ function generateAnchors(inputSize9) {
}
return anchors4;
}
function transformRawCoords(coordsRaw, box5, angle, rotationMatrix, inputSize9) {
function transformRawCoords(coordsRaw, box5, angle, rotationMatrix, inputSize10) {
const boxSize = getBoxSize(box5);
const coordsScaled = coordsRaw.map((coord) => [
boxSize[0] / inputSize9 * (coord[0] - inputSize9 / 2),
boxSize[1] / inputSize9 * (coord[1] - inputSize9 / 2),
boxSize[0] / inputSize10 * (coord[0] - inputSize10 / 2),
boxSize[1] / inputSize10 * (coord[1] - inputSize10 / 2),
coord[2] || 0
]);
const largeAngle = angle && angle !== 0 && Math.abs(angle) > 0.2;
@ -5035,7 +5035,7 @@ function transformRawCoords(coordsRaw, box5, angle, rotationMatrix, inputSize9)
Math.trunc(coord[2] || 0)
]);
}
function correctFaceRotation(rotate, box5, input, inputSize9) {
function correctFaceRotation(rotate, box5, input, inputSize10) {
const symmetryLine = box5.landmarks.length >= meshLandmarks.count ? meshLandmarks.symmetryLine : blazeFaceLandmarks.symmetryLine;
let angle = 0;
let rotationMatrix = fixedRotationMatrix;
@ -5048,13 +5048,13 @@ function correctFaceRotation(rotate, box5, input, inputSize9) {
const centerRaw = [center[0] / input.shape[2], center[1] / input.shape[1]];
const rotated = tf9.image.rotateWithOffset(input, angle, 0, centerRaw);
rotationMatrix = buildRotationMatrix(-angle, center);
face5 = cutAndResize(box5, rotated, [inputSize9, inputSize9]);
face5 = cutAndResize(box5, rotated, [inputSize10, inputSize10]);
tf9.dispose(rotated);
} else {
face5 = cutAndResize(box5, input, [inputSize9, inputSize9]);
face5 = cutAndResize(box5, input, [inputSize10, inputSize10]);
}
} else {
face5 = cutAndResize(box5, input, [inputSize9, inputSize9]);
face5 = cutAndResize(box5, input, [inputSize10, inputSize10]);
}
return [angle, rotationMatrix, face5];
}
@ -5157,7 +5157,7 @@ async function getBoxes(inputImage, config3) {
confidence
};
const scaledBox = scaleBoxCoordinates(rawBox, [(inputImage.shape[2] || 0) / inputSize, (inputImage.shape[1] || 0) / inputSize]);
const enlargedBox = enlargeBox(scaledBox, faceBoxScaleFactor);
const enlargedBox = enlargeBox(scaledBox, config3.face["scale"] || faceBoxScaleFactor);
const squaredBox = squarifyBox(enlargedBox);
boxes.push(squaredBox);
Object.keys(b).forEach((tensor3) => tf10.dispose(b[tensor3]));
@ -5574,7 +5574,7 @@ async function process3(res, outputShape, config3) {
t.scores = tf13.squeeze(arr[4]);
t.classes = tf13.squeeze(arr[5]);
tf13.dispose([res, ...arr]);
t.nms = await tf13.image.nonMaxSuppressionAsync(t.boxes, t.scores, config3.object.maxDetected, config3.object.iouThreshold, config3.object.minConfidence);
t.nms = await tf13.image.nonMaxSuppressionAsync(t.boxes, t.scores, config3.object.maxDetected, config3.object.iouThreshold, config3.object.minConfidence || 0);
const nms = await t.nms.data();
let i = 0;
for (const id of Array.from(nms)) {
@ -5611,7 +5611,7 @@ async function predict6(input, config3) {
}
skipped6 = 0;
return new Promise(async (resolve) => {
const outputSize2 = [input.shape[2], input.shape[1]];
const outputSize2 = [input.shape[2] || 0, input.shape[1] || 0];
const resize = tf13.image.resizeBilinear(input, [inputSize4, inputSize4]);
const objectT = config3.object.enabled ? model6 == null ? void 0 : model6.execute(resize, ["tower_0/detections"]) : null;
lastTime6 = now();
@ -5718,10 +5718,10 @@ async function predict7(image29, config3) {
tf14.dispose(tensor3);
if (resT) {
cache2.keypoints.length = 0;
const squeeze10 = resT.squeeze();
const squeeze11 = resT.squeeze();
tf14.dispose(resT);
const stack5 = squeeze10.unstack(2);
tf14.dispose(squeeze10);
const stack5 = squeeze11.unstack(2);
tf14.dispose(squeeze11);
for (let id = 0; id < stack5.length; id++) {
const [x2, y2, partScore] = await max2d(stack5[id], config3.body.minConfidence);
if (partScore > (((_a = config3.body) == null ? void 0 : _a.minConfidence) || 0)) {
@ -5810,8 +5810,8 @@ async function predict8(image29, config3, idx, count2) {
const obj = [];
if ((_a2 = config3.face.emotion) == null ? void 0 : _a2.enabled) {
const t = {};
const inputSize9 = (model8 == null ? void 0 : model8.inputs[0].shape) ? model8.inputs[0].shape[2] : 0;
t.resize = tf15.image.resizeBilinear(image29, [inputSize9, inputSize9], false);
const inputSize10 = (model8 == null ? void 0 : model8.inputs[0].shape) ? model8.inputs[0].shape[2] : 0;
t.resize = tf15.image.resizeBilinear(image29, [inputSize10, inputSize10], false);
t.channels = tf15.mul(t.resize, constants.rgb);
t.grayscale = tf15.sum(t.channels, 3, true);
t.grayscaleSub = tf15.sub(t.grayscale, constants.tf05);
@ -10354,7 +10354,7 @@ function jitter(keypoints) {
}
return keypoints;
}
function padInput(input, inputSize9) {
function padInput(input, inputSize10) {
const t = {};
if (!input.shape || !input.shape[1] || !input.shape[2])
return input;
@ -10365,7 +10365,7 @@ function padInput(input, inputSize9) {
[0, 0]
];
t.pad = tf26.pad(input, cache5.padding);
t.resize = tf26.image.resizeBilinear(t.pad, [inputSize9, inputSize9]);
t.resize = tf26.image.resizeBilinear(t.pad, [inputSize10, inputSize10]);
const final = tf26.cast(t.resize, "int32");
Object.keys(t).forEach((tensor3) => tf26.dispose(t[tensor3]));
return final;
@ -10525,36 +10525,36 @@ var model15;
var last9 = [];
var lastTime14 = 0;
var skipped14 = Number.MAX_SAFE_INTEGER;
var inputSize9 = 0;
var scaleBox = 2.5;
async function load16(config3) {
if (!model15 || env.initial) {
model15 = await tf28.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 || !model15.modelUrl)
inputSize9 = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : 0;
if (!model15 || !model15["modelUrl"])
log("load model failed:", config3.object.modelPath);
else if (config3.debug)
log("load model:", model15.modelUrl);
log("load model:", model15["modelUrl"]);
} else if (config3.debug)
log("cached model:", model15.modelUrl);
log("cached model:", model15["modelUrl"]);
return model15;
}
async function process4(res, inputSize9, outputShape, config3) {
async function process4(res, outputShape, config3) {
let id = 0;
let results = [];
for (const strideSize of [1, 2, 4]) {
tf28.tidy(async () => {
var _a, _b;
const baseSize = strideSize * 13;
const scoresT = (_a = res.find((a) => a.shape[1] === baseSize ** 2 && a.shape[2] === labels.length)) == null ? void 0 : _a.squeeze();
const featuresT = (_b = res.find((a) => a.shape[1] === baseSize ** 2 && a.shape[2] < labels.length)) == null ? void 0 : _b.squeeze();
const scoresT = tf28.squeeze(res.find((a) => a.shape[1] === baseSize ** 2 && (a.shape[2] || 0) === labels.length));
const featuresT = tf28.squeeze(res.find((a) => a.shape[1] === baseSize ** 2 && (a.shape[2] || 0) < labels.length));
const boxesMax = featuresT.reshape([-1, 4, featuresT.shape[1] / 4]);
const boxIdx = await boxesMax.argMax(2).array();
const scores = await scoresT.array();
for (let i = 0; i < scoresT.shape[0]; i++) {
for (let j = 0; j < scoresT.shape[1]; j++) {
const score = scores[i][j];
if (score > config3.object.minConfidence && j !== 61) {
if (score > (config3.object.minConfidence || 0) && j !== 61) {
const cx = (0.5 + Math.trunc(i % baseSize)) / baseSize;
const cy = (0.5 + Math.trunc(i / baseSize)) / baseSize;
const boxOffset = boxIdx[i].map((a) => a * (baseSize / strideSize / inputSize9));
@ -10611,8 +10611,8 @@ async function predict16(image29, config3) {
if (!env.kernels.includes("mod") || !env.kernels.includes("sparsetodense"))
return last9;
return new Promise(async (resolve) => {
const outputSize2 = [image29.shape[2], image29.shape[1]];
const resize = tf28.image.resizeBilinear(image29, [model15.inputSize, model15.inputSize], false);
const outputSize2 = [image29.shape[2] || 0, image29.shape[1] || 0];
const resize = tf28.image.resizeBilinear(image29, [inputSize9, inputSize9], false);
const norm = tf28.div(resize, constants.tf255);
const transpose = norm.transpose([0, 3, 1, 2]);
tf28.dispose(norm);
@ -10622,7 +10622,7 @@ async function predict16(image29, config3) {
objectT = model15.execute(transpose);
lastTime14 = now();
tf28.dispose(transpose);
const obj = await process4(objectT, model15.inputSize, outputSize2, config3);
const obj = await process4(objectT, outputSize2, config3);
last9 = obj;
resolve(obj);
});
@ -11023,6 +11023,7 @@ async function process5(input, background, config3) {
return { data, canvas: null, alpha: null };
}
const alphaCanvas = canvas(width, height);
if (tf30.browser)
await tf30.browser.toPixels(t.data, alphaCanvas);
const alphaCtx = alphaCanvas.getContext("2d");
if (config3.segmentation.blur && config3.segmentation.blur > 0)
@ -11944,7 +11945,7 @@ var calculateGaze = (face5) => {
return { bearing: 0, strength: 0 };
const offsetIris = [0, -0.1];
const eyeRatio = 1;
const left = face5.mesh[33][2] > face5.mesh[263][2];
const left = (face5.mesh[33][2] || 0) > (face5.mesh[263][2] || 0);
const irisCenter = left ? face5.mesh[473] : face5.mesh[468];
const eyeCenter = left ? [(face5.mesh[133][0] + face5.mesh[33][0]) / 2, (face5.mesh[133][1] + face5.mesh[33][1]) / 2] : [(face5.mesh[263][0] + face5.mesh[362][0]) / 2, (face5.mesh[263][1] + face5.mesh[362][1]) / 2];
const eyeSize = left ? [face5.mesh[133][0] - face5.mesh[33][0], face5.mesh[23][1] - face5.mesh[27][1]] : [face5.mesh[263][0] - face5.mesh[362][0], face5.mesh[253][1] - face5.mesh[257][1]];
@ -12033,7 +12034,7 @@ var calculateFaceAngle = (face5, imageSize) => {
// src/face/face.ts
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;
let timeStamp;
let timeStamp = now();
let ageRes;
let gearRes;
let genderRes;
@ -12044,7 +12045,6 @@ var detectFace = async (instance, input) => {
let descRes;
const faceRes = [];
instance.state = "run:face";
timeStamp = now();
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)
@ -12065,63 +12065,63 @@ var detectFace = async (instance, input) => {
const rotation = faces[i].mesh && faces[i].mesh.length > 200 ? calculateFaceAngle(faces[i], [input.shape[2], input.shape[1]]) : null;
instance.analyze("Start Emotion:");
if (instance.config.async) {
emotionRes = ((_b = instance.config.face.emotion) == null ? void 0 : _b.enabled) ? predict8(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
emotionRes = ((_b = instance.config.face.emotion) == null ? void 0 : _b.enabled) ? predict8(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : [];
} else {
instance.state = "run:emotion";
timeStamp = now();
emotionRes = ((_c = instance.config.face.emotion) == null ? void 0 : _c.enabled) ? await predict8(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
emotionRes = ((_c = instance.config.face.emotion) == null ? void 0 : _c.enabled) ? await predict8(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : [];
instance.performance.emotion = env.perfadd ? (instance.performance.emotion || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
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 || tf34.tensor([]), instance.config, i, faces.length) : null;
antispoofRes = ((_d = instance.config.face.antispoof) == null ? void 0 : _d.enabled) ? predict4(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : 0;
} else {
instance.state = "run:antispoof";
timeStamp = now();
antispoofRes = ((_e = instance.config.face.antispoof) == null ? void 0 : _e.enabled) ? await predict4(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
antispoofRes = ((_e = instance.config.face.antispoof) == null ? void 0 : _e.enabled) ? await predict4(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : 0;
instance.performance.antispoof = env.perfadd ? (instance.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
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 || tf34.tensor([]), instance.config, i, faces.length) : null;
livenessRes = ((_f = instance.config.face.liveness) == null ? void 0 : _f.enabled) ? predict14(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : 0;
} else {
instance.state = "run:liveness";
timeStamp = now();
livenessRes = ((_g = instance.config.face.liveness) == null ? void 0 : _g.enabled) ? await predict14(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
livenessRes = ((_g = instance.config.face.liveness) == null ? void 0 : _g.enabled) ? await predict14(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : 0;
instance.performance.liveness = env.perfadd ? (instance.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
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 || tf34.tensor([]), instance.config, i, faces.length) : {};
gearRes = ((_h = instance.config.face["gear"]) == null ? void 0 : _h.enabled) ? predict(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
} else {
instance.state = "run:gear";
timeStamp = now();
gearRes = ((_i = instance.config.face["gear"]) == null ? void 0 : _i.enabled) ? await predict(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : {};
gearRes = ((_i = instance.config.face["gear"]) == null ? void 0 : _i.enabled) ? await predict(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
instance.performance.gear = Math.trunc(now() - timeStamp);
}
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 || tf34.tensor([]), instance.config, i, faces.length) : {};
genderRes = ((_k = instance.config.face["ssrnet"]) == null ? void 0 : _k.enabled) ? predict3(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : {};
ageRes = ((_j = instance.config.face["ssrnet"]) == null ? void 0 : _j.enabled) ? predict2(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
genderRes = ((_k = instance.config.face["ssrnet"]) == null ? void 0 : _k.enabled) ? predict3(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
} else {
instance.state = "run:ssrnet";
timeStamp = now();
ageRes = ((_l = instance.config.face["ssrnet"]) == null ? void 0 : _l.enabled) ? await predict2(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : {};
genderRes = ((_m = instance.config.face["ssrnet"]) == null ? void 0 : _m.enabled) ? await predict3(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : {};
ageRes = ((_l = instance.config.face["ssrnet"]) == null ? void 0 : _l.enabled) ? await predict2(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
genderRes = ((_m = instance.config.face["ssrnet"]) == null ? void 0 : _m.enabled) ? await predict3(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
instance.performance.ssrnet = Math.trunc(now() - timeStamp);
}
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 || tf34.tensor([]), instance.config, i, faces.length) : {};
mobilefacenetRes = ((_n = instance.config.face["mobilefacenet"]) == null ? void 0 : _n.enabled) ? predict9(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
} else {
instance.state = "run:mobilefacenet";
timeStamp = now();
mobilefacenetRes = ((_o = instance.config.face["mobilefacenet"]) == null ? void 0 : _o.enabled) ? await predict9(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : {};
mobilefacenetRes = ((_o = instance.config.face["mobilefacenet"]) == null ? void 0 : _o.enabled) ? await predict9(faces[i].tensor || tf34.tensor([]), instance.config, i, faces.length) : null;
instance.performance.mobilefacenet = Math.trunc(now() - timeStamp);
}
instance.analyze("End MobileFaceNet:");
@ -12139,12 +12139,26 @@ var detectFace = async (instance, input) => {
[ageRes, genderRes, emotionRes, mobilefacenetRes, descRes, gearRes, antispoofRes, livenessRes] = await Promise.all([ageRes, genderRes, emotionRes, mobilefacenetRes, descRes, gearRes, antispoofRes, livenessRes]);
}
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 = 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 = instance.config.face["mobilefacenet"]) == null ? void 0 : _t.enabled) && mobilefacenetRes)
if (((_r = instance.config.face["ssrnet"]) == null ? void 0 : _r.enabled) && ageRes && genderRes) {
descRes = {
...descRes,
age: ageRes.age,
gender: genderRes.gender,
genderScore: genderRes.genderScore
};
}
if (((_s = instance.config.face["gear"]) == null ? void 0 : _s.enabled) && gearRes) {
descRes = {
...descRes,
age: gearRes.age,
gender: gearRes.gender,
genderScore: gearRes.genderScore,
race: gearRes.race
};
}
if (((_t = instance.config.face["mobilefacenet"]) == null ? void 0 : _t.enabled) && mobilefacenetRes) {
descRes.descriptor = mobilefacenetRes;
}
if (!((_u = instance.config.face.iris) == null ? void 0 : _u.enabled)) {
}
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;

View File

@ -5,17 +5,21 @@
export interface GenericConfig {
/** is module enabled? */
enabled: boolean,
/** path to model json file */
/** path to model json file (relative to `modelBasePath` */
modelPath: string,
/** how many max frames to go without re-running model if cached results are acceptable */
/** how many max frames to go without re-running model if cached results are acceptable
* for two-phase models such as face and hand caching applies to bounding boxes detection only */
skipFrames: number,
/** how many max milliseconds to go without re-running model if cached results are acceptable */
/** how many max milliseconds to go without re-running model if cached results are acceptable
* for two-phase models such as face and hand caching applies to bounding boxes detection only */
skipTime: number,
}
/** Detector part of face configuration */
export interface FaceDetectorConfig extends GenericConfig {
/** is face rotation correction performed after detecting face? */
/** is face rotation correction performed after detecting face?
* used to correctly analyze faces under high angles
*/
rotation: boolean,
/** maximum number of detected faces */
maxDetected: number,
@ -25,7 +29,8 @@ export interface FaceDetectorConfig extends GenericConfig {
iouThreshold: number,
/** should child models perform on masked image of a face */
mask: boolean,
/** should face detection return face tensor to be used in some other extenrnal model? */
/** should face detection return processed and cropped face tensor that can with an external model for addtional processing?
* if enabled it must be manually deallocated to avoid memory leak */
return: boolean,
}

View File

@ -1,11 +1,15 @@
const calculateGaze = (face): { bearing: number, strength: number } => {
const radians = (pt1, pt2) => Math.atan2(pt1[1] - pt2[1], pt1[0] - pt2[0]); // function to calculate angle between any two points
import type { Point, FaceResult } from '../result';
type Vector = [number, number, number];
const calculateGaze = (face: FaceResult): { bearing: number, strength: number } => {
const radians = (pt1: Point, pt2: Point) => Math.atan2(pt1[1] - pt2[1], pt1[0] - pt2[0]); // function to calculate angle between any two points
if (!face.annotations['rightEyeIris'] || !face.annotations['leftEyeIris']) return { bearing: 0, strength: 0 };
const offsetIris = [0, -0.1]; // iris center may not align with average of eye extremes
const eyeRatio = 1; // factor to normalize changes x vs y
const left = face.mesh[33][2] > face.mesh[263][2]; // pick left or right eye depending which one is closer bazed on outsize point z axis
const left = (face.mesh[33][2] || 0) > (face.mesh[263][2] || 0); // pick left or right eye depending which one is closer bazed on outsize point z axis
const irisCenter = left ? face.mesh[473] : face.mesh[468];
const eyeCenter = left // eye center is average of extreme points on x axis for both x and y, ignoring y extreme points as eyelids naturally open/close more when gazing up/down so relative point is less precise
? [(face.mesh[133][0] + face.mesh[33][0]) / 2, (face.mesh[133][1] + face.mesh[33][1]) / 2]
@ -13,7 +17,7 @@ const calculateGaze = (face): { bearing: number, strength: number } => {
const eyeSize = left // eye size is difference between extreme points for both x and y, used to normalize & squarify eye dimensions
? [face.mesh[133][0] - face.mesh[33][0], face.mesh[23][1] - face.mesh[27][1]]
: [face.mesh[263][0] - face.mesh[362][0], face.mesh[253][1] - face.mesh[257][1]];
const eyeDiff = [ // x distance between extreme point and center point normalized with eye size
const eyeDiff: Point = [ // x distance between extreme point and center point normalized with eye size
(eyeCenter[0] - irisCenter[0]) / eyeSize[0] - offsetIris[0],
eyeRatio * (irisCenter[1] - eyeCenter[1]) / eyeSize[1] - offsetIris[1],
];
@ -23,33 +27,33 @@ const calculateGaze = (face): { bearing: number, strength: number } => {
return { bearing, strength };
};
export const calculateFaceAngle = (face, imageSize): {
export const calculateFaceAngle = (face: FaceResult, imageSize: [number, number]): {
angle: { pitch: number, yaw: number, roll: number },
matrix: [number, number, number, number, number, number, number, number, number],
gaze: { bearing: number, strength: number },
} => {
// const degrees = (theta) => Math.abs(((theta * 180) / Math.PI) % 360);
const normalize = (v) => { // normalize vector
const normalize = (v: Vector): Vector => { // normalize vector
const length = Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
v[0] /= length;
v[1] /= length;
v[2] /= length;
return v;
};
const subVectors = (a, b) => { // vector subtraction (a - b)
const subVectors = (a: Vector, b: Vector): Vector => { // vector subtraction (a - b)
const x = a[0] - b[0];
const y = a[1] - b[1];
const z = a[2] - b[2];
return [x, y, z];
};
const crossVectors = (a, b) => { // vector cross product (a x b)
const crossVectors = (a: Vector, b: Vector): Vector => { // vector cross product (a x b)
const x = a[1] * b[2] - a[2] * b[1];
const y = a[2] * b[0] - a[0] * b[2];
const z = a[0] * b[1] - a[1] * b[0];
return [x, y, z];
};
// 3x3 rotation matrix to Euler angles based on https://www.geometrictools.com/Documentation/EulerAngles.pdf
const rotationMatrixToEulerAngle = (r) => {
const rotationMatrixToEulerAngle = (r: number[]): { pitch: number, yaw: number, roll: number } => {
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
const [r00, _r01, _r02, r10, r11, r12, r20, r21, r22] = r;
let thetaX: number;
@ -93,10 +97,10 @@ export const calculateFaceAngle = (face, imageSize): {
const size = Math.max(face.boxRaw[2] * imageSize[0], face.boxRaw[3] * imageSize[1]) / 1.5;
// top, bottom, left, right
const pts = [mesh[10], mesh[152], mesh[234], mesh[454]].map((pt) => [pt[0] * imageSize[0] / size, pt[1] * imageSize[1] / size, pt[2]]); // make the xyz coordinates proportional, independent of the image/box size
const pts: Point[] = [mesh[10], mesh[152], mesh[234], mesh[454]].map((pt) => [pt[0] * imageSize[0] / size, pt[1] * imageSize[1] / size, pt[2]] as Point); // make the xyz coordinates proportional, independent of the image/box size
const y_axis = normalize(subVectors(pts[1], pts[0]));
let x_axis = normalize(subVectors(pts[3], pts[2]));
const y_axis = normalize(subVectors(pts[1] as Vector, pts[0] as Vector));
let x_axis = normalize(subVectors(pts[3] as Vector, pts[2] as Vector));
const z_axis = normalize(crossVectors(x_axis, y_axis));
// adjust x_axis to make sure that all axes are perpendicular to each other
x_axis = crossVectors(y_axis, z_axis);

View File

@ -36,7 +36,7 @@ export async function load(config: Config): Promise<GraphModel> {
return model;
}
function decodeBounds(boxOutputs) {
function decodeBounds(boxOutputs: Tensor) {
const t: Record<string, Tensor> = {};
t.boxStarts = tf.slice(boxOutputs, [0, 1], [-1, 2]);
t.centers = tf.add(t.boxStarts, anchors);

View File

@ -16,26 +16,28 @@ import * as gear from '../gear/gear';
import * as ssrnetAge from '../gear/ssrnet-age';
import * as ssrnetGender from '../gear/ssrnet-gender';
import * as mobilefacenet from './mobilefacenet';
import type { FaceResult } from '../result';
import type { FaceResult, Emotion, Gender, Race } from '../result';
import type { Tensor } from '../tfjs/types';
import type { Human } from '../human';
import { calculateFaceAngle } from './angles';
type DescRes = { age: number, gender: Gender, genderScore: number, descriptor: number[], race?: { score: number, race: Race }[] };
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;
let ageRes;
let gearRes;
let genderRes;
let emotionRes;
let mobilefacenetRes;
let antispoofRes;
let livenessRes;
let descRes;
let timeStamp: number = now();
let ageRes: { age: number } | Promise<{ age: number }> | null;
let gearRes: gear.GearType | Promise<gear.GearType> | null;
let genderRes: { gender: string, genderScore: number } | Promise<{ gender: string, genderScore: number }> | null;
let emotionRes: { score: number, emotion: Emotion }[] | Promise<{ score: number, emotion: Emotion }[]>;
let mobilefacenetRes: number[] | Promise<number[]> | null;
let antispoofRes: number | Promise<number> | null;
let livenessRes: number | Promise<number> | null;
let descRes: DescRes | Promise<DescRes> | null;
const faceRes: Array<FaceResult> = [];
instance.state = 'run:face';
timeStamp = now();
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);
@ -65,11 +67,11 @@ export const detectFace = async (instance: Human /* instance of human */, input:
// run emotion, inherits face from blazeface
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;
emotionRes = instance.config.face.emotion?.enabled ? emotion.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : [];
} else {
instance.state = 'run:emotion';
timeStamp = now();
emotionRes = instance.config.face.emotion?.enabled ? await emotion.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : null;
emotionRes = instance.config.face.emotion?.enabled ? await emotion.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : [];
instance.performance.emotion = env.perfadd ? (instance.performance.emotion || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
instance.analyze('End Emotion:');
@ -77,11 +79,11 @@ export const detectFace = async (instance: Human /* instance of human */, input:
// run antispoof, inherits face from blazeface
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;
antispoofRes = instance.config.face.antispoof?.enabled ? antispoof.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : 0;
} else {
instance.state = 'run:antispoof';
timeStamp = now();
antispoofRes = instance.config.face.antispoof?.enabled ? await antispoof.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : null;
antispoofRes = instance.config.face.antispoof?.enabled ? await antispoof.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : 0;
instance.performance.antispoof = env.perfadd ? (instance.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
instance.analyze('End AntiSpoof:');
@ -89,11 +91,11 @@ export const detectFace = async (instance: Human /* instance of human */, input:
// run liveness, inherits face from blazeface
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;
livenessRes = instance.config.face.liveness?.enabled ? liveness.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : 0;
} else {
instance.state = 'run:liveness';
timeStamp = now();
livenessRes = instance.config.face.liveness?.enabled ? await liveness.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : null;
livenessRes = instance.config.face.liveness?.enabled ? await liveness.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : 0;
instance.performance.liveness = env.perfadd ? (instance.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);
}
instance.analyze('End Liveness:');
@ -101,11 +103,11 @@ export const detectFace = async (instance: Human /* instance of human */, input:
// run gear, inherits face from blazeface
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) : {};
gearRes = instance.config.face['gear']?.enabled ? gear.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : null;
} else {
instance.state = 'run:gear';
timeStamp = now();
gearRes = instance.config.face['gear']?.enabled ? await gear.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : {};
gearRes = instance.config.face['gear']?.enabled ? await gear.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : null;
instance.performance.gear = Math.trunc(now() - timeStamp);
}
instance.analyze('End GEAR:');
@ -113,13 +115,13 @@ export const detectFace = async (instance: Human /* instance of human */, input:
// run gear, inherits face from blazeface
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) : {};
ageRes = instance.config.face['ssrnet']?.enabled ? ssrnetAge.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : null;
genderRes = instance.config.face['ssrnet']?.enabled ? ssrnetGender.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : null;
} else {
instance.state = 'run:ssrnet';
timeStamp = now();
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) : {};
ageRes = instance.config.face['ssrnet']?.enabled ? await ssrnetAge.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : null;
genderRes = instance.config.face['ssrnet']?.enabled ? await ssrnetGender.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : null;
instance.performance.ssrnet = Math.trunc(now() - timeStamp);
}
instance.analyze('End SSRNet:');
@ -127,11 +129,11 @@ export const detectFace = async (instance: Human /* instance of human */, input:
// run gear, inherits face from blazeface
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) : {};
mobilefacenetRes = instance.config.face['mobilefacenet']?.enabled ? mobilefacenet.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : null;
} else {
instance.state = 'run:mobilefacenet';
timeStamp = now();
mobilefacenetRes = instance.config.face['mobilefacenet']?.enabled ? await mobilefacenet.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : {};
mobilefacenetRes = instance.config.face['mobilefacenet']?.enabled ? await mobilefacenet.predict(faces[i].tensor || tf.tensor([]), instance.config, i, faces.length) : null;
instance.performance.mobilefacenet = Math.trunc(now() - timeStamp);
}
instance.analyze('End MobileFaceNet:');
@ -154,11 +156,26 @@ export const detectFace = async (instance: Human /* instance of human */, input:
}
instance.analyze('Finish Face:');
// override age/gender if alternative models are used
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 (instance.config.face['mobilefacenet']?.enabled && mobilefacenetRes) descRes.descriptor = mobilefacenetRes;
if (instance.config.face['ssrnet']?.enabled && ageRes && genderRes) { // override age/gender if ssrnet model is used
descRes = {
...(descRes as DescRes),
age: (ageRes as { age: number}).age,
gender: (genderRes as { gender: Gender, genderScore: number }).gender,
genderScore: (genderRes as { gender: Gender, genderScore: number }).genderScore,
};
}
if (instance.config.face['gear']?.enabled && gearRes) { // override age/gender/race if gear model is used
descRes = {
...(descRes as DescRes),
age: (gearRes as gear.GearType).age,
gender: (gearRes as gear.GearType).gender,
genderScore: (gearRes as gear.GearType).genderScore,
race: (gearRes as gear.GearType).race,
};
}
if (instance.config.face['mobilefacenet']?.enabled && mobilefacenetRes) { // override descriptor if embedding model is used
(descRes as DescRes).descriptor = mobilefacenetRes as number[];
}
// calculate iris distance
// iris: array[ center, left, top, right, bottom]
@ -183,14 +200,14 @@ export const detectFace = async (instance: Human /* instance of human */, input:
...faces[i],
id: i,
};
if (descRes?.age) res.age = descRes.age;
if (descRes?.gender) res.gender = descRes.gender;
if (descRes?.genderScore) res.genderScore = descRes?.genderScore;
if (descRes?.descriptor) res.embedding = descRes?.descriptor;
if (descRes?.race) res.race = descRes?.race;
if (emotionRes) res.emotion = emotionRes;
if (antispoofRes) res.real = antispoofRes;
if (livenessRes) res.live = livenessRes;
if ((descRes as DescRes)?.age) res.age = (descRes as DescRes).age as number;
if ((descRes as DescRes)?.gender) res.gender = (descRes as DescRes).gender as Gender;
if ((descRes as DescRes)?.genderScore) res.genderScore = (descRes as DescRes)?.genderScore as number;
if ((descRes as DescRes)?.descriptor) res.embedding = (descRes as DescRes)?.descriptor as Array<number>;
if ((descRes as DescRes)?.race) res.race = (descRes as DescRes)?.race as { score: number, race: Race }[];
if (emotionRes) res.emotion = emotionRes as Array<{ score: number, emotion: Emotion }>;
if (antispoofRes) res.real = antispoofRes as number;
if (livenessRes) res.live = livenessRes as number;
if (irisSize && irisSize !== 0) res.iris = Math.trunc(500 / irisSize / 11.7) / 100;
if (rotation) res.rotation = rotation;
if (tensor) res.tensor = tensor;

View File

@ -13,11 +13,14 @@ import * as tf from '../../dist/tfjs.esm.js';
import { constants } from '../tfjs/constants';
import type { Tensor, GraphModel } from '../tfjs/types';
import type { Config } from '../config';
import type { Gender, Race } from '../result';
export type FaceRes = { age: number, gender: Gender, genderScore: number, descriptor: number[], race?: { score: number, race: Race }[] };
let model: GraphModel | null;
const last: Array<{
age: number,
gender: string,
gender: Gender,
genderScore: number,
descriptor: number[],
}> = [];
@ -63,7 +66,7 @@ export function enhance(input): Tensor {
*/
}
export async function predict(image: Tensor, config: Config, idx, count): Promise<{ age: number, gender: string, genderScore: number, descriptor: number[] }> {
export async function predict(image: Tensor, config: Config, idx: number, count: number): Promise<FaceRes> {
if (!model) return { age: 0, gender: 'unknown', genderScore: 0, descriptor: [] };
const skipFrame = skipped < (config.face.description?.skipFrames || 0);
const skipTime = (config.face.description?.skipTime || 0) > (now() - lastTime);
@ -75,7 +78,7 @@ export async function predict(image: Tensor, config: Config, idx, count): Promis
return new Promise(async (resolve) => {
const obj = {
age: <number>0,
gender: <string>'unknown',
gender: <Gender>'unknown',
genderScore: <number>0,
descriptor: <number[]>[],
};

View File

@ -11,7 +11,7 @@ import type { Config } from '../config';
import type { GraphModel, Tensor } from '../tfjs/types';
import { env } from '../util/env';
type GearType = { age: number, gender: Gender, genderScore: number, race: Array<{ score: number, race: Race }> }
export type GearType = { age: number, gender: Gender, genderScore: number, race: Array<{ score: number, race: Race }> }
let model: GraphModel | null;
const last: Array<GearType> = [];
const raceNames = ['white', 'black', 'asian', 'indian', 'other'];
@ -32,7 +32,7 @@ export async function load(config: Config) {
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export async function predict(image: Tensor, config: Config, idx, count): Promise<GearType> {
export async function predict(image: Tensor, config: Config, idx: number, count: number): Promise<GearType> {
if (!model) return { age: 0, gender: 'unknown', genderScore: 0, race: [] };
const skipFrame = skipped < (config.face['gear']?.skipFrames || 0);
const skipTime = (config.face['gear']?.skipTime || 0) > (now() - lastTime);

View File

@ -172,7 +172,7 @@ async function detectFingers(input: Tensor, h: HandDetectResult, config: Config)
]);
hand.landmarks = fingerPose.analyze(hand.keypoints) as HandResult['landmarks']; // calculate finger gestures
for (const key of Object.keys(fingerMap)) { // map keypoints to per-finger annotations
hand.annotations[key] = fingerMap[key].map((index) => (hand.landmarks && hand.keypoints[index] ? hand.keypoints[index] : null));
hand.annotations[key] = fingerMap[key].map((index: number) => (hand.landmarks && hand.keypoints[index] ? hand.keypoints[index] : null));
}
}
Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));

View File

@ -31,11 +31,11 @@ export async function load(config: Config): Promise<GraphModel> {
return model;
}
async function process(res: Tensor | null, outputShape, config: Config) {
async function process(res: Tensor | null, outputShape: [number, number], config: Config) {
if (!res) return [];
const t: Record<string, Tensor> = {};
const results: Array<ObjectResult> = [];
const detections = await res.array();
const detections = await res.array() as number[][][];
t.squeeze = tf.squeeze(res);
const arr = tf.split(t.squeeze, 6, 1) as Tensor[]; // x1, y1, x2, y2, score, class
t.stack = tf.stack([arr[1], arr[0], arr[3], arr[2]], 1); // reorder dims as tf.nms expects y, x
@ -43,7 +43,7 @@ async function process(res: Tensor | null, outputShape, config: Config) {
t.scores = tf.squeeze(arr[4]);
t.classes = tf.squeeze(arr[5]);
tf.dispose([res, ...arr]);
t.nms = await tf.image.nonMaxSuppressionAsync(t.boxes, t.scores, config.object.maxDetected, config.object.iouThreshold, config.object.minConfidence);
t.nms = await tf.image.nonMaxSuppressionAsync(t.boxes, t.scores, config.object.maxDetected, config.object.iouThreshold, (config.object.minConfidence || 0));
const nms = await t.nms.data();
let i = 0;
for (const id of Array.from(nms)) {
@ -81,7 +81,7 @@ export async function predict(input: Tensor, config: Config): Promise<ObjectResu
}
skipped = 0;
return new Promise(async (resolve) => {
const outputSize = [input.shape[2], input.shape[1]];
const outputSize = [input.shape[2] || 0, input.shape[1] || 0] as [number, number];
const resize = tf.image.resizeBilinear(input, [inputSize, inputSize]);
const objectT = config.object.enabled ? model?.execute(resize, ['tower_0/detections']) as Tensor : null;
lastTime = now();

View File

@ -13,25 +13,26 @@ import type { GraphModel, Tensor } from '../tfjs/types';
import type { Config } from '../config';
import { env } from '../util/env';
let model;
let model: GraphModel;
let last: Array<ObjectResult> = [];
let lastTime = 0;
let skipped = Number.MAX_SAFE_INTEGER;
let inputSize = 0;
const scaleBox = 2.5; // increase box size
export async function load(config: Config): Promise<GraphModel> {
if (!model || env.initial) {
model = await tf.loadGraphModel(join(config.modelBasePath, config.object.modelPath || ''));
model = await tf.loadGraphModel(join(config.modelBasePath, config.object.modelPath || '')) as unknown as GraphModel;
const inputs = Object.values(model.modelSignature['inputs']);
model.inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : null;
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);
inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : 0;
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']);
return model;
}
async function process(res, inputSize, outputShape, config) {
async function process(res: Tensor[], outputShape: [number, number], config: Config) {
let id = 0;
let results: Array<ObjectResult> = [];
for (const strideSize of [1, 2, 4]) { // try each stride size as it detects large/medium/small objects
@ -39,18 +40,18 @@ async function process(res, inputSize, outputShape, config) {
tf.tidy(async () => { // wrap in tidy to automatically deallocate temp tensors
const baseSize = strideSize * 13; // 13x13=169, 26x26=676, 52x52=2704
// find boxes and scores output depending on stride
const scoresT = res.find((a) => (a.shape[1] === (baseSize ** 2) && a.shape[2] === labels.length))?.squeeze();
const featuresT = res.find((a) => (a.shape[1] === (baseSize ** 2) && a.shape[2] < labels.length))?.squeeze();
const scoresT = tf.squeeze(res.find((a: Tensor) => (a.shape[1] === (baseSize ** 2) && (a.shape[2] || 0) === labels.length)));
const featuresT = tf.squeeze(res.find((a: Tensor) => (a.shape[1] === (baseSize ** 2) && (a.shape[2] || 0) < labels.length)));
const boxesMax = featuresT.reshape([-1, 4, featuresT.shape[1] / 4]); // reshape [output] to [4, output / 4] where number is number of different features inside each stride
const boxIdx = await boxesMax.argMax(2).array(); // what we need is indexes of features with highest scores, not values itself
const scores = await scoresT.array(); // optionally use exponential scores or just as-is
for (let i = 0; i < scoresT.shape[0]; i++) { // total strides (x * y matrix)
for (let j = 0; j < scoresT.shape[1]; j++) { // one score for each class
const score = scores[i][j]; // get score for current position
if (score > config.object.minConfidence && j !== 61) {
if (score > (config.object.minConfidence || 0) && j !== 61) {
const cx = (0.5 + Math.trunc(i % baseSize)) / baseSize; // center.x normalized to range 0..1
const cy = (0.5 + Math.trunc(i / baseSize)) / baseSize; // center.y normalized to range 0..1
const boxOffset = boxIdx[i].map((a) => a * (baseSize / strideSize / inputSize)); // just grab indexes of features with highest scores
const boxOffset = boxIdx[i].map((a: number) => a * (baseSize / strideSize / inputSize)); // just grab indexes of features with highest scores
const [x, y] = [
cx - (scaleBox / strideSize * boxOffset[0]),
cy - (scaleBox / strideSize * boxOffset[1]),
@ -116,8 +117,8 @@ export async function predict(image: Tensor, config: Config): Promise<ObjectResu
skipped = 0;
if (!env.kernels.includes('mod') || !env.kernels.includes('sparsetodense')) return last;
return new Promise(async (resolve) => {
const outputSize = [image.shape[2], image.shape[1]];
const resize = tf.image.resizeBilinear(image, [model.inputSize, model.inputSize], false);
const outputSize = [image.shape[2] || 0, image.shape[1] || 0];
const resize = tf.image.resizeBilinear(image, [inputSize, inputSize], false);
const norm = tf.div(resize, constants.tf255);
const transpose = norm.transpose([0, 3, 1, 2]);
tf.dispose(norm);
@ -128,7 +129,7 @@ export async function predict(image: Tensor, config: Config): Promise<ObjectResu
lastTime = now();
tf.dispose(transpose);
const obj = await process(objectT, model.inputSize, outputSize, config);
const obj = await process(objectT as Tensor[], outputSize as [number, number], config);
last = obj;
resolve(obj);
});

View File

@ -66,7 +66,8 @@ export async function process(input: Input, background: Input | undefined, confi
}
const alphaCanvas = image.canvas(width, height);
await tf.browser.toPixels(t.data, alphaCanvas);
// @ts-ignore browser is not defined in tfjs-node
if (tf.browser) await tf.browser.toPixels(t.data, alphaCanvas);
const alphaCtx = alphaCanvas.getContext('2d') as CanvasRenderingContext2D;
if (config.segmentation.blur && config.segmentation.blur > 0) alphaCtx.filter = `blur(${config.segmentation.blur}px)`; // use css filter for bluring, can be done with gaussian blur manually instead
const alphaData = alphaCtx.getImageData(0, 0, width, height);

View File

@ -1,24 +1,24 @@
2021-12-27 10:48:11 INFO:  Application: {"name":"@vladmandic/human","version":"2.5.7"}
2021-12-27 10:48:11 INFO:  Environment: {"profile":"production","config":".build.json","package":"package.json","tsconfig":true,"eslintrc":true,"git":true}
2021-12-27 10:48:11 INFO:  Toolchain: {"build":"0.6.6","esbuild":"0.13.15","typescript":"4.5.4","typedoc":"0.22.10","eslint":"8.5.0"}
2021-12-27 10:48:11 INFO:  Build: {"profile":"production","steps":["clean","compile","typings","typedoc","lint","changelog"]}
2021-12-27 10:48:11 STATE: Clean: {"locations":["dist/*","types/lib/*","typedoc/*"]}
2021-12-27 10:48:11 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-12-27 10:48:11 STATE: Compile: {"name":"human/nodejs/cpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node.js","files":63,"inputBytes":561109,"outputBytes":463260}
2021-12-27 10:48:11 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-12-27 10:48:11 STATE: Compile: {"name":"human/nodejs/gpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-gpu.js","files":63,"inputBytes":561117,"outputBytes":463264}
2021-12-27 10:48:11 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-12-27 10:48:11 STATE: Compile: {"name":"human/nodejs/wasm","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-wasm.js","files":63,"inputBytes":561184,"outputBytes":463336}
2021-12-27 10:48:11 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-12-27 10:48:11 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-12-27 10:48:11 STATE: Compile: {"name":"human/browser/esm/nobundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm-nobundle.js","files":63,"inputBytes":560746,"outputBytes":465022}
2021-12-27 10:48:11 STATE: Compile: {"name":"tfjs/browser/esm/custom","format":"esm","platform":"browser","input":"tfjs/tf-custom.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":110,"outputBytes":2515619}
2021-12-27 10:48:12 STATE: Compile: {"name":"human/browser/iife/bundle","format":"iife","platform":"browser","input":"src/human.ts","output":"dist/human.js","files":63,"inputBytes":3075453,"outputBytes":1631330}
2021-12-27 10:48:12 STATE: Compile: {"name":"human/browser/esm/bundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm.js","files":63,"inputBytes":3075453,"outputBytes":2986636}
2021-12-27 10:48:25 STATE: Typings: {"input":"src/human.ts","output":"types/lib","files":110}
2021-12-27 10:48:28 STATE: TypeDoc: {"input":"src/human.ts","output":"typedoc","objects":69,"generated":true}
2021-12-27 10:48:28 STATE: Compile: {"name":"demo/typescript","format":"esm","platform":"browser","input":"demo/typescript/index.ts","output":"demo/typescript/index.js","files":1,"inputBytes":5864,"outputBytes":4127}
2021-12-27 10:48:28 STATE: Compile: {"name":"demo/faceid","format":"esm","platform":"browser","input":"demo/faceid/index.ts","output":"demo/faceid/index.js","files":2,"inputBytes":15174,"outputBytes":11794}
2021-12-27 10:49:01 STATE: Lint: {"locations":["*.json","src/**/*.ts","test/**/*.js","demo/**/*.js"],"files":93,"errors":0,"warnings":0}
2021-12-27 10:49:01 STATE: ChangeLog: {"repository":"https://github.com/vladmandic/human","branch":"main","output":"CHANGELOG.md"}
2021-12-27 10:49:01 INFO:  Done...
2021-12-28 11:31:57 INFO:  Application: {"name":"@vladmandic/human","version":"2.5.7"}
2021-12-28 11:31:57 INFO:  Environment: {"profile":"production","config":".build.json","package":"package.json","tsconfig":true,"eslintrc":true,"git":true}
2021-12-28 11:31:57 INFO:  Toolchain: {"build":"0.6.6","esbuild":"0.13.15","typescript":"4.5.4","typedoc":"0.22.10","eslint":"8.5.0"}
2021-12-28 11:31:57 INFO:  Build: {"profile":"production","steps":["clean","compile","typings","typedoc","lint","changelog"]}
2021-12-28 11:31:57 STATE: Clean: {"locations":["dist/*","types/lib/*","typedoc/*"]}
2021-12-28 11:31:57 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-12-28 11:31:57 STATE: Compile: {"name":"human/nodejs/cpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node.js","files":63,"inputBytes":563599,"outputBytes":463415}
2021-12-28 11:31:57 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-12-28 11:31:57 STATE: Compile: {"name":"human/nodejs/gpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-gpu.js","files":63,"inputBytes":563607,"outputBytes":463419}
2021-12-28 11:31:57 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-12-28 11:31:57 STATE: Compile: {"name":"human/nodejs/wasm","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-wasm.js","files":63,"inputBytes":563674,"outputBytes":463491}
2021-12-28 11:31:57 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-12-28 11:31:57 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-12-28 11:31:57 STATE: Compile: {"name":"human/browser/esm/nobundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm-nobundle.js","files":63,"inputBytes":563236,"outputBytes":465213}
2021-12-28 11:31:57 STATE: Compile: {"name":"tfjs/browser/esm/custom","format":"esm","platform":"browser","input":"tfjs/tf-custom.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":110,"outputBytes":2515619}
2021-12-28 11:31:57 STATE: Compile: {"name":"human/browser/iife/bundle","format":"iife","platform":"browser","input":"src/human.ts","output":"dist/human.js","files":63,"inputBytes":3077943,"outputBytes":1631298}
2021-12-28 11:31:57 STATE: Compile: {"name":"human/browser/esm/bundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm.js","files":63,"inputBytes":3077943,"outputBytes":2986799}
2021-12-28 11:32:07 STATE: Typings: {"input":"src/human.ts","output":"types/lib","files":110}
2021-12-28 11:32:11 STATE: TypeDoc: {"input":"src/human.ts","output":"typedoc","objects":69,"generated":true}
2021-12-28 11:32:11 STATE: Compile: {"name":"demo/typescript","format":"esm","platform":"browser","input":"demo/typescript/index.ts","output":"demo/typescript/index.js","files":1,"inputBytes":5864,"outputBytes":4127}
2021-12-28 11:32:11 STATE: Compile: {"name":"demo/faceid","format":"esm","platform":"browser","input":"demo/faceid/index.ts","output":"demo/faceid/index.js","files":2,"inputBytes":15174,"outputBytes":11794}
2021-12-28 11:32:32 STATE: Lint: {"locations":["*.json","src/**/*.ts","test/**/*.js","demo/**/*.js"],"files":93,"errors":0,"warnings":0}
2021-12-28 11:32:32 STATE: ChangeLog: {"repository":"https://github.com/vladmandic/human","branch":"main","output":"CHANGELOG.md"}
2021-12-28 11:32:32 INFO:  Done...

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -2,14 +2,16 @@
<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 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" 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 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"><div class="lead">
<p>is module enabled?</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="maxDetected" class="tsd-anchor"></a><h3>max<wbr/>Detected</h3><div class="tsd-signature tsd-kind-icon">max<wbr/>Detected<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L72">src/config.ts:72</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>maximum numboer of detected bodies</p>
</div></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#L74">src/config.ts:74</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="maxDetected" class="tsd-anchor"></a><h3>max<wbr/>Detected</h3><div class="tsd-signature tsd-kind-icon">max<wbr/>Detected<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L77">src/config.ts:77</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>maximum number of detected bodies</p>
</div></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#L79">src/config.ts:79</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>minimum confidence for a detected body before results are discarded</p>
</div></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"><div class="lead">
<p>path to model json file</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipFrames" class="tsd-anchor"></a><h3>skip<wbr/>Frames</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Frames<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipFrames">skipFrames</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L11">src/config.ts:11</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max frames to go without re-running model if cached results are acceptable</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipTime" class="tsd-anchor"></a><h3>skip<wbr/>Time</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Time<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipTime">skipTime</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L13">src/config.ts:13</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max miliseconds to go without re-running model if cached results are acceptable</p>
<p>path to model json file (relative to <code>modelBasePath</code></p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipFrames" class="tsd-anchor"></a><h3>skip<wbr/>Frames</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Frames<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipFrames">skipFrames</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L12">src/config.ts:12</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max frames to go without re-running model if cached results are acceptable
for two-phase models such as face and hand caching applies to bounding boxes detection only</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipTime" class="tsd-anchor"></a><h3>skip<wbr/>Time</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Time<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipTime">skipTime</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L15">src/config.ts:15</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max milliseconds to go without re-running model if cached results are acceptable
for two-phase models such as face and hand caching applies to bounding boxes detection only</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="BodyConfig.html" class="tsd-kind-icon">Body<wbr/>Config</a><ul><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" 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></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

@ -2,10 +2,10 @@
<p>Configuration interface definition for <strong>Human</strong> library
Contains all configurable parameters
Defaults: <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L262">config</a></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#L229">src/config.ts:229</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#L234">src/config.ts:234</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#L211">src/config.ts:211</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#L216">src/config.ts:216</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>
@ -13,48 +13,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#L270">src/config.ts:270</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#L275">src/config.ts:275</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Body config <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#L252">src/config.ts:252</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#L257">src/config.ts:257</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#L255">src/config.ts:255</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#L260">src/config.ts:260</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#L223">src/config.ts:223</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#L228">src/config.ts:228</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#L267">src/config.ts:267</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#L272">src/config.ts:272</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Face config <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#L261">src/config.ts:261</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#L266">src/config.ts:266</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Filter config <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#L264">src/config.ts:264</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#L269">src/config.ts:269</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Gesture config <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#L273">src/config.ts:273</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#L278">src/config.ts:278</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Hand config <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#L244">src/config.ts:244</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#L249">src/config.ts:249</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#L276">src/config.ts:276</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#L281">src/config.ts:281</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Object config <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#L279">src/config.ts:279</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#L284">src/config.ts:284</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Segmentation config <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#L258">src/config.ts:258</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#L263">src/config.ts:263</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;&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">
</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#L242">src/config.ts:242</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#L217">src/config.ts:217</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#L222">src/config.ts:222</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

@ -3,9 +3,11 @@
</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"><div class="lead">
<p>is module enabled?</p>
</div></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"><div class="lead">
<p>path to model json file</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipFrames" class="tsd-anchor"></a><h3>skip<wbr/>Frames</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Frames<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipFrames">skipFrames</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L11">src/config.ts:11</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max frames to go without re-running model if cached results are acceptable</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipTime" class="tsd-anchor"></a><h3>skip<wbr/>Time</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Time<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipTime">skipTime</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L13">src/config.ts:13</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max miliseconds to go without re-running model if cached results are acceptable</p>
<p>path to model json file (relative to <code>modelBasePath</code></p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipFrames" class="tsd-anchor"></a><h3>skip<wbr/>Frames</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Frames<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipFrames">skipFrames</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L12">src/config.ts:12</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max frames to go without re-running model if cached results are acceptable
for two-phase models such as face and hand caching applies to bounding boxes detection only</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipTime" class="tsd-anchor"></a><h3>skip<wbr/>Time</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Time<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipTime">skipTime</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L15">src/config.ts:15</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max milliseconds to go without re-running model if cached results are acceptable
for two-phase models such as face and hand caching applies to bounding boxes detection only</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="FaceAntiSpoofConfig.html" class="tsd-kind-icon">Face<wbr/>Anti<wbr/>Spoof<wbr/>Config</a><ul><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></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>

File diff suppressed because one or more lines are too long

View File

@ -5,12 +5,14 @@
</ul>
</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">FaceDescriptionConfig</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="FaceDescriptionConfig.html#enabled" class="tsd-kind-icon">enabled</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceDescriptionConfig.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="FaceDescriptionConfig.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="FaceDescriptionConfig.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="FaceDescriptionConfig.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"><div class="lead">
<p>is module enabled?</p>
</div></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#L43">src/config.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="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#L48">src/config.ts:48</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>minimum confidence for a detected face before results are discarded</p>
</div></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"><div class="lead">
<p>path to model json file</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipFrames" class="tsd-anchor"></a><h3>skip<wbr/>Frames</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Frames<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipFrames">skipFrames</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L11">src/config.ts:11</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max frames to go without re-running model if cached results are acceptable</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipTime" class="tsd-anchor"></a><h3>skip<wbr/>Time</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Time<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipTime">skipTime</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L13">src/config.ts:13</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max miliseconds to go without re-running model if cached results are acceptable</p>
<p>path to model json file (relative to <code>modelBasePath</code></p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipFrames" class="tsd-anchor"></a><h3>skip<wbr/>Frames</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Frames<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipFrames">skipFrames</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L12">src/config.ts:12</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max frames to go without re-running model if cached results are acceptable
for two-phase models such as face and hand caching applies to bounding boxes detection only</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipTime" class="tsd-anchor"></a><h3>skip<wbr/>Time</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Time<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipTime">skipTime</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L15">src/config.ts:15</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max milliseconds to go without re-running model if cached results are acceptable
for two-phase models such as face and hand caching applies to bounding boxes detection only</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="FaceDescriptionConfig.html" class="tsd-kind-icon">Face<wbr/>Description<wbr/>Config</a><ul><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceDescriptionConfig.html#enabled" class="tsd-kind-icon">enabled</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceDescriptionConfig.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="FaceDescriptionConfig.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="FaceDescriptionConfig.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="FaceDescriptionConfig.html#skipTime" class="tsd-kind-icon">skip<wbr/>Time</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,23 +1,27 @@
<!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.7</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.7"/><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.7</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.7</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>
<p>Detector 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 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 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"><div class="lead">
<p>is module enabled?</p>
</div></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#L25">src/config.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="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#L29">src/config.ts:29</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>minimum overlap between two detected faces before one is discarded</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="mask" class="tsd-anchor"></a><h3>mask</h3><div class="tsd-signature tsd-kind-icon">mask<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#L27">src/config.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="mask" class="tsd-anchor"></a><h3>mask</h3><div class="tsd-signature tsd-kind-icon">mask<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#L31">src/config.ts:31</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>should child models perform on masked image of a face</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="maxDetected" class="tsd-anchor"></a><h3>max<wbr/>Detected</h3><div class="tsd-signature tsd-kind-icon">max<wbr/>Detected<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L21">src/config.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="maxDetected" class="tsd-anchor"></a><h3>max<wbr/>Detected</h3><div class="tsd-signature tsd-kind-icon">max<wbr/>Detected<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L25">src/config.ts:25</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>maximum number of detected faces</p>
</div></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#L23">src/config.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="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#L27">src/config.ts:27</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>minimum confidence for a detected face before results are discarded</p>
</div></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"><div class="lead">
<p>path to model json file</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="return" class="tsd-anchor"></a><h3>return</h3><div class="tsd-signature tsd-kind-icon">return<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L29">src/config.ts:29</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>should face detection return face tensor to be used in some other extenrnal model?</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>rotation</h3><div class="tsd-signature tsd-kind-icon">rotation<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L19">src/config.ts:19</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>is face rotation correction performed after detecting face?</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipFrames" class="tsd-anchor"></a><h3>skip<wbr/>Frames</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Frames<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipFrames">skipFrames</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L11">src/config.ts:11</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max frames to go without re-running model if cached results are acceptable</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipTime" class="tsd-anchor"></a><h3>skip<wbr/>Time</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Time<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipTime">skipTime</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L13">src/config.ts:13</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max miliseconds to go without re-running model if cached results are acceptable</p>
<p>path to model json file (relative to <code>modelBasePath</code></p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="return" class="tsd-anchor"></a><h3>return</h3><div class="tsd-signature tsd-kind-icon">return<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L34">src/config.ts:34</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>should face detection return processed and cropped face tensor that can with an external model for addtional processing?
if enabled it must be manually deallocated to avoid memory leak</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>rotation</h3><div class="tsd-signature tsd-kind-icon">rotation<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L23">src/config.ts:23</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>is face rotation correction performed after detecting face?
used to correctly analyze faces under high angles</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipFrames" class="tsd-anchor"></a><h3>skip<wbr/>Frames</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Frames<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipFrames">skipFrames</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L12">src/config.ts:12</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max frames to go without re-running model if cached results are acceptable
for two-phase models such as face and hand caching applies to bounding boxes detection only</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipTime" class="tsd-anchor"></a><h3>skip<wbr/>Time</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Time<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipTime">skipTime</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L15">src/config.ts:15</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max milliseconds to go without re-running model if cached results are acceptable
for two-phase models such as face and hand caching applies to bounding boxes detection only</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="FaceDetectorConfig.html" class="tsd-kind-icon">Face<wbr/>Detector<wbr/>Config</a><ul><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></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

@ -2,12 +2,14 @@
<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"><div class="lead">
<p>is module enabled?</p>
</div></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#L49">src/config.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="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#L54">src/config.ts:54</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>minimum confidence for a detected face before results are discarded</p>
</div></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"><div class="lead">
<p>path to model json file</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipFrames" class="tsd-anchor"></a><h3>skip<wbr/>Frames</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Frames<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipFrames">skipFrames</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L11">src/config.ts:11</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max frames to go without re-running model if cached results are acceptable</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipTime" class="tsd-anchor"></a><h3>skip<wbr/>Time</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Time<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipTime">skipTime</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L13">src/config.ts:13</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max miliseconds to go without re-running model if cached results are acceptable</p>
<p>path to model json file (relative to <code>modelBasePath</code></p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipFrames" class="tsd-anchor"></a><h3>skip<wbr/>Frames</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Frames<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipFrames">skipFrames</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L12">src/config.ts:12</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max frames to go without re-running model if cached results are acceptable
for two-phase models such as face and hand caching applies to bounding boxes detection only</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipTime" class="tsd-anchor"></a><h3>skip<wbr/>Time</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Time<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipTime">skipTime</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L15">src/config.ts:15</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max milliseconds to go without re-running model if cached results are acceptable
for two-phase models such as face and hand caching applies to bounding boxes detection only</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="FaceEmotionConfig.html" class="tsd-kind-icon">Face<wbr/>Emotion<wbr/>Config</a><ul><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></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

@ -3,9 +3,11 @@
</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"><div class="lead">
<p>is module enabled?</p>
</div></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"><div class="lead">
<p>path to model json file</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipFrames" class="tsd-anchor"></a><h3>skip<wbr/>Frames</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Frames<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipFrames">skipFrames</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L11">src/config.ts:11</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max frames to go without re-running model if cached results are acceptable</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipTime" class="tsd-anchor"></a><h3>skip<wbr/>Time</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Time<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipTime">skipTime</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L13">src/config.ts:13</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max miliseconds to go without re-running model if cached results are acceptable</p>
<p>path to model json file (relative to <code>modelBasePath</code></p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipFrames" class="tsd-anchor"></a><h3>skip<wbr/>Frames</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Frames<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipFrames">skipFrames</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L12">src/config.ts:12</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max frames to go without re-running model if cached results are acceptable
for two-phase models such as face and hand caching applies to bounding boxes detection only</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipTime" class="tsd-anchor"></a><h3>skip<wbr/>Time</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Time<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipTime">skipTime</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L15">src/config.ts:15</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max milliseconds to go without re-running model if cached results are acceptable
for two-phase models such as face and hand caching applies to bounding boxes detection only</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="FaceIrisConfig.html" class="tsd-kind-icon">Face<wbr/>Iris<wbr/>Config</a><ul><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></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

@ -3,9 +3,11 @@
</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"><div class="lead">
<p>is module enabled?</p>
</div></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"><div class="lead">
<p>path to model json file</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipFrames" class="tsd-anchor"></a><h3>skip<wbr/>Frames</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Frames<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipFrames">skipFrames</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L11">src/config.ts:11</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max frames to go without re-running model if cached results are acceptable</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipTime" class="tsd-anchor"></a><h3>skip<wbr/>Time</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Time<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipTime">skipTime</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L13">src/config.ts:13</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max miliseconds to go without re-running model if cached results are acceptable</p>
<p>path to model json file (relative to <code>modelBasePath</code></p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipFrames" class="tsd-anchor"></a><h3>skip<wbr/>Frames</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Frames<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipFrames">skipFrames</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L12">src/config.ts:12</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max frames to go without re-running model if cached results are acceptable
for two-phase models such as face and hand caching applies to bounding boxes detection only</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipTime" class="tsd-anchor"></a><h3>skip<wbr/>Time</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Time<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipTime">skipTime</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L15">src/config.ts:15</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max milliseconds to go without re-running model if cached results are acceptable
for two-phase models such as face and hand caching applies to bounding boxes detection only</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="FaceLivenessConfig.html" class="tsd-kind-icon">Face<wbr/>Liveness<wbr/>Config</a><ul><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></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

@ -3,9 +3,11 @@
</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"><div class="lead">
<p>is module enabled?</p>
</div></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"><div class="lead">
<p>path to model json file</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipFrames" class="tsd-anchor"></a><h3>skip<wbr/>Frames</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Frames<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipFrames">skipFrames</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L11">src/config.ts:11</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max frames to go without re-running model if cached results are acceptable</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipTime" class="tsd-anchor"></a><h3>skip<wbr/>Time</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Time<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipTime">skipTime</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L13">src/config.ts:13</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max miliseconds to go without re-running model if cached results are acceptable</p>
<p>path to model json file (relative to <code>modelBasePath</code></p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipFrames" class="tsd-anchor"></a><h3>skip<wbr/>Frames</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Frames<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipFrames">skipFrames</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L12">src/config.ts:12</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max frames to go without re-running model if cached results are acceptable
for two-phase models such as face and hand caching applies to bounding boxes detection only</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipTime" class="tsd-anchor"></a><h3>skip<wbr/>Time</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Time<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipTime">skipTime</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L15">src/config.ts:15</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max milliseconds to go without re-running model if cached results are acceptable
for two-phase models such as face and hand caching applies to bounding boxes detection only</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="FaceMeshConfig.html" class="tsd-kind-icon">Face<wbr/>Mesh<wbr/>Config</a><ul><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></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

@ -4,51 +4,51 @@
<li>available only in Browser environments</li>
<li>image filters run with near-zero latency as they are executed on the GPU using WebGL</li>
</ul>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">FilterConfig</span></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#blur" class="tsd-kind-icon">blur</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#brightness" class="tsd-kind-icon">brightness</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#contrast" class="tsd-kind-icon">contrast</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#enabled" class="tsd-kind-icon">enabled</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#equalization" class="tsd-kind-icon">equalization</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#flip" class="tsd-kind-icon">flip</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#height" class="tsd-kind-icon">height</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#hue" class="tsd-kind-icon">hue</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#kodachrome" class="tsd-kind-icon">kodachrome</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#negative" class="tsd-kind-icon">negative</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#pixelate" class="tsd-kind-icon">pixelate</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#polaroid" class="tsd-kind-icon">polaroid</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#return" class="tsd-kind-icon">return</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#saturation" class="tsd-kind-icon">saturation</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#sepia" class="tsd-kind-icon">sepia</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#sharpness" class="tsd-kind-icon">sharpness</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#technicolor" class="tsd-kind-icon">technicolor</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#vintage" class="tsd-kind-icon">vintage</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#width" class="tsd-kind-icon">width</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="blur" class="tsd-anchor"></a><h3>blur</h3><div class="tsd-signature tsd-kind-icon">blur<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L167">src/config.ts:167</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">FilterConfig</span></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#blur" class="tsd-kind-icon">blur</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#brightness" class="tsd-kind-icon">brightness</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#contrast" class="tsd-kind-icon">contrast</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#enabled" class="tsd-kind-icon">enabled</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#equalization" class="tsd-kind-icon">equalization</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#flip" class="tsd-kind-icon">flip</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#height" class="tsd-kind-icon">height</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#hue" class="tsd-kind-icon">hue</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#kodachrome" class="tsd-kind-icon">kodachrome</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#negative" class="tsd-kind-icon">negative</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#pixelate" class="tsd-kind-icon">pixelate</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#polaroid" class="tsd-kind-icon">polaroid</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#return" class="tsd-kind-icon">return</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#saturation" class="tsd-kind-icon">saturation</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#sepia" class="tsd-kind-icon">sepia</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#sharpness" class="tsd-kind-icon">sharpness</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#technicolor" class="tsd-kind-icon">technicolor</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#vintage" class="tsd-kind-icon">vintage</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FilterConfig.html#width" class="tsd-kind-icon">width</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="blur" class="tsd-anchor"></a><h3>blur</h3><div class="tsd-signature tsd-kind-icon">blur<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L172">src/config.ts:172</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>range: 0 (no blur) to N (blur radius in pixels)</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="brightness" class="tsd-anchor"></a><h3>brightness</h3><div class="tsd-signature tsd-kind-icon">brightness<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L161">src/config.ts:161</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="brightness" class="tsd-anchor"></a><h3>brightness</h3><div class="tsd-signature tsd-kind-icon">brightness<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L166">src/config.ts:166</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>range: -1 (darken) to 1 (lighten)</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="contrast" class="tsd-anchor"></a><h3>contrast</h3><div class="tsd-signature tsd-kind-icon">contrast<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L163">src/config.ts:163</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="contrast" class="tsd-anchor"></a><h3>contrast</h3><div class="tsd-signature tsd-kind-icon">contrast<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L168">src/config.ts:168</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>range: -1 (reduce contrast) to 1 (increase contrast)</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a 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#L139">src/config.ts:139</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="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#L144">src/config.ts:144</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>are image filters enabled?</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="equalization" class="tsd-anchor"></a><h3>equalization</h3><div class="tsd-signature tsd-kind-icon">equalization<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#L143">src/config.ts:143</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="equalization" class="tsd-anchor"></a><h3>equalization</h3><div class="tsd-signature tsd-kind-icon">equalization<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#L148">src/config.ts:148</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>perform image histogram equalization</p>
<ul>
<li>equalization is performed on input as a whole and detected face before its passed for further analysis</li>
</ul>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="flip" class="tsd-anchor"></a><h3>flip</h3><div class="tsd-signature tsd-kind-icon">flip<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L159">src/config.ts:159</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="flip" class="tsd-anchor"></a><h3>flip</h3><div class="tsd-signature tsd-kind-icon">flip<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L164">src/config.ts:164</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>flip input as mirror image</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="height" class="tsd-anchor"></a><h3>height</h3><div class="tsd-signature tsd-kind-icon">height<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L155">src/config.ts:155</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="height" class="tsd-anchor"></a><h3>height</h3><div class="tsd-signature tsd-kind-icon">height<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L160">src/config.ts:160</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>resize input height</p>
<ul>
<li>if both width and height are set to 0, there is no resizing</li>
<li>if just one is set, second one is scaled automatically</li>
<li>if both are set, values are used as-is</li>
</ul>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="hue" class="tsd-anchor"></a><h3>hue</h3><div class="tsd-signature tsd-kind-icon">hue<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L171">src/config.ts:171</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="hue" class="tsd-anchor"></a><h3>hue</h3><div class="tsd-signature tsd-kind-icon">hue<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L176">src/config.ts:176</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>range: 0 (no change) to 360 (hue rotation in degrees)</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="kodachrome" class="tsd-anchor"></a><h3>kodachrome</h3><div class="tsd-signature tsd-kind-icon">kodachrome<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L179">src/config.ts:179</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="kodachrome" class="tsd-anchor"></a><h3>kodachrome</h3><div class="tsd-signature tsd-kind-icon">kodachrome<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L184">src/config.ts:184</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>image kodachrome colors</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="negative" class="tsd-anchor"></a><h3>negative</h3><div class="tsd-signature tsd-kind-icon">negative<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L173">src/config.ts:173</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="negative" class="tsd-anchor"></a><h3>negative</h3><div class="tsd-signature tsd-kind-icon">negative<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L178">src/config.ts:178</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>image negative</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="pixelate" class="tsd-anchor"></a><h3>pixelate</h3><div class="tsd-signature tsd-kind-icon">pixelate<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L185">src/config.ts:185</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="pixelate" class="tsd-anchor"></a><h3>pixelate</h3><div class="tsd-signature tsd-kind-icon">pixelate<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L190">src/config.ts:190</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>range: 0 (no pixelate) to N (number of pixels to pixelate)</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="polaroid" class="tsd-anchor"></a><h3>polaroid</h3><div class="tsd-signature tsd-kind-icon">polaroid<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L183">src/config.ts:183</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="polaroid" class="tsd-anchor"></a><h3>polaroid</h3><div class="tsd-signature tsd-kind-icon">polaroid<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L188">src/config.ts:188</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>image polaroid camera effect</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="return" class="tsd-anchor"></a><h3>return</h3><div class="tsd-signature tsd-kind-icon">return<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L157">src/config.ts:157</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="return" class="tsd-anchor"></a><h3>return</h3><div class="tsd-signature tsd-kind-icon">return<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L162">src/config.ts:162</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>return processed canvas imagedata in result</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="saturation" class="tsd-anchor"></a><h3>saturation</h3><div class="tsd-signature tsd-kind-icon">saturation<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L169">src/config.ts:169</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="saturation" class="tsd-anchor"></a><h3>saturation</h3><div class="tsd-signature tsd-kind-icon">saturation<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L174">src/config.ts:174</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>range: -1 (reduce saturation) to 1 (increase saturation)</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="sepia" class="tsd-anchor"></a><h3>sepia</h3><div class="tsd-signature tsd-kind-icon">sepia<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L175">src/config.ts:175</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="sepia" class="tsd-anchor"></a><h3>sepia</h3><div class="tsd-signature tsd-kind-icon">sepia<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L180">src/config.ts:180</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>image sepia colors</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="sharpness" class="tsd-anchor"></a><h3>sharpness</h3><div class="tsd-signature tsd-kind-icon">sharpness<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L165">src/config.ts:165</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="sharpness" class="tsd-anchor"></a><h3>sharpness</h3><div class="tsd-signature tsd-kind-icon">sharpness<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L170">src/config.ts:170</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>range: 0 (no sharpening) to 1 (maximum sharpening)</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="technicolor" class="tsd-anchor"></a><h3>technicolor</h3><div class="tsd-signature tsd-kind-icon">technicolor<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L181">src/config.ts:181</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="technicolor" class="tsd-anchor"></a><h3>technicolor</h3><div class="tsd-signature tsd-kind-icon">technicolor<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L186">src/config.ts:186</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>image technicolor colors</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="vintage" class="tsd-anchor"></a><h3>vintage</h3><div class="tsd-signature tsd-kind-icon">vintage<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L177">src/config.ts:177</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="vintage" class="tsd-anchor"></a><h3>vintage</h3><div class="tsd-signature tsd-kind-icon">vintage<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L182">src/config.ts:182</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>image vintage colors</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="width" class="tsd-anchor"></a><h3>width</h3><div class="tsd-signature tsd-kind-icon">width<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L149">src/config.ts:149</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="width" class="tsd-anchor"></a><h3>width</h3><div class="tsd-signature tsd-kind-icon">width<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L154">src/config.ts:154</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>resize input width</p>
<ul>
<li>if both width and height are set to 0, there is no resizing</li>

View File

@ -3,9 +3,11 @@
</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"><div class="lead">
<p>is module enabled?</p>
</div></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"><div class="lead">
<p>path to model json file</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="skipFrames" class="tsd-anchor"></a><h3>skip<wbr/>Frames</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Frames<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L11">src/config.ts:11</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max frames to go without re-running model if cached results are acceptable</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="skipTime" class="tsd-anchor"></a><h3>skip<wbr/>Time</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Time<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#L13">src/config.ts:13</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max miliseconds to go without re-running model if cached results are acceptable</p>
<p>path to model json file (relative to <code>modelBasePath</code></p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="skipFrames" class="tsd-anchor"></a><h3>skip<wbr/>Frames</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Frames<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L12">src/config.ts:12</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max frames to go without re-running model if cached results are acceptable
for two-phase models such as face and hand caching applies to bounding boxes detection only</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="skipTime" class="tsd-anchor"></a><h3>skip<wbr/>Time</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Time<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#L15">src/config.ts:15</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max milliseconds to go without re-running model if cached results are acceptable
for two-phase models such as face and hand caching applies to bounding boxes detection only</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="GenericConfig.html" class="tsd-kind-icon">Generic<wbr/>Config</a><ul><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></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,5 +1,5 @@
<!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.7</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.7"/><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.7</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.7</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#L191">src/config.ts:191</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">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#L196">src/config.ts:196</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>is gesture detection enabled?</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="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,25 +1,27 @@
<!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.7</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.7"/><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.7</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.7</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#L102">src/config.ts:102</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"><div class="lead">
</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#L107">src/config.ts:107</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"><div class="lead">
<p>path to hand detector model json</p>
</div></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"><div class="lead">
<p>is module enabled?</p>
</div></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#L97">src/config.ts:97</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="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#L102">src/config.ts:102</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>minimum overlap between two detected hands before one is discarded</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">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L101">src/config.ts:101</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">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L106">src/config.ts:106</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>should hand landmarks be detected or just return detected hand box</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="maxDetected" class="tsd-anchor"></a><h3>max<wbr/>Detected</h3><div class="tsd-signature tsd-kind-icon">max<wbr/>Detected<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L99">src/config.ts:99</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="maxDetected" class="tsd-anchor"></a><h3>max<wbr/>Detected</h3><div class="tsd-signature tsd-kind-icon">max<wbr/>Detected<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L104">src/config.ts:104</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>maximum number of detected hands</p>
</div></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#L95">src/config.ts:95</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="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#L100">src/config.ts:100</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>minimum confidence for a detected hand before results are discarded</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="modelPath-1" 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"><div class="lead">
<p>path to model json file</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>rotation</h3><div class="tsd-signature tsd-kind-icon">rotation<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L93">src/config.ts:93</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>path to model json file (relative to <code>modelBasePath</code></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>rotation</h3><div class="tsd-signature tsd-kind-icon">rotation<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L98">src/config.ts:98</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>should hand rotation correction be performed after hand detection?</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="skeleton" class="tsd-anchor"></a><h3>skeleton</h3><div class="tsd-signature tsd-kind-icon">skeleton<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>modelPath<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L106">src/config.ts:106</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"><div class="lead">
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="skeleton" class="tsd-anchor"></a><h3>skeleton</h3><div class="tsd-signature tsd-kind-icon">skeleton<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>modelPath<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L111">src/config.ts:111</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"><div class="lead">
<p>path to hand skeleton model json</p>
</div></div></li></ul></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipFrames" class="tsd-anchor"></a><h3>skip<wbr/>Frames</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Frames<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipFrames">skipFrames</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L11">src/config.ts:11</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max frames to go without re-running model if cached results are acceptable</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipTime" class="tsd-anchor"></a><h3>skip<wbr/>Time</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Time<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipTime">skipTime</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L13">src/config.ts:13</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max miliseconds to go without re-running model if cached results are acceptable</p>
</div></div></li></ul></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipFrames" class="tsd-anchor"></a><h3>skip<wbr/>Frames</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Frames<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipFrames">skipFrames</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L12">src/config.ts:12</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max frames to go without re-running model if cached results are acceptable
for two-phase models such as face and hand caching applies to bounding boxes detection only</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipTime" class="tsd-anchor"></a><h3>skip<wbr/>Time</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Time<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipTime">skipTime</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L15">src/config.ts:15</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max milliseconds to go without re-running model if cached results are acceptable
for two-phase models such as face and hand caching applies to bounding boxes detection only</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="HandConfig.html" class="tsd-kind-icon">Hand<wbr/>Config</a><ul><li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandConfig.html#detector" class="tsd-kind-icon">detector</a></li><li class="tsd-kind-property tsd-parent-kind-interface 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></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

@ -2,16 +2,18 @@
<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"><div class="lead">
<p>is module enabled?</p>
</div></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#L117">src/config.ts:117</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="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#L122">src/config.ts:122</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>minimum overlap between two detected objects before one is discarded</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="maxDetected" class="tsd-anchor"></a><h3>max<wbr/>Detected</h3><div class="tsd-signature tsd-kind-icon">max<wbr/>Detected<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L119">src/config.ts:119</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="maxDetected" class="tsd-anchor"></a><h3>max<wbr/>Detected</h3><div class="tsd-signature tsd-kind-icon">max<wbr/>Detected<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L124">src/config.ts:124</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>maximum number of detected objects</p>
</div></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#L115">src/config.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="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#L120">src/config.ts:120</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>minimum confidence for a detected objects before results are discarded</p>
</div></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"><div class="lead">
<p>path to model json file</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipFrames" class="tsd-anchor"></a><h3>skip<wbr/>Frames</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Frames<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipFrames">skipFrames</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L11">src/config.ts:11</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max frames to go without re-running model if cached results are acceptable</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipTime" class="tsd-anchor"></a><h3>skip<wbr/>Time</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Time<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipTime">skipTime</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L13">src/config.ts:13</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max miliseconds to go without re-running model if cached results are acceptable</p>
<p>path to model json file (relative to <code>modelBasePath</code></p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipFrames" class="tsd-anchor"></a><h3>skip<wbr/>Frames</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Frames<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipFrames">skipFrames</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L12">src/config.ts:12</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max frames to go without re-running model if cached results are acceptable
for two-phase models such as face and hand caching applies to bounding boxes detection only</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipTime" class="tsd-anchor"></a><h3>skip<wbr/>Time</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Time<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipTime">skipTime</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L15">src/config.ts:15</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max milliseconds to go without re-running model if cached results are acceptable
for two-phase models such as face and hand caching applies to bounding boxes detection only</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="ObjectConfig.html" class="tsd-kind-icon">Object<wbr/>Config</a><ul><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></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

@ -4,14 +4,16 @@ removes background from input containing person
if segmentation is enabled it will run as preprocessing task before any other model
alternatively leave it disabled and use it on-demand using human.segmentation method which can
remove background or replace it with user-provided background</p>
</div></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">SegmentationConfig</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="SegmentationConfig.html#blur" class="tsd-kind-icon">blur</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="SegmentationConfig.html#enabled" class="tsd-kind-icon">enabled</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="SegmentationConfig.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="SegmentationConfig.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="SegmentationConfig.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="blur" class="tsd-anchor"></a><h3>blur</h3><div class="tsd-signature tsd-kind-icon">blur<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L130">src/config.ts:130</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><a href="GenericConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">GenericConfig</a><ul class="tsd-hierarchy"><li><span class="target">SegmentationConfig</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="SegmentationConfig.html#blur" class="tsd-kind-icon">blur</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="SegmentationConfig.html#enabled" class="tsd-kind-icon">enabled</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="SegmentationConfig.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="SegmentationConfig.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="SegmentationConfig.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="blur" class="tsd-anchor"></a><h3>blur</h3><div class="tsd-signature tsd-kind-icon">blur<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L135">src/config.ts:135</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>blur segmentation output by <number> pixels for more realistic image</p>
</div></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"><div class="lead">
<p>is module enabled?</p>
</div></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"><div class="lead">
<p>path to model json file</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipFrames" class="tsd-anchor"></a><h3>skip<wbr/>Frames</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Frames<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipFrames">skipFrames</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L11">src/config.ts:11</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max frames to go without re-running model if cached results are acceptable</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipTime" class="tsd-anchor"></a><h3>skip<wbr/>Time</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Time<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipTime">skipTime</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L13">src/config.ts:13</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max miliseconds to go without re-running model if cached results are acceptable</p>
<p>path to model json file (relative to <code>modelBasePath</code></p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipFrames" class="tsd-anchor"></a><h3>skip<wbr/>Frames</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Frames<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipFrames">skipFrames</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L12">src/config.ts:12</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max frames to go without re-running model if cached results are acceptable
for two-phase models such as face and hand caching applies to bounding boxes detection only</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="skipTime" class="tsd-anchor"></a><h3>skip<wbr/>Time</h3><div class="tsd-signature tsd-kind-icon">skip<wbr/>Time<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#skipTime">skipTime</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L15">src/config.ts:15</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>how many max milliseconds to go without re-running model if cached results are acceptable
for two-phase models such as face and hand caching applies to bounding boxes detection only</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="SegmentationConfig.html" class="tsd-kind-icon">Segmentation<wbr/>Config</a><ul><li class="tsd-kind-property tsd-parent-kind-interface"><a href="SegmentationConfig.html#blur" class="tsd-kind-icon">blur</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="SegmentationConfig.html#enabled" class="tsd-kind-icon">enabled</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="SegmentationConfig.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="SegmentationConfig.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="SegmentationConfig.html#skipTime" class="tsd-kind-icon">skip<wbr/>Time</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>

19
types/human.d.ts vendored
View File

@ -37,7 +37,7 @@ export declare type BodyAnnotationEfficientPose = 'leftLeg' | 'rightLeg' | 'tors
/** Configures all body detection specific options */
export declare interface BodyConfig extends GenericConfig {
/** maximum numboer of detected bodies */
/** maximum number of detected bodies */
maxDetected: number;
/** minimum confidence for a detected body before results are discarded */
minConfidence: number;
@ -502,9 +502,11 @@ export declare interface FaceDescriptionConfig extends GenericConfig {
minConfidence: number;
}
/** Dectector part of face configuration */
/** Detector part of face configuration */
export declare interface FaceDetectorConfig extends GenericConfig {
/** is face rotation correction performed after detecting face? */
/** is face rotation correction performed after detecting face?
* used to correctly analyze faces under high angles
*/
rotation: boolean;
/** maximum number of detected faces */
maxDetected: number;
@ -514,7 +516,8 @@ export declare interface FaceDetectorConfig extends GenericConfig {
iouThreshold: number;
/** should child models perform on masked image of a face */
mask: boolean;
/** should face detection return face tensor to be used in some other extenrnal model? */
/** should face detection return processed and cropped face tensor that can with an external model for addtional processing?
* if enabled it must be manually deallocated to avoid memory leak */
return: boolean;
}
@ -695,11 +698,13 @@ export declare type Gender = 'male' | 'female' | 'unknown';
export declare interface GenericConfig {
/** is module enabled? */
enabled: boolean;
/** path to model json file */
/** path to model json file (relative to `modelBasePath` */
modelPath: string;
/** how many max frames to go without re-running model if cached results are acceptable */
/** how many max frames to go without re-running model if cached results are acceptable
* for two-phase models such as face and hand caching applies to bounding boxes detection only */
skipFrames: number;
/** how many max miliseconds to go without re-running model if cached results are acceptable */
/** how many max milliseconds to go without re-running model if cached results are acceptable
* for two-phase models such as face and hand caching applies to bounding boxes detection only */
skipTime: number;
}