change on how face box is calculated

pull/233/head
Vladimir Mandic 2021-12-27 10:59:56 -05:00
parent 3c45874ee5
commit 83d3e6ec22
67 changed files with 3034 additions and 3169 deletions

View File

@ -9,9 +9,13 @@
## Changelog ## Changelog
### **HEAD -> main** 2021/12/18 mandic00@live.com ### **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 ### **release: 2.5.6** 2021/12/15 mandic00@live.com

View File

@ -3,6 +3,8 @@ const Human = require('../../dist/human.node.js').default; // this is same as `@
async function main(inputFile) { async function main(inputFile) {
const human = new Human(); // create instance of human using default configuration const human = new Human(); // create instance of human using default configuration
await human.load(); // optional as models would be loaded on-demand first time they are required
await human.warmup(); // optional as model warmup is performed on-demand first time its executed
const buffer = fs.readFileSync(inputFile); // read file data into buffer const buffer = fs.readFileSync(inputFile); // read file data into buffer
const tensor = human.tf.node.decodeImage(buffer); // decode jpg data const tensor = human.tf.node.decodeImage(buffer); // decode jpg data
const result = await human.detect(tensor); // run detection; will initialize backend and on-demand load models const result = await human.detect(tensor); // run detection; will initialize backend and on-demand load models

10
dist/human.d.ts vendored
View File

@ -137,7 +137,7 @@ declare function browserFiles(files: File[]): IOHandler;
declare function browserHTTPRequest(path: string, loadOptions?: LoadOptions): IOHandler; declare function browserHTTPRequest(path: string, loadOptions?: LoadOptions): IOHandler;
/** draw processed canvas */ /** draw processed canvas */
declare function canvas(input: AnyCanvas | HTMLImageElement | HTMLMediaElement | HTMLVideoElement, output: AnyCanvas): Promise<void>; declare function canvas(input: AnyCanvas | HTMLImageElement | HTMLVideoElement, output: AnyCanvas): Promise<void>;
/** /**
* Concatenate a number of ArrayBuffers into one. * Concatenate a number of ArrayBuffers into one.
@ -512,12 +512,6 @@ export declare interface FaceDetectorConfig extends GenericConfig {
minConfidence: number; minConfidence: number;
/** minimum overlap between two detected faces before one is discarded */ /** minimum overlap between two detected faces before one is discarded */
iouThreshold: number; iouThreshold: number;
/** factor used to expand detected face before further analysis
* - default: 1.6
* - for high-quality inputs can be reduced to increase precision
* - for video inputs or low-quality inputs can be increased to allow for more flexible tracking
*/
cropFactor: number;
/** should child models perform on masked image of a face */ /** should child models perform on masked image of a face */
mask: boolean; mask: boolean;
/** should face detection return face tensor to be used in some other extenrnal model? */ /** should face detection return face tensor to be used in some other extenrnal model? */
@ -1249,7 +1243,7 @@ declare class Human {
* @param userConfig - {@link Config} * @param userConfig - {@link Config}
* @returns result - {@link Result} * @returns result - {@link Result}
*/ */
warmup(userConfig?: Partial<Config>): Promise<Result>; warmup(userConfig?: Partial<Config>): Promise<Result | undefined>;
/** Run detect with tensorflow profiling /** Run detect with tensorflow profiling
* - result object will contain total exeuction time information for top-20 kernels * - result object will contain total exeuction time information for top-20 kernels
* - actual detection object can be accessed via `human.result` * - actual detection object can be accessed via `human.result`

View File

@ -137,7 +137,7 @@ declare function browserFiles(files: File[]): IOHandler;
declare function browserHTTPRequest(path: string, loadOptions?: LoadOptions): IOHandler; declare function browserHTTPRequest(path: string, loadOptions?: LoadOptions): IOHandler;
/** draw processed canvas */ /** draw processed canvas */
declare function canvas(input: AnyCanvas | HTMLImageElement | HTMLMediaElement | HTMLVideoElement, output: AnyCanvas): Promise<void>; declare function canvas(input: AnyCanvas | HTMLImageElement | HTMLVideoElement, output: AnyCanvas): Promise<void>;
/** /**
* Concatenate a number of ArrayBuffers into one. * Concatenate a number of ArrayBuffers into one.
@ -512,12 +512,6 @@ export declare interface FaceDetectorConfig extends GenericConfig {
minConfidence: number; minConfidence: number;
/** minimum overlap between two detected faces before one is discarded */ /** minimum overlap between two detected faces before one is discarded */
iouThreshold: number; iouThreshold: number;
/** factor used to expand detected face before further analysis
* - default: 1.6
* - for high-quality inputs can be reduced to increase precision
* - for video inputs or low-quality inputs can be increased to allow for more flexible tracking
*/
cropFactor: number;
/** should child models perform on masked image of a face */ /** should child models perform on masked image of a face */
mask: boolean; mask: boolean;
/** should face detection return face tensor to be used in some other extenrnal model? */ /** should face detection return face tensor to be used in some other extenrnal model? */
@ -1249,7 +1243,7 @@ declare class Human {
* @param userConfig - {@link Config} * @param userConfig - {@link Config}
* @returns result - {@link Result} * @returns result - {@link Result}
*/ */
warmup(userConfig?: Partial<Config>): Promise<Result>; warmup(userConfig?: Partial<Config>): Promise<Result | undefined>;
/** Run detect with tensorflow profiling /** Run detect with tensorflow profiling
* - result object will contain total exeuction time information for top-20 kernels * - result object will contain total exeuction time information for top-20 kernels
* - actual detection object can be accessed via `human.result` * - actual detection object can be accessed via `human.result`

View File

@ -145,7 +145,6 @@ var config = {
skipTime: 2500, skipTime: 2500,
minConfidence: 0.2, minConfidence: 0.2,
iouThreshold: 0.1, iouThreshold: 0.1,
cropFactor: 1.6,
mask: false, mask: false,
return: false return: false
}, },
@ -1219,7 +1218,7 @@ async function skip(config3, input) {
const diffRelative = diffSum[0] / (input.shape[1] || 1) / (input.shape[2] || 1) / 255 / 3; const diffRelative = diffSum[0] / (input.shape[1] || 1) / (input.shape[2] || 1) / 255 / 3;
tfjs_esm_exports.dispose([last.inputTensor, t.diff, t.squared, t.sum]); tfjs_esm_exports.dispose([last.inputTensor, t.diff, t.squared, t.sum]);
last.inputTensor = tfjs_esm_exports.clone(input); last.inputTensor = tfjs_esm_exports.clone(input);
skipFrame = diffRelative <= config3.cacheSensitivity; skipFrame = diffRelative <= (config3.cacheSensitivity || 0);
} }
return skipFrame; return skipFrame;
} }
@ -1351,7 +1350,7 @@ var Env = class {
var env = new Env(); var env = new Env();
// package.json // package.json
var version10 = "2.5.6"; var version10 = "2.5.7";
// src/gear/gear.ts // src/gear/gear.ts
var model; var model;
@ -4876,8 +4875,8 @@ var UV7 = VTX7.map((x) => UV468[x]);
// src/face/facemeshutil.ts // src/face/facemeshutil.ts
var getBoxSize = (box5) => [Math.abs(box5.endPoint[0] - box5.startPoint[0]), Math.abs(box5.endPoint[1] - box5.startPoint[1])]; var getBoxSize = (box5) => [Math.abs(box5.endPoint[0] - box5.startPoint[0]), Math.abs(box5.endPoint[1] - box5.startPoint[1])];
var getBoxCenter = (box5) => [box5.startPoint[0] + (box5.endPoint[0] - box5.startPoint[0]) / 2, box5.startPoint[1] + (box5.endPoint[1] - box5.startPoint[1]) / 2]; var getBoxCenter = (box5) => [box5.startPoint[0] + (box5.endPoint[0] - box5.startPoint[0]) / 2, box5.startPoint[1] + (box5.endPoint[1] - box5.startPoint[1]) / 2, 1];
var getClampedBox = (box5, input) => box5 ? [ var clampBox = (box5, input) => box5 ? [
Math.trunc(Math.max(0, box5.startPoint[0])), Math.trunc(Math.max(0, box5.startPoint[0])),
Math.trunc(Math.max(0, box5.startPoint[1])), Math.trunc(Math.max(0, box5.startPoint[1])),
Math.trunc(Math.min(input.shape[2] || 0, box5.endPoint[0]) - Math.max(0, box5.startPoint[0])), Math.trunc(Math.min(input.shape[2] || 0, box5.endPoint[0]) - Math.max(0, box5.startPoint[0])),
@ -4894,10 +4893,11 @@ var scaleBoxCoordinates = (box5, factor) => {
const endPoint = [box5.endPoint[0] * factor[0], box5.endPoint[1] * factor[1]]; const endPoint = [box5.endPoint[0] * factor[0], box5.endPoint[1] * factor[1]];
return { startPoint, endPoint, landmarks: box5.landmarks, confidence: box5.confidence }; return { startPoint, endPoint, landmarks: box5.landmarks, confidence: box5.confidence };
}; };
var cutBoxFromImageAndResize = (box5, image29, cropSize) => { var cutAndResize = (box5, image29, cropSize) => {
const h = image29.shape[1]; const h = image29.shape[1];
const w = image29.shape[2]; const w = image29.shape[2];
const crop2 = tfjs_esm_exports.image.cropAndResize(image29, [[box5.startPoint[1] / h, box5.startPoint[0] / w, box5.endPoint[1] / h, box5.endPoint[0] / w]], [0], cropSize); const cutBox = [box5.startPoint[1] / h, box5.startPoint[0] / w, box5.endPoint[1] / h, box5.endPoint[0] / w];
const crop2 = tfjs_esm_exports.image.cropAndResize(image29, [cutBox], [0], cropSize);
const norm = tfjs_esm_exports.div(crop2, constants.tf255); const norm = tfjs_esm_exports.div(crop2, constants.tf255);
tfjs_esm_exports.dispose(crop2); tfjs_esm_exports.dispose(crop2);
return norm; return norm;
@ -4915,9 +4915,9 @@ var squarifyBox = (box5) => {
return { startPoint: [Math.round(centers[0] - halfSize), Math.round(centers[1] - halfSize)], endPoint: [Math.round(centers[0] + halfSize), Math.round(centers[1] + halfSize)], landmarks: box5.landmarks, confidence: box5.confidence }; return { startPoint: [Math.round(centers[0] - halfSize), Math.round(centers[1] - halfSize)], endPoint: [Math.round(centers[0] + halfSize), Math.round(centers[1] + halfSize)], landmarks: box5.landmarks, confidence: box5.confidence };
}; };
var calculateLandmarksBoundingBox = (landmarks) => { var calculateLandmarksBoundingBox = (landmarks) => {
const xs = landmarks.map((d) => d[0]); const x = landmarks.map((d) => d[0]);
const ys = landmarks.map((d) => d[1]); const y = landmarks.map((d) => d[1]);
return { startPoint: [Math.min(...xs), Math.min(...ys)], endPoint: [Math.max(...xs), Math.max(...ys)], landmarks }; return { startPoint: [Math.min(...x), Math.min(...y)], endPoint: [Math.max(...x), Math.max(...y)], landmarks };
}; };
var fixedRotationMatrix = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]; var fixedRotationMatrix = [[1, 0, 0], [0, 1, 0], [0, 0, 1]];
var normalizeRadians = (angle) => angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI)); var normalizeRadians = (angle) => angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI));
@ -4991,11 +4991,12 @@ function transformRawCoords(coordsRaw, box5, angle, rotationMatrix, inputSize9)
const coordsRotationMatrix = largeAngle ? buildRotationMatrix(angle, [0, 0]) : fixedRotationMatrix; const coordsRotationMatrix = largeAngle ? buildRotationMatrix(angle, [0, 0]) : fixedRotationMatrix;
const coordsRotated = largeAngle ? coordsScaled.map((coord) => [...rotatePoint(coord, coordsRotationMatrix), coord[2]]) : coordsScaled; const coordsRotated = largeAngle ? coordsScaled.map((coord) => [...rotatePoint(coord, coordsRotationMatrix), coord[2]]) : coordsScaled;
const inverseRotationMatrix = largeAngle ? invertTransformMatrix(rotationMatrix) : fixedRotationMatrix; const inverseRotationMatrix = largeAngle ? invertTransformMatrix(rotationMatrix) : fixedRotationMatrix;
const boxCenter = [...getBoxCenter({ startPoint: box5.startPoint, endPoint: box5.endPoint }), 1]; const boxCenter = getBoxCenter(box5);
const offsets = [dot(boxCenter, inverseRotationMatrix[0]), dot(boxCenter, inverseRotationMatrix[1])];
return coordsRotated.map((coord) => [ return coordsRotated.map((coord) => [
Math.round(coord[0] + dot(boxCenter, inverseRotationMatrix[0])), Math.trunc(coord[0] + offsets[0]),
Math.round(coord[1] + dot(boxCenter, inverseRotationMatrix[1])), Math.trunc(coord[1] + offsets[1]),
Math.round(coord[2] || 0) Math.trunc(coord[2] || 0)
]); ]);
} }
function correctFaceRotation(rotate, box5, input, inputSize9) { function correctFaceRotation(rotate, box5, input, inputSize9) {
@ -5007,23 +5008,38 @@ function correctFaceRotation(rotate, box5, input, inputSize9) {
angle = computeRotation(box5.landmarks[symmetryLine[0]], box5.landmarks[symmetryLine[1]]); angle = computeRotation(box5.landmarks[symmetryLine[0]], box5.landmarks[symmetryLine[1]]);
const largeAngle = angle && angle !== 0 && Math.abs(angle) > 0.2; const largeAngle = angle && angle !== 0 && Math.abs(angle) > 0.2;
if (largeAngle) { if (largeAngle) {
const center = getBoxCenter({ startPoint: box5.startPoint, endPoint: box5.endPoint }); const center = getBoxCenter(box5);
const centerRaw = [center[0] / input.shape[2], center[1] / input.shape[1]]; const centerRaw = [center[0] / input.shape[2], center[1] / input.shape[1]];
const rotated = tfjs_esm_exports.image.rotateWithOffset(input, angle, 0, centerRaw); const rotated = tfjs_esm_exports.image.rotateWithOffset(input, angle, 0, centerRaw);
rotationMatrix = buildRotationMatrix(-angle, center); rotationMatrix = buildRotationMatrix(-angle, center);
face5 = cutBoxFromImageAndResize(box5, rotated, [inputSize9, inputSize9]); face5 = cutAndResize(box5, rotated, [inputSize9, inputSize9]);
tfjs_esm_exports.dispose(rotated); tfjs_esm_exports.dispose(rotated);
} else { } else {
face5 = cutBoxFromImageAndResize(box5, input, [inputSize9, inputSize9]); face5 = cutAndResize(box5, input, [inputSize9, inputSize9]);
} }
} else { } else {
face5 = cutBoxFromImageAndResize(box5, input, [inputSize9, inputSize9]); face5 = cutAndResize(box5, input, [inputSize9, inputSize9]);
} }
return [angle, rotationMatrix, face5]; return [angle, rotationMatrix, face5];
} }
var findFaceCenter = (mesh) => {
const x = mesh.map((m) => m[0]);
const y = mesh.map((m) => m[1]);
return [Math.min(...x) + (Math.max(...x) - Math.min(...x)) / 2, Math.min(...y) + (Math.max(...y) - Math.min(...y)) / 2];
};
var calculateFaceBox = (mesh, previousBox) => {
const center = findFaceCenter(mesh);
const boxSize = getBoxSize(previousBox);
const calculatedBox = {
startPoint: [center[0] - boxSize[0] / 2, center[1] - boxSize[1] / 2],
endPoint: [center[0] + boxSize[0] / 2, center[1] + boxSize[1] / 2]
};
return calculatedBox;
};
// src/face/blazeface.ts // src/face/blazeface.ts
var keypointsCount = 6; var keypointsCount = 6;
var faceBoxScaleFactor = 1.2;
var model5; var model5;
var anchors = null; var anchors = null;
var inputSize = 0; var inputSize = 0;
@ -5065,7 +5081,7 @@ function decodeBounds(boxOutputs) {
async function getBoxes(inputImage, config3) { async function getBoxes(inputImage, config3) {
var _a, _b, _c, _d; var _a, _b, _c, _d;
if (!inputImage || inputImage["isDisposedInternal"] || inputImage.shape.length !== 4 || inputImage.shape[1] < 1 || inputImage.shape[2] < 1) if (!inputImage || inputImage["isDisposedInternal"] || inputImage.shape.length !== 4 || inputImage.shape[1] < 1 || inputImage.shape[2] < 1)
return { boxes: [] }; return [];
const t = {}; const t = {};
t.resized = tfjs_esm_exports.image.resizeBilinear(inputImage, [inputSize, inputSize]); t.resized = tfjs_esm_exports.image.resizeBilinear(inputImage, [inputSize, inputSize]);
t.div = tfjs_esm_exports.div(t.resized, constants.tf127); t.div = tfjs_esm_exports.div(t.resized, constants.tf127);
@ -5098,17 +5114,21 @@ async function getBoxes(inputImage, config3) {
b.squeeze = tfjs_esm_exports.squeeze(b.slice); b.squeeze = tfjs_esm_exports.squeeze(b.slice);
b.landmarks = tfjs_esm_exports.reshape(b.squeeze, [keypointsCount, -1]); b.landmarks = tfjs_esm_exports.reshape(b.squeeze, [keypointsCount, -1]);
const points = await b.bbox.data(); const points = await b.bbox.data();
boxes.push({ const rawBox = {
startPoint: [points[0], points[1]], startPoint: [points[0], points[1]],
endPoint: [points[2], points[3]], endPoint: [points[2], points[3]],
landmarks: await b.landmarks.array(), landmarks: await b.landmarks.array(),
confidence confidence
}); };
const scaledBox = scaleBoxCoordinates(rawBox, [(inputImage.shape[2] || 0) / inputSize, (inputImage.shape[1] || 0) / inputSize]);
const enlargedBox = enlargeBox(scaledBox, faceBoxScaleFactor);
const squaredBox = squarifyBox(enlargedBox);
boxes.push(squaredBox);
Object.keys(b).forEach((tensor3) => tfjs_esm_exports.dispose(b[tensor3])); Object.keys(b).forEach((tensor3) => tfjs_esm_exports.dispose(b[tensor3]));
} }
} }
Object.keys(t).forEach((tensor3) => tfjs_esm_exports.dispose(t[tensor3])); Object.keys(t).forEach((tensor3) => tfjs_esm_exports.dispose(t[tensor3]));
return { boxes, scaleFactor: [inputImage.shape[2] / inputSize, inputImage.shape[1] / inputSize] }; return boxes;
} }
// src/body/blazeposecoords.ts // src/body/blazeposecoords.ts
@ -5945,36 +5965,29 @@ async function augmentIris(rawCoords, face5, config3, meshSize) {
} }
// src/face/facemesh.ts // src/face/facemesh.ts
var boxCache = []; var cache3 = {
boxes: [],
skipped: Number.MAX_SAFE_INTEGER,
timestamp: 0
};
var model11 = null; var model11 = null;
var inputSize6 = 0; var inputSize6 = 0;
var skipped10 = Number.MAX_SAFE_INTEGER;
var lastTime10 = 0;
async function predict10(input, config3) { async function predict10(input, config3) {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k; var _a, _b, _c, _d, _e, _f, _g, _h;
const skipTime = (((_a = config3.face.detector) == null ? void 0 : _a.skipTime) || 0) > now() - lastTime10; const skipTime = (((_a = config3.face.detector) == null ? void 0 : _a.skipTime) || 0) > now() - cache3.timestamp;
const skipFrame = skipped10 < (((_b = config3.face.detector) == null ? void 0 : _b.skipFrames) || 0); const skipFrame = cache3.skipped < (((_b = config3.face.detector) == null ? void 0 : _b.skipFrames) || 0);
if (!config3.skipAllowed || !skipTime || !skipFrame || boxCache.length === 0) { if (!config3.skipAllowed || !skipTime || !skipFrame || cache3.boxes.length === 0) {
const possibleBoxes = await getBoxes(input, config3); cache3.boxes = await getBoxes(input, config3);
lastTime10 = now(); cache3.timestamp = now();
boxCache = []; cache3.skipped = 0;
for (const possible of possibleBoxes.boxes) {
const boxScaled = scaleBoxCoordinates(possible, possibleBoxes.scaleFactor);
const detectedWidth = (boxScaled.endPoint[0] - boxScaled.startPoint[0]) / (input.shape[2] || 1e3);
const calcFactor = (((_c = config3.face.detector) == null ? void 0 : _c.cropFactor) || 1.6) / (detectedWidth + 0.75) / 1.34;
const boxEnlarged = enlargeBox(boxScaled, calcFactor);
const boxSquared = squarifyBox(boxEnlarged);
boxCache.push(boxSquared);
}
skipped10 = 0;
} else { } else {
skipped10++; cache3.skipped++;
} }
const faces = []; const faces = [];
const newCache = []; const newCache = [];
let id = 0; let id = 0;
for (let i = 0; i < boxCache.length; i++) { for (let i = 0; i < cache3.boxes.length; i++) {
let box5 = boxCache[i]; const box5 = cache3.boxes[i];
let angle = 0; let angle = 0;
let rotationMatrix; let rotationMatrix;
const face5 = { const face5 = {
@ -5988,15 +6001,15 @@ async function predict10(input, config3) {
faceScore: 0, faceScore: 0,
annotations: {} annotations: {}
}; };
[angle, rotationMatrix, face5.tensor] = correctFaceRotation((_d = config3.face.detector) == null ? void 0 : _d.rotation, box5, input, ((_e = config3.face.mesh) == null ? void 0 : _e.enabled) ? inputSize6 : size()); [angle, rotationMatrix, face5.tensor] = correctFaceRotation((_c = config3.face.detector) == null ? void 0 : _c.rotation, box5, input, ((_d = config3.face.mesh) == null ? void 0 : _d.enabled) ? inputSize6 : size());
if ((_f = config3 == null ? void 0 : config3.filter) == null ? void 0 : _f.equalization) { if ((_e = config3 == null ? void 0 : config3.filter) == null ? void 0 : _e.equalization) {
const equilized = await histogramEqualization(face5.tensor); const equilized = await histogramEqualization(face5.tensor);
tfjs_esm_exports.dispose(face5.tensor); tfjs_esm_exports.dispose(face5.tensor);
face5.tensor = equilized; face5.tensor = equilized;
} }
face5.boxScore = Math.round(100 * box5.confidence) / 100; face5.boxScore = Math.round(100 * box5.confidence) / 100;
if (!((_g = config3.face.mesh) == null ? void 0 : _g.enabled)) { if (!((_f = config3.face.mesh) == null ? void 0 : _f.enabled)) {
face5.box = getClampedBox(box5, input); face5.box = clampBox(box5, input);
face5.boxRaw = getRawBox(box5, input); face5.boxRaw = getRawBox(box5, input);
face5.score = face5.boxScore; face5.score = face5.boxScore;
face5.mesh = box5.landmarks.map((pt) => [ face5.mesh = box5.landmarks.map((pt) => [
@ -6016,30 +6029,25 @@ async function predict10(input, config3) {
const coordsReshaped = tfjs_esm_exports.reshape(contourCoords, [-1, 3]); const coordsReshaped = tfjs_esm_exports.reshape(contourCoords, [-1, 3]);
let rawCoords = await coordsReshaped.array(); let rawCoords = await coordsReshaped.array();
tfjs_esm_exports.dispose([contourCoords, coordsReshaped, confidence, contours]); tfjs_esm_exports.dispose([contourCoords, coordsReshaped, confidence, contours]);
if (face5.faceScore < (((_h = config3.face.detector) == null ? void 0 : _h.minConfidence) || 1)) { if (face5.faceScore < (((_g = config3.face.detector) == null ? void 0 : _g.minConfidence) || 1)) {
box5.confidence = face5.faceScore; box5.confidence = face5.faceScore;
} else { } else {
if ((_i = config3.face.iris) == null ? void 0 : _i.enabled) if ((_h = config3.face.iris) == null ? void 0 : _h.enabled)
rawCoords = await augmentIris(rawCoords, face5.tensor, config3, inputSize6); rawCoords = await augmentIris(rawCoords, face5.tensor, config3, inputSize6);
face5.mesh = transformRawCoords(rawCoords, box5, angle, rotationMatrix, inputSize6); face5.mesh = transformRawCoords(rawCoords, box5, angle, rotationMatrix, inputSize6);
face5.meshRaw = face5.mesh.map((pt) => [pt[0] / (input.shape[2] || 0), pt[1] / (input.shape[1] || 0), (pt[2] || 0) / inputSize6]); face5.meshRaw = face5.mesh.map((pt) => [pt[0] / (input.shape[2] || 0), pt[1] / (input.shape[1] || 0), (pt[2] || 0) / inputSize6]);
for (const key of Object.keys(meshAnnotations)) for (const key of Object.keys(meshAnnotations))
face5.annotations[key] = meshAnnotations[key].map((index2) => face5.mesh[index2]); face5.annotations[key] = meshAnnotations[key].map((index2) => face5.mesh[index2]);
const boxCalculated = calculateLandmarksBoundingBox(face5.mesh);
const boxEnlarged = enlargeBox(boxCalculated, ((_j = config3.face.detector) == null ? void 0 : _j.cropFactor) || 1.6);
const boxSquared = squarifyBox(boxEnlarged);
box5 = { ...boxSquared, confidence: box5.confidence };
face5.box = getClampedBox(box5, input);
face5.boxRaw = getRawBox(box5, input);
face5.score = face5.faceScore; face5.score = face5.faceScore;
newCache.push(box5); const calculatedBox = { ...calculateFaceBox(face5.mesh, box5), confidence: box5.confidence, landmarks: box5.landmarks };
tfjs_esm_exports.dispose(face5.tensor); face5.box = clampBox(calculatedBox, input);
[angle, rotationMatrix, face5.tensor] = correctFaceRotation((_k = config3.face.detector) == null ? void 0 : _k.rotation, box5, input, inputSize6); face5.boxRaw = getRawBox(calculatedBox, input);
newCache.push(calculatedBox);
} }
} }
faces.push(face5); faces.push(face5);
} }
boxCache = [...newCache]; cache3.boxes = newCache;
return faces; return faces;
} }
async function load11(config3) { async function load11(config3) {
@ -6063,9 +6071,9 @@ var uvmap = UV468;
// src/face/faceres.ts // src/face/faceres.ts
var model12; var model12;
var last8 = []; var last8 = [];
var lastTime11 = 0; var lastTime10 = 0;
var lastCount7 = 0; var lastCount7 = 0;
var skipped11 = Number.MAX_SAFE_INTEGER; var skipped10 = Number.MAX_SAFE_INTEGER;
async function load12(config3) { async function load12(config3) {
var _a, _b; var _a, _b;
const modelUrl = join(config3.modelBasePath, ((_a = config3.face.description) == null ? void 0 : _a.modelPath) || ""); const modelUrl = join(config3.modelBasePath, ((_a = config3.face.description) == null ? void 0 : _a.modelPath) || "");
@ -6094,13 +6102,13 @@ async function predict11(image29, config3, idx, count2) {
var _a, _b, _c, _d; var _a, _b, _c, _d;
if (!model12) if (!model12)
return { age: 0, gender: "unknown", genderScore: 0, descriptor: [] }; return { age: 0, gender: "unknown", genderScore: 0, descriptor: [] };
const skipFrame = skipped11 < (((_a = config3.face.description) == null ? void 0 : _a.skipFrames) || 0); const skipFrame = skipped10 < (((_a = config3.face.description) == null ? void 0 : _a.skipFrames) || 0);
const skipTime = (((_b = config3.face.description) == null ? void 0 : _b.skipTime) || 0) > now() - lastTime11; const skipTime = (((_b = config3.face.description) == null ? void 0 : _b.skipTime) || 0) > now() - lastTime10;
if (config3.skipAllowed && skipFrame && skipTime && lastCount7 === count2 && ((_c = last8[idx]) == null ? void 0 : _c.age) && ((_d = last8[idx]) == null ? void 0 : _d.age) > 0) { if (config3.skipAllowed && skipFrame && skipTime && lastCount7 === count2 && ((_c = last8[idx]) == null ? void 0 : _c.age) && ((_d = last8[idx]) == null ? void 0 : _d.age) > 0) {
skipped11++; skipped10++;
return last8[idx]; return last8[idx];
} }
skipped11 = 0; skipped10 = 0;
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
var _a2, _b2; var _a2, _b2;
const obj = { const obj = {
@ -6112,7 +6120,7 @@ async function predict11(image29, config3, idx, count2) {
if ((_a2 = config3.face.description) == null ? void 0 : _a2.enabled) { if ((_a2 = config3.face.description) == null ? void 0 : _a2.enabled) {
const enhanced = enhance2(image29); const enhanced = enhance2(image29);
const resT = model12 == null ? void 0 : model12.execute(enhanced); const resT = model12 == null ? void 0 : model12.execute(enhanced);
lastTime11 = now(); lastTime10 = now();
tfjs_esm_exports.dispose(enhanced); tfjs_esm_exports.dispose(enhanced);
const genderT = await resT.find((t) => t.shape[1] === 1); const genderT = await resT.find((t) => t.shape[1] === 1);
const gender = await genderT.data(); const gender = await genderT.data();
@ -6151,7 +6159,7 @@ function getBoxCenter2(box5) {
box5.startPoint[1] + (box5.endPoint[1] - box5.startPoint[1]) / 2 box5.startPoint[1] + (box5.endPoint[1] - box5.startPoint[1]) / 2
]; ];
} }
function cutBoxFromImageAndResize2(box5, image29, cropSize) { function cutBoxFromImageAndResize(box5, image29, cropSize) {
const h = image29.shape[1]; const h = image29.shape[1];
const w = image29.shape[2]; const w = image29.shape[2];
const boxes = [[ const boxes = [[
@ -9280,7 +9288,7 @@ var handBoxEnlargeFactor = 1.65;
var palmLandmarkIds = [0, 5, 9, 13, 17, 1, 2]; var palmLandmarkIds = [0, 5, 9, 13, 17, 1, 2];
var palmLandmarksPalmBase = 0; var palmLandmarksPalmBase = 0;
var palmLandmarksMiddleFingerBase = 2; var palmLandmarksMiddleFingerBase = 2;
var lastTime12 = 0; var lastTime11 = 0;
var HandPipeline = class { var HandPipeline = class {
constructor(handDetector, handPoseModel2) { constructor(handDetector, handPoseModel2) {
__publicField(this, "handDetector"); __publicField(this, "handDetector");
@ -9345,7 +9353,7 @@ var HandPipeline = class {
async estimateHands(image29, config3) { async estimateHands(image29, config3) {
let useFreshBox = false; let useFreshBox = false;
let boxes; let boxes;
const skipTime = (config3.hand.skipTime || 0) > now() - lastTime12; const skipTime = (config3.hand.skipTime || 0) > now() - lastTime11;
const skipFrame = this.skipped < (config3.hand.skipFrames || 0); const skipFrame = this.skipped < (config3.hand.skipFrames || 0);
if (config3.skipAllowed && skipTime && skipFrame) { if (config3.skipAllowed && skipTime && skipFrame) {
boxes = await this.handDetector.predict(image29, config3); boxes = await this.handDetector.predict(image29, config3);
@ -9371,12 +9379,12 @@ var HandPipeline = class {
const rotatedImage = config3.hand.rotation && env.kernels.includes("rotatewithoffset") ? tfjs_esm_exports.image.rotateWithOffset(image29, angle, 0, palmCenterNormalized) : image29.clone(); const rotatedImage = config3.hand.rotation && env.kernels.includes("rotatewithoffset") ? tfjs_esm_exports.image.rotateWithOffset(image29, angle, 0, palmCenterNormalized) : image29.clone();
const rotationMatrix = buildRotationMatrix2(-angle, palmCenter); const rotationMatrix = buildRotationMatrix2(-angle, palmCenter);
const newBox = useFreshBox ? this.getBoxForPalmLandmarks(currentBox.palmLandmarks, rotationMatrix) : currentBox; const newBox = useFreshBox ? this.getBoxForPalmLandmarks(currentBox.palmLandmarks, rotationMatrix) : currentBox;
const croppedInput = cutBoxFromImageAndResize2(newBox, rotatedImage, [this.inputSize, this.inputSize]); const croppedInput = cutBoxFromImageAndResize(newBox, rotatedImage, [this.inputSize, this.inputSize]);
const handImage = tfjs_esm_exports.div(croppedInput, constants.tf255); const handImage = tfjs_esm_exports.div(croppedInput, constants.tf255);
tfjs_esm_exports.dispose(croppedInput); tfjs_esm_exports.dispose(croppedInput);
tfjs_esm_exports.dispose(rotatedImage); tfjs_esm_exports.dispose(rotatedImage);
const [confidenceT, keypoints] = this.handPoseModel.execute(handImage); const [confidenceT, keypoints] = this.handPoseModel.execute(handImage);
lastTime12 = now(); lastTime11 = now();
tfjs_esm_exports.dispose(handImage); tfjs_esm_exports.dispose(handImage);
const confidence = (await confidenceT.data())[0]; const confidence = (await confidenceT.data())[0];
tfjs_esm_exports.dispose(confidenceT); tfjs_esm_exports.dispose(confidenceT);
@ -9935,10 +9943,10 @@ var faceIndex = 4;
var boxExpandFact = 1.6; var boxExpandFact = 1.6;
var maxDetectorResolution = 512; var maxDetectorResolution = 512;
var detectorExpandFact = 1.4; var detectorExpandFact = 1.4;
var skipped12 = Number.MAX_SAFE_INTEGER; var skipped11 = Number.MAX_SAFE_INTEGER;
var lastTime13 = 0; var lastTime12 = 0;
var outputSize = [0, 0]; var outputSize = [0, 0];
var cache3 = { var cache4 = {
boxes: [], boxes: [],
hands: [] hands: []
}; };
@ -10074,53 +10082,53 @@ async function predict13(input, config3) {
if (!models2[0] || !models2[1] || !((_a = models2[0]) == null ? void 0 : _a.inputs[0].shape) || !((_b = models2[1]) == null ? void 0 : _b.inputs[0].shape)) if (!models2[0] || !models2[1] || !((_a = models2[0]) == null ? void 0 : _a.inputs[0].shape) || !((_b = models2[1]) == null ? void 0 : _b.inputs[0].shape))
return []; return [];
outputSize = [input.shape[2] || 0, input.shape[1] || 0]; outputSize = [input.shape[2] || 0, input.shape[1] || 0];
skipped12++; skipped11++;
const skipTime = (config3.hand.skipTime || 0) > now() - lastTime13; const skipTime = (config3.hand.skipTime || 0) > now() - lastTime12;
const skipFrame = skipped12 < (config3.hand.skipFrames || 0); const skipFrame = skipped11 < (config3.hand.skipFrames || 0);
if (config3.skipAllowed && skipTime && skipFrame) { if (config3.skipAllowed && skipTime && skipFrame) {
return cache3.hands; return cache4.hands;
} }
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
const skipTimeExtended = 3 * (config3.hand.skipTime || 0) > now() - lastTime13; const skipTimeExtended = 3 * (config3.hand.skipTime || 0) > now() - lastTime12;
const skipFrameExtended = skipped12 < 3 * (config3.hand.skipFrames || 0); const skipFrameExtended = skipped11 < 3 * (config3.hand.skipFrames || 0);
if (config3.skipAllowed && cache3.hands.length === config3.hand.maxDetected) { if (config3.skipAllowed && cache4.hands.length === config3.hand.maxDetected) {
cache3.hands = await Promise.all(cache3.boxes.map((handBox) => detectFingers(input, handBox, config3))); cache4.hands = await Promise.all(cache4.boxes.map((handBox) => detectFingers(input, handBox, config3)));
} else if (config3.skipAllowed && skipTimeExtended && skipFrameExtended && cache3.hands.length > 0) { } else if (config3.skipAllowed && skipTimeExtended && skipFrameExtended && cache4.hands.length > 0) {
cache3.hands = await Promise.all(cache3.boxes.map((handBox) => detectFingers(input, handBox, config3))); cache4.hands = await Promise.all(cache4.boxes.map((handBox) => detectFingers(input, handBox, config3)));
} else { } else {
cache3.boxes = await detectHands(input, config3); cache4.boxes = await detectHands(input, config3);
lastTime13 = now(); lastTime12 = now();
cache3.hands = await Promise.all(cache3.boxes.map((handBox) => detectFingers(input, handBox, config3))); cache4.hands = await Promise.all(cache4.boxes.map((handBox) => detectFingers(input, handBox, config3)));
skipped12 = 0; skipped11 = 0;
} }
const oldCache = [...cache3.boxes]; const oldCache = [...cache4.boxes];
cache3.boxes.length = 0; cache4.boxes.length = 0;
if (config3.cacheSensitivity > 0) { if (config3.cacheSensitivity > 0) {
for (let i = 0; i < cache3.hands.length; i++) { for (let i = 0; i < cache4.hands.length; i++) {
const boxKpt = square(cache3.hands[i].keypoints, outputSize); const boxKpt = square(cache4.hands[i].keypoints, outputSize);
if (boxKpt.box[2] / (input.shape[2] || 1) > 0.05 && boxKpt.box[3] / (input.shape[1] || 1) > 0.05 && cache3.hands[i].fingerScore && cache3.hands[i].fingerScore > (config3.hand.minConfidence || 0)) { if (boxKpt.box[2] / (input.shape[2] || 1) > 0.05 && boxKpt.box[3] / (input.shape[1] || 1) > 0.05 && cache4.hands[i].fingerScore && cache4.hands[i].fingerScore > (config3.hand.minConfidence || 0)) {
const boxScale = scale(boxKpt.box, boxExpandFact); const boxScale = scale(boxKpt.box, boxExpandFact);
const boxScaleRaw = scale(boxKpt.boxRaw, boxExpandFact); const boxScaleRaw = scale(boxKpt.boxRaw, boxExpandFact);
const boxCrop = crop(boxScaleRaw); const boxCrop = crop(boxScaleRaw);
cache3.boxes.push({ ...oldCache[i], box: boxScale, boxRaw: boxScaleRaw, boxCrop }); cache4.boxes.push({ ...oldCache[i], box: boxScale, boxRaw: boxScaleRaw, boxCrop });
} }
} }
} }
for (let i = 0; i < cache3.hands.length; i++) { for (let i = 0; i < cache4.hands.length; i++) {
const bbox = calc(cache3.hands[i].keypoints, outputSize); const bbox = calc(cache4.hands[i].keypoints, outputSize);
cache3.hands[i].box = bbox.box; cache4.hands[i].box = bbox.box;
cache3.hands[i].boxRaw = bbox.boxRaw; cache4.hands[i].boxRaw = bbox.boxRaw;
} }
resolve(cache3.hands); resolve(cache4.hands);
}); });
} }
// src/face/liveness.ts // src/face/liveness.ts
var model13; var model13;
var cached2 = []; var cached2 = [];
var skipped13 = Number.MAX_SAFE_INTEGER; var skipped12 = Number.MAX_SAFE_INTEGER;
var lastCount8 = 0; var lastCount8 = 0;
var lastTime14 = 0; var lastTime13 = 0;
async function load14(config3) { async function load14(config3) {
var _a, _b; var _a, _b;
if (env.initial) if (env.initial)
@ -10139,20 +10147,20 @@ async function predict14(image29, config3, idx, count2) {
var _a, _b; var _a, _b;
if (!model13) if (!model13)
return 0; return 0;
const skipTime = (((_a = config3.face.liveness) == null ? void 0 : _a.skipTime) || 0) > now() - lastTime14; const skipTime = (((_a = config3.face.liveness) == null ? void 0 : _a.skipTime) || 0) > now() - lastTime13;
const skipFrame = skipped13 < (((_b = config3.face.liveness) == null ? void 0 : _b.skipFrames) || 0); const skipFrame = skipped12 < (((_b = config3.face.liveness) == null ? void 0 : _b.skipFrames) || 0);
if (config3.skipAllowed && skipTime && skipFrame && lastCount8 === count2 && cached2[idx]) { if (config3.skipAllowed && skipTime && skipFrame && lastCount8 === count2 && cached2[idx]) {
skipped13++; skipped12++;
return cached2[idx]; return cached2[idx];
} }
skipped13 = 0; skipped12 = 0;
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
const resize = tfjs_esm_exports.image.resizeBilinear(image29, [(model13 == null ? void 0 : model13.inputs[0].shape) ? model13.inputs[0].shape[2] : 0, (model13 == null ? void 0 : model13.inputs[0].shape) ? model13.inputs[0].shape[1] : 0], false); const resize = tfjs_esm_exports.image.resizeBilinear(image29, [(model13 == null ? void 0 : model13.inputs[0].shape) ? model13.inputs[0].shape[2] : 0, (model13 == null ? void 0 : model13.inputs[0].shape) ? model13.inputs[0].shape[1] : 0], false);
const res = model13 == null ? void 0 : model13.execute(resize); const res = model13 == null ? void 0 : model13.execute(resize);
const num = (await res.data())[0]; const num = (await res.data())[0];
cached2[idx] = Math.round(100 * num) / 100; cached2[idx] = Math.round(100 * num) / 100;
lastCount8 = count2; lastCount8 = count2;
lastTime14 = now(); lastTime13 = now();
tfjs_esm_exports.dispose([resize, res]); tfjs_esm_exports.dispose([resize, res]);
resolve(cached2[idx]); resolve(cached2[idx]);
}); });
@ -10217,7 +10225,7 @@ var connected3 = {
// src/body/movenetfix.ts // src/body/movenetfix.ts
var maxJitter = 5e-3; var maxJitter = 5e-3;
var cache4 = { var cache5 = {
keypoints: [], keypoints: [],
padding: [[0, 0], [0, 0], [0, 0], [0, 0]] padding: [[0, 0], [0, 0], [0, 0], [0, 0]]
}; };
@ -10266,15 +10274,15 @@ function bodyParts(body4) {
} }
function jitter(keypoints) { function jitter(keypoints) {
for (let i = 0; i < keypoints.length; i++) { for (let i = 0; i < keypoints.length; i++) {
if (keypoints[i] && cache4.keypoints[i]) { if (keypoints[i] && cache5.keypoints[i]) {
const diff = [Math.abs(keypoints[i].positionRaw[0] - cache4.keypoints[i].positionRaw[0]), Math.abs(keypoints[i].positionRaw[1] - cache4.keypoints[i].positionRaw[1])]; const diff = [Math.abs(keypoints[i].positionRaw[0] - cache5.keypoints[i].positionRaw[0]), Math.abs(keypoints[i].positionRaw[1] - cache5.keypoints[i].positionRaw[1])];
if (diff[0] < maxJitter && diff[1] < maxJitter) { if (diff[0] < maxJitter && diff[1] < maxJitter) {
keypoints[i] = cache4.keypoints[i]; keypoints[i] = cache5.keypoints[i];
} else { } else {
cache4.keypoints[i] = keypoints[i]; cache5.keypoints[i] = keypoints[i];
} }
} else { } else {
cache4.keypoints[i] = keypoints[i]; cache5.keypoints[i] = keypoints[i];
} }
} }
return keypoints; return keypoints;
@ -10283,13 +10291,13 @@ function padInput(input, inputSize9) {
const t = {}; const t = {};
if (!input.shape || !input.shape[1] || !input.shape[2]) if (!input.shape || !input.shape[1] || !input.shape[2])
return input; return input;
cache4.padding = [ cache5.padding = [
[0, 0], [0, 0],
[input.shape[2] > input.shape[1] ? Math.trunc((input.shape[2] - input.shape[1]) / 2) : 0, input.shape[2] > input.shape[1] ? Math.trunc((input.shape[2] - input.shape[1]) / 2) : 0], [input.shape[2] > input.shape[1] ? Math.trunc((input.shape[2] - input.shape[1]) / 2) : 0, input.shape[2] > input.shape[1] ? Math.trunc((input.shape[2] - input.shape[1]) / 2) : 0],
[input.shape[1] > input.shape[2] ? Math.trunc((input.shape[1] - input.shape[2]) / 2) : 0, input.shape[1] > input.shape[2] ? Math.trunc((input.shape[1] - input.shape[2]) / 2) : 0], [input.shape[1] > input.shape[2] ? Math.trunc((input.shape[1] - input.shape[2]) / 2) : 0, input.shape[1] > input.shape[2] ? Math.trunc((input.shape[1] - input.shape[2]) / 2) : 0],
[0, 0] [0, 0]
]; ];
t.pad = tfjs_esm_exports.pad(input, cache4.padding); 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, [inputSize9, inputSize9]);
const final = tfjs_esm_exports.cast(t.resize, "int32"); const final = tfjs_esm_exports.cast(t.resize, "int32");
Object.keys(t).forEach((tensor3) => tfjs_esm_exports.dispose(t[tensor3])); Object.keys(t).forEach((tensor3) => tfjs_esm_exports.dispose(t[tensor3]));
@ -10299,8 +10307,8 @@ function rescaleBody(body4, outputSize2) {
body4.keypoints = body4.keypoints.filter((kpt4) => kpt4 && kpt4.position); body4.keypoints = body4.keypoints.filter((kpt4) => kpt4 && kpt4.position);
for (const kpt4 of body4.keypoints) { for (const kpt4 of body4.keypoints) {
kpt4.position = [ kpt4.position = [
kpt4.position[0] * (outputSize2[0] + cache4.padding[2][0] + cache4.padding[2][1]) / outputSize2[0] - cache4.padding[2][0], kpt4.position[0] * (outputSize2[0] + cache5.padding[2][0] + cache5.padding[2][1]) / outputSize2[0] - cache5.padding[2][0],
kpt4.position[1] * (outputSize2[1] + cache4.padding[1][0] + cache4.padding[1][1]) / outputSize2[1] - cache4.padding[1][0] kpt4.position[1] * (outputSize2[1] + cache5.padding[1][0] + cache5.padding[1][1]) / outputSize2[1] - cache5.padding[1][0]
]; ];
kpt4.positionRaw = [ kpt4.positionRaw = [
kpt4.position[0] / outputSize2[0], kpt4.position[0] / outputSize2[0],
@ -10316,8 +10324,8 @@ function rescaleBody(body4, outputSize2) {
// src/body/movenet.ts // src/body/movenet.ts
var model14; var model14;
var inputSize8 = 0; var inputSize8 = 0;
var skipped14 = Number.MAX_SAFE_INTEGER; var skipped13 = Number.MAX_SAFE_INTEGER;
var cache5 = { var cache6 = {
boxes: [], boxes: [],
bodies: [], bodies: [],
last: 0 last: 0
@ -10420,35 +10428,35 @@ async function predict15(input, config3) {
if (!model14 || !(model14 == null ? void 0 : model14.inputs[0].shape)) if (!model14 || !(model14 == null ? void 0 : model14.inputs[0].shape))
return []; return [];
if (!config3.skipAllowed) if (!config3.skipAllowed)
cache5.boxes.length = 0; cache6.boxes.length = 0;
skipped14++; skipped13++;
const skipTime = (config3.body.skipTime || 0) > now() - cache5.last; const skipTime = (config3.body.skipTime || 0) > now() - cache6.last;
const skipFrame = skipped14 < (config3.body.skipFrames || 0); const skipFrame = skipped13 < (config3.body.skipFrames || 0);
if (config3.skipAllowed && skipTime && skipFrame) { if (config3.skipAllowed && skipTime && skipFrame) {
return cache5.bodies; return cache6.bodies;
} }
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
const t = {}; const t = {};
skipped14 = 0; skipped13 = 0;
t.input = padInput(input, inputSize8); t.input = padInput(input, inputSize8);
t.res = model14 == null ? void 0 : model14.execute(t.input); t.res = model14 == null ? void 0 : model14.execute(t.input);
cache5.last = now(); cache6.last = now();
const res = await t.res.array(); const res = await t.res.array();
cache5.bodies = t.res.shape[2] === 17 ? await parseSinglePose(res, config3, input) : await parseMultiPose(res, config3, input); cache6.bodies = t.res.shape[2] === 17 ? await parseSinglePose(res, config3, input) : await parseMultiPose(res, config3, input);
for (const body4 of cache5.bodies) { for (const body4 of cache6.bodies) {
rescaleBody(body4, [input.shape[2] || 1, input.shape[1] || 1]); rescaleBody(body4, [input.shape[2] || 1, input.shape[1] || 1]);
jitter(body4.keypoints); jitter(body4.keypoints);
} }
Object.keys(t).forEach((tensor3) => tfjs_esm_exports.dispose(t[tensor3])); Object.keys(t).forEach((tensor3) => tfjs_esm_exports.dispose(t[tensor3]));
resolve(cache5.bodies); resolve(cache6.bodies);
}); });
} }
// src/object/nanodet.ts // src/object/nanodet.ts
var model15; var model15;
var last9 = []; var last9 = [];
var lastTime15 = 0; var lastTime14 = 0;
var skipped15 = Number.MAX_SAFE_INTEGER; var skipped14 = Number.MAX_SAFE_INTEGER;
var scaleBox = 2.5; var scaleBox = 2.5;
async function load16(config3) { async function load16(config3) {
if (!model15 || env.initial) { if (!model15 || env.initial) {
@ -10525,13 +10533,13 @@ async function process4(res, inputSize9, outputShape, config3) {
return results; return results;
} }
async function predict16(image29, config3) { async function predict16(image29, config3) {
const skipTime = (config3.object.skipTime || 0) > now() - lastTime15; const skipTime = (config3.object.skipTime || 0) > now() - lastTime14;
const skipFrame = skipped15 < (config3.object.skipFrames || 0); const skipFrame = skipped14 < (config3.object.skipFrames || 0);
if (config3.skipAllowed && skipTime && skipFrame && last9.length > 0) { if (config3.skipAllowed && skipTime && skipFrame && last9.length > 0) {
skipped15++; skipped14++;
return last9; return last9;
} }
skipped15 = 0; skipped14 = 0;
if (!env.kernels.includes("mod") || !env.kernels.includes("sparsetodense")) if (!env.kernels.includes("mod") || !env.kernels.includes("sparsetodense"))
return last9; return last9;
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
@ -10544,7 +10552,7 @@ async function predict16(image29, config3) {
let objectT; let objectT;
if (config3.object.enabled) if (config3.object.enabled)
objectT = model15.execute(transpose); objectT = model15.execute(transpose);
lastTime15 = now(); lastTime14 = now();
tfjs_esm_exports.dispose(transpose); tfjs_esm_exports.dispose(transpose);
const obj = await process4(objectT, model15.inputSize, outputSize2, config3); const obj = await process4(objectT, model15.inputSize, outputSize2, config3);
last9 = obj; last9 = obj;
@ -11067,41 +11075,29 @@ async function load19(instance) {
async function validate2(instance) { async function validate2(instance) {
const simpleOps = ["const", "placeholder", "noop", "pad", "squeeze", "add", "sub", "mul", "div"]; const simpleOps = ["const", "placeholder", "noop", "pad", "squeeze", "add", "sub", "mul", "div"];
for (const defined of Object.keys(instance.models)) { for (const defined of Object.keys(instance.models)) {
if (instance.models[defined]) { const model18 = instance.models[defined];
let models5 = []; if (!model18)
if (Array.isArray(instance.models[defined])) { continue;
models5 = instance.models[defined].filter((model18) => model18 !== null).map((model18) => model18 && model18.executor ? model18 : model18.model); const ops = [];
} else { const executor = model18 == null ? void 0 : model18.executor;
models5 = [instance.models[defined]]; if (executor && executor.graph.nodes) {
for (const kernel of Object.values(executor.graph.nodes)) {
const op = kernel.op.toLowerCase();
if (!ops.includes(op))
ops.push(op);
} }
for (const model18 of models5) { } else {
if (!model18) { if (!executor && instance.config.debug)
if (instance.config.debug) log("model signature not determined:", defined);
log("model marked as loaded but not defined:", defined); }
continue; const missing = [];
} for (const op of ops) {
const ops = []; if (!simpleOps.includes(op) && !instance.env.kernels.includes(op) && !instance.env.kernels.includes(op.replace("_", "")) && !instance.env.kernels.includes(op.replace("native", "")) && !instance.env.kernels.includes(op.replace("v2", ""))) {
const executor = model18 == null ? void 0 : model18.executor; missing.push(op);
if (executor && executor.graph.nodes) {
for (const kernel of Object.values(executor.graph.nodes)) {
const op = kernel.op.toLowerCase();
if (!ops.includes(op))
ops.push(op);
}
} else {
if (!executor && instance.config.debug)
log("model signature not determined:", defined);
}
const missing = [];
for (const op of ops) {
if (!simpleOps.includes(op) && !instance.env.kernels.includes(op) && !instance.env.kernels.includes(op.replace("_", "")) && !instance.env.kernels.includes(op.replace("native", "")) && !instance.env.kernels.includes(op.replace("v2", ""))) {
missing.push(op);
}
}
if (missing.length > 0 && instance.config.debug)
log("model validation:", defined, missing);
} }
} }
if (instance.config.debug && missing.length > 0)
log("model validation failed:", defined, missing);
} }
} }
@ -11383,12 +11379,12 @@ function point(ctx, x, y, z, localOptions) {
} }
function rect(ctx, x, y, width, height, localOptions) { function rect(ctx, x, y, width, height, localOptions) {
ctx.beginPath(); ctx.beginPath();
ctx.lineWidth = localOptions.lineWidth;
if (localOptions.useCurves) { if (localOptions.useCurves) {
const cx = (x + x + width) / 2; const cx = (x + x + width) / 2;
const cy = (y + y + height) / 2; const cy = (y + y + height) / 2;
ctx.ellipse(cx, cy, width / 2, height / 2, 0, 0, 2 * Math.PI); ctx.ellipse(cx, cy, width / 2, height / 2, 0, 0, 2 * Math.PI);
} else { } else {
ctx.lineWidth = localOptions.lineWidth;
ctx.moveTo(x + localOptions.roundRect, y); ctx.moveTo(x + localOptions.roundRect, y);
ctx.lineTo(x + width - localOptions.roundRect, y); ctx.lineTo(x + width - localOptions.roundRect, y);
ctx.quadraticCurveTo(x + width, y, x + width, y + localOptions.roundRect); ctx.quadraticCurveTo(x + width, y, x + width, y + localOptions.roundRect);
@ -11422,6 +11418,7 @@ function lines(ctx, points, localOptions) {
function curves(ctx, points, localOptions) { function curves(ctx, points, localOptions) {
if (points.length < 2) if (points.length < 2)
return; return;
ctx.lineWidth = localOptions.lineWidth;
if (!localOptions.useCurves || points.length <= 2) { if (!localOptions.useCurves || points.length <= 2) {
lines(ctx, points, localOptions); lines(ctx, points, localOptions);
return; return;
@ -11544,14 +11541,13 @@ async function face(inCanvas2, result, drawOptions) {
ctx.fillText(labels2[i], x + 4, y + 15); ctx.fillText(labels2[i], x + 4, y + 15);
} }
} }
ctx.lineWidth = 1; ctx.lineWidth = 2;
if (f.mesh && f.mesh.length > 0) { if (f.mesh && f.mesh.length > 0) {
if (localOptions.drawPoints) { if (localOptions.drawPoints) {
for (const pt of f.mesh) for (const pt of f.mesh)
point(ctx, pt[0], pt[1], pt[2], localOptions); point(ctx, pt[0], pt[1], pt[2], localOptions);
} }
if (localOptions.drawPolygons) { if (localOptions.drawPolygons) {
ctx.lineWidth = 1;
if (f.mesh.length > 450) { if (f.mesh.length > 450) {
for (let i = 0; i < TRI468.length / 3; i++) { for (let i = 0; i < TRI468.length / 3; i++) {
const points = [ const points = [
@ -11711,7 +11707,8 @@ async function hand(inCanvas2, result, drawOptions) {
const addHandLabel = (part, title) => { const addHandLabel = (part, title) => {
if (!part || part.length === 0 || !part[0]) if (!part || part.length === 0 || !part[0])
return; return;
ctx.fillStyle = localOptions.useDepth ? `rgba(${127.5 + 2 * part[part.length - 1][2]}, ${127.5 - 2 * part[part.length - 1][2]}, 255, 0.5)` : localOptions.color; const z = part[part.length - 1][2] || 0;
ctx.fillStyle = localOptions.useDepth ? `rgba(${127.5 + 2 * z}, ${127.5 - 2 * z}, 255, 0.5)` : localOptions.color;
ctx.fillText(title, part[part.length - 1][0] + 4, part[part.length - 1][1] + 4); ctx.fillText(title, part[part.length - 1][0] + 4, part[part.length - 1][1] + 4);
}; };
ctx.font = localOptions.font; ctx.font = localOptions.font;
@ -11728,7 +11725,8 @@ async function hand(inCanvas2, result, drawOptions) {
return; return;
for (let i = 0; i < part.length; i++) { for (let i = 0; i < part.length; i++) {
ctx.beginPath(); ctx.beginPath();
ctx.strokeStyle = localOptions.useDepth ? `rgba(${127.5 + i * part[i][2]}, ${127.5 - i * part[i][2]}, 255, 0.5)` : localOptions.color; const z = part[i][2] || 0;
ctx.strokeStyle = localOptions.useDepth ? `rgba(${127.5 + i * z}, ${127.5 - i * z}, 255, 0.5)` : localOptions.color;
ctx.moveTo(part[i > 0 ? i - 1 : 0][0], part[i > 0 ? i - 1 : 0][1]); ctx.moveTo(part[i > 0 ? i - 1 : 0][0], part[i > 0 ? i - 1 : 0][1]);
ctx.lineTo(part[i][0], part[i][1]); ctx.lineTo(part[i][0], part[i][1]);
ctx.stroke(); ctx.stroke();
@ -11903,7 +11901,7 @@ var calculateFaceAngle = (face5, imageSize) => {
return [x, y, z]; return [x, y, z];
}; };
const rotationMatrixToEulerAngle = (r) => { const rotationMatrixToEulerAngle = (r) => {
const [r00, r01, r02, r10, r11, r12, r20, r21, r22] = r; const [r00, _r01, _r02, r10, r11, r12, r20, r21, r22] = r;
let thetaX; let thetaX;
let thetaY; let thetaY;
let thetaZ; let thetaZ;
@ -11930,24 +11928,11 @@ var calculateFaceAngle = (face5, imageSize) => {
thetaZ = 0; thetaZ = 0;
return { pitch: 2 * -thetaX, yaw: 2 * -thetaY, roll: 2 * -thetaZ }; return { pitch: 2 * -thetaX, yaw: 2 * -thetaY, roll: 2 * -thetaZ };
}; };
const meshToEulerAngle = (mesh2) => {
const radians = (a1, a2, b1, b2) => Math.atan2(b2 - a2, b1 - a1);
const angle2 = {
pitch: radians(mesh2[10][1], mesh2[10][2], mesh2[152][1], mesh2[152][2]),
yaw: radians(mesh2[33][0], mesh2[33][2], mesh2[263][0], mesh2[263][2]),
roll: radians(mesh2[33][0], mesh2[33][1], mesh2[263][0], mesh2[263][1])
};
return angle2;
};
const mesh = face5.meshRaw; const mesh = face5.meshRaw;
if (!mesh || mesh.length < 300) if (!mesh || mesh.length < 300)
return { angle: { pitch: 0, yaw: 0, roll: 0 }, matrix: [1, 0, 0, 0, 1, 0, 0, 0, 1], gaze: { bearing: 0, strength: 0 } }; return { angle: { pitch: 0, yaw: 0, roll: 0 }, matrix: [1, 0, 0, 0, 1, 0, 0, 0, 1], gaze: { bearing: 0, strength: 0 } };
const size2 = Math.max(face5.boxRaw[2] * imageSize[0], face5.boxRaw[3] * imageSize[1]) / 1.5; const size2 = Math.max(face5.boxRaw[2] * imageSize[0], face5.boxRaw[3] * imageSize[1]) / 1.5;
const pts = [mesh[10], mesh[152], mesh[234], mesh[454]].map((pt) => [ const pts = [mesh[10], mesh[152], mesh[234], mesh[454]].map((pt) => [pt[0] * imageSize[0] / size2, pt[1] * imageSize[1] / size2, pt[2]]);
pt[0] * imageSize[0] / size2,
pt[1] * imageSize[1] / size2,
pt[2]
]);
const y_axis = normalize(subVectors(pts[1], pts[0])); const y_axis = normalize(subVectors(pts[1], pts[0]));
let x_axis = normalize(subVectors(pts[3], pts[2])); let x_axis = normalize(subVectors(pts[3], pts[2]));
const z_axis = normalize(crossVectors(x_axis, y_axis)); const z_axis = normalize(crossVectors(x_axis, y_axis));
@ -13250,7 +13235,7 @@ async function warmupCanvas(instance) {
const canvas3 = canvas(img.naturalWidth, img.naturalHeight); const canvas3 = canvas(img.naturalWidth, img.naturalHeight);
if (!canvas3) { if (!canvas3) {
log("Warmup: Canvas not found"); log("Warmup: Canvas not found");
resolve({}); resolve(void 0);
} else { } else {
const ctx = canvas3.getContext("2d"); const ctx = canvas3.getContext("2d");
if (ctx) if (ctx)
@ -13263,7 +13248,7 @@ async function warmupCanvas(instance) {
if (src) if (src)
img.src = src; img.src = src;
else else
resolve(null); resolve(void 0);
}); });
} }
async function warmupNode(instance) { async function warmupNode(instance) {
@ -13271,12 +13256,10 @@ async function warmupNode(instance) {
let img; let img;
if (instance.config.warmup === "face") if (instance.config.warmup === "face")
img = atob(face3); img = atob(face3);
if (instance.config.warmup === "body" || instance.config.warmup === "full") else
img = atob(body3); img = atob(body3);
if (!img)
return null;
let res; let res;
if (typeof tfjs_esm_exports["node"] !== "undefined") { if ("node" in tfjs_esm_exports) {
const data = tfjs_esm_exports["node"].decodeJpeg(img); const data = tfjs_esm_exports["node"].decodeJpeg(img);
const expanded = data.expandDims(0); const expanded = data.expandDims(0);
instance.tf.dispose(data); instance.tf.dispose(data);

File diff suppressed because one or more lines are too long

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

@ -137,7 +137,7 @@ declare function browserFiles(files: File[]): IOHandler;
declare function browserHTTPRequest(path: string, loadOptions?: LoadOptions): IOHandler; declare function browserHTTPRequest(path: string, loadOptions?: LoadOptions): IOHandler;
/** draw processed canvas */ /** draw processed canvas */
declare function canvas(input: AnyCanvas | HTMLImageElement | HTMLMediaElement | HTMLVideoElement, output: AnyCanvas): Promise<void>; declare function canvas(input: AnyCanvas | HTMLImageElement | HTMLVideoElement, output: AnyCanvas): Promise<void>;
/** /**
* Concatenate a number of ArrayBuffers into one. * Concatenate a number of ArrayBuffers into one.
@ -512,12 +512,6 @@ export declare interface FaceDetectorConfig extends GenericConfig {
minConfidence: number; minConfidence: number;
/** minimum overlap between two detected faces before one is discarded */ /** minimum overlap between two detected faces before one is discarded */
iouThreshold: number; iouThreshold: number;
/** factor used to expand detected face before further analysis
* - default: 1.6
* - for high-quality inputs can be reduced to increase precision
* - for video inputs or low-quality inputs can be increased to allow for more flexible tracking
*/
cropFactor: number;
/** should child models perform on masked image of a face */ /** should child models perform on masked image of a face */
mask: boolean; mask: boolean;
/** should face detection return face tensor to be used in some other extenrnal model? */ /** should face detection return face tensor to be used in some other extenrnal model? */
@ -1249,7 +1243,7 @@ declare class Human {
* @param userConfig - {@link Config} * @param userConfig - {@link Config}
* @returns result - {@link Result} * @returns result - {@link Result}
*/ */
warmup(userConfig?: Partial<Config>): Promise<Result>; warmup(userConfig?: Partial<Config>): Promise<Result | undefined>;
/** Run detect with tensorflow profiling /** Run detect with tensorflow profiling
* - result object will contain total exeuction time information for top-20 kernels * - result object will contain total exeuction time information for top-20 kernels
* - actual detection object can be accessed via `human.result` * - actual detection object can be accessed via `human.result`

1881
dist/human.esm.js vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

796
dist/human.js vendored

File diff suppressed because one or more lines are too long

View File

@ -137,7 +137,7 @@ declare function browserFiles(files: File[]): IOHandler;
declare function browserHTTPRequest(path: string, loadOptions?: LoadOptions): IOHandler; declare function browserHTTPRequest(path: string, loadOptions?: LoadOptions): IOHandler;
/** draw processed canvas */ /** draw processed canvas */
declare function canvas(input: AnyCanvas | HTMLImageElement | HTMLMediaElement | HTMLVideoElement, output: AnyCanvas): Promise<void>; declare function canvas(input: AnyCanvas | HTMLImageElement | HTMLVideoElement, output: AnyCanvas): Promise<void>;
/** /**
* Concatenate a number of ArrayBuffers into one. * Concatenate a number of ArrayBuffers into one.
@ -512,12 +512,6 @@ export declare interface FaceDetectorConfig extends GenericConfig {
minConfidence: number; minConfidence: number;
/** minimum overlap between two detected faces before one is discarded */ /** minimum overlap between two detected faces before one is discarded */
iouThreshold: number; iouThreshold: number;
/** factor used to expand detected face before further analysis
* - default: 1.6
* - for high-quality inputs can be reduced to increase precision
* - for video inputs or low-quality inputs can be increased to allow for more flexible tracking
*/
cropFactor: number;
/** should child models perform on masked image of a face */ /** should child models perform on masked image of a face */
mask: boolean; mask: boolean;
/** should face detection return face tensor to be used in some other extenrnal model? */ /** should face detection return face tensor to be used in some other extenrnal model? */
@ -1249,7 +1243,7 @@ declare class Human {
* @param userConfig - {@link Config} * @param userConfig - {@link Config}
* @returns result - {@link Result} * @returns result - {@link Result}
*/ */
warmup(userConfig?: Partial<Config>): Promise<Result>; warmup(userConfig?: Partial<Config>): Promise<Result | undefined>;
/** Run detect with tensorflow profiling /** Run detect with tensorflow profiling
* - result object will contain total exeuction time information for top-20 kernels * - result object will contain total exeuction time information for top-20 kernels
* - actual detection object can be accessed via `human.result` * - actual detection object can be accessed via `human.result`

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

@ -187,7 +187,6 @@ var config = {
skipTime: 2500, skipTime: 2500,
minConfidence: 0.2, minConfidence: 0.2,
iouThreshold: 0.1, iouThreshold: 0.1,
cropFactor: 1.6,
mask: false, mask: false,
return: false return: false
}, },
@ -1236,7 +1235,7 @@ async function skip(config3, input) {
const diffRelative = diffSum[0] / (input.shape[1] || 1) / (input.shape[2] || 1) / 255 / 3; const diffRelative = diffSum[0] / (input.shape[1] || 1) / (input.shape[2] || 1) / 255 / 3;
tf2.dispose([last.inputTensor, t.diff, t.squared, t.sum]); tf2.dispose([last.inputTensor, t.diff, t.squared, t.sum]);
last.inputTensor = tf2.clone(input); last.inputTensor = tf2.clone(input);
skipFrame = diffRelative <= config3.cacheSensitivity; skipFrame = diffRelative <= (config3.cacheSensitivity || 0);
} }
return skipFrame; return skipFrame;
} }
@ -1371,7 +1370,7 @@ var env = new Env();
var tf36 = __toModule(require_tfjs_esm()); var tf36 = __toModule(require_tfjs_esm());
// package.json // package.json
var version2 = "2.5.6"; var version2 = "2.5.7";
// src/tfjs/humangl.ts // src/tfjs/humangl.ts
var tf31 = __toModule(require_tfjs_esm()); var tf31 = __toModule(require_tfjs_esm());
@ -4912,8 +4911,8 @@ var UV7 = VTX7.map((x) => UV468[x]);
// src/face/facemeshutil.ts // src/face/facemeshutil.ts
var getBoxSize = (box5) => [Math.abs(box5.endPoint[0] - box5.startPoint[0]), Math.abs(box5.endPoint[1] - box5.startPoint[1])]; var getBoxSize = (box5) => [Math.abs(box5.endPoint[0] - box5.startPoint[0]), Math.abs(box5.endPoint[1] - box5.startPoint[1])];
var getBoxCenter = (box5) => [box5.startPoint[0] + (box5.endPoint[0] - box5.startPoint[0]) / 2, box5.startPoint[1] + (box5.endPoint[1] - box5.startPoint[1]) / 2]; var getBoxCenter = (box5) => [box5.startPoint[0] + (box5.endPoint[0] - box5.startPoint[0]) / 2, box5.startPoint[1] + (box5.endPoint[1] - box5.startPoint[1]) / 2, 1];
var getClampedBox = (box5, input) => box5 ? [ var clampBox = (box5, input) => box5 ? [
Math.trunc(Math.max(0, box5.startPoint[0])), Math.trunc(Math.max(0, box5.startPoint[0])),
Math.trunc(Math.max(0, box5.startPoint[1])), Math.trunc(Math.max(0, box5.startPoint[1])),
Math.trunc(Math.min(input.shape[2] || 0, box5.endPoint[0]) - Math.max(0, box5.startPoint[0])), Math.trunc(Math.min(input.shape[2] || 0, box5.endPoint[0]) - Math.max(0, box5.startPoint[0])),
@ -4930,10 +4929,11 @@ var scaleBoxCoordinates = (box5, factor) => {
const endPoint = [box5.endPoint[0] * factor[0], box5.endPoint[1] * factor[1]]; const endPoint = [box5.endPoint[0] * factor[0], box5.endPoint[1] * factor[1]];
return { startPoint, endPoint, landmarks: box5.landmarks, confidence: box5.confidence }; return { startPoint, endPoint, landmarks: box5.landmarks, confidence: box5.confidence };
}; };
var cutBoxFromImageAndResize = (box5, image29, cropSize) => { var cutAndResize = (box5, image29, cropSize) => {
const h = image29.shape[1]; const h = image29.shape[1];
const w = image29.shape[2]; const w = image29.shape[2];
const crop2 = tf9.image.cropAndResize(image29, [[box5.startPoint[1] / h, box5.startPoint[0] / w, box5.endPoint[1] / h, box5.endPoint[0] / w]], [0], cropSize); const cutBox = [box5.startPoint[1] / h, box5.startPoint[0] / w, box5.endPoint[1] / h, box5.endPoint[0] / w];
const crop2 = tf9.image.cropAndResize(image29, [cutBox], [0], cropSize);
const norm = tf9.div(crop2, constants.tf255); const norm = tf9.div(crop2, constants.tf255);
tf9.dispose(crop2); tf9.dispose(crop2);
return norm; return norm;
@ -4951,9 +4951,9 @@ var squarifyBox = (box5) => {
return { startPoint: [Math.round(centers[0] - halfSize), Math.round(centers[1] - halfSize)], endPoint: [Math.round(centers[0] + halfSize), Math.round(centers[1] + halfSize)], landmarks: box5.landmarks, confidence: box5.confidence }; return { startPoint: [Math.round(centers[0] - halfSize), Math.round(centers[1] - halfSize)], endPoint: [Math.round(centers[0] + halfSize), Math.round(centers[1] + halfSize)], landmarks: box5.landmarks, confidence: box5.confidence };
}; };
var calculateLandmarksBoundingBox = (landmarks) => { var calculateLandmarksBoundingBox = (landmarks) => {
const xs = landmarks.map((d) => d[0]); const x = landmarks.map((d) => d[0]);
const ys = landmarks.map((d) => d[1]); const y = landmarks.map((d) => d[1]);
return { startPoint: [Math.min(...xs), Math.min(...ys)], endPoint: [Math.max(...xs), Math.max(...ys)], landmarks }; return { startPoint: [Math.min(...x), Math.min(...y)], endPoint: [Math.max(...x), Math.max(...y)], landmarks };
}; };
var fixedRotationMatrix = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]; var fixedRotationMatrix = [[1, 0, 0], [0, 1, 0], [0, 0, 1]];
var normalizeRadians = (angle) => angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI)); var normalizeRadians = (angle) => angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI));
@ -5027,11 +5027,12 @@ function transformRawCoords(coordsRaw, box5, angle, rotationMatrix, inputSize9)
const coordsRotationMatrix = largeAngle ? buildRotationMatrix(angle, [0, 0]) : fixedRotationMatrix; const coordsRotationMatrix = largeAngle ? buildRotationMatrix(angle, [0, 0]) : fixedRotationMatrix;
const coordsRotated = largeAngle ? coordsScaled.map((coord) => [...rotatePoint(coord, coordsRotationMatrix), coord[2]]) : coordsScaled; const coordsRotated = largeAngle ? coordsScaled.map((coord) => [...rotatePoint(coord, coordsRotationMatrix), coord[2]]) : coordsScaled;
const inverseRotationMatrix = largeAngle ? invertTransformMatrix(rotationMatrix) : fixedRotationMatrix; const inverseRotationMatrix = largeAngle ? invertTransformMatrix(rotationMatrix) : fixedRotationMatrix;
const boxCenter = [...getBoxCenter({ startPoint: box5.startPoint, endPoint: box5.endPoint }), 1]; const boxCenter = getBoxCenter(box5);
const offsets = [dot(boxCenter, inverseRotationMatrix[0]), dot(boxCenter, inverseRotationMatrix[1])];
return coordsRotated.map((coord) => [ return coordsRotated.map((coord) => [
Math.round(coord[0] + dot(boxCenter, inverseRotationMatrix[0])), Math.trunc(coord[0] + offsets[0]),
Math.round(coord[1] + dot(boxCenter, inverseRotationMatrix[1])), Math.trunc(coord[1] + offsets[1]),
Math.round(coord[2] || 0) Math.trunc(coord[2] || 0)
]); ]);
} }
function correctFaceRotation(rotate, box5, input, inputSize9) { function correctFaceRotation(rotate, box5, input, inputSize9) {
@ -5043,23 +5044,38 @@ function correctFaceRotation(rotate, box5, input, inputSize9) {
angle = computeRotation(box5.landmarks[symmetryLine[0]], box5.landmarks[symmetryLine[1]]); angle = computeRotation(box5.landmarks[symmetryLine[0]], box5.landmarks[symmetryLine[1]]);
const largeAngle = angle && angle !== 0 && Math.abs(angle) > 0.2; const largeAngle = angle && angle !== 0 && Math.abs(angle) > 0.2;
if (largeAngle) { if (largeAngle) {
const center = getBoxCenter({ startPoint: box5.startPoint, endPoint: box5.endPoint }); const center = getBoxCenter(box5);
const centerRaw = [center[0] / input.shape[2], center[1] / input.shape[1]]; const centerRaw = [center[0] / input.shape[2], center[1] / input.shape[1]];
const rotated = tf9.image.rotateWithOffset(input, angle, 0, centerRaw); const rotated = tf9.image.rotateWithOffset(input, angle, 0, centerRaw);
rotationMatrix = buildRotationMatrix(-angle, center); rotationMatrix = buildRotationMatrix(-angle, center);
face5 = cutBoxFromImageAndResize(box5, rotated, [inputSize9, inputSize9]); face5 = cutAndResize(box5, rotated, [inputSize9, inputSize9]);
tf9.dispose(rotated); tf9.dispose(rotated);
} else { } else {
face5 = cutBoxFromImageAndResize(box5, input, [inputSize9, inputSize9]); face5 = cutAndResize(box5, input, [inputSize9, inputSize9]);
} }
} else { } else {
face5 = cutBoxFromImageAndResize(box5, input, [inputSize9, inputSize9]); face5 = cutAndResize(box5, input, [inputSize9, inputSize9]);
} }
return [angle, rotationMatrix, face5]; return [angle, rotationMatrix, face5];
} }
var findFaceCenter = (mesh) => {
const x = mesh.map((m) => m[0]);
const y = mesh.map((m) => m[1]);
return [Math.min(...x) + (Math.max(...x) - Math.min(...x)) / 2, Math.min(...y) + (Math.max(...y) - Math.min(...y)) / 2];
};
var calculateFaceBox = (mesh, previousBox) => {
const center = findFaceCenter(mesh);
const boxSize = getBoxSize(previousBox);
const calculatedBox = {
startPoint: [center[0] - boxSize[0] / 2, center[1] - boxSize[1] / 2],
endPoint: [center[0] + boxSize[0] / 2, center[1] + boxSize[1] / 2]
};
return calculatedBox;
};
// src/face/blazeface.ts // src/face/blazeface.ts
var keypointsCount = 6; var keypointsCount = 6;
var faceBoxScaleFactor = 1.2;
var model5; var model5;
var anchors = null; var anchors = null;
var inputSize = 0; var inputSize = 0;
@ -5101,7 +5117,7 @@ function decodeBounds(boxOutputs) {
async function getBoxes(inputImage, config3) { async function getBoxes(inputImage, config3) {
var _a, _b, _c, _d; var _a, _b, _c, _d;
if (!inputImage || inputImage["isDisposedInternal"] || inputImage.shape.length !== 4 || inputImage.shape[1] < 1 || inputImage.shape[2] < 1) if (!inputImage || inputImage["isDisposedInternal"] || inputImage.shape.length !== 4 || inputImage.shape[1] < 1 || inputImage.shape[2] < 1)
return { boxes: [] }; return [];
const t = {}; const t = {};
t.resized = tf10.image.resizeBilinear(inputImage, [inputSize, inputSize]); t.resized = tf10.image.resizeBilinear(inputImage, [inputSize, inputSize]);
t.div = tf10.div(t.resized, constants.tf127); t.div = tf10.div(t.resized, constants.tf127);
@ -5134,17 +5150,21 @@ async function getBoxes(inputImage, config3) {
b.squeeze = tf10.squeeze(b.slice); b.squeeze = tf10.squeeze(b.slice);
b.landmarks = tf10.reshape(b.squeeze, [keypointsCount, -1]); b.landmarks = tf10.reshape(b.squeeze, [keypointsCount, -1]);
const points = await b.bbox.data(); const points = await b.bbox.data();
boxes.push({ const rawBox = {
startPoint: [points[0], points[1]], startPoint: [points[0], points[1]],
endPoint: [points[2], points[3]], endPoint: [points[2], points[3]],
landmarks: await b.landmarks.array(), landmarks: await b.landmarks.array(),
confidence confidence
}); };
const scaledBox = scaleBoxCoordinates(rawBox, [(inputImage.shape[2] || 0) / inputSize, (inputImage.shape[1] || 0) / inputSize]);
const enlargedBox = enlargeBox(scaledBox, faceBoxScaleFactor);
const squaredBox = squarifyBox(enlargedBox);
boxes.push(squaredBox);
Object.keys(b).forEach((tensor3) => tf10.dispose(b[tensor3])); Object.keys(b).forEach((tensor3) => tf10.dispose(b[tensor3]));
} }
} }
Object.keys(t).forEach((tensor3) => tf10.dispose(t[tensor3])); Object.keys(t).forEach((tensor3) => tf10.dispose(t[tensor3]));
return { boxes, scaleFactor: [inputImage.shape[2] / inputSize, inputImage.shape[1] / inputSize] }; return boxes;
} }
// src/body/blazepose.ts // src/body/blazepose.ts
@ -5997,36 +6017,29 @@ async function augmentIris(rawCoords, face5, config3, meshSize) {
} }
// src/face/facemesh.ts // src/face/facemesh.ts
var boxCache = []; var cache3 = {
boxes: [],
skipped: Number.MAX_SAFE_INTEGER,
timestamp: 0
};
var model11 = null; var model11 = null;
var inputSize6 = 0; var inputSize6 = 0;
var skipped10 = Number.MAX_SAFE_INTEGER;
var lastTime10 = 0;
async function predict10(input, config3) { async function predict10(input, config3) {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k; var _a, _b, _c, _d, _e, _f, _g, _h;
const skipTime = (((_a = config3.face.detector) == null ? void 0 : _a.skipTime) || 0) > now() - lastTime10; const skipTime = (((_a = config3.face.detector) == null ? void 0 : _a.skipTime) || 0) > now() - cache3.timestamp;
const skipFrame = skipped10 < (((_b = config3.face.detector) == null ? void 0 : _b.skipFrames) || 0); const skipFrame = cache3.skipped < (((_b = config3.face.detector) == null ? void 0 : _b.skipFrames) || 0);
if (!config3.skipAllowed || !skipTime || !skipFrame || boxCache.length === 0) { if (!config3.skipAllowed || !skipTime || !skipFrame || cache3.boxes.length === 0) {
const possibleBoxes = await getBoxes(input, config3); cache3.boxes = await getBoxes(input, config3);
lastTime10 = now(); cache3.timestamp = now();
boxCache = []; cache3.skipped = 0;
for (const possible of possibleBoxes.boxes) {
const boxScaled = scaleBoxCoordinates(possible, possibleBoxes.scaleFactor);
const detectedWidth = (boxScaled.endPoint[0] - boxScaled.startPoint[0]) / (input.shape[2] || 1e3);
const calcFactor = (((_c = config3.face.detector) == null ? void 0 : _c.cropFactor) || 1.6) / (detectedWidth + 0.75) / 1.34;
const boxEnlarged = enlargeBox(boxScaled, calcFactor);
const boxSquared = squarifyBox(boxEnlarged);
boxCache.push(boxSquared);
}
skipped10 = 0;
} else { } else {
skipped10++; cache3.skipped++;
} }
const faces = []; const faces = [];
const newCache = []; const newCache = [];
let id = 0; let id = 0;
for (let i = 0; i < boxCache.length; i++) { for (let i = 0; i < cache3.boxes.length; i++) {
let box5 = boxCache[i]; const box5 = cache3.boxes[i];
let angle = 0; let angle = 0;
let rotationMatrix; let rotationMatrix;
const face5 = { const face5 = {
@ -6040,15 +6053,15 @@ async function predict10(input, config3) {
faceScore: 0, faceScore: 0,
annotations: {} annotations: {}
}; };
[angle, rotationMatrix, face5.tensor] = correctFaceRotation((_d = config3.face.detector) == null ? void 0 : _d.rotation, box5, input, ((_e = config3.face.mesh) == null ? void 0 : _e.enabled) ? inputSize6 : size()); [angle, rotationMatrix, face5.tensor] = correctFaceRotation((_c = config3.face.detector) == null ? void 0 : _c.rotation, box5, input, ((_d = config3.face.mesh) == null ? void 0 : _d.enabled) ? inputSize6 : size());
if ((_f = config3 == null ? void 0 : config3.filter) == null ? void 0 : _f.equalization) { if ((_e = config3 == null ? void 0 : config3.filter) == null ? void 0 : _e.equalization) {
const equilized = await histogramEqualization(face5.tensor); const equilized = await histogramEqualization(face5.tensor);
tf18.dispose(face5.tensor); tf18.dispose(face5.tensor);
face5.tensor = equilized; face5.tensor = equilized;
} }
face5.boxScore = Math.round(100 * box5.confidence) / 100; face5.boxScore = Math.round(100 * box5.confidence) / 100;
if (!((_g = config3.face.mesh) == null ? void 0 : _g.enabled)) { if (!((_f = config3.face.mesh) == null ? void 0 : _f.enabled)) {
face5.box = getClampedBox(box5, input); face5.box = clampBox(box5, input);
face5.boxRaw = getRawBox(box5, input); face5.boxRaw = getRawBox(box5, input);
face5.score = face5.boxScore; face5.score = face5.boxScore;
face5.mesh = box5.landmarks.map((pt) => [ face5.mesh = box5.landmarks.map((pt) => [
@ -6068,30 +6081,25 @@ async function predict10(input, config3) {
const coordsReshaped = tf18.reshape(contourCoords, [-1, 3]); const coordsReshaped = tf18.reshape(contourCoords, [-1, 3]);
let rawCoords = await coordsReshaped.array(); let rawCoords = await coordsReshaped.array();
tf18.dispose([contourCoords, coordsReshaped, confidence, contours]); tf18.dispose([contourCoords, coordsReshaped, confidence, contours]);
if (face5.faceScore < (((_h = config3.face.detector) == null ? void 0 : _h.minConfidence) || 1)) { if (face5.faceScore < (((_g = config3.face.detector) == null ? void 0 : _g.minConfidence) || 1)) {
box5.confidence = face5.faceScore; box5.confidence = face5.faceScore;
} else { } else {
if ((_i = config3.face.iris) == null ? void 0 : _i.enabled) if ((_h = config3.face.iris) == null ? void 0 : _h.enabled)
rawCoords = await augmentIris(rawCoords, face5.tensor, config3, inputSize6); rawCoords = await augmentIris(rawCoords, face5.tensor, config3, inputSize6);
face5.mesh = transformRawCoords(rawCoords, box5, angle, rotationMatrix, inputSize6); face5.mesh = transformRawCoords(rawCoords, box5, angle, rotationMatrix, inputSize6);
face5.meshRaw = face5.mesh.map((pt) => [pt[0] / (input.shape[2] || 0), pt[1] / (input.shape[1] || 0), (pt[2] || 0) / inputSize6]); face5.meshRaw = face5.mesh.map((pt) => [pt[0] / (input.shape[2] || 0), pt[1] / (input.shape[1] || 0), (pt[2] || 0) / inputSize6]);
for (const key of Object.keys(meshAnnotations)) for (const key of Object.keys(meshAnnotations))
face5.annotations[key] = meshAnnotations[key].map((index2) => face5.mesh[index2]); face5.annotations[key] = meshAnnotations[key].map((index2) => face5.mesh[index2]);
const boxCalculated = calculateLandmarksBoundingBox(face5.mesh);
const boxEnlarged = enlargeBox(boxCalculated, ((_j = config3.face.detector) == null ? void 0 : _j.cropFactor) || 1.6);
const boxSquared = squarifyBox(boxEnlarged);
box5 = { ...boxSquared, confidence: box5.confidence };
face5.box = getClampedBox(box5, input);
face5.boxRaw = getRawBox(box5, input);
face5.score = face5.faceScore; face5.score = face5.faceScore;
newCache.push(box5); const calculatedBox = { ...calculateFaceBox(face5.mesh, box5), confidence: box5.confidence, landmarks: box5.landmarks };
tf18.dispose(face5.tensor); face5.box = clampBox(calculatedBox, input);
[angle, rotationMatrix, face5.tensor] = correctFaceRotation((_k = config3.face.detector) == null ? void 0 : _k.rotation, box5, input, inputSize6); face5.boxRaw = getRawBox(calculatedBox, input);
newCache.push(calculatedBox);
} }
} }
faces.push(face5); faces.push(face5);
} }
boxCache = [...newCache]; cache3.boxes = newCache;
return faces; return faces;
} }
async function load11(config3) { async function load11(config3) {
@ -6116,9 +6124,9 @@ var uvmap = UV468;
var tf19 = __toModule(require_tfjs_esm()); var tf19 = __toModule(require_tfjs_esm());
var model12; var model12;
var last8 = []; var last8 = [];
var lastTime11 = 0; var lastTime10 = 0;
var lastCount7 = 0; var lastCount7 = 0;
var skipped11 = Number.MAX_SAFE_INTEGER; var skipped10 = Number.MAX_SAFE_INTEGER;
async function load12(config3) { async function load12(config3) {
var _a, _b; var _a, _b;
const modelUrl = join(config3.modelBasePath, ((_a = config3.face.description) == null ? void 0 : _a.modelPath) || ""); const modelUrl = join(config3.modelBasePath, ((_a = config3.face.description) == null ? void 0 : _a.modelPath) || "");
@ -6147,13 +6155,13 @@ async function predict11(image29, config3, idx, count2) {
var _a, _b, _c, _d; var _a, _b, _c, _d;
if (!model12) if (!model12)
return { age: 0, gender: "unknown", genderScore: 0, descriptor: [] }; return { age: 0, gender: "unknown", genderScore: 0, descriptor: [] };
const skipFrame = skipped11 < (((_a = config3.face.description) == null ? void 0 : _a.skipFrames) || 0); const skipFrame = skipped10 < (((_a = config3.face.description) == null ? void 0 : _a.skipFrames) || 0);
const skipTime = (((_b = config3.face.description) == null ? void 0 : _b.skipTime) || 0) > now() - lastTime11; const skipTime = (((_b = config3.face.description) == null ? void 0 : _b.skipTime) || 0) > now() - lastTime10;
if (config3.skipAllowed && skipFrame && skipTime && lastCount7 === count2 && ((_c = last8[idx]) == null ? void 0 : _c.age) && ((_d = last8[idx]) == null ? void 0 : _d.age) > 0) { if (config3.skipAllowed && skipFrame && skipTime && lastCount7 === count2 && ((_c = last8[idx]) == null ? void 0 : _c.age) && ((_d = last8[idx]) == null ? void 0 : _d.age) > 0) {
skipped11++; skipped10++;
return last8[idx]; return last8[idx];
} }
skipped11 = 0; skipped10 = 0;
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
var _a2, _b2; var _a2, _b2;
const obj = { const obj = {
@ -6165,7 +6173,7 @@ async function predict11(image29, config3, idx, count2) {
if ((_a2 = config3.face.description) == null ? void 0 : _a2.enabled) { if ((_a2 = config3.face.description) == null ? void 0 : _a2.enabled) {
const enhanced = enhance2(image29); const enhanced = enhance2(image29);
const resT = model12 == null ? void 0 : model12.execute(enhanced); const resT = model12 == null ? void 0 : model12.execute(enhanced);
lastTime11 = now(); lastTime10 = now();
tf19.dispose(enhanced); tf19.dispose(enhanced);
const genderT = await resT.find((t) => t.shape[1] === 1); const genderT = await resT.find((t) => t.shape[1] === 1);
const gender = await genderT.data(); const gender = await genderT.data();
@ -6211,7 +6219,7 @@ function getBoxCenter2(box5) {
box5.startPoint[1] + (box5.endPoint[1] - box5.startPoint[1]) / 2 box5.startPoint[1] + (box5.endPoint[1] - box5.startPoint[1]) / 2
]; ];
} }
function cutBoxFromImageAndResize2(box5, image29, cropSize) { function cutBoxFromImageAndResize(box5, image29, cropSize) {
const h = image29.shape[1]; const h = image29.shape[1];
const w = image29.shape[2]; const w = image29.shape[2];
const boxes = [[ const boxes = [[
@ -9341,7 +9349,7 @@ var handBoxEnlargeFactor = 1.65;
var palmLandmarkIds = [0, 5, 9, 13, 17, 1, 2]; var palmLandmarkIds = [0, 5, 9, 13, 17, 1, 2];
var palmLandmarksPalmBase = 0; var palmLandmarksPalmBase = 0;
var palmLandmarksMiddleFingerBase = 2; var palmLandmarksMiddleFingerBase = 2;
var lastTime12 = 0; var lastTime11 = 0;
var HandPipeline = class { var HandPipeline = class {
constructor(handDetector, handPoseModel2) { constructor(handDetector, handPoseModel2) {
__publicField(this, "handDetector"); __publicField(this, "handDetector");
@ -9406,7 +9414,7 @@ var HandPipeline = class {
async estimateHands(image29, config3) { async estimateHands(image29, config3) {
let useFreshBox = false; let useFreshBox = false;
let boxes; let boxes;
const skipTime = (config3.hand.skipTime || 0) > now() - lastTime12; const skipTime = (config3.hand.skipTime || 0) > now() - lastTime11;
const skipFrame = this.skipped < (config3.hand.skipFrames || 0); const skipFrame = this.skipped < (config3.hand.skipFrames || 0);
if (config3.skipAllowed && skipTime && skipFrame) { if (config3.skipAllowed && skipTime && skipFrame) {
boxes = await this.handDetector.predict(image29, config3); boxes = await this.handDetector.predict(image29, config3);
@ -9432,12 +9440,12 @@ var HandPipeline = class {
const rotatedImage = config3.hand.rotation && env.kernels.includes("rotatewithoffset") ? tf22.image.rotateWithOffset(image29, angle, 0, palmCenterNormalized) : image29.clone(); const rotatedImage = config3.hand.rotation && env.kernels.includes("rotatewithoffset") ? tf22.image.rotateWithOffset(image29, angle, 0, palmCenterNormalized) : image29.clone();
const rotationMatrix = buildRotationMatrix2(-angle, palmCenter); const rotationMatrix = buildRotationMatrix2(-angle, palmCenter);
const newBox = useFreshBox ? this.getBoxForPalmLandmarks(currentBox.palmLandmarks, rotationMatrix) : currentBox; const newBox = useFreshBox ? this.getBoxForPalmLandmarks(currentBox.palmLandmarks, rotationMatrix) : currentBox;
const croppedInput = cutBoxFromImageAndResize2(newBox, rotatedImage, [this.inputSize, this.inputSize]); const croppedInput = cutBoxFromImageAndResize(newBox, rotatedImage, [this.inputSize, this.inputSize]);
const handImage = tf22.div(croppedInput, constants.tf255); const handImage = tf22.div(croppedInput, constants.tf255);
tf22.dispose(croppedInput); tf22.dispose(croppedInput);
tf22.dispose(rotatedImage); tf22.dispose(rotatedImage);
const [confidenceT, keypoints] = this.handPoseModel.execute(handImage); const [confidenceT, keypoints] = this.handPoseModel.execute(handImage);
lastTime12 = now(); lastTime11 = now();
tf22.dispose(handImage); tf22.dispose(handImage);
const confidence = (await confidenceT.data())[0]; const confidence = (await confidenceT.data())[0];
tf22.dispose(confidenceT); tf22.dispose(confidenceT);
@ -9997,10 +10005,10 @@ var faceIndex = 4;
var boxExpandFact = 1.6; var boxExpandFact = 1.6;
var maxDetectorResolution = 512; var maxDetectorResolution = 512;
var detectorExpandFact = 1.4; var detectorExpandFact = 1.4;
var skipped12 = Number.MAX_SAFE_INTEGER; var skipped11 = Number.MAX_SAFE_INTEGER;
var lastTime13 = 0; var lastTime12 = 0;
var outputSize = [0, 0]; var outputSize = [0, 0];
var cache3 = { var cache4 = {
boxes: [], boxes: [],
hands: [] hands: []
}; };
@ -10136,44 +10144,44 @@ async function predict13(input, config3) {
if (!models2[0] || !models2[1] || !((_a = models2[0]) == null ? void 0 : _a.inputs[0].shape) || !((_b = models2[1]) == null ? void 0 : _b.inputs[0].shape)) if (!models2[0] || !models2[1] || !((_a = models2[0]) == null ? void 0 : _a.inputs[0].shape) || !((_b = models2[1]) == null ? void 0 : _b.inputs[0].shape))
return []; return [];
outputSize = [input.shape[2] || 0, input.shape[1] || 0]; outputSize = [input.shape[2] || 0, input.shape[1] || 0];
skipped12++; skipped11++;
const skipTime = (config3.hand.skipTime || 0) > now() - lastTime13; const skipTime = (config3.hand.skipTime || 0) > now() - lastTime12;
const skipFrame = skipped12 < (config3.hand.skipFrames || 0); const skipFrame = skipped11 < (config3.hand.skipFrames || 0);
if (config3.skipAllowed && skipTime && skipFrame) { if (config3.skipAllowed && skipTime && skipFrame) {
return cache3.hands; return cache4.hands;
} }
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
const skipTimeExtended = 3 * (config3.hand.skipTime || 0) > now() - lastTime13; const skipTimeExtended = 3 * (config3.hand.skipTime || 0) > now() - lastTime12;
const skipFrameExtended = skipped12 < 3 * (config3.hand.skipFrames || 0); const skipFrameExtended = skipped11 < 3 * (config3.hand.skipFrames || 0);
if (config3.skipAllowed && cache3.hands.length === config3.hand.maxDetected) { if (config3.skipAllowed && cache4.hands.length === config3.hand.maxDetected) {
cache3.hands = await Promise.all(cache3.boxes.map((handBox) => detectFingers(input, handBox, config3))); cache4.hands = await Promise.all(cache4.boxes.map((handBox) => detectFingers(input, handBox, config3)));
} else if (config3.skipAllowed && skipTimeExtended && skipFrameExtended && cache3.hands.length > 0) { } else if (config3.skipAllowed && skipTimeExtended && skipFrameExtended && cache4.hands.length > 0) {
cache3.hands = await Promise.all(cache3.boxes.map((handBox) => detectFingers(input, handBox, config3))); cache4.hands = await Promise.all(cache4.boxes.map((handBox) => detectFingers(input, handBox, config3)));
} else { } else {
cache3.boxes = await detectHands(input, config3); cache4.boxes = await detectHands(input, config3);
lastTime13 = now(); lastTime12 = now();
cache3.hands = await Promise.all(cache3.boxes.map((handBox) => detectFingers(input, handBox, config3))); cache4.hands = await Promise.all(cache4.boxes.map((handBox) => detectFingers(input, handBox, config3)));
skipped12 = 0; skipped11 = 0;
} }
const oldCache = [...cache3.boxes]; const oldCache = [...cache4.boxes];
cache3.boxes.length = 0; cache4.boxes.length = 0;
if (config3.cacheSensitivity > 0) { if (config3.cacheSensitivity > 0) {
for (let i = 0; i < cache3.hands.length; i++) { for (let i = 0; i < cache4.hands.length; i++) {
const boxKpt = square(cache3.hands[i].keypoints, outputSize); const boxKpt = square(cache4.hands[i].keypoints, outputSize);
if (boxKpt.box[2] / (input.shape[2] || 1) > 0.05 && boxKpt.box[3] / (input.shape[1] || 1) > 0.05 && cache3.hands[i].fingerScore && cache3.hands[i].fingerScore > (config3.hand.minConfidence || 0)) { if (boxKpt.box[2] / (input.shape[2] || 1) > 0.05 && boxKpt.box[3] / (input.shape[1] || 1) > 0.05 && cache4.hands[i].fingerScore && cache4.hands[i].fingerScore > (config3.hand.minConfidence || 0)) {
const boxScale = scale(boxKpt.box, boxExpandFact); const boxScale = scale(boxKpt.box, boxExpandFact);
const boxScaleRaw = scale(boxKpt.boxRaw, boxExpandFact); const boxScaleRaw = scale(boxKpt.boxRaw, boxExpandFact);
const boxCrop = crop(boxScaleRaw); const boxCrop = crop(boxScaleRaw);
cache3.boxes.push({ ...oldCache[i], box: boxScale, boxRaw: boxScaleRaw, boxCrop }); cache4.boxes.push({ ...oldCache[i], box: boxScale, boxRaw: boxScaleRaw, boxCrop });
} }
} }
} }
for (let i = 0; i < cache3.hands.length; i++) { for (let i = 0; i < cache4.hands.length; i++) {
const bbox = calc(cache3.hands[i].keypoints, outputSize); const bbox = calc(cache4.hands[i].keypoints, outputSize);
cache3.hands[i].box = bbox.box; cache4.hands[i].box = bbox.box;
cache3.hands[i].boxRaw = bbox.boxRaw; cache4.hands[i].boxRaw = bbox.boxRaw;
} }
resolve(cache3.hands); resolve(cache4.hands);
}); });
} }
@ -10181,9 +10189,9 @@ async function predict13(input, config3) {
var tf25 = __toModule(require_tfjs_esm()); var tf25 = __toModule(require_tfjs_esm());
var model13; var model13;
var cached2 = []; var cached2 = [];
var skipped13 = Number.MAX_SAFE_INTEGER; var skipped12 = Number.MAX_SAFE_INTEGER;
var lastCount8 = 0; var lastCount8 = 0;
var lastTime14 = 0; var lastTime13 = 0;
async function load14(config3) { async function load14(config3) {
var _a, _b; var _a, _b;
if (env.initial) if (env.initial)
@ -10202,20 +10210,20 @@ async function predict14(image29, config3, idx, count2) {
var _a, _b; var _a, _b;
if (!model13) if (!model13)
return 0; return 0;
const skipTime = (((_a = config3.face.liveness) == null ? void 0 : _a.skipTime) || 0) > now() - lastTime14; const skipTime = (((_a = config3.face.liveness) == null ? void 0 : _a.skipTime) || 0) > now() - lastTime13;
const skipFrame = skipped13 < (((_b = config3.face.liveness) == null ? void 0 : _b.skipFrames) || 0); const skipFrame = skipped12 < (((_b = config3.face.liveness) == null ? void 0 : _b.skipFrames) || 0);
if (config3.skipAllowed && skipTime && skipFrame && lastCount8 === count2 && cached2[idx]) { if (config3.skipAllowed && skipTime && skipFrame && lastCount8 === count2 && cached2[idx]) {
skipped13++; skipped12++;
return cached2[idx]; return cached2[idx];
} }
skipped13 = 0; skipped12 = 0;
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
const resize = tf25.image.resizeBilinear(image29, [(model13 == null ? void 0 : model13.inputs[0].shape) ? model13.inputs[0].shape[2] : 0, (model13 == null ? void 0 : model13.inputs[0].shape) ? model13.inputs[0].shape[1] : 0], false); const resize = tf25.image.resizeBilinear(image29, [(model13 == null ? void 0 : model13.inputs[0].shape) ? model13.inputs[0].shape[2] : 0, (model13 == null ? void 0 : model13.inputs[0].shape) ? model13.inputs[0].shape[1] : 0], false);
const res = model13 == null ? void 0 : model13.execute(resize); const res = model13 == null ? void 0 : model13.execute(resize);
const num = (await res.data())[0]; const num = (await res.data())[0];
cached2[idx] = Math.round(100 * num) / 100; cached2[idx] = Math.round(100 * num) / 100;
lastCount8 = count2; lastCount8 = count2;
lastTime14 = now(); lastTime13 = now();
tf25.dispose([resize, res]); tf25.dispose([resize, res]);
resolve(cached2[idx]); resolve(cached2[idx]);
}); });
@ -10284,7 +10292,7 @@ var connected3 = {
// src/body/movenetfix.ts // src/body/movenetfix.ts
var tf26 = __toModule(require_tfjs_esm()); var tf26 = __toModule(require_tfjs_esm());
var maxJitter = 5e-3; var maxJitter = 5e-3;
var cache4 = { var cache5 = {
keypoints: [], keypoints: [],
padding: [[0, 0], [0, 0], [0, 0], [0, 0]] padding: [[0, 0], [0, 0], [0, 0], [0, 0]]
}; };
@ -10333,15 +10341,15 @@ function bodyParts(body4) {
} }
function jitter(keypoints) { function jitter(keypoints) {
for (let i = 0; i < keypoints.length; i++) { for (let i = 0; i < keypoints.length; i++) {
if (keypoints[i] && cache4.keypoints[i]) { if (keypoints[i] && cache5.keypoints[i]) {
const diff = [Math.abs(keypoints[i].positionRaw[0] - cache4.keypoints[i].positionRaw[0]), Math.abs(keypoints[i].positionRaw[1] - cache4.keypoints[i].positionRaw[1])]; const diff = [Math.abs(keypoints[i].positionRaw[0] - cache5.keypoints[i].positionRaw[0]), Math.abs(keypoints[i].positionRaw[1] - cache5.keypoints[i].positionRaw[1])];
if (diff[0] < maxJitter && diff[1] < maxJitter) { if (diff[0] < maxJitter && diff[1] < maxJitter) {
keypoints[i] = cache4.keypoints[i]; keypoints[i] = cache5.keypoints[i];
} else { } else {
cache4.keypoints[i] = keypoints[i]; cache5.keypoints[i] = keypoints[i];
} }
} else { } else {
cache4.keypoints[i] = keypoints[i]; cache5.keypoints[i] = keypoints[i];
} }
} }
return keypoints; return keypoints;
@ -10350,13 +10358,13 @@ function padInput(input, inputSize9) {
const t = {}; const t = {};
if (!input.shape || !input.shape[1] || !input.shape[2]) if (!input.shape || !input.shape[1] || !input.shape[2])
return input; return input;
cache4.padding = [ cache5.padding = [
[0, 0], [0, 0],
[input.shape[2] > input.shape[1] ? Math.trunc((input.shape[2] - input.shape[1]) / 2) : 0, input.shape[2] > input.shape[1] ? Math.trunc((input.shape[2] - input.shape[1]) / 2) : 0], [input.shape[2] > input.shape[1] ? Math.trunc((input.shape[2] - input.shape[1]) / 2) : 0, input.shape[2] > input.shape[1] ? Math.trunc((input.shape[2] - input.shape[1]) / 2) : 0],
[input.shape[1] > input.shape[2] ? Math.trunc((input.shape[1] - input.shape[2]) / 2) : 0, input.shape[1] > input.shape[2] ? Math.trunc((input.shape[1] - input.shape[2]) / 2) : 0], [input.shape[1] > input.shape[2] ? Math.trunc((input.shape[1] - input.shape[2]) / 2) : 0, input.shape[1] > input.shape[2] ? Math.trunc((input.shape[1] - input.shape[2]) / 2) : 0],
[0, 0] [0, 0]
]; ];
t.pad = tf26.pad(input, cache4.padding); t.pad = tf26.pad(input, cache5.padding);
t.resize = tf26.image.resizeBilinear(t.pad, [inputSize9, inputSize9]); t.resize = tf26.image.resizeBilinear(t.pad, [inputSize9, inputSize9]);
const final = tf26.cast(t.resize, "int32"); const final = tf26.cast(t.resize, "int32");
Object.keys(t).forEach((tensor3) => tf26.dispose(t[tensor3])); Object.keys(t).forEach((tensor3) => tf26.dispose(t[tensor3]));
@ -10366,8 +10374,8 @@ function rescaleBody(body4, outputSize2) {
body4.keypoints = body4.keypoints.filter((kpt4) => kpt4 && kpt4.position); body4.keypoints = body4.keypoints.filter((kpt4) => kpt4 && kpt4.position);
for (const kpt4 of body4.keypoints) { for (const kpt4 of body4.keypoints) {
kpt4.position = [ kpt4.position = [
kpt4.position[0] * (outputSize2[0] + cache4.padding[2][0] + cache4.padding[2][1]) / outputSize2[0] - cache4.padding[2][0], kpt4.position[0] * (outputSize2[0] + cache5.padding[2][0] + cache5.padding[2][1]) / outputSize2[0] - cache5.padding[2][0],
kpt4.position[1] * (outputSize2[1] + cache4.padding[1][0] + cache4.padding[1][1]) / outputSize2[1] - cache4.padding[1][0] kpt4.position[1] * (outputSize2[1] + cache5.padding[1][0] + cache5.padding[1][1]) / outputSize2[1] - cache5.padding[1][0]
]; ];
kpt4.positionRaw = [ kpt4.positionRaw = [
kpt4.position[0] / outputSize2[0], kpt4.position[0] / outputSize2[0],
@ -10383,8 +10391,8 @@ function rescaleBody(body4, outputSize2) {
// src/body/movenet.ts // src/body/movenet.ts
var model14; var model14;
var inputSize8 = 0; var inputSize8 = 0;
var skipped14 = Number.MAX_SAFE_INTEGER; var skipped13 = Number.MAX_SAFE_INTEGER;
var cache5 = { var cache6 = {
boxes: [], boxes: [],
bodies: [], bodies: [],
last: 0 last: 0
@ -10487,27 +10495,27 @@ async function predict15(input, config3) {
if (!model14 || !(model14 == null ? void 0 : model14.inputs[0].shape)) if (!model14 || !(model14 == null ? void 0 : model14.inputs[0].shape))
return []; return [];
if (!config3.skipAllowed) if (!config3.skipAllowed)
cache5.boxes.length = 0; cache6.boxes.length = 0;
skipped14++; skipped13++;
const skipTime = (config3.body.skipTime || 0) > now() - cache5.last; const skipTime = (config3.body.skipTime || 0) > now() - cache6.last;
const skipFrame = skipped14 < (config3.body.skipFrames || 0); const skipFrame = skipped13 < (config3.body.skipFrames || 0);
if (config3.skipAllowed && skipTime && skipFrame) { if (config3.skipAllowed && skipTime && skipFrame) {
return cache5.bodies; return cache6.bodies;
} }
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
const t = {}; const t = {};
skipped14 = 0; skipped13 = 0;
t.input = padInput(input, inputSize8); t.input = padInput(input, inputSize8);
t.res = model14 == null ? void 0 : model14.execute(t.input); t.res = model14 == null ? void 0 : model14.execute(t.input);
cache5.last = now(); cache6.last = now();
const res = await t.res.array(); const res = await t.res.array();
cache5.bodies = t.res.shape[2] === 17 ? await parseSinglePose(res, config3, input) : await parseMultiPose(res, config3, input); cache6.bodies = t.res.shape[2] === 17 ? await parseSinglePose(res, config3, input) : await parseMultiPose(res, config3, input);
for (const body4 of cache5.bodies) { for (const body4 of cache6.bodies) {
rescaleBody(body4, [input.shape[2] || 1, input.shape[1] || 1]); rescaleBody(body4, [input.shape[2] || 1, input.shape[1] || 1]);
jitter(body4.keypoints); jitter(body4.keypoints);
} }
Object.keys(t).forEach((tensor3) => tf27.dispose(t[tensor3])); Object.keys(t).forEach((tensor3) => tf27.dispose(t[tensor3]));
resolve(cache5.bodies); resolve(cache6.bodies);
}); });
} }
@ -10515,8 +10523,8 @@ async function predict15(input, config3) {
var tf28 = __toModule(require_tfjs_esm()); var tf28 = __toModule(require_tfjs_esm());
var model15; var model15;
var last9 = []; var last9 = [];
var lastTime15 = 0; var lastTime14 = 0;
var skipped15 = Number.MAX_SAFE_INTEGER; var skipped14 = Number.MAX_SAFE_INTEGER;
var scaleBox = 2.5; var scaleBox = 2.5;
async function load16(config3) { async function load16(config3) {
if (!model15 || env.initial) { if (!model15 || env.initial) {
@ -10593,13 +10601,13 @@ async function process4(res, inputSize9, outputShape, config3) {
return results; return results;
} }
async function predict16(image29, config3) { async function predict16(image29, config3) {
const skipTime = (config3.object.skipTime || 0) > now() - lastTime15; const skipTime = (config3.object.skipTime || 0) > now() - lastTime14;
const skipFrame = skipped15 < (config3.object.skipFrames || 0); const skipFrame = skipped14 < (config3.object.skipFrames || 0);
if (config3.skipAllowed && skipTime && skipFrame && last9.length > 0) { if (config3.skipAllowed && skipTime && skipFrame && last9.length > 0) {
skipped15++; skipped14++;
return last9; return last9;
} }
skipped15 = 0; skipped14 = 0;
if (!env.kernels.includes("mod") || !env.kernels.includes("sparsetodense")) if (!env.kernels.includes("mod") || !env.kernels.includes("sparsetodense"))
return last9; return last9;
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
@ -10612,7 +10620,7 @@ async function predict16(image29, config3) {
let objectT; let objectT;
if (config3.object.enabled) if (config3.object.enabled)
objectT = model15.execute(transpose); objectT = model15.execute(transpose);
lastTime15 = now(); lastTime14 = now();
tf28.dispose(transpose); tf28.dispose(transpose);
const obj = await process4(objectT, model15.inputSize, outputSize2, config3); const obj = await process4(objectT, model15.inputSize, outputSize2, config3);
last9 = obj; last9 = obj;
@ -11139,41 +11147,29 @@ async function load19(instance) {
async function validate2(instance) { async function validate2(instance) {
const simpleOps = ["const", "placeholder", "noop", "pad", "squeeze", "add", "sub", "mul", "div"]; const simpleOps = ["const", "placeholder", "noop", "pad", "squeeze", "add", "sub", "mul", "div"];
for (const defined of Object.keys(instance.models)) { for (const defined of Object.keys(instance.models)) {
if (instance.models[defined]) { const model18 = instance.models[defined];
let models5 = []; if (!model18)
if (Array.isArray(instance.models[defined])) { continue;
models5 = instance.models[defined].filter((model18) => model18 !== null).map((model18) => model18 && model18.executor ? model18 : model18.model); const ops = [];
} else { const executor = model18 == null ? void 0 : model18.executor;
models5 = [instance.models[defined]]; if (executor && executor.graph.nodes) {
for (const kernel of Object.values(executor.graph.nodes)) {
const op = kernel.op.toLowerCase();
if (!ops.includes(op))
ops.push(op);
} }
for (const model18 of models5) { } else {
if (!model18) { if (!executor && instance.config.debug)
if (instance.config.debug) log("model signature not determined:", defined);
log("model marked as loaded but not defined:", defined); }
continue; const missing = [];
} for (const op of ops) {
const ops = []; if (!simpleOps.includes(op) && !instance.env.kernels.includes(op) && !instance.env.kernels.includes(op.replace("_", "")) && !instance.env.kernels.includes(op.replace("native", "")) && !instance.env.kernels.includes(op.replace("v2", ""))) {
const executor = model18 == null ? void 0 : model18.executor; missing.push(op);
if (executor && executor.graph.nodes) {
for (const kernel of Object.values(executor.graph.nodes)) {
const op = kernel.op.toLowerCase();
if (!ops.includes(op))
ops.push(op);
}
} else {
if (!executor && instance.config.debug)
log("model signature not determined:", defined);
}
const missing = [];
for (const op of ops) {
if (!simpleOps.includes(op) && !instance.env.kernels.includes(op) && !instance.env.kernels.includes(op.replace("_", "")) && !instance.env.kernels.includes(op.replace("native", "")) && !instance.env.kernels.includes(op.replace("v2", ""))) {
missing.push(op);
}
}
if (missing.length > 0 && instance.config.debug)
log("model validation:", defined, missing);
} }
} }
if (instance.config.debug && missing.length > 0)
log("model validation failed:", defined, missing);
} }
} }
@ -11456,12 +11452,12 @@ function point(ctx, x, y, z, localOptions) {
} }
function rect(ctx, x, y, width, height, localOptions) { function rect(ctx, x, y, width, height, localOptions) {
ctx.beginPath(); ctx.beginPath();
ctx.lineWidth = localOptions.lineWidth;
if (localOptions.useCurves) { if (localOptions.useCurves) {
const cx = (x + x + width) / 2; const cx = (x + x + width) / 2;
const cy = (y + y + height) / 2; const cy = (y + y + height) / 2;
ctx.ellipse(cx, cy, width / 2, height / 2, 0, 0, 2 * Math.PI); ctx.ellipse(cx, cy, width / 2, height / 2, 0, 0, 2 * Math.PI);
} else { } else {
ctx.lineWidth = localOptions.lineWidth;
ctx.moveTo(x + localOptions.roundRect, y); ctx.moveTo(x + localOptions.roundRect, y);
ctx.lineTo(x + width - localOptions.roundRect, y); ctx.lineTo(x + width - localOptions.roundRect, y);
ctx.quadraticCurveTo(x + width, y, x + width, y + localOptions.roundRect); ctx.quadraticCurveTo(x + width, y, x + width, y + localOptions.roundRect);
@ -11495,6 +11491,7 @@ function lines(ctx, points, localOptions) {
function curves(ctx, points, localOptions) { function curves(ctx, points, localOptions) {
if (points.length < 2) if (points.length < 2)
return; return;
ctx.lineWidth = localOptions.lineWidth;
if (!localOptions.useCurves || points.length <= 2) { if (!localOptions.useCurves || points.length <= 2) {
lines(ctx, points, localOptions); lines(ctx, points, localOptions);
return; return;
@ -11617,14 +11614,13 @@ async function face(inCanvas2, result, drawOptions) {
ctx.fillText(labels2[i], x + 4, y + 15); ctx.fillText(labels2[i], x + 4, y + 15);
} }
} }
ctx.lineWidth = 1; ctx.lineWidth = 2;
if (f.mesh && f.mesh.length > 0) { if (f.mesh && f.mesh.length > 0) {
if (localOptions.drawPoints) { if (localOptions.drawPoints) {
for (const pt of f.mesh) for (const pt of f.mesh)
point(ctx, pt[0], pt[1], pt[2], localOptions); point(ctx, pt[0], pt[1], pt[2], localOptions);
} }
if (localOptions.drawPolygons) { if (localOptions.drawPolygons) {
ctx.lineWidth = 1;
if (f.mesh.length > 450) { if (f.mesh.length > 450) {
for (let i = 0; i < TRI468.length / 3; i++) { for (let i = 0; i < TRI468.length / 3; i++) {
const points = [ const points = [
@ -11784,7 +11780,8 @@ async function hand(inCanvas2, result, drawOptions) {
const addHandLabel = (part, title) => { const addHandLabel = (part, title) => {
if (!part || part.length === 0 || !part[0]) if (!part || part.length === 0 || !part[0])
return; return;
ctx.fillStyle = localOptions.useDepth ? `rgba(${127.5 + 2 * part[part.length - 1][2]}, ${127.5 - 2 * part[part.length - 1][2]}, 255, 0.5)` : localOptions.color; const z = part[part.length - 1][2] || 0;
ctx.fillStyle = localOptions.useDepth ? `rgba(${127.5 + 2 * z}, ${127.5 - 2 * z}, 255, 0.5)` : localOptions.color;
ctx.fillText(title, part[part.length - 1][0] + 4, part[part.length - 1][1] + 4); ctx.fillText(title, part[part.length - 1][0] + 4, part[part.length - 1][1] + 4);
}; };
ctx.font = localOptions.font; ctx.font = localOptions.font;
@ -11801,7 +11798,8 @@ async function hand(inCanvas2, result, drawOptions) {
return; return;
for (let i = 0; i < part.length; i++) { for (let i = 0; i < part.length; i++) {
ctx.beginPath(); ctx.beginPath();
ctx.strokeStyle = localOptions.useDepth ? `rgba(${127.5 + i * part[i][2]}, ${127.5 - i * part[i][2]}, 255, 0.5)` : localOptions.color; const z = part[i][2] || 0;
ctx.strokeStyle = localOptions.useDepth ? `rgba(${127.5 + i * z}, ${127.5 - i * z}, 255, 0.5)` : localOptions.color;
ctx.moveTo(part[i > 0 ? i - 1 : 0][0], part[i > 0 ? i - 1 : 0][1]); ctx.moveTo(part[i > 0 ? i - 1 : 0][0], part[i > 0 ? i - 1 : 0][1]);
ctx.lineTo(part[i][0], part[i][1]); ctx.lineTo(part[i][0], part[i][1]);
ctx.stroke(); ctx.stroke();
@ -11980,7 +11978,7 @@ var calculateFaceAngle = (face5, imageSize) => {
return [x, y, z]; return [x, y, z];
}; };
const rotationMatrixToEulerAngle = (r) => { const rotationMatrixToEulerAngle = (r) => {
const [r00, r01, r02, r10, r11, r12, r20, r21, r22] = r; const [r00, _r01, _r02, r10, r11, r12, r20, r21, r22] = r;
let thetaX; let thetaX;
let thetaY; let thetaY;
let thetaZ; let thetaZ;
@ -12007,24 +12005,11 @@ var calculateFaceAngle = (face5, imageSize) => {
thetaZ = 0; thetaZ = 0;
return { pitch: 2 * -thetaX, yaw: 2 * -thetaY, roll: 2 * -thetaZ }; return { pitch: 2 * -thetaX, yaw: 2 * -thetaY, roll: 2 * -thetaZ };
}; };
const meshToEulerAngle = (mesh2) => {
const radians = (a1, a2, b1, b2) => Math.atan2(b2 - a2, b1 - a1);
const angle2 = {
pitch: radians(mesh2[10][1], mesh2[10][2], mesh2[152][1], mesh2[152][2]),
yaw: radians(mesh2[33][0], mesh2[33][2], mesh2[263][0], mesh2[263][2]),
roll: radians(mesh2[33][0], mesh2[33][1], mesh2[263][0], mesh2[263][1])
};
return angle2;
};
const mesh = face5.meshRaw; const mesh = face5.meshRaw;
if (!mesh || mesh.length < 300) if (!mesh || mesh.length < 300)
return { angle: { pitch: 0, yaw: 0, roll: 0 }, matrix: [1, 0, 0, 0, 1, 0, 0, 0, 1], gaze: { bearing: 0, strength: 0 } }; return { angle: { pitch: 0, yaw: 0, roll: 0 }, matrix: [1, 0, 0, 0, 1, 0, 0, 0, 1], gaze: { bearing: 0, strength: 0 } };
const size2 = Math.max(face5.boxRaw[2] * imageSize[0], face5.boxRaw[3] * imageSize[1]) / 1.5; const size2 = Math.max(face5.boxRaw[2] * imageSize[0], face5.boxRaw[3] * imageSize[1]) / 1.5;
const pts = [mesh[10], mesh[152], mesh[234], mesh[454]].map((pt) => [ const pts = [mesh[10], mesh[152], mesh[234], mesh[454]].map((pt) => [pt[0] * imageSize[0] / size2, pt[1] * imageSize[1] / size2, pt[2]]);
pt[0] * imageSize[0] / size2,
pt[1] * imageSize[1] / size2,
pt[2]
]);
const y_axis = normalize(subVectors(pts[1], pts[0])); const y_axis = normalize(subVectors(pts[1], pts[0]));
let x_axis = normalize(subVectors(pts[3], pts[2])); let x_axis = normalize(subVectors(pts[3], pts[2]));
const z_axis = normalize(crossVectors(x_axis, y_axis)); const z_axis = normalize(crossVectors(x_axis, y_axis));
@ -13328,7 +13313,7 @@ async function warmupCanvas(instance) {
const canvas3 = canvas(img.naturalWidth, img.naturalHeight); const canvas3 = canvas(img.naturalWidth, img.naturalHeight);
if (!canvas3) { if (!canvas3) {
log("Warmup: Canvas not found"); log("Warmup: Canvas not found");
resolve({}); resolve(void 0);
} else { } else {
const ctx = canvas3.getContext("2d"); const ctx = canvas3.getContext("2d");
if (ctx) if (ctx)
@ -13341,7 +13326,7 @@ async function warmupCanvas(instance) {
if (src) if (src)
img.src = src; img.src = src;
else else
resolve(null); resolve(void 0);
}); });
} }
async function warmupNode(instance) { async function warmupNode(instance) {
@ -13349,12 +13334,10 @@ async function warmupNode(instance) {
let img; let img;
if (instance.config.warmup === "face") if (instance.config.warmup === "face")
img = atob(face3); img = atob(face3);
if (instance.config.warmup === "body" || instance.config.warmup === "full") else
img = atob(body3); img = atob(body3);
if (!img)
return null;
let res; let res;
if (typeof tf35["node"] !== "undefined") { if ("node" in tf35) {
const data = tf35["node"].decodeJpeg(img); const data = tf35["node"].decodeJpeg(img);
const expanded = data.expandDims(0); const expanded = data.expandDims(0);
instance.tf.dispose(data); instance.tf.dispose(data);

View File

@ -137,7 +137,7 @@ declare function browserFiles(files: File[]): IOHandler;
declare function browserHTTPRequest(path: string, loadOptions?: LoadOptions): IOHandler; declare function browserHTTPRequest(path: string, loadOptions?: LoadOptions): IOHandler;
/** draw processed canvas */ /** draw processed canvas */
declare function canvas(input: AnyCanvas | HTMLImageElement | HTMLMediaElement | HTMLVideoElement, output: AnyCanvas): Promise<void>; declare function canvas(input: AnyCanvas | HTMLImageElement | HTMLVideoElement, output: AnyCanvas): Promise<void>;
/** /**
* Concatenate a number of ArrayBuffers into one. * Concatenate a number of ArrayBuffers into one.
@ -512,12 +512,6 @@ export declare interface FaceDetectorConfig extends GenericConfig {
minConfidence: number; minConfidence: number;
/** minimum overlap between two detected faces before one is discarded */ /** minimum overlap between two detected faces before one is discarded */
iouThreshold: number; iouThreshold: number;
/** factor used to expand detected face before further analysis
* - default: 1.6
* - for high-quality inputs can be reduced to increase precision
* - for video inputs or low-quality inputs can be increased to allow for more flexible tracking
*/
cropFactor: number;
/** should child models perform on masked image of a face */ /** should child models perform on masked image of a face */
mask: boolean; mask: boolean;
/** should face detection return face tensor to be used in some other extenrnal model? */ /** should face detection return face tensor to be used in some other extenrnal model? */
@ -1249,7 +1243,7 @@ declare class Human {
* @param userConfig - {@link Config} * @param userConfig - {@link Config}
* @returns result - {@link Result} * @returns result - {@link Result}
*/ */
warmup(userConfig?: Partial<Config>): Promise<Result>; warmup(userConfig?: Partial<Config>): Promise<Result | undefined>;
/** Run detect with tensorflow profiling /** Run detect with tensorflow profiling
* - result object will contain total exeuction time information for top-20 kernels * - result object will contain total exeuction time information for top-20 kernels
* - actual detection object can be accessed via `human.result` * - actual detection object can be accessed via `human.result`

View File

@ -188,7 +188,6 @@ var config = {
skipTime: 2500, skipTime: 2500,
minConfidence: 0.2, minConfidence: 0.2,
iouThreshold: 0.1, iouThreshold: 0.1,
cropFactor: 1.6,
mask: false, mask: false,
return: false return: false
}, },
@ -1237,7 +1236,7 @@ async function skip(config3, input) {
const diffRelative = diffSum[0] / (input.shape[1] || 1) / (input.shape[2] || 1) / 255 / 3; const diffRelative = diffSum[0] / (input.shape[1] || 1) / (input.shape[2] || 1) / 255 / 3;
tf2.dispose([last.inputTensor, t.diff, t.squared, t.sum]); tf2.dispose([last.inputTensor, t.diff, t.squared, t.sum]);
last.inputTensor = tf2.clone(input); last.inputTensor = tf2.clone(input);
skipFrame = diffRelative <= config3.cacheSensitivity; skipFrame = diffRelative <= (config3.cacheSensitivity || 0);
} }
return skipFrame; return skipFrame;
} }
@ -1372,7 +1371,7 @@ var env = new Env();
var tf36 = __toModule(require_tfjs_esm()); var tf36 = __toModule(require_tfjs_esm());
// package.json // package.json
var version2 = "2.5.6"; var version2 = "2.5.7";
// src/tfjs/humangl.ts // src/tfjs/humangl.ts
var tf31 = __toModule(require_tfjs_esm()); var tf31 = __toModule(require_tfjs_esm());
@ -4913,8 +4912,8 @@ var UV7 = VTX7.map((x) => UV468[x]);
// src/face/facemeshutil.ts // src/face/facemeshutil.ts
var getBoxSize = (box5) => [Math.abs(box5.endPoint[0] - box5.startPoint[0]), Math.abs(box5.endPoint[1] - box5.startPoint[1])]; var getBoxSize = (box5) => [Math.abs(box5.endPoint[0] - box5.startPoint[0]), Math.abs(box5.endPoint[1] - box5.startPoint[1])];
var getBoxCenter = (box5) => [box5.startPoint[0] + (box5.endPoint[0] - box5.startPoint[0]) / 2, box5.startPoint[1] + (box5.endPoint[1] - box5.startPoint[1]) / 2]; var getBoxCenter = (box5) => [box5.startPoint[0] + (box5.endPoint[0] - box5.startPoint[0]) / 2, box5.startPoint[1] + (box5.endPoint[1] - box5.startPoint[1]) / 2, 1];
var getClampedBox = (box5, input) => box5 ? [ var clampBox = (box5, input) => box5 ? [
Math.trunc(Math.max(0, box5.startPoint[0])), Math.trunc(Math.max(0, box5.startPoint[0])),
Math.trunc(Math.max(0, box5.startPoint[1])), Math.trunc(Math.max(0, box5.startPoint[1])),
Math.trunc(Math.min(input.shape[2] || 0, box5.endPoint[0]) - Math.max(0, box5.startPoint[0])), Math.trunc(Math.min(input.shape[2] || 0, box5.endPoint[0]) - Math.max(0, box5.startPoint[0])),
@ -4931,10 +4930,11 @@ var scaleBoxCoordinates = (box5, factor) => {
const endPoint = [box5.endPoint[0] * factor[0], box5.endPoint[1] * factor[1]]; const endPoint = [box5.endPoint[0] * factor[0], box5.endPoint[1] * factor[1]];
return { startPoint, endPoint, landmarks: box5.landmarks, confidence: box5.confidence }; return { startPoint, endPoint, landmarks: box5.landmarks, confidence: box5.confidence };
}; };
var cutBoxFromImageAndResize = (box5, image29, cropSize) => { var cutAndResize = (box5, image29, cropSize) => {
const h = image29.shape[1]; const h = image29.shape[1];
const w = image29.shape[2]; const w = image29.shape[2];
const crop2 = tf9.image.cropAndResize(image29, [[box5.startPoint[1] / h, box5.startPoint[0] / w, box5.endPoint[1] / h, box5.endPoint[0] / w]], [0], cropSize); const cutBox = [box5.startPoint[1] / h, box5.startPoint[0] / w, box5.endPoint[1] / h, box5.endPoint[0] / w];
const crop2 = tf9.image.cropAndResize(image29, [cutBox], [0], cropSize);
const norm = tf9.div(crop2, constants.tf255); const norm = tf9.div(crop2, constants.tf255);
tf9.dispose(crop2); tf9.dispose(crop2);
return norm; return norm;
@ -4952,9 +4952,9 @@ var squarifyBox = (box5) => {
return { startPoint: [Math.round(centers[0] - halfSize), Math.round(centers[1] - halfSize)], endPoint: [Math.round(centers[0] + halfSize), Math.round(centers[1] + halfSize)], landmarks: box5.landmarks, confidence: box5.confidence }; return { startPoint: [Math.round(centers[0] - halfSize), Math.round(centers[1] - halfSize)], endPoint: [Math.round(centers[0] + halfSize), Math.round(centers[1] + halfSize)], landmarks: box5.landmarks, confidence: box5.confidence };
}; };
var calculateLandmarksBoundingBox = (landmarks) => { var calculateLandmarksBoundingBox = (landmarks) => {
const xs = landmarks.map((d) => d[0]); const x = landmarks.map((d) => d[0]);
const ys = landmarks.map((d) => d[1]); const y = landmarks.map((d) => d[1]);
return { startPoint: [Math.min(...xs), Math.min(...ys)], endPoint: [Math.max(...xs), Math.max(...ys)], landmarks }; return { startPoint: [Math.min(...x), Math.min(...y)], endPoint: [Math.max(...x), Math.max(...y)], landmarks };
}; };
var fixedRotationMatrix = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]; var fixedRotationMatrix = [[1, 0, 0], [0, 1, 0], [0, 0, 1]];
var normalizeRadians = (angle) => angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI)); var normalizeRadians = (angle) => angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI));
@ -5028,11 +5028,12 @@ function transformRawCoords(coordsRaw, box5, angle, rotationMatrix, inputSize9)
const coordsRotationMatrix = largeAngle ? buildRotationMatrix(angle, [0, 0]) : fixedRotationMatrix; const coordsRotationMatrix = largeAngle ? buildRotationMatrix(angle, [0, 0]) : fixedRotationMatrix;
const coordsRotated = largeAngle ? coordsScaled.map((coord) => [...rotatePoint(coord, coordsRotationMatrix), coord[2]]) : coordsScaled; const coordsRotated = largeAngle ? coordsScaled.map((coord) => [...rotatePoint(coord, coordsRotationMatrix), coord[2]]) : coordsScaled;
const inverseRotationMatrix = largeAngle ? invertTransformMatrix(rotationMatrix) : fixedRotationMatrix; const inverseRotationMatrix = largeAngle ? invertTransformMatrix(rotationMatrix) : fixedRotationMatrix;
const boxCenter = [...getBoxCenter({ startPoint: box5.startPoint, endPoint: box5.endPoint }), 1]; const boxCenter = getBoxCenter(box5);
const offsets = [dot(boxCenter, inverseRotationMatrix[0]), dot(boxCenter, inverseRotationMatrix[1])];
return coordsRotated.map((coord) => [ return coordsRotated.map((coord) => [
Math.round(coord[0] + dot(boxCenter, inverseRotationMatrix[0])), Math.trunc(coord[0] + offsets[0]),
Math.round(coord[1] + dot(boxCenter, inverseRotationMatrix[1])), Math.trunc(coord[1] + offsets[1]),
Math.round(coord[2] || 0) Math.trunc(coord[2] || 0)
]); ]);
} }
function correctFaceRotation(rotate, box5, input, inputSize9) { function correctFaceRotation(rotate, box5, input, inputSize9) {
@ -5044,23 +5045,38 @@ function correctFaceRotation(rotate, box5, input, inputSize9) {
angle = computeRotation(box5.landmarks[symmetryLine[0]], box5.landmarks[symmetryLine[1]]); angle = computeRotation(box5.landmarks[symmetryLine[0]], box5.landmarks[symmetryLine[1]]);
const largeAngle = angle && angle !== 0 && Math.abs(angle) > 0.2; const largeAngle = angle && angle !== 0 && Math.abs(angle) > 0.2;
if (largeAngle) { if (largeAngle) {
const center = getBoxCenter({ startPoint: box5.startPoint, endPoint: box5.endPoint }); const center = getBoxCenter(box5);
const centerRaw = [center[0] / input.shape[2], center[1] / input.shape[1]]; const centerRaw = [center[0] / input.shape[2], center[1] / input.shape[1]];
const rotated = tf9.image.rotateWithOffset(input, angle, 0, centerRaw); const rotated = tf9.image.rotateWithOffset(input, angle, 0, centerRaw);
rotationMatrix = buildRotationMatrix(-angle, center); rotationMatrix = buildRotationMatrix(-angle, center);
face5 = cutBoxFromImageAndResize(box5, rotated, [inputSize9, inputSize9]); face5 = cutAndResize(box5, rotated, [inputSize9, inputSize9]);
tf9.dispose(rotated); tf9.dispose(rotated);
} else { } else {
face5 = cutBoxFromImageAndResize(box5, input, [inputSize9, inputSize9]); face5 = cutAndResize(box5, input, [inputSize9, inputSize9]);
} }
} else { } else {
face5 = cutBoxFromImageAndResize(box5, input, [inputSize9, inputSize9]); face5 = cutAndResize(box5, input, [inputSize9, inputSize9]);
} }
return [angle, rotationMatrix, face5]; return [angle, rotationMatrix, face5];
} }
var findFaceCenter = (mesh) => {
const x = mesh.map((m) => m[0]);
const y = mesh.map((m) => m[1]);
return [Math.min(...x) + (Math.max(...x) - Math.min(...x)) / 2, Math.min(...y) + (Math.max(...y) - Math.min(...y)) / 2];
};
var calculateFaceBox = (mesh, previousBox) => {
const center = findFaceCenter(mesh);
const boxSize = getBoxSize(previousBox);
const calculatedBox = {
startPoint: [center[0] - boxSize[0] / 2, center[1] - boxSize[1] / 2],
endPoint: [center[0] + boxSize[0] / 2, center[1] + boxSize[1] / 2]
};
return calculatedBox;
};
// src/face/blazeface.ts // src/face/blazeface.ts
var keypointsCount = 6; var keypointsCount = 6;
var faceBoxScaleFactor = 1.2;
var model5; var model5;
var anchors = null; var anchors = null;
var inputSize = 0; var inputSize = 0;
@ -5102,7 +5118,7 @@ function decodeBounds(boxOutputs) {
async function getBoxes(inputImage, config3) { async function getBoxes(inputImage, config3) {
var _a, _b, _c, _d; var _a, _b, _c, _d;
if (!inputImage || inputImage["isDisposedInternal"] || inputImage.shape.length !== 4 || inputImage.shape[1] < 1 || inputImage.shape[2] < 1) if (!inputImage || inputImage["isDisposedInternal"] || inputImage.shape.length !== 4 || inputImage.shape[1] < 1 || inputImage.shape[2] < 1)
return { boxes: [] }; return [];
const t = {}; const t = {};
t.resized = tf10.image.resizeBilinear(inputImage, [inputSize, inputSize]); t.resized = tf10.image.resizeBilinear(inputImage, [inputSize, inputSize]);
t.div = tf10.div(t.resized, constants.tf127); t.div = tf10.div(t.resized, constants.tf127);
@ -5135,17 +5151,21 @@ async function getBoxes(inputImage, config3) {
b.squeeze = tf10.squeeze(b.slice); b.squeeze = tf10.squeeze(b.slice);
b.landmarks = tf10.reshape(b.squeeze, [keypointsCount, -1]); b.landmarks = tf10.reshape(b.squeeze, [keypointsCount, -1]);
const points = await b.bbox.data(); const points = await b.bbox.data();
boxes.push({ const rawBox = {
startPoint: [points[0], points[1]], startPoint: [points[0], points[1]],
endPoint: [points[2], points[3]], endPoint: [points[2], points[3]],
landmarks: await b.landmarks.array(), landmarks: await b.landmarks.array(),
confidence confidence
}); };
const scaledBox = scaleBoxCoordinates(rawBox, [(inputImage.shape[2] || 0) / inputSize, (inputImage.shape[1] || 0) / inputSize]);
const enlargedBox = enlargeBox(scaledBox, faceBoxScaleFactor);
const squaredBox = squarifyBox(enlargedBox);
boxes.push(squaredBox);
Object.keys(b).forEach((tensor3) => tf10.dispose(b[tensor3])); Object.keys(b).forEach((tensor3) => tf10.dispose(b[tensor3]));
} }
} }
Object.keys(t).forEach((tensor3) => tf10.dispose(t[tensor3])); Object.keys(t).forEach((tensor3) => tf10.dispose(t[tensor3]));
return { boxes, scaleFactor: [inputImage.shape[2] / inputSize, inputImage.shape[1] / inputSize] }; return boxes;
} }
// src/body/blazepose.ts // src/body/blazepose.ts
@ -5998,36 +6018,29 @@ async function augmentIris(rawCoords, face5, config3, meshSize) {
} }
// src/face/facemesh.ts // src/face/facemesh.ts
var boxCache = []; var cache3 = {
boxes: [],
skipped: Number.MAX_SAFE_INTEGER,
timestamp: 0
};
var model11 = null; var model11 = null;
var inputSize6 = 0; var inputSize6 = 0;
var skipped10 = Number.MAX_SAFE_INTEGER;
var lastTime10 = 0;
async function predict10(input, config3) { async function predict10(input, config3) {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k; var _a, _b, _c, _d, _e, _f, _g, _h;
const skipTime = (((_a = config3.face.detector) == null ? void 0 : _a.skipTime) || 0) > now() - lastTime10; const skipTime = (((_a = config3.face.detector) == null ? void 0 : _a.skipTime) || 0) > now() - cache3.timestamp;
const skipFrame = skipped10 < (((_b = config3.face.detector) == null ? void 0 : _b.skipFrames) || 0); const skipFrame = cache3.skipped < (((_b = config3.face.detector) == null ? void 0 : _b.skipFrames) || 0);
if (!config3.skipAllowed || !skipTime || !skipFrame || boxCache.length === 0) { if (!config3.skipAllowed || !skipTime || !skipFrame || cache3.boxes.length === 0) {
const possibleBoxes = await getBoxes(input, config3); cache3.boxes = await getBoxes(input, config3);
lastTime10 = now(); cache3.timestamp = now();
boxCache = []; cache3.skipped = 0;
for (const possible of possibleBoxes.boxes) {
const boxScaled = scaleBoxCoordinates(possible, possibleBoxes.scaleFactor);
const detectedWidth = (boxScaled.endPoint[0] - boxScaled.startPoint[0]) / (input.shape[2] || 1e3);
const calcFactor = (((_c = config3.face.detector) == null ? void 0 : _c.cropFactor) || 1.6) / (detectedWidth + 0.75) / 1.34;
const boxEnlarged = enlargeBox(boxScaled, calcFactor);
const boxSquared = squarifyBox(boxEnlarged);
boxCache.push(boxSquared);
}
skipped10 = 0;
} else { } else {
skipped10++; cache3.skipped++;
} }
const faces = []; const faces = [];
const newCache = []; const newCache = [];
let id = 0; let id = 0;
for (let i = 0; i < boxCache.length; i++) { for (let i = 0; i < cache3.boxes.length; i++) {
let box5 = boxCache[i]; const box5 = cache3.boxes[i];
let angle = 0; let angle = 0;
let rotationMatrix; let rotationMatrix;
const face5 = { const face5 = {
@ -6041,15 +6054,15 @@ async function predict10(input, config3) {
faceScore: 0, faceScore: 0,
annotations: {} annotations: {}
}; };
[angle, rotationMatrix, face5.tensor] = correctFaceRotation((_d = config3.face.detector) == null ? void 0 : _d.rotation, box5, input, ((_e = config3.face.mesh) == null ? void 0 : _e.enabled) ? inputSize6 : size()); [angle, rotationMatrix, face5.tensor] = correctFaceRotation((_c = config3.face.detector) == null ? void 0 : _c.rotation, box5, input, ((_d = config3.face.mesh) == null ? void 0 : _d.enabled) ? inputSize6 : size());
if ((_f = config3 == null ? void 0 : config3.filter) == null ? void 0 : _f.equalization) { if ((_e = config3 == null ? void 0 : config3.filter) == null ? void 0 : _e.equalization) {
const equilized = await histogramEqualization(face5.tensor); const equilized = await histogramEqualization(face5.tensor);
tf18.dispose(face5.tensor); tf18.dispose(face5.tensor);
face5.tensor = equilized; face5.tensor = equilized;
} }
face5.boxScore = Math.round(100 * box5.confidence) / 100; face5.boxScore = Math.round(100 * box5.confidence) / 100;
if (!((_g = config3.face.mesh) == null ? void 0 : _g.enabled)) { if (!((_f = config3.face.mesh) == null ? void 0 : _f.enabled)) {
face5.box = getClampedBox(box5, input); face5.box = clampBox(box5, input);
face5.boxRaw = getRawBox(box5, input); face5.boxRaw = getRawBox(box5, input);
face5.score = face5.boxScore; face5.score = face5.boxScore;
face5.mesh = box5.landmarks.map((pt) => [ face5.mesh = box5.landmarks.map((pt) => [
@ -6069,30 +6082,25 @@ async function predict10(input, config3) {
const coordsReshaped = tf18.reshape(contourCoords, [-1, 3]); const coordsReshaped = tf18.reshape(contourCoords, [-1, 3]);
let rawCoords = await coordsReshaped.array(); let rawCoords = await coordsReshaped.array();
tf18.dispose([contourCoords, coordsReshaped, confidence, contours]); tf18.dispose([contourCoords, coordsReshaped, confidence, contours]);
if (face5.faceScore < (((_h = config3.face.detector) == null ? void 0 : _h.minConfidence) || 1)) { if (face5.faceScore < (((_g = config3.face.detector) == null ? void 0 : _g.minConfidence) || 1)) {
box5.confidence = face5.faceScore; box5.confidence = face5.faceScore;
} else { } else {
if ((_i = config3.face.iris) == null ? void 0 : _i.enabled) if ((_h = config3.face.iris) == null ? void 0 : _h.enabled)
rawCoords = await augmentIris(rawCoords, face5.tensor, config3, inputSize6); rawCoords = await augmentIris(rawCoords, face5.tensor, config3, inputSize6);
face5.mesh = transformRawCoords(rawCoords, box5, angle, rotationMatrix, inputSize6); face5.mesh = transformRawCoords(rawCoords, box5, angle, rotationMatrix, inputSize6);
face5.meshRaw = face5.mesh.map((pt) => [pt[0] / (input.shape[2] || 0), pt[1] / (input.shape[1] || 0), (pt[2] || 0) / inputSize6]); face5.meshRaw = face5.mesh.map((pt) => [pt[0] / (input.shape[2] || 0), pt[1] / (input.shape[1] || 0), (pt[2] || 0) / inputSize6]);
for (const key of Object.keys(meshAnnotations)) for (const key of Object.keys(meshAnnotations))
face5.annotations[key] = meshAnnotations[key].map((index2) => face5.mesh[index2]); face5.annotations[key] = meshAnnotations[key].map((index2) => face5.mesh[index2]);
const boxCalculated = calculateLandmarksBoundingBox(face5.mesh);
const boxEnlarged = enlargeBox(boxCalculated, ((_j = config3.face.detector) == null ? void 0 : _j.cropFactor) || 1.6);
const boxSquared = squarifyBox(boxEnlarged);
box5 = { ...boxSquared, confidence: box5.confidence };
face5.box = getClampedBox(box5, input);
face5.boxRaw = getRawBox(box5, input);
face5.score = face5.faceScore; face5.score = face5.faceScore;
newCache.push(box5); const calculatedBox = { ...calculateFaceBox(face5.mesh, box5), confidence: box5.confidence, landmarks: box5.landmarks };
tf18.dispose(face5.tensor); face5.box = clampBox(calculatedBox, input);
[angle, rotationMatrix, face5.tensor] = correctFaceRotation((_k = config3.face.detector) == null ? void 0 : _k.rotation, box5, input, inputSize6); face5.boxRaw = getRawBox(calculatedBox, input);
newCache.push(calculatedBox);
} }
} }
faces.push(face5); faces.push(face5);
} }
boxCache = [...newCache]; cache3.boxes = newCache;
return faces; return faces;
} }
async function load11(config3) { async function load11(config3) {
@ -6117,9 +6125,9 @@ var uvmap = UV468;
var tf19 = __toModule(require_tfjs_esm()); var tf19 = __toModule(require_tfjs_esm());
var model12; var model12;
var last8 = []; var last8 = [];
var lastTime11 = 0; var lastTime10 = 0;
var lastCount7 = 0; var lastCount7 = 0;
var skipped11 = Number.MAX_SAFE_INTEGER; var skipped10 = Number.MAX_SAFE_INTEGER;
async function load12(config3) { async function load12(config3) {
var _a, _b; var _a, _b;
const modelUrl = join(config3.modelBasePath, ((_a = config3.face.description) == null ? void 0 : _a.modelPath) || ""); const modelUrl = join(config3.modelBasePath, ((_a = config3.face.description) == null ? void 0 : _a.modelPath) || "");
@ -6148,13 +6156,13 @@ async function predict11(image29, config3, idx, count2) {
var _a, _b, _c, _d; var _a, _b, _c, _d;
if (!model12) if (!model12)
return { age: 0, gender: "unknown", genderScore: 0, descriptor: [] }; return { age: 0, gender: "unknown", genderScore: 0, descriptor: [] };
const skipFrame = skipped11 < (((_a = config3.face.description) == null ? void 0 : _a.skipFrames) || 0); const skipFrame = skipped10 < (((_a = config3.face.description) == null ? void 0 : _a.skipFrames) || 0);
const skipTime = (((_b = config3.face.description) == null ? void 0 : _b.skipTime) || 0) > now() - lastTime11; const skipTime = (((_b = config3.face.description) == null ? void 0 : _b.skipTime) || 0) > now() - lastTime10;
if (config3.skipAllowed && skipFrame && skipTime && lastCount7 === count2 && ((_c = last8[idx]) == null ? void 0 : _c.age) && ((_d = last8[idx]) == null ? void 0 : _d.age) > 0) { if (config3.skipAllowed && skipFrame && skipTime && lastCount7 === count2 && ((_c = last8[idx]) == null ? void 0 : _c.age) && ((_d = last8[idx]) == null ? void 0 : _d.age) > 0) {
skipped11++; skipped10++;
return last8[idx]; return last8[idx];
} }
skipped11 = 0; skipped10 = 0;
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
var _a2, _b2; var _a2, _b2;
const obj = { const obj = {
@ -6166,7 +6174,7 @@ async function predict11(image29, config3, idx, count2) {
if ((_a2 = config3.face.description) == null ? void 0 : _a2.enabled) { if ((_a2 = config3.face.description) == null ? void 0 : _a2.enabled) {
const enhanced = enhance2(image29); const enhanced = enhance2(image29);
const resT = model12 == null ? void 0 : model12.execute(enhanced); const resT = model12 == null ? void 0 : model12.execute(enhanced);
lastTime11 = now(); lastTime10 = now();
tf19.dispose(enhanced); tf19.dispose(enhanced);
const genderT = await resT.find((t) => t.shape[1] === 1); const genderT = await resT.find((t) => t.shape[1] === 1);
const gender = await genderT.data(); const gender = await genderT.data();
@ -6212,7 +6220,7 @@ function getBoxCenter2(box5) {
box5.startPoint[1] + (box5.endPoint[1] - box5.startPoint[1]) / 2 box5.startPoint[1] + (box5.endPoint[1] - box5.startPoint[1]) / 2
]; ];
} }
function cutBoxFromImageAndResize2(box5, image29, cropSize) { function cutBoxFromImageAndResize(box5, image29, cropSize) {
const h = image29.shape[1]; const h = image29.shape[1];
const w = image29.shape[2]; const w = image29.shape[2];
const boxes = [[ const boxes = [[
@ -9342,7 +9350,7 @@ var handBoxEnlargeFactor = 1.65;
var palmLandmarkIds = [0, 5, 9, 13, 17, 1, 2]; var palmLandmarkIds = [0, 5, 9, 13, 17, 1, 2];
var palmLandmarksPalmBase = 0; var palmLandmarksPalmBase = 0;
var palmLandmarksMiddleFingerBase = 2; var palmLandmarksMiddleFingerBase = 2;
var lastTime12 = 0; var lastTime11 = 0;
var HandPipeline = class { var HandPipeline = class {
constructor(handDetector, handPoseModel2) { constructor(handDetector, handPoseModel2) {
__publicField(this, "handDetector"); __publicField(this, "handDetector");
@ -9407,7 +9415,7 @@ var HandPipeline = class {
async estimateHands(image29, config3) { async estimateHands(image29, config3) {
let useFreshBox = false; let useFreshBox = false;
let boxes; let boxes;
const skipTime = (config3.hand.skipTime || 0) > now() - lastTime12; const skipTime = (config3.hand.skipTime || 0) > now() - lastTime11;
const skipFrame = this.skipped < (config3.hand.skipFrames || 0); const skipFrame = this.skipped < (config3.hand.skipFrames || 0);
if (config3.skipAllowed && skipTime && skipFrame) { if (config3.skipAllowed && skipTime && skipFrame) {
boxes = await this.handDetector.predict(image29, config3); boxes = await this.handDetector.predict(image29, config3);
@ -9433,12 +9441,12 @@ var HandPipeline = class {
const rotatedImage = config3.hand.rotation && env.kernels.includes("rotatewithoffset") ? tf22.image.rotateWithOffset(image29, angle, 0, palmCenterNormalized) : image29.clone(); const rotatedImage = config3.hand.rotation && env.kernels.includes("rotatewithoffset") ? tf22.image.rotateWithOffset(image29, angle, 0, palmCenterNormalized) : image29.clone();
const rotationMatrix = buildRotationMatrix2(-angle, palmCenter); const rotationMatrix = buildRotationMatrix2(-angle, palmCenter);
const newBox = useFreshBox ? this.getBoxForPalmLandmarks(currentBox.palmLandmarks, rotationMatrix) : currentBox; const newBox = useFreshBox ? this.getBoxForPalmLandmarks(currentBox.palmLandmarks, rotationMatrix) : currentBox;
const croppedInput = cutBoxFromImageAndResize2(newBox, rotatedImage, [this.inputSize, this.inputSize]); const croppedInput = cutBoxFromImageAndResize(newBox, rotatedImage, [this.inputSize, this.inputSize]);
const handImage = tf22.div(croppedInput, constants.tf255); const handImage = tf22.div(croppedInput, constants.tf255);
tf22.dispose(croppedInput); tf22.dispose(croppedInput);
tf22.dispose(rotatedImage); tf22.dispose(rotatedImage);
const [confidenceT, keypoints] = this.handPoseModel.execute(handImage); const [confidenceT, keypoints] = this.handPoseModel.execute(handImage);
lastTime12 = now(); lastTime11 = now();
tf22.dispose(handImage); tf22.dispose(handImage);
const confidence = (await confidenceT.data())[0]; const confidence = (await confidenceT.data())[0];
tf22.dispose(confidenceT); tf22.dispose(confidenceT);
@ -9998,10 +10006,10 @@ var faceIndex = 4;
var boxExpandFact = 1.6; var boxExpandFact = 1.6;
var maxDetectorResolution = 512; var maxDetectorResolution = 512;
var detectorExpandFact = 1.4; var detectorExpandFact = 1.4;
var skipped12 = Number.MAX_SAFE_INTEGER; var skipped11 = Number.MAX_SAFE_INTEGER;
var lastTime13 = 0; var lastTime12 = 0;
var outputSize = [0, 0]; var outputSize = [0, 0];
var cache3 = { var cache4 = {
boxes: [], boxes: [],
hands: [] hands: []
}; };
@ -10137,44 +10145,44 @@ async function predict13(input, config3) {
if (!models2[0] || !models2[1] || !((_a = models2[0]) == null ? void 0 : _a.inputs[0].shape) || !((_b = models2[1]) == null ? void 0 : _b.inputs[0].shape)) if (!models2[0] || !models2[1] || !((_a = models2[0]) == null ? void 0 : _a.inputs[0].shape) || !((_b = models2[1]) == null ? void 0 : _b.inputs[0].shape))
return []; return [];
outputSize = [input.shape[2] || 0, input.shape[1] || 0]; outputSize = [input.shape[2] || 0, input.shape[1] || 0];
skipped12++; skipped11++;
const skipTime = (config3.hand.skipTime || 0) > now() - lastTime13; const skipTime = (config3.hand.skipTime || 0) > now() - lastTime12;
const skipFrame = skipped12 < (config3.hand.skipFrames || 0); const skipFrame = skipped11 < (config3.hand.skipFrames || 0);
if (config3.skipAllowed && skipTime && skipFrame) { if (config3.skipAllowed && skipTime && skipFrame) {
return cache3.hands; return cache4.hands;
} }
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
const skipTimeExtended = 3 * (config3.hand.skipTime || 0) > now() - lastTime13; const skipTimeExtended = 3 * (config3.hand.skipTime || 0) > now() - lastTime12;
const skipFrameExtended = skipped12 < 3 * (config3.hand.skipFrames || 0); const skipFrameExtended = skipped11 < 3 * (config3.hand.skipFrames || 0);
if (config3.skipAllowed && cache3.hands.length === config3.hand.maxDetected) { if (config3.skipAllowed && cache4.hands.length === config3.hand.maxDetected) {
cache3.hands = await Promise.all(cache3.boxes.map((handBox) => detectFingers(input, handBox, config3))); cache4.hands = await Promise.all(cache4.boxes.map((handBox) => detectFingers(input, handBox, config3)));
} else if (config3.skipAllowed && skipTimeExtended && skipFrameExtended && cache3.hands.length > 0) { } else if (config3.skipAllowed && skipTimeExtended && skipFrameExtended && cache4.hands.length > 0) {
cache3.hands = await Promise.all(cache3.boxes.map((handBox) => detectFingers(input, handBox, config3))); cache4.hands = await Promise.all(cache4.boxes.map((handBox) => detectFingers(input, handBox, config3)));
} else { } else {
cache3.boxes = await detectHands(input, config3); cache4.boxes = await detectHands(input, config3);
lastTime13 = now(); lastTime12 = now();
cache3.hands = await Promise.all(cache3.boxes.map((handBox) => detectFingers(input, handBox, config3))); cache4.hands = await Promise.all(cache4.boxes.map((handBox) => detectFingers(input, handBox, config3)));
skipped12 = 0; skipped11 = 0;
} }
const oldCache = [...cache3.boxes]; const oldCache = [...cache4.boxes];
cache3.boxes.length = 0; cache4.boxes.length = 0;
if (config3.cacheSensitivity > 0) { if (config3.cacheSensitivity > 0) {
for (let i = 0; i < cache3.hands.length; i++) { for (let i = 0; i < cache4.hands.length; i++) {
const boxKpt = square(cache3.hands[i].keypoints, outputSize); const boxKpt = square(cache4.hands[i].keypoints, outputSize);
if (boxKpt.box[2] / (input.shape[2] || 1) > 0.05 && boxKpt.box[3] / (input.shape[1] || 1) > 0.05 && cache3.hands[i].fingerScore && cache3.hands[i].fingerScore > (config3.hand.minConfidence || 0)) { if (boxKpt.box[2] / (input.shape[2] || 1) > 0.05 && boxKpt.box[3] / (input.shape[1] || 1) > 0.05 && cache4.hands[i].fingerScore && cache4.hands[i].fingerScore > (config3.hand.minConfidence || 0)) {
const boxScale = scale(boxKpt.box, boxExpandFact); const boxScale = scale(boxKpt.box, boxExpandFact);
const boxScaleRaw = scale(boxKpt.boxRaw, boxExpandFact); const boxScaleRaw = scale(boxKpt.boxRaw, boxExpandFact);
const boxCrop = crop(boxScaleRaw); const boxCrop = crop(boxScaleRaw);
cache3.boxes.push({ ...oldCache[i], box: boxScale, boxRaw: boxScaleRaw, boxCrop }); cache4.boxes.push({ ...oldCache[i], box: boxScale, boxRaw: boxScaleRaw, boxCrop });
} }
} }
} }
for (let i = 0; i < cache3.hands.length; i++) { for (let i = 0; i < cache4.hands.length; i++) {
const bbox = calc(cache3.hands[i].keypoints, outputSize); const bbox = calc(cache4.hands[i].keypoints, outputSize);
cache3.hands[i].box = bbox.box; cache4.hands[i].box = bbox.box;
cache3.hands[i].boxRaw = bbox.boxRaw; cache4.hands[i].boxRaw = bbox.boxRaw;
} }
resolve(cache3.hands); resolve(cache4.hands);
}); });
} }
@ -10182,9 +10190,9 @@ async function predict13(input, config3) {
var tf25 = __toModule(require_tfjs_esm()); var tf25 = __toModule(require_tfjs_esm());
var model13; var model13;
var cached2 = []; var cached2 = [];
var skipped13 = Number.MAX_SAFE_INTEGER; var skipped12 = Number.MAX_SAFE_INTEGER;
var lastCount8 = 0; var lastCount8 = 0;
var lastTime14 = 0; var lastTime13 = 0;
async function load14(config3) { async function load14(config3) {
var _a, _b; var _a, _b;
if (env.initial) if (env.initial)
@ -10203,20 +10211,20 @@ async function predict14(image29, config3, idx, count2) {
var _a, _b; var _a, _b;
if (!model13) if (!model13)
return 0; return 0;
const skipTime = (((_a = config3.face.liveness) == null ? void 0 : _a.skipTime) || 0) > now() - lastTime14; const skipTime = (((_a = config3.face.liveness) == null ? void 0 : _a.skipTime) || 0) > now() - lastTime13;
const skipFrame = skipped13 < (((_b = config3.face.liveness) == null ? void 0 : _b.skipFrames) || 0); const skipFrame = skipped12 < (((_b = config3.face.liveness) == null ? void 0 : _b.skipFrames) || 0);
if (config3.skipAllowed && skipTime && skipFrame && lastCount8 === count2 && cached2[idx]) { if (config3.skipAllowed && skipTime && skipFrame && lastCount8 === count2 && cached2[idx]) {
skipped13++; skipped12++;
return cached2[idx]; return cached2[idx];
} }
skipped13 = 0; skipped12 = 0;
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
const resize = tf25.image.resizeBilinear(image29, [(model13 == null ? void 0 : model13.inputs[0].shape) ? model13.inputs[0].shape[2] : 0, (model13 == null ? void 0 : model13.inputs[0].shape) ? model13.inputs[0].shape[1] : 0], false); const resize = tf25.image.resizeBilinear(image29, [(model13 == null ? void 0 : model13.inputs[0].shape) ? model13.inputs[0].shape[2] : 0, (model13 == null ? void 0 : model13.inputs[0].shape) ? model13.inputs[0].shape[1] : 0], false);
const res = model13 == null ? void 0 : model13.execute(resize); const res = model13 == null ? void 0 : model13.execute(resize);
const num = (await res.data())[0]; const num = (await res.data())[0];
cached2[idx] = Math.round(100 * num) / 100; cached2[idx] = Math.round(100 * num) / 100;
lastCount8 = count2; lastCount8 = count2;
lastTime14 = now(); lastTime13 = now();
tf25.dispose([resize, res]); tf25.dispose([resize, res]);
resolve(cached2[idx]); resolve(cached2[idx]);
}); });
@ -10285,7 +10293,7 @@ var connected3 = {
// src/body/movenetfix.ts // src/body/movenetfix.ts
var tf26 = __toModule(require_tfjs_esm()); var tf26 = __toModule(require_tfjs_esm());
var maxJitter = 5e-3; var maxJitter = 5e-3;
var cache4 = { var cache5 = {
keypoints: [], keypoints: [],
padding: [[0, 0], [0, 0], [0, 0], [0, 0]] padding: [[0, 0], [0, 0], [0, 0], [0, 0]]
}; };
@ -10334,15 +10342,15 @@ function bodyParts(body4) {
} }
function jitter(keypoints) { function jitter(keypoints) {
for (let i = 0; i < keypoints.length; i++) { for (let i = 0; i < keypoints.length; i++) {
if (keypoints[i] && cache4.keypoints[i]) { if (keypoints[i] && cache5.keypoints[i]) {
const diff = [Math.abs(keypoints[i].positionRaw[0] - cache4.keypoints[i].positionRaw[0]), Math.abs(keypoints[i].positionRaw[1] - cache4.keypoints[i].positionRaw[1])]; const diff = [Math.abs(keypoints[i].positionRaw[0] - cache5.keypoints[i].positionRaw[0]), Math.abs(keypoints[i].positionRaw[1] - cache5.keypoints[i].positionRaw[1])];
if (diff[0] < maxJitter && diff[1] < maxJitter) { if (diff[0] < maxJitter && diff[1] < maxJitter) {
keypoints[i] = cache4.keypoints[i]; keypoints[i] = cache5.keypoints[i];
} else { } else {
cache4.keypoints[i] = keypoints[i]; cache5.keypoints[i] = keypoints[i];
} }
} else { } else {
cache4.keypoints[i] = keypoints[i]; cache5.keypoints[i] = keypoints[i];
} }
} }
return keypoints; return keypoints;
@ -10351,13 +10359,13 @@ function padInput(input, inputSize9) {
const t = {}; const t = {};
if (!input.shape || !input.shape[1] || !input.shape[2]) if (!input.shape || !input.shape[1] || !input.shape[2])
return input; return input;
cache4.padding = [ cache5.padding = [
[0, 0], [0, 0],
[input.shape[2] > input.shape[1] ? Math.trunc((input.shape[2] - input.shape[1]) / 2) : 0, input.shape[2] > input.shape[1] ? Math.trunc((input.shape[2] - input.shape[1]) / 2) : 0], [input.shape[2] > input.shape[1] ? Math.trunc((input.shape[2] - input.shape[1]) / 2) : 0, input.shape[2] > input.shape[1] ? Math.trunc((input.shape[2] - input.shape[1]) / 2) : 0],
[input.shape[1] > input.shape[2] ? Math.trunc((input.shape[1] - input.shape[2]) / 2) : 0, input.shape[1] > input.shape[2] ? Math.trunc((input.shape[1] - input.shape[2]) / 2) : 0], [input.shape[1] > input.shape[2] ? Math.trunc((input.shape[1] - input.shape[2]) / 2) : 0, input.shape[1] > input.shape[2] ? Math.trunc((input.shape[1] - input.shape[2]) / 2) : 0],
[0, 0] [0, 0]
]; ];
t.pad = tf26.pad(input, cache4.padding); t.pad = tf26.pad(input, cache5.padding);
t.resize = tf26.image.resizeBilinear(t.pad, [inputSize9, inputSize9]); t.resize = tf26.image.resizeBilinear(t.pad, [inputSize9, inputSize9]);
const final = tf26.cast(t.resize, "int32"); const final = tf26.cast(t.resize, "int32");
Object.keys(t).forEach((tensor3) => tf26.dispose(t[tensor3])); Object.keys(t).forEach((tensor3) => tf26.dispose(t[tensor3]));
@ -10367,8 +10375,8 @@ function rescaleBody(body4, outputSize2) {
body4.keypoints = body4.keypoints.filter((kpt4) => kpt4 && kpt4.position); body4.keypoints = body4.keypoints.filter((kpt4) => kpt4 && kpt4.position);
for (const kpt4 of body4.keypoints) { for (const kpt4 of body4.keypoints) {
kpt4.position = [ kpt4.position = [
kpt4.position[0] * (outputSize2[0] + cache4.padding[2][0] + cache4.padding[2][1]) / outputSize2[0] - cache4.padding[2][0], kpt4.position[0] * (outputSize2[0] + cache5.padding[2][0] + cache5.padding[2][1]) / outputSize2[0] - cache5.padding[2][0],
kpt4.position[1] * (outputSize2[1] + cache4.padding[1][0] + cache4.padding[1][1]) / outputSize2[1] - cache4.padding[1][0] kpt4.position[1] * (outputSize2[1] + cache5.padding[1][0] + cache5.padding[1][1]) / outputSize2[1] - cache5.padding[1][0]
]; ];
kpt4.positionRaw = [ kpt4.positionRaw = [
kpt4.position[0] / outputSize2[0], kpt4.position[0] / outputSize2[0],
@ -10384,8 +10392,8 @@ function rescaleBody(body4, outputSize2) {
// src/body/movenet.ts // src/body/movenet.ts
var model14; var model14;
var inputSize8 = 0; var inputSize8 = 0;
var skipped14 = Number.MAX_SAFE_INTEGER; var skipped13 = Number.MAX_SAFE_INTEGER;
var cache5 = { var cache6 = {
boxes: [], boxes: [],
bodies: [], bodies: [],
last: 0 last: 0
@ -10488,27 +10496,27 @@ async function predict15(input, config3) {
if (!model14 || !(model14 == null ? void 0 : model14.inputs[0].shape)) if (!model14 || !(model14 == null ? void 0 : model14.inputs[0].shape))
return []; return [];
if (!config3.skipAllowed) if (!config3.skipAllowed)
cache5.boxes.length = 0; cache6.boxes.length = 0;
skipped14++; skipped13++;
const skipTime = (config3.body.skipTime || 0) > now() - cache5.last; const skipTime = (config3.body.skipTime || 0) > now() - cache6.last;
const skipFrame = skipped14 < (config3.body.skipFrames || 0); const skipFrame = skipped13 < (config3.body.skipFrames || 0);
if (config3.skipAllowed && skipTime && skipFrame) { if (config3.skipAllowed && skipTime && skipFrame) {
return cache5.bodies; return cache6.bodies;
} }
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
const t = {}; const t = {};
skipped14 = 0; skipped13 = 0;
t.input = padInput(input, inputSize8); t.input = padInput(input, inputSize8);
t.res = model14 == null ? void 0 : model14.execute(t.input); t.res = model14 == null ? void 0 : model14.execute(t.input);
cache5.last = now(); cache6.last = now();
const res = await t.res.array(); const res = await t.res.array();
cache5.bodies = t.res.shape[2] === 17 ? await parseSinglePose(res, config3, input) : await parseMultiPose(res, config3, input); cache6.bodies = t.res.shape[2] === 17 ? await parseSinglePose(res, config3, input) : await parseMultiPose(res, config3, input);
for (const body4 of cache5.bodies) { for (const body4 of cache6.bodies) {
rescaleBody(body4, [input.shape[2] || 1, input.shape[1] || 1]); rescaleBody(body4, [input.shape[2] || 1, input.shape[1] || 1]);
jitter(body4.keypoints); jitter(body4.keypoints);
} }
Object.keys(t).forEach((tensor3) => tf27.dispose(t[tensor3])); Object.keys(t).forEach((tensor3) => tf27.dispose(t[tensor3]));
resolve(cache5.bodies); resolve(cache6.bodies);
}); });
} }
@ -10516,8 +10524,8 @@ async function predict15(input, config3) {
var tf28 = __toModule(require_tfjs_esm()); var tf28 = __toModule(require_tfjs_esm());
var model15; var model15;
var last9 = []; var last9 = [];
var lastTime15 = 0; var lastTime14 = 0;
var skipped15 = Number.MAX_SAFE_INTEGER; var skipped14 = Number.MAX_SAFE_INTEGER;
var scaleBox = 2.5; var scaleBox = 2.5;
async function load16(config3) { async function load16(config3) {
if (!model15 || env.initial) { if (!model15 || env.initial) {
@ -10594,13 +10602,13 @@ async function process4(res, inputSize9, outputShape, config3) {
return results; return results;
} }
async function predict16(image29, config3) { async function predict16(image29, config3) {
const skipTime = (config3.object.skipTime || 0) > now() - lastTime15; const skipTime = (config3.object.skipTime || 0) > now() - lastTime14;
const skipFrame = skipped15 < (config3.object.skipFrames || 0); const skipFrame = skipped14 < (config3.object.skipFrames || 0);
if (config3.skipAllowed && skipTime && skipFrame && last9.length > 0) { if (config3.skipAllowed && skipTime && skipFrame && last9.length > 0) {
skipped15++; skipped14++;
return last9; return last9;
} }
skipped15 = 0; skipped14 = 0;
if (!env.kernels.includes("mod") || !env.kernels.includes("sparsetodense")) if (!env.kernels.includes("mod") || !env.kernels.includes("sparsetodense"))
return last9; return last9;
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
@ -10613,7 +10621,7 @@ async function predict16(image29, config3) {
let objectT; let objectT;
if (config3.object.enabled) if (config3.object.enabled)
objectT = model15.execute(transpose); objectT = model15.execute(transpose);
lastTime15 = now(); lastTime14 = now();
tf28.dispose(transpose); tf28.dispose(transpose);
const obj = await process4(objectT, model15.inputSize, outputSize2, config3); const obj = await process4(objectT, model15.inputSize, outputSize2, config3);
last9 = obj; last9 = obj;
@ -11140,41 +11148,29 @@ async function load19(instance) {
async function validate2(instance) { async function validate2(instance) {
const simpleOps = ["const", "placeholder", "noop", "pad", "squeeze", "add", "sub", "mul", "div"]; const simpleOps = ["const", "placeholder", "noop", "pad", "squeeze", "add", "sub", "mul", "div"];
for (const defined of Object.keys(instance.models)) { for (const defined of Object.keys(instance.models)) {
if (instance.models[defined]) { const model18 = instance.models[defined];
let models5 = []; if (!model18)
if (Array.isArray(instance.models[defined])) { continue;
models5 = instance.models[defined].filter((model18) => model18 !== null).map((model18) => model18 && model18.executor ? model18 : model18.model); const ops = [];
} else { const executor = model18 == null ? void 0 : model18.executor;
models5 = [instance.models[defined]]; if (executor && executor.graph.nodes) {
for (const kernel of Object.values(executor.graph.nodes)) {
const op = kernel.op.toLowerCase();
if (!ops.includes(op))
ops.push(op);
} }
for (const model18 of models5) { } else {
if (!model18) { if (!executor && instance.config.debug)
if (instance.config.debug) log("model signature not determined:", defined);
log("model marked as loaded but not defined:", defined); }
continue; const missing = [];
} for (const op of ops) {
const ops = []; if (!simpleOps.includes(op) && !instance.env.kernels.includes(op) && !instance.env.kernels.includes(op.replace("_", "")) && !instance.env.kernels.includes(op.replace("native", "")) && !instance.env.kernels.includes(op.replace("v2", ""))) {
const executor = model18 == null ? void 0 : model18.executor; missing.push(op);
if (executor && executor.graph.nodes) {
for (const kernel of Object.values(executor.graph.nodes)) {
const op = kernel.op.toLowerCase();
if (!ops.includes(op))
ops.push(op);
}
} else {
if (!executor && instance.config.debug)
log("model signature not determined:", defined);
}
const missing = [];
for (const op of ops) {
if (!simpleOps.includes(op) && !instance.env.kernels.includes(op) && !instance.env.kernels.includes(op.replace("_", "")) && !instance.env.kernels.includes(op.replace("native", "")) && !instance.env.kernels.includes(op.replace("v2", ""))) {
missing.push(op);
}
}
if (missing.length > 0 && instance.config.debug)
log("model validation:", defined, missing);
} }
} }
if (instance.config.debug && missing.length > 0)
log("model validation failed:", defined, missing);
} }
} }
@ -11457,12 +11453,12 @@ function point(ctx, x, y, z, localOptions) {
} }
function rect(ctx, x, y, width, height, localOptions) { function rect(ctx, x, y, width, height, localOptions) {
ctx.beginPath(); ctx.beginPath();
ctx.lineWidth = localOptions.lineWidth;
if (localOptions.useCurves) { if (localOptions.useCurves) {
const cx = (x + x + width) / 2; const cx = (x + x + width) / 2;
const cy = (y + y + height) / 2; const cy = (y + y + height) / 2;
ctx.ellipse(cx, cy, width / 2, height / 2, 0, 0, 2 * Math.PI); ctx.ellipse(cx, cy, width / 2, height / 2, 0, 0, 2 * Math.PI);
} else { } else {
ctx.lineWidth = localOptions.lineWidth;
ctx.moveTo(x + localOptions.roundRect, y); ctx.moveTo(x + localOptions.roundRect, y);
ctx.lineTo(x + width - localOptions.roundRect, y); ctx.lineTo(x + width - localOptions.roundRect, y);
ctx.quadraticCurveTo(x + width, y, x + width, y + localOptions.roundRect); ctx.quadraticCurveTo(x + width, y, x + width, y + localOptions.roundRect);
@ -11496,6 +11492,7 @@ function lines(ctx, points, localOptions) {
function curves(ctx, points, localOptions) { function curves(ctx, points, localOptions) {
if (points.length < 2) if (points.length < 2)
return; return;
ctx.lineWidth = localOptions.lineWidth;
if (!localOptions.useCurves || points.length <= 2) { if (!localOptions.useCurves || points.length <= 2) {
lines(ctx, points, localOptions); lines(ctx, points, localOptions);
return; return;
@ -11618,14 +11615,13 @@ async function face(inCanvas2, result, drawOptions) {
ctx.fillText(labels2[i], x + 4, y + 15); ctx.fillText(labels2[i], x + 4, y + 15);
} }
} }
ctx.lineWidth = 1; ctx.lineWidth = 2;
if (f.mesh && f.mesh.length > 0) { if (f.mesh && f.mesh.length > 0) {
if (localOptions.drawPoints) { if (localOptions.drawPoints) {
for (const pt of f.mesh) for (const pt of f.mesh)
point(ctx, pt[0], pt[1], pt[2], localOptions); point(ctx, pt[0], pt[1], pt[2], localOptions);
} }
if (localOptions.drawPolygons) { if (localOptions.drawPolygons) {
ctx.lineWidth = 1;
if (f.mesh.length > 450) { if (f.mesh.length > 450) {
for (let i = 0; i < TRI468.length / 3; i++) { for (let i = 0; i < TRI468.length / 3; i++) {
const points = [ const points = [
@ -11785,7 +11781,8 @@ async function hand(inCanvas2, result, drawOptions) {
const addHandLabel = (part, title) => { const addHandLabel = (part, title) => {
if (!part || part.length === 0 || !part[0]) if (!part || part.length === 0 || !part[0])
return; return;
ctx.fillStyle = localOptions.useDepth ? `rgba(${127.5 + 2 * part[part.length - 1][2]}, ${127.5 - 2 * part[part.length - 1][2]}, 255, 0.5)` : localOptions.color; const z = part[part.length - 1][2] || 0;
ctx.fillStyle = localOptions.useDepth ? `rgba(${127.5 + 2 * z}, ${127.5 - 2 * z}, 255, 0.5)` : localOptions.color;
ctx.fillText(title, part[part.length - 1][0] + 4, part[part.length - 1][1] + 4); ctx.fillText(title, part[part.length - 1][0] + 4, part[part.length - 1][1] + 4);
}; };
ctx.font = localOptions.font; ctx.font = localOptions.font;
@ -11802,7 +11799,8 @@ async function hand(inCanvas2, result, drawOptions) {
return; return;
for (let i = 0; i < part.length; i++) { for (let i = 0; i < part.length; i++) {
ctx.beginPath(); ctx.beginPath();
ctx.strokeStyle = localOptions.useDepth ? `rgba(${127.5 + i * part[i][2]}, ${127.5 - i * part[i][2]}, 255, 0.5)` : localOptions.color; const z = part[i][2] || 0;
ctx.strokeStyle = localOptions.useDepth ? `rgba(${127.5 + i * z}, ${127.5 - i * z}, 255, 0.5)` : localOptions.color;
ctx.moveTo(part[i > 0 ? i - 1 : 0][0], part[i > 0 ? i - 1 : 0][1]); ctx.moveTo(part[i > 0 ? i - 1 : 0][0], part[i > 0 ? i - 1 : 0][1]);
ctx.lineTo(part[i][0], part[i][1]); ctx.lineTo(part[i][0], part[i][1]);
ctx.stroke(); ctx.stroke();
@ -11981,7 +11979,7 @@ var calculateFaceAngle = (face5, imageSize) => {
return [x, y, z]; return [x, y, z];
}; };
const rotationMatrixToEulerAngle = (r) => { const rotationMatrixToEulerAngle = (r) => {
const [r00, r01, r02, r10, r11, r12, r20, r21, r22] = r; const [r00, _r01, _r02, r10, r11, r12, r20, r21, r22] = r;
let thetaX; let thetaX;
let thetaY; let thetaY;
let thetaZ; let thetaZ;
@ -12008,24 +12006,11 @@ var calculateFaceAngle = (face5, imageSize) => {
thetaZ = 0; thetaZ = 0;
return { pitch: 2 * -thetaX, yaw: 2 * -thetaY, roll: 2 * -thetaZ }; return { pitch: 2 * -thetaX, yaw: 2 * -thetaY, roll: 2 * -thetaZ };
}; };
const meshToEulerAngle = (mesh2) => {
const radians = (a1, a2, b1, b2) => Math.atan2(b2 - a2, b1 - a1);
const angle2 = {
pitch: radians(mesh2[10][1], mesh2[10][2], mesh2[152][1], mesh2[152][2]),
yaw: radians(mesh2[33][0], mesh2[33][2], mesh2[263][0], mesh2[263][2]),
roll: radians(mesh2[33][0], mesh2[33][1], mesh2[263][0], mesh2[263][1])
};
return angle2;
};
const mesh = face5.meshRaw; const mesh = face5.meshRaw;
if (!mesh || mesh.length < 300) if (!mesh || mesh.length < 300)
return { angle: { pitch: 0, yaw: 0, roll: 0 }, matrix: [1, 0, 0, 0, 1, 0, 0, 0, 1], gaze: { bearing: 0, strength: 0 } }; return { angle: { pitch: 0, yaw: 0, roll: 0 }, matrix: [1, 0, 0, 0, 1, 0, 0, 0, 1], gaze: { bearing: 0, strength: 0 } };
const size2 = Math.max(face5.boxRaw[2] * imageSize[0], face5.boxRaw[3] * imageSize[1]) / 1.5; const size2 = Math.max(face5.boxRaw[2] * imageSize[0], face5.boxRaw[3] * imageSize[1]) / 1.5;
const pts = [mesh[10], mesh[152], mesh[234], mesh[454]].map((pt) => [ const pts = [mesh[10], mesh[152], mesh[234], mesh[454]].map((pt) => [pt[0] * imageSize[0] / size2, pt[1] * imageSize[1] / size2, pt[2]]);
pt[0] * imageSize[0] / size2,
pt[1] * imageSize[1] / size2,
pt[2]
]);
const y_axis = normalize(subVectors(pts[1], pts[0])); const y_axis = normalize(subVectors(pts[1], pts[0]));
let x_axis = normalize(subVectors(pts[3], pts[2])); let x_axis = normalize(subVectors(pts[3], pts[2]));
const z_axis = normalize(crossVectors(x_axis, y_axis)); const z_axis = normalize(crossVectors(x_axis, y_axis));
@ -13329,7 +13314,7 @@ async function warmupCanvas(instance) {
const canvas3 = canvas(img.naturalWidth, img.naturalHeight); const canvas3 = canvas(img.naturalWidth, img.naturalHeight);
if (!canvas3) { if (!canvas3) {
log("Warmup: Canvas not found"); log("Warmup: Canvas not found");
resolve({}); resolve(void 0);
} else { } else {
const ctx = canvas3.getContext("2d"); const ctx = canvas3.getContext("2d");
if (ctx) if (ctx)
@ -13342,7 +13327,7 @@ async function warmupCanvas(instance) {
if (src) if (src)
img.src = src; img.src = src;
else else
resolve(null); resolve(void 0);
}); });
} }
async function warmupNode(instance) { async function warmupNode(instance) {
@ -13350,12 +13335,10 @@ async function warmupNode(instance) {
let img; let img;
if (instance.config.warmup === "face") if (instance.config.warmup === "face")
img = atob(face3); img = atob(face3);
if (instance.config.warmup === "body" || instance.config.warmup === "full") else
img = atob(body3); img = atob(body3);
if (!img)
return null;
let res; let res;
if (typeof tf35["node"] !== "undefined") { if ("node" in tf35) {
const data = tf35["node"].decodeJpeg(img); const data = tf35["node"].decodeJpeg(img);
const expanded = data.expandDims(0); const expanded = data.expandDims(0);
instance.tf.dispose(data); instance.tf.dispose(data);

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

@ -137,7 +137,7 @@ declare function browserFiles(files: File[]): IOHandler;
declare function browserHTTPRequest(path: string, loadOptions?: LoadOptions): IOHandler; declare function browserHTTPRequest(path: string, loadOptions?: LoadOptions): IOHandler;
/** draw processed canvas */ /** draw processed canvas */
declare function canvas(input: AnyCanvas | HTMLImageElement | HTMLMediaElement | HTMLVideoElement, output: AnyCanvas): Promise<void>; declare function canvas(input: AnyCanvas | HTMLImageElement | HTMLVideoElement, output: AnyCanvas): Promise<void>;
/** /**
* Concatenate a number of ArrayBuffers into one. * Concatenate a number of ArrayBuffers into one.
@ -512,12 +512,6 @@ export declare interface FaceDetectorConfig extends GenericConfig {
minConfidence: number; minConfidence: number;
/** minimum overlap between two detected faces before one is discarded */ /** minimum overlap between two detected faces before one is discarded */
iouThreshold: number; iouThreshold: number;
/** factor used to expand detected face before further analysis
* - default: 1.6
* - for high-quality inputs can be reduced to increase precision
* - for video inputs or low-quality inputs can be increased to allow for more flexible tracking
*/
cropFactor: number;
/** should child models perform on masked image of a face */ /** should child models perform on masked image of a face */
mask: boolean; mask: boolean;
/** should face detection return face tensor to be used in some other extenrnal model? */ /** should face detection return face tensor to be used in some other extenrnal model? */
@ -1249,7 +1243,7 @@ declare class Human {
* @param userConfig - {@link Config} * @param userConfig - {@link Config}
* @returns result - {@link Result} * @returns result - {@link Result}
*/ */
warmup(userConfig?: Partial<Config>): Promise<Result>; warmup(userConfig?: Partial<Config>): Promise<Result | undefined>;
/** Run detect with tensorflow profiling /** Run detect with tensorflow profiling
* - result object will contain total exeuction time information for top-20 kernels * - result object will contain total exeuction time information for top-20 kernels
* - actual detection object can be accessed via `human.result` * - actual detection object can be accessed via `human.result`

371
dist/human.node.js vendored
View File

@ -187,7 +187,6 @@ var config = {
skipTime: 2500, skipTime: 2500,
minConfidence: 0.2, minConfidence: 0.2,
iouThreshold: 0.1, iouThreshold: 0.1,
cropFactor: 1.6,
mask: false, mask: false,
return: false return: false
}, },
@ -1236,7 +1235,7 @@ async function skip(config3, input) {
const diffRelative = diffSum[0] / (input.shape[1] || 1) / (input.shape[2] || 1) / 255 / 3; const diffRelative = diffSum[0] / (input.shape[1] || 1) / (input.shape[2] || 1) / 255 / 3;
tf2.dispose([last.inputTensor, t.diff, t.squared, t.sum]); tf2.dispose([last.inputTensor, t.diff, t.squared, t.sum]);
last.inputTensor = tf2.clone(input); last.inputTensor = tf2.clone(input);
skipFrame = diffRelative <= config3.cacheSensitivity; skipFrame = diffRelative <= (config3.cacheSensitivity || 0);
} }
return skipFrame; return skipFrame;
} }
@ -1371,7 +1370,7 @@ var env = new Env();
var tf36 = __toModule(require_tfjs_esm()); var tf36 = __toModule(require_tfjs_esm());
// package.json // package.json
var version2 = "2.5.6"; var version2 = "2.5.7";
// src/tfjs/humangl.ts // src/tfjs/humangl.ts
var tf31 = __toModule(require_tfjs_esm()); var tf31 = __toModule(require_tfjs_esm());
@ -4912,8 +4911,8 @@ var UV7 = VTX7.map((x) => UV468[x]);
// src/face/facemeshutil.ts // src/face/facemeshutil.ts
var getBoxSize = (box5) => [Math.abs(box5.endPoint[0] - box5.startPoint[0]), Math.abs(box5.endPoint[1] - box5.startPoint[1])]; var getBoxSize = (box5) => [Math.abs(box5.endPoint[0] - box5.startPoint[0]), Math.abs(box5.endPoint[1] - box5.startPoint[1])];
var getBoxCenter = (box5) => [box5.startPoint[0] + (box5.endPoint[0] - box5.startPoint[0]) / 2, box5.startPoint[1] + (box5.endPoint[1] - box5.startPoint[1]) / 2]; var getBoxCenter = (box5) => [box5.startPoint[0] + (box5.endPoint[0] - box5.startPoint[0]) / 2, box5.startPoint[1] + (box5.endPoint[1] - box5.startPoint[1]) / 2, 1];
var getClampedBox = (box5, input) => box5 ? [ var clampBox = (box5, input) => box5 ? [
Math.trunc(Math.max(0, box5.startPoint[0])), Math.trunc(Math.max(0, box5.startPoint[0])),
Math.trunc(Math.max(0, box5.startPoint[1])), Math.trunc(Math.max(0, box5.startPoint[1])),
Math.trunc(Math.min(input.shape[2] || 0, box5.endPoint[0]) - Math.max(0, box5.startPoint[0])), Math.trunc(Math.min(input.shape[2] || 0, box5.endPoint[0]) - Math.max(0, box5.startPoint[0])),
@ -4930,10 +4929,11 @@ var scaleBoxCoordinates = (box5, factor) => {
const endPoint = [box5.endPoint[0] * factor[0], box5.endPoint[1] * factor[1]]; const endPoint = [box5.endPoint[0] * factor[0], box5.endPoint[1] * factor[1]];
return { startPoint, endPoint, landmarks: box5.landmarks, confidence: box5.confidence }; return { startPoint, endPoint, landmarks: box5.landmarks, confidence: box5.confidence };
}; };
var cutBoxFromImageAndResize = (box5, image29, cropSize) => { var cutAndResize = (box5, image29, cropSize) => {
const h = image29.shape[1]; const h = image29.shape[1];
const w = image29.shape[2]; const w = image29.shape[2];
const crop2 = tf9.image.cropAndResize(image29, [[box5.startPoint[1] / h, box5.startPoint[0] / w, box5.endPoint[1] / h, box5.endPoint[0] / w]], [0], cropSize); const cutBox = [box5.startPoint[1] / h, box5.startPoint[0] / w, box5.endPoint[1] / h, box5.endPoint[0] / w];
const crop2 = tf9.image.cropAndResize(image29, [cutBox], [0], cropSize);
const norm = tf9.div(crop2, constants.tf255); const norm = tf9.div(crop2, constants.tf255);
tf9.dispose(crop2); tf9.dispose(crop2);
return norm; return norm;
@ -4951,9 +4951,9 @@ var squarifyBox = (box5) => {
return { startPoint: [Math.round(centers[0] - halfSize), Math.round(centers[1] - halfSize)], endPoint: [Math.round(centers[0] + halfSize), Math.round(centers[1] + halfSize)], landmarks: box5.landmarks, confidence: box5.confidence }; return { startPoint: [Math.round(centers[0] - halfSize), Math.round(centers[1] - halfSize)], endPoint: [Math.round(centers[0] + halfSize), Math.round(centers[1] + halfSize)], landmarks: box5.landmarks, confidence: box5.confidence };
}; };
var calculateLandmarksBoundingBox = (landmarks) => { var calculateLandmarksBoundingBox = (landmarks) => {
const xs = landmarks.map((d) => d[0]); const x = landmarks.map((d) => d[0]);
const ys = landmarks.map((d) => d[1]); const y = landmarks.map((d) => d[1]);
return { startPoint: [Math.min(...xs), Math.min(...ys)], endPoint: [Math.max(...xs), Math.max(...ys)], landmarks }; return { startPoint: [Math.min(...x), Math.min(...y)], endPoint: [Math.max(...x), Math.max(...y)], landmarks };
}; };
var fixedRotationMatrix = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]; var fixedRotationMatrix = [[1, 0, 0], [0, 1, 0], [0, 0, 1]];
var normalizeRadians = (angle) => angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI)); var normalizeRadians = (angle) => angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI));
@ -5027,11 +5027,12 @@ function transformRawCoords(coordsRaw, box5, angle, rotationMatrix, inputSize9)
const coordsRotationMatrix = largeAngle ? buildRotationMatrix(angle, [0, 0]) : fixedRotationMatrix; const coordsRotationMatrix = largeAngle ? buildRotationMatrix(angle, [0, 0]) : fixedRotationMatrix;
const coordsRotated = largeAngle ? coordsScaled.map((coord) => [...rotatePoint(coord, coordsRotationMatrix), coord[2]]) : coordsScaled; const coordsRotated = largeAngle ? coordsScaled.map((coord) => [...rotatePoint(coord, coordsRotationMatrix), coord[2]]) : coordsScaled;
const inverseRotationMatrix = largeAngle ? invertTransformMatrix(rotationMatrix) : fixedRotationMatrix; const inverseRotationMatrix = largeAngle ? invertTransformMatrix(rotationMatrix) : fixedRotationMatrix;
const boxCenter = [...getBoxCenter({ startPoint: box5.startPoint, endPoint: box5.endPoint }), 1]; const boxCenter = getBoxCenter(box5);
const offsets = [dot(boxCenter, inverseRotationMatrix[0]), dot(boxCenter, inverseRotationMatrix[1])];
return coordsRotated.map((coord) => [ return coordsRotated.map((coord) => [
Math.round(coord[0] + dot(boxCenter, inverseRotationMatrix[0])), Math.trunc(coord[0] + offsets[0]),
Math.round(coord[1] + dot(boxCenter, inverseRotationMatrix[1])), Math.trunc(coord[1] + offsets[1]),
Math.round(coord[2] || 0) Math.trunc(coord[2] || 0)
]); ]);
} }
function correctFaceRotation(rotate, box5, input, inputSize9) { function correctFaceRotation(rotate, box5, input, inputSize9) {
@ -5043,23 +5044,38 @@ function correctFaceRotation(rotate, box5, input, inputSize9) {
angle = computeRotation(box5.landmarks[symmetryLine[0]], box5.landmarks[symmetryLine[1]]); angle = computeRotation(box5.landmarks[symmetryLine[0]], box5.landmarks[symmetryLine[1]]);
const largeAngle = angle && angle !== 0 && Math.abs(angle) > 0.2; const largeAngle = angle && angle !== 0 && Math.abs(angle) > 0.2;
if (largeAngle) { if (largeAngle) {
const center = getBoxCenter({ startPoint: box5.startPoint, endPoint: box5.endPoint }); const center = getBoxCenter(box5);
const centerRaw = [center[0] / input.shape[2], center[1] / input.shape[1]]; const centerRaw = [center[0] / input.shape[2], center[1] / input.shape[1]];
const rotated = tf9.image.rotateWithOffset(input, angle, 0, centerRaw); const rotated = tf9.image.rotateWithOffset(input, angle, 0, centerRaw);
rotationMatrix = buildRotationMatrix(-angle, center); rotationMatrix = buildRotationMatrix(-angle, center);
face5 = cutBoxFromImageAndResize(box5, rotated, [inputSize9, inputSize9]); face5 = cutAndResize(box5, rotated, [inputSize9, inputSize9]);
tf9.dispose(rotated); tf9.dispose(rotated);
} else { } else {
face5 = cutBoxFromImageAndResize(box5, input, [inputSize9, inputSize9]); face5 = cutAndResize(box5, input, [inputSize9, inputSize9]);
} }
} else { } else {
face5 = cutBoxFromImageAndResize(box5, input, [inputSize9, inputSize9]); face5 = cutAndResize(box5, input, [inputSize9, inputSize9]);
} }
return [angle, rotationMatrix, face5]; return [angle, rotationMatrix, face5];
} }
var findFaceCenter = (mesh) => {
const x = mesh.map((m) => m[0]);
const y = mesh.map((m) => m[1]);
return [Math.min(...x) + (Math.max(...x) - Math.min(...x)) / 2, Math.min(...y) + (Math.max(...y) - Math.min(...y)) / 2];
};
var calculateFaceBox = (mesh, previousBox) => {
const center = findFaceCenter(mesh);
const boxSize = getBoxSize(previousBox);
const calculatedBox = {
startPoint: [center[0] - boxSize[0] / 2, center[1] - boxSize[1] / 2],
endPoint: [center[0] + boxSize[0] / 2, center[1] + boxSize[1] / 2]
};
return calculatedBox;
};
// src/face/blazeface.ts // src/face/blazeface.ts
var keypointsCount = 6; var keypointsCount = 6;
var faceBoxScaleFactor = 1.2;
var model5; var model5;
var anchors = null; var anchors = null;
var inputSize = 0; var inputSize = 0;
@ -5101,7 +5117,7 @@ function decodeBounds(boxOutputs) {
async function getBoxes(inputImage, config3) { async function getBoxes(inputImage, config3) {
var _a, _b, _c, _d; var _a, _b, _c, _d;
if (!inputImage || inputImage["isDisposedInternal"] || inputImage.shape.length !== 4 || inputImage.shape[1] < 1 || inputImage.shape[2] < 1) if (!inputImage || inputImage["isDisposedInternal"] || inputImage.shape.length !== 4 || inputImage.shape[1] < 1 || inputImage.shape[2] < 1)
return { boxes: [] }; return [];
const t = {}; const t = {};
t.resized = tf10.image.resizeBilinear(inputImage, [inputSize, inputSize]); t.resized = tf10.image.resizeBilinear(inputImage, [inputSize, inputSize]);
t.div = tf10.div(t.resized, constants.tf127); t.div = tf10.div(t.resized, constants.tf127);
@ -5134,17 +5150,21 @@ async function getBoxes(inputImage, config3) {
b.squeeze = tf10.squeeze(b.slice); b.squeeze = tf10.squeeze(b.slice);
b.landmarks = tf10.reshape(b.squeeze, [keypointsCount, -1]); b.landmarks = tf10.reshape(b.squeeze, [keypointsCount, -1]);
const points = await b.bbox.data(); const points = await b.bbox.data();
boxes.push({ const rawBox = {
startPoint: [points[0], points[1]], startPoint: [points[0], points[1]],
endPoint: [points[2], points[3]], endPoint: [points[2], points[3]],
landmarks: await b.landmarks.array(), landmarks: await b.landmarks.array(),
confidence confidence
}); };
const scaledBox = scaleBoxCoordinates(rawBox, [(inputImage.shape[2] || 0) / inputSize, (inputImage.shape[1] || 0) / inputSize]);
const enlargedBox = enlargeBox(scaledBox, faceBoxScaleFactor);
const squaredBox = squarifyBox(enlargedBox);
boxes.push(squaredBox);
Object.keys(b).forEach((tensor3) => tf10.dispose(b[tensor3])); Object.keys(b).forEach((tensor3) => tf10.dispose(b[tensor3]));
} }
} }
Object.keys(t).forEach((tensor3) => tf10.dispose(t[tensor3])); Object.keys(t).forEach((tensor3) => tf10.dispose(t[tensor3]));
return { boxes, scaleFactor: [inputImage.shape[2] / inputSize, inputImage.shape[1] / inputSize] }; return boxes;
} }
// src/body/blazepose.ts // src/body/blazepose.ts
@ -5997,36 +6017,29 @@ async function augmentIris(rawCoords, face5, config3, meshSize) {
} }
// src/face/facemesh.ts // src/face/facemesh.ts
var boxCache = []; var cache3 = {
boxes: [],
skipped: Number.MAX_SAFE_INTEGER,
timestamp: 0
};
var model11 = null; var model11 = null;
var inputSize6 = 0; var inputSize6 = 0;
var skipped10 = Number.MAX_SAFE_INTEGER;
var lastTime10 = 0;
async function predict10(input, config3) { async function predict10(input, config3) {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k; var _a, _b, _c, _d, _e, _f, _g, _h;
const skipTime = (((_a = config3.face.detector) == null ? void 0 : _a.skipTime) || 0) > now() - lastTime10; const skipTime = (((_a = config3.face.detector) == null ? void 0 : _a.skipTime) || 0) > now() - cache3.timestamp;
const skipFrame = skipped10 < (((_b = config3.face.detector) == null ? void 0 : _b.skipFrames) || 0); const skipFrame = cache3.skipped < (((_b = config3.face.detector) == null ? void 0 : _b.skipFrames) || 0);
if (!config3.skipAllowed || !skipTime || !skipFrame || boxCache.length === 0) { if (!config3.skipAllowed || !skipTime || !skipFrame || cache3.boxes.length === 0) {
const possibleBoxes = await getBoxes(input, config3); cache3.boxes = await getBoxes(input, config3);
lastTime10 = now(); cache3.timestamp = now();
boxCache = []; cache3.skipped = 0;
for (const possible of possibleBoxes.boxes) {
const boxScaled = scaleBoxCoordinates(possible, possibleBoxes.scaleFactor);
const detectedWidth = (boxScaled.endPoint[0] - boxScaled.startPoint[0]) / (input.shape[2] || 1e3);
const calcFactor = (((_c = config3.face.detector) == null ? void 0 : _c.cropFactor) || 1.6) / (detectedWidth + 0.75) / 1.34;
const boxEnlarged = enlargeBox(boxScaled, calcFactor);
const boxSquared = squarifyBox(boxEnlarged);
boxCache.push(boxSquared);
}
skipped10 = 0;
} else { } else {
skipped10++; cache3.skipped++;
} }
const faces = []; const faces = [];
const newCache = []; const newCache = [];
let id = 0; let id = 0;
for (let i = 0; i < boxCache.length; i++) { for (let i = 0; i < cache3.boxes.length; i++) {
let box5 = boxCache[i]; const box5 = cache3.boxes[i];
let angle = 0; let angle = 0;
let rotationMatrix; let rotationMatrix;
const face5 = { const face5 = {
@ -6040,15 +6053,15 @@ async function predict10(input, config3) {
faceScore: 0, faceScore: 0,
annotations: {} annotations: {}
}; };
[angle, rotationMatrix, face5.tensor] = correctFaceRotation((_d = config3.face.detector) == null ? void 0 : _d.rotation, box5, input, ((_e = config3.face.mesh) == null ? void 0 : _e.enabled) ? inputSize6 : size()); [angle, rotationMatrix, face5.tensor] = correctFaceRotation((_c = config3.face.detector) == null ? void 0 : _c.rotation, box5, input, ((_d = config3.face.mesh) == null ? void 0 : _d.enabled) ? inputSize6 : size());
if ((_f = config3 == null ? void 0 : config3.filter) == null ? void 0 : _f.equalization) { if ((_e = config3 == null ? void 0 : config3.filter) == null ? void 0 : _e.equalization) {
const equilized = await histogramEqualization(face5.tensor); const equilized = await histogramEqualization(face5.tensor);
tf18.dispose(face5.tensor); tf18.dispose(face5.tensor);
face5.tensor = equilized; face5.tensor = equilized;
} }
face5.boxScore = Math.round(100 * box5.confidence) / 100; face5.boxScore = Math.round(100 * box5.confidence) / 100;
if (!((_g = config3.face.mesh) == null ? void 0 : _g.enabled)) { if (!((_f = config3.face.mesh) == null ? void 0 : _f.enabled)) {
face5.box = getClampedBox(box5, input); face5.box = clampBox(box5, input);
face5.boxRaw = getRawBox(box5, input); face5.boxRaw = getRawBox(box5, input);
face5.score = face5.boxScore; face5.score = face5.boxScore;
face5.mesh = box5.landmarks.map((pt) => [ face5.mesh = box5.landmarks.map((pt) => [
@ -6068,30 +6081,25 @@ async function predict10(input, config3) {
const coordsReshaped = tf18.reshape(contourCoords, [-1, 3]); const coordsReshaped = tf18.reshape(contourCoords, [-1, 3]);
let rawCoords = await coordsReshaped.array(); let rawCoords = await coordsReshaped.array();
tf18.dispose([contourCoords, coordsReshaped, confidence, contours]); tf18.dispose([contourCoords, coordsReshaped, confidence, contours]);
if (face5.faceScore < (((_h = config3.face.detector) == null ? void 0 : _h.minConfidence) || 1)) { if (face5.faceScore < (((_g = config3.face.detector) == null ? void 0 : _g.minConfidence) || 1)) {
box5.confidence = face5.faceScore; box5.confidence = face5.faceScore;
} else { } else {
if ((_i = config3.face.iris) == null ? void 0 : _i.enabled) if ((_h = config3.face.iris) == null ? void 0 : _h.enabled)
rawCoords = await augmentIris(rawCoords, face5.tensor, config3, inputSize6); rawCoords = await augmentIris(rawCoords, face5.tensor, config3, inputSize6);
face5.mesh = transformRawCoords(rawCoords, box5, angle, rotationMatrix, inputSize6); face5.mesh = transformRawCoords(rawCoords, box5, angle, rotationMatrix, inputSize6);
face5.meshRaw = face5.mesh.map((pt) => [pt[0] / (input.shape[2] || 0), pt[1] / (input.shape[1] || 0), (pt[2] || 0) / inputSize6]); face5.meshRaw = face5.mesh.map((pt) => [pt[0] / (input.shape[2] || 0), pt[1] / (input.shape[1] || 0), (pt[2] || 0) / inputSize6]);
for (const key of Object.keys(meshAnnotations)) for (const key of Object.keys(meshAnnotations))
face5.annotations[key] = meshAnnotations[key].map((index2) => face5.mesh[index2]); face5.annotations[key] = meshAnnotations[key].map((index2) => face5.mesh[index2]);
const boxCalculated = calculateLandmarksBoundingBox(face5.mesh);
const boxEnlarged = enlargeBox(boxCalculated, ((_j = config3.face.detector) == null ? void 0 : _j.cropFactor) || 1.6);
const boxSquared = squarifyBox(boxEnlarged);
box5 = { ...boxSquared, confidence: box5.confidence };
face5.box = getClampedBox(box5, input);
face5.boxRaw = getRawBox(box5, input);
face5.score = face5.faceScore; face5.score = face5.faceScore;
newCache.push(box5); const calculatedBox = { ...calculateFaceBox(face5.mesh, box5), confidence: box5.confidence, landmarks: box5.landmarks };
tf18.dispose(face5.tensor); face5.box = clampBox(calculatedBox, input);
[angle, rotationMatrix, face5.tensor] = correctFaceRotation((_k = config3.face.detector) == null ? void 0 : _k.rotation, box5, input, inputSize6); face5.boxRaw = getRawBox(calculatedBox, input);
newCache.push(calculatedBox);
} }
} }
faces.push(face5); faces.push(face5);
} }
boxCache = [...newCache]; cache3.boxes = newCache;
return faces; return faces;
} }
async function load11(config3) { async function load11(config3) {
@ -6116,9 +6124,9 @@ var uvmap = UV468;
var tf19 = __toModule(require_tfjs_esm()); var tf19 = __toModule(require_tfjs_esm());
var model12; var model12;
var last8 = []; var last8 = [];
var lastTime11 = 0; var lastTime10 = 0;
var lastCount7 = 0; var lastCount7 = 0;
var skipped11 = Number.MAX_SAFE_INTEGER; var skipped10 = Number.MAX_SAFE_INTEGER;
async function load12(config3) { async function load12(config3) {
var _a, _b; var _a, _b;
const modelUrl = join(config3.modelBasePath, ((_a = config3.face.description) == null ? void 0 : _a.modelPath) || ""); const modelUrl = join(config3.modelBasePath, ((_a = config3.face.description) == null ? void 0 : _a.modelPath) || "");
@ -6147,13 +6155,13 @@ async function predict11(image29, config3, idx, count2) {
var _a, _b, _c, _d; var _a, _b, _c, _d;
if (!model12) if (!model12)
return { age: 0, gender: "unknown", genderScore: 0, descriptor: [] }; return { age: 0, gender: "unknown", genderScore: 0, descriptor: [] };
const skipFrame = skipped11 < (((_a = config3.face.description) == null ? void 0 : _a.skipFrames) || 0); const skipFrame = skipped10 < (((_a = config3.face.description) == null ? void 0 : _a.skipFrames) || 0);
const skipTime = (((_b = config3.face.description) == null ? void 0 : _b.skipTime) || 0) > now() - lastTime11; const skipTime = (((_b = config3.face.description) == null ? void 0 : _b.skipTime) || 0) > now() - lastTime10;
if (config3.skipAllowed && skipFrame && skipTime && lastCount7 === count2 && ((_c = last8[idx]) == null ? void 0 : _c.age) && ((_d = last8[idx]) == null ? void 0 : _d.age) > 0) { if (config3.skipAllowed && skipFrame && skipTime && lastCount7 === count2 && ((_c = last8[idx]) == null ? void 0 : _c.age) && ((_d = last8[idx]) == null ? void 0 : _d.age) > 0) {
skipped11++; skipped10++;
return last8[idx]; return last8[idx];
} }
skipped11 = 0; skipped10 = 0;
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
var _a2, _b2; var _a2, _b2;
const obj = { const obj = {
@ -6165,7 +6173,7 @@ async function predict11(image29, config3, idx, count2) {
if ((_a2 = config3.face.description) == null ? void 0 : _a2.enabled) { if ((_a2 = config3.face.description) == null ? void 0 : _a2.enabled) {
const enhanced = enhance2(image29); const enhanced = enhance2(image29);
const resT = model12 == null ? void 0 : model12.execute(enhanced); const resT = model12 == null ? void 0 : model12.execute(enhanced);
lastTime11 = now(); lastTime10 = now();
tf19.dispose(enhanced); tf19.dispose(enhanced);
const genderT = await resT.find((t) => t.shape[1] === 1); const genderT = await resT.find((t) => t.shape[1] === 1);
const gender = await genderT.data(); const gender = await genderT.data();
@ -6211,7 +6219,7 @@ function getBoxCenter2(box5) {
box5.startPoint[1] + (box5.endPoint[1] - box5.startPoint[1]) / 2 box5.startPoint[1] + (box5.endPoint[1] - box5.startPoint[1]) / 2
]; ];
} }
function cutBoxFromImageAndResize2(box5, image29, cropSize) { function cutBoxFromImageAndResize(box5, image29, cropSize) {
const h = image29.shape[1]; const h = image29.shape[1];
const w = image29.shape[2]; const w = image29.shape[2];
const boxes = [[ const boxes = [[
@ -9341,7 +9349,7 @@ var handBoxEnlargeFactor = 1.65;
var palmLandmarkIds = [0, 5, 9, 13, 17, 1, 2]; var palmLandmarkIds = [0, 5, 9, 13, 17, 1, 2];
var palmLandmarksPalmBase = 0; var palmLandmarksPalmBase = 0;
var palmLandmarksMiddleFingerBase = 2; var palmLandmarksMiddleFingerBase = 2;
var lastTime12 = 0; var lastTime11 = 0;
var HandPipeline = class { var HandPipeline = class {
constructor(handDetector, handPoseModel2) { constructor(handDetector, handPoseModel2) {
__publicField(this, "handDetector"); __publicField(this, "handDetector");
@ -9406,7 +9414,7 @@ var HandPipeline = class {
async estimateHands(image29, config3) { async estimateHands(image29, config3) {
let useFreshBox = false; let useFreshBox = false;
let boxes; let boxes;
const skipTime = (config3.hand.skipTime || 0) > now() - lastTime12; const skipTime = (config3.hand.skipTime || 0) > now() - lastTime11;
const skipFrame = this.skipped < (config3.hand.skipFrames || 0); const skipFrame = this.skipped < (config3.hand.skipFrames || 0);
if (config3.skipAllowed && skipTime && skipFrame) { if (config3.skipAllowed && skipTime && skipFrame) {
boxes = await this.handDetector.predict(image29, config3); boxes = await this.handDetector.predict(image29, config3);
@ -9432,12 +9440,12 @@ var HandPipeline = class {
const rotatedImage = config3.hand.rotation && env.kernels.includes("rotatewithoffset") ? tf22.image.rotateWithOffset(image29, angle, 0, palmCenterNormalized) : image29.clone(); const rotatedImage = config3.hand.rotation && env.kernels.includes("rotatewithoffset") ? tf22.image.rotateWithOffset(image29, angle, 0, palmCenterNormalized) : image29.clone();
const rotationMatrix = buildRotationMatrix2(-angle, palmCenter); const rotationMatrix = buildRotationMatrix2(-angle, palmCenter);
const newBox = useFreshBox ? this.getBoxForPalmLandmarks(currentBox.palmLandmarks, rotationMatrix) : currentBox; const newBox = useFreshBox ? this.getBoxForPalmLandmarks(currentBox.palmLandmarks, rotationMatrix) : currentBox;
const croppedInput = cutBoxFromImageAndResize2(newBox, rotatedImage, [this.inputSize, this.inputSize]); const croppedInput = cutBoxFromImageAndResize(newBox, rotatedImage, [this.inputSize, this.inputSize]);
const handImage = tf22.div(croppedInput, constants.tf255); const handImage = tf22.div(croppedInput, constants.tf255);
tf22.dispose(croppedInput); tf22.dispose(croppedInput);
tf22.dispose(rotatedImage); tf22.dispose(rotatedImage);
const [confidenceT, keypoints] = this.handPoseModel.execute(handImage); const [confidenceT, keypoints] = this.handPoseModel.execute(handImage);
lastTime12 = now(); lastTime11 = now();
tf22.dispose(handImage); tf22.dispose(handImage);
const confidence = (await confidenceT.data())[0]; const confidence = (await confidenceT.data())[0];
tf22.dispose(confidenceT); tf22.dispose(confidenceT);
@ -9997,10 +10005,10 @@ var faceIndex = 4;
var boxExpandFact = 1.6; var boxExpandFact = 1.6;
var maxDetectorResolution = 512; var maxDetectorResolution = 512;
var detectorExpandFact = 1.4; var detectorExpandFact = 1.4;
var skipped12 = Number.MAX_SAFE_INTEGER; var skipped11 = Number.MAX_SAFE_INTEGER;
var lastTime13 = 0; var lastTime12 = 0;
var outputSize = [0, 0]; var outputSize = [0, 0];
var cache3 = { var cache4 = {
boxes: [], boxes: [],
hands: [] hands: []
}; };
@ -10136,44 +10144,44 @@ async function predict13(input, config3) {
if (!models2[0] || !models2[1] || !((_a = models2[0]) == null ? void 0 : _a.inputs[0].shape) || !((_b = models2[1]) == null ? void 0 : _b.inputs[0].shape)) if (!models2[0] || !models2[1] || !((_a = models2[0]) == null ? void 0 : _a.inputs[0].shape) || !((_b = models2[1]) == null ? void 0 : _b.inputs[0].shape))
return []; return [];
outputSize = [input.shape[2] || 0, input.shape[1] || 0]; outputSize = [input.shape[2] || 0, input.shape[1] || 0];
skipped12++; skipped11++;
const skipTime = (config3.hand.skipTime || 0) > now() - lastTime13; const skipTime = (config3.hand.skipTime || 0) > now() - lastTime12;
const skipFrame = skipped12 < (config3.hand.skipFrames || 0); const skipFrame = skipped11 < (config3.hand.skipFrames || 0);
if (config3.skipAllowed && skipTime && skipFrame) { if (config3.skipAllowed && skipTime && skipFrame) {
return cache3.hands; return cache4.hands;
} }
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
const skipTimeExtended = 3 * (config3.hand.skipTime || 0) > now() - lastTime13; const skipTimeExtended = 3 * (config3.hand.skipTime || 0) > now() - lastTime12;
const skipFrameExtended = skipped12 < 3 * (config3.hand.skipFrames || 0); const skipFrameExtended = skipped11 < 3 * (config3.hand.skipFrames || 0);
if (config3.skipAllowed && cache3.hands.length === config3.hand.maxDetected) { if (config3.skipAllowed && cache4.hands.length === config3.hand.maxDetected) {
cache3.hands = await Promise.all(cache3.boxes.map((handBox) => detectFingers(input, handBox, config3))); cache4.hands = await Promise.all(cache4.boxes.map((handBox) => detectFingers(input, handBox, config3)));
} else if (config3.skipAllowed && skipTimeExtended && skipFrameExtended && cache3.hands.length > 0) { } else if (config3.skipAllowed && skipTimeExtended && skipFrameExtended && cache4.hands.length > 0) {
cache3.hands = await Promise.all(cache3.boxes.map((handBox) => detectFingers(input, handBox, config3))); cache4.hands = await Promise.all(cache4.boxes.map((handBox) => detectFingers(input, handBox, config3)));
} else { } else {
cache3.boxes = await detectHands(input, config3); cache4.boxes = await detectHands(input, config3);
lastTime13 = now(); lastTime12 = now();
cache3.hands = await Promise.all(cache3.boxes.map((handBox) => detectFingers(input, handBox, config3))); cache4.hands = await Promise.all(cache4.boxes.map((handBox) => detectFingers(input, handBox, config3)));
skipped12 = 0; skipped11 = 0;
} }
const oldCache = [...cache3.boxes]; const oldCache = [...cache4.boxes];
cache3.boxes.length = 0; cache4.boxes.length = 0;
if (config3.cacheSensitivity > 0) { if (config3.cacheSensitivity > 0) {
for (let i = 0; i < cache3.hands.length; i++) { for (let i = 0; i < cache4.hands.length; i++) {
const boxKpt = square(cache3.hands[i].keypoints, outputSize); const boxKpt = square(cache4.hands[i].keypoints, outputSize);
if (boxKpt.box[2] / (input.shape[2] || 1) > 0.05 && boxKpt.box[3] / (input.shape[1] || 1) > 0.05 && cache3.hands[i].fingerScore && cache3.hands[i].fingerScore > (config3.hand.minConfidence || 0)) { if (boxKpt.box[2] / (input.shape[2] || 1) > 0.05 && boxKpt.box[3] / (input.shape[1] || 1) > 0.05 && cache4.hands[i].fingerScore && cache4.hands[i].fingerScore > (config3.hand.minConfidence || 0)) {
const boxScale = scale(boxKpt.box, boxExpandFact); const boxScale = scale(boxKpt.box, boxExpandFact);
const boxScaleRaw = scale(boxKpt.boxRaw, boxExpandFact); const boxScaleRaw = scale(boxKpt.boxRaw, boxExpandFact);
const boxCrop = crop(boxScaleRaw); const boxCrop = crop(boxScaleRaw);
cache3.boxes.push({ ...oldCache[i], box: boxScale, boxRaw: boxScaleRaw, boxCrop }); cache4.boxes.push({ ...oldCache[i], box: boxScale, boxRaw: boxScaleRaw, boxCrop });
} }
} }
} }
for (let i = 0; i < cache3.hands.length; i++) { for (let i = 0; i < cache4.hands.length; i++) {
const bbox = calc(cache3.hands[i].keypoints, outputSize); const bbox = calc(cache4.hands[i].keypoints, outputSize);
cache3.hands[i].box = bbox.box; cache4.hands[i].box = bbox.box;
cache3.hands[i].boxRaw = bbox.boxRaw; cache4.hands[i].boxRaw = bbox.boxRaw;
} }
resolve(cache3.hands); resolve(cache4.hands);
}); });
} }
@ -10181,9 +10189,9 @@ async function predict13(input, config3) {
var tf25 = __toModule(require_tfjs_esm()); var tf25 = __toModule(require_tfjs_esm());
var model13; var model13;
var cached2 = []; var cached2 = [];
var skipped13 = Number.MAX_SAFE_INTEGER; var skipped12 = Number.MAX_SAFE_INTEGER;
var lastCount8 = 0; var lastCount8 = 0;
var lastTime14 = 0; var lastTime13 = 0;
async function load14(config3) { async function load14(config3) {
var _a, _b; var _a, _b;
if (env.initial) if (env.initial)
@ -10202,20 +10210,20 @@ async function predict14(image29, config3, idx, count2) {
var _a, _b; var _a, _b;
if (!model13) if (!model13)
return 0; return 0;
const skipTime = (((_a = config3.face.liveness) == null ? void 0 : _a.skipTime) || 0) > now() - lastTime14; const skipTime = (((_a = config3.face.liveness) == null ? void 0 : _a.skipTime) || 0) > now() - lastTime13;
const skipFrame = skipped13 < (((_b = config3.face.liveness) == null ? void 0 : _b.skipFrames) || 0); const skipFrame = skipped12 < (((_b = config3.face.liveness) == null ? void 0 : _b.skipFrames) || 0);
if (config3.skipAllowed && skipTime && skipFrame && lastCount8 === count2 && cached2[idx]) { if (config3.skipAllowed && skipTime && skipFrame && lastCount8 === count2 && cached2[idx]) {
skipped13++; skipped12++;
return cached2[idx]; return cached2[idx];
} }
skipped13 = 0; skipped12 = 0;
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
const resize = tf25.image.resizeBilinear(image29, [(model13 == null ? void 0 : model13.inputs[0].shape) ? model13.inputs[0].shape[2] : 0, (model13 == null ? void 0 : model13.inputs[0].shape) ? model13.inputs[0].shape[1] : 0], false); const resize = tf25.image.resizeBilinear(image29, [(model13 == null ? void 0 : model13.inputs[0].shape) ? model13.inputs[0].shape[2] : 0, (model13 == null ? void 0 : model13.inputs[0].shape) ? model13.inputs[0].shape[1] : 0], false);
const res = model13 == null ? void 0 : model13.execute(resize); const res = model13 == null ? void 0 : model13.execute(resize);
const num = (await res.data())[0]; const num = (await res.data())[0];
cached2[idx] = Math.round(100 * num) / 100; cached2[idx] = Math.round(100 * num) / 100;
lastCount8 = count2; lastCount8 = count2;
lastTime14 = now(); lastTime13 = now();
tf25.dispose([resize, res]); tf25.dispose([resize, res]);
resolve(cached2[idx]); resolve(cached2[idx]);
}); });
@ -10284,7 +10292,7 @@ var connected3 = {
// src/body/movenetfix.ts // src/body/movenetfix.ts
var tf26 = __toModule(require_tfjs_esm()); var tf26 = __toModule(require_tfjs_esm());
var maxJitter = 5e-3; var maxJitter = 5e-3;
var cache4 = { var cache5 = {
keypoints: [], keypoints: [],
padding: [[0, 0], [0, 0], [0, 0], [0, 0]] padding: [[0, 0], [0, 0], [0, 0], [0, 0]]
}; };
@ -10333,15 +10341,15 @@ function bodyParts(body4) {
} }
function jitter(keypoints) { function jitter(keypoints) {
for (let i = 0; i < keypoints.length; i++) { for (let i = 0; i < keypoints.length; i++) {
if (keypoints[i] && cache4.keypoints[i]) { if (keypoints[i] && cache5.keypoints[i]) {
const diff = [Math.abs(keypoints[i].positionRaw[0] - cache4.keypoints[i].positionRaw[0]), Math.abs(keypoints[i].positionRaw[1] - cache4.keypoints[i].positionRaw[1])]; const diff = [Math.abs(keypoints[i].positionRaw[0] - cache5.keypoints[i].positionRaw[0]), Math.abs(keypoints[i].positionRaw[1] - cache5.keypoints[i].positionRaw[1])];
if (diff[0] < maxJitter && diff[1] < maxJitter) { if (diff[0] < maxJitter && diff[1] < maxJitter) {
keypoints[i] = cache4.keypoints[i]; keypoints[i] = cache5.keypoints[i];
} else { } else {
cache4.keypoints[i] = keypoints[i]; cache5.keypoints[i] = keypoints[i];
} }
} else { } else {
cache4.keypoints[i] = keypoints[i]; cache5.keypoints[i] = keypoints[i];
} }
} }
return keypoints; return keypoints;
@ -10350,13 +10358,13 @@ function padInput(input, inputSize9) {
const t = {}; const t = {};
if (!input.shape || !input.shape[1] || !input.shape[2]) if (!input.shape || !input.shape[1] || !input.shape[2])
return input; return input;
cache4.padding = [ cache5.padding = [
[0, 0], [0, 0],
[input.shape[2] > input.shape[1] ? Math.trunc((input.shape[2] - input.shape[1]) / 2) : 0, input.shape[2] > input.shape[1] ? Math.trunc((input.shape[2] - input.shape[1]) / 2) : 0], [input.shape[2] > input.shape[1] ? Math.trunc((input.shape[2] - input.shape[1]) / 2) : 0, input.shape[2] > input.shape[1] ? Math.trunc((input.shape[2] - input.shape[1]) / 2) : 0],
[input.shape[1] > input.shape[2] ? Math.trunc((input.shape[1] - input.shape[2]) / 2) : 0, input.shape[1] > input.shape[2] ? Math.trunc((input.shape[1] - input.shape[2]) / 2) : 0], [input.shape[1] > input.shape[2] ? Math.trunc((input.shape[1] - input.shape[2]) / 2) : 0, input.shape[1] > input.shape[2] ? Math.trunc((input.shape[1] - input.shape[2]) / 2) : 0],
[0, 0] [0, 0]
]; ];
t.pad = tf26.pad(input, cache4.padding); t.pad = tf26.pad(input, cache5.padding);
t.resize = tf26.image.resizeBilinear(t.pad, [inputSize9, inputSize9]); t.resize = tf26.image.resizeBilinear(t.pad, [inputSize9, inputSize9]);
const final = tf26.cast(t.resize, "int32"); const final = tf26.cast(t.resize, "int32");
Object.keys(t).forEach((tensor3) => tf26.dispose(t[tensor3])); Object.keys(t).forEach((tensor3) => tf26.dispose(t[tensor3]));
@ -10366,8 +10374,8 @@ function rescaleBody(body4, outputSize2) {
body4.keypoints = body4.keypoints.filter((kpt4) => kpt4 && kpt4.position); body4.keypoints = body4.keypoints.filter((kpt4) => kpt4 && kpt4.position);
for (const kpt4 of body4.keypoints) { for (const kpt4 of body4.keypoints) {
kpt4.position = [ kpt4.position = [
kpt4.position[0] * (outputSize2[0] + cache4.padding[2][0] + cache4.padding[2][1]) / outputSize2[0] - cache4.padding[2][0], kpt4.position[0] * (outputSize2[0] + cache5.padding[2][0] + cache5.padding[2][1]) / outputSize2[0] - cache5.padding[2][0],
kpt4.position[1] * (outputSize2[1] + cache4.padding[1][0] + cache4.padding[1][1]) / outputSize2[1] - cache4.padding[1][0] kpt4.position[1] * (outputSize2[1] + cache5.padding[1][0] + cache5.padding[1][1]) / outputSize2[1] - cache5.padding[1][0]
]; ];
kpt4.positionRaw = [ kpt4.positionRaw = [
kpt4.position[0] / outputSize2[0], kpt4.position[0] / outputSize2[0],
@ -10383,8 +10391,8 @@ function rescaleBody(body4, outputSize2) {
// src/body/movenet.ts // src/body/movenet.ts
var model14; var model14;
var inputSize8 = 0; var inputSize8 = 0;
var skipped14 = Number.MAX_SAFE_INTEGER; var skipped13 = Number.MAX_SAFE_INTEGER;
var cache5 = { var cache6 = {
boxes: [], boxes: [],
bodies: [], bodies: [],
last: 0 last: 0
@ -10487,27 +10495,27 @@ async function predict15(input, config3) {
if (!model14 || !(model14 == null ? void 0 : model14.inputs[0].shape)) if (!model14 || !(model14 == null ? void 0 : model14.inputs[0].shape))
return []; return [];
if (!config3.skipAllowed) if (!config3.skipAllowed)
cache5.boxes.length = 0; cache6.boxes.length = 0;
skipped14++; skipped13++;
const skipTime = (config3.body.skipTime || 0) > now() - cache5.last; const skipTime = (config3.body.skipTime || 0) > now() - cache6.last;
const skipFrame = skipped14 < (config3.body.skipFrames || 0); const skipFrame = skipped13 < (config3.body.skipFrames || 0);
if (config3.skipAllowed && skipTime && skipFrame) { if (config3.skipAllowed && skipTime && skipFrame) {
return cache5.bodies; return cache6.bodies;
} }
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
const t = {}; const t = {};
skipped14 = 0; skipped13 = 0;
t.input = padInput(input, inputSize8); t.input = padInput(input, inputSize8);
t.res = model14 == null ? void 0 : model14.execute(t.input); t.res = model14 == null ? void 0 : model14.execute(t.input);
cache5.last = now(); cache6.last = now();
const res = await t.res.array(); const res = await t.res.array();
cache5.bodies = t.res.shape[2] === 17 ? await parseSinglePose(res, config3, input) : await parseMultiPose(res, config3, input); cache6.bodies = t.res.shape[2] === 17 ? await parseSinglePose(res, config3, input) : await parseMultiPose(res, config3, input);
for (const body4 of cache5.bodies) { for (const body4 of cache6.bodies) {
rescaleBody(body4, [input.shape[2] || 1, input.shape[1] || 1]); rescaleBody(body4, [input.shape[2] || 1, input.shape[1] || 1]);
jitter(body4.keypoints); jitter(body4.keypoints);
} }
Object.keys(t).forEach((tensor3) => tf27.dispose(t[tensor3])); Object.keys(t).forEach((tensor3) => tf27.dispose(t[tensor3]));
resolve(cache5.bodies); resolve(cache6.bodies);
}); });
} }
@ -10515,8 +10523,8 @@ async function predict15(input, config3) {
var tf28 = __toModule(require_tfjs_esm()); var tf28 = __toModule(require_tfjs_esm());
var model15; var model15;
var last9 = []; var last9 = [];
var lastTime15 = 0; var lastTime14 = 0;
var skipped15 = Number.MAX_SAFE_INTEGER; var skipped14 = Number.MAX_SAFE_INTEGER;
var scaleBox = 2.5; var scaleBox = 2.5;
async function load16(config3) { async function load16(config3) {
if (!model15 || env.initial) { if (!model15 || env.initial) {
@ -10593,13 +10601,13 @@ async function process4(res, inputSize9, outputShape, config3) {
return results; return results;
} }
async function predict16(image29, config3) { async function predict16(image29, config3) {
const skipTime = (config3.object.skipTime || 0) > now() - lastTime15; const skipTime = (config3.object.skipTime || 0) > now() - lastTime14;
const skipFrame = skipped15 < (config3.object.skipFrames || 0); const skipFrame = skipped14 < (config3.object.skipFrames || 0);
if (config3.skipAllowed && skipTime && skipFrame && last9.length > 0) { if (config3.skipAllowed && skipTime && skipFrame && last9.length > 0) {
skipped15++; skipped14++;
return last9; return last9;
} }
skipped15 = 0; skipped14 = 0;
if (!env.kernels.includes("mod") || !env.kernels.includes("sparsetodense")) if (!env.kernels.includes("mod") || !env.kernels.includes("sparsetodense"))
return last9; return last9;
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
@ -10612,7 +10620,7 @@ async function predict16(image29, config3) {
let objectT; let objectT;
if (config3.object.enabled) if (config3.object.enabled)
objectT = model15.execute(transpose); objectT = model15.execute(transpose);
lastTime15 = now(); lastTime14 = now();
tf28.dispose(transpose); tf28.dispose(transpose);
const obj = await process4(objectT, model15.inputSize, outputSize2, config3); const obj = await process4(objectT, model15.inputSize, outputSize2, config3);
last9 = obj; last9 = obj;
@ -11139,41 +11147,29 @@ async function load19(instance) {
async function validate2(instance) { async function validate2(instance) {
const simpleOps = ["const", "placeholder", "noop", "pad", "squeeze", "add", "sub", "mul", "div"]; const simpleOps = ["const", "placeholder", "noop", "pad", "squeeze", "add", "sub", "mul", "div"];
for (const defined of Object.keys(instance.models)) { for (const defined of Object.keys(instance.models)) {
if (instance.models[defined]) { const model18 = instance.models[defined];
let models5 = []; if (!model18)
if (Array.isArray(instance.models[defined])) { continue;
models5 = instance.models[defined].filter((model18) => model18 !== null).map((model18) => model18 && model18.executor ? model18 : model18.model); const ops = [];
} else { const executor = model18 == null ? void 0 : model18.executor;
models5 = [instance.models[defined]]; if (executor && executor.graph.nodes) {
for (const kernel of Object.values(executor.graph.nodes)) {
const op = kernel.op.toLowerCase();
if (!ops.includes(op))
ops.push(op);
} }
for (const model18 of models5) { } else {
if (!model18) { if (!executor && instance.config.debug)
if (instance.config.debug) log("model signature not determined:", defined);
log("model marked as loaded but not defined:", defined); }
continue; const missing = [];
} for (const op of ops) {
const ops = []; if (!simpleOps.includes(op) && !instance.env.kernels.includes(op) && !instance.env.kernels.includes(op.replace("_", "")) && !instance.env.kernels.includes(op.replace("native", "")) && !instance.env.kernels.includes(op.replace("v2", ""))) {
const executor = model18 == null ? void 0 : model18.executor; missing.push(op);
if (executor && executor.graph.nodes) {
for (const kernel of Object.values(executor.graph.nodes)) {
const op = kernel.op.toLowerCase();
if (!ops.includes(op))
ops.push(op);
}
} else {
if (!executor && instance.config.debug)
log("model signature not determined:", defined);
}
const missing = [];
for (const op of ops) {
if (!simpleOps.includes(op) && !instance.env.kernels.includes(op) && !instance.env.kernels.includes(op.replace("_", "")) && !instance.env.kernels.includes(op.replace("native", "")) && !instance.env.kernels.includes(op.replace("v2", ""))) {
missing.push(op);
}
}
if (missing.length > 0 && instance.config.debug)
log("model validation:", defined, missing);
} }
} }
if (instance.config.debug && missing.length > 0)
log("model validation failed:", defined, missing);
} }
} }
@ -11456,12 +11452,12 @@ function point(ctx, x, y, z, localOptions) {
} }
function rect(ctx, x, y, width, height, localOptions) { function rect(ctx, x, y, width, height, localOptions) {
ctx.beginPath(); ctx.beginPath();
ctx.lineWidth = localOptions.lineWidth;
if (localOptions.useCurves) { if (localOptions.useCurves) {
const cx = (x + x + width) / 2; const cx = (x + x + width) / 2;
const cy = (y + y + height) / 2; const cy = (y + y + height) / 2;
ctx.ellipse(cx, cy, width / 2, height / 2, 0, 0, 2 * Math.PI); ctx.ellipse(cx, cy, width / 2, height / 2, 0, 0, 2 * Math.PI);
} else { } else {
ctx.lineWidth = localOptions.lineWidth;
ctx.moveTo(x + localOptions.roundRect, y); ctx.moveTo(x + localOptions.roundRect, y);
ctx.lineTo(x + width - localOptions.roundRect, y); ctx.lineTo(x + width - localOptions.roundRect, y);
ctx.quadraticCurveTo(x + width, y, x + width, y + localOptions.roundRect); ctx.quadraticCurveTo(x + width, y, x + width, y + localOptions.roundRect);
@ -11495,6 +11491,7 @@ function lines(ctx, points, localOptions) {
function curves(ctx, points, localOptions) { function curves(ctx, points, localOptions) {
if (points.length < 2) if (points.length < 2)
return; return;
ctx.lineWidth = localOptions.lineWidth;
if (!localOptions.useCurves || points.length <= 2) { if (!localOptions.useCurves || points.length <= 2) {
lines(ctx, points, localOptions); lines(ctx, points, localOptions);
return; return;
@ -11617,14 +11614,13 @@ async function face(inCanvas2, result, drawOptions) {
ctx.fillText(labels2[i], x + 4, y + 15); ctx.fillText(labels2[i], x + 4, y + 15);
} }
} }
ctx.lineWidth = 1; ctx.lineWidth = 2;
if (f.mesh && f.mesh.length > 0) { if (f.mesh && f.mesh.length > 0) {
if (localOptions.drawPoints) { if (localOptions.drawPoints) {
for (const pt of f.mesh) for (const pt of f.mesh)
point(ctx, pt[0], pt[1], pt[2], localOptions); point(ctx, pt[0], pt[1], pt[2], localOptions);
} }
if (localOptions.drawPolygons) { if (localOptions.drawPolygons) {
ctx.lineWidth = 1;
if (f.mesh.length > 450) { if (f.mesh.length > 450) {
for (let i = 0; i < TRI468.length / 3; i++) { for (let i = 0; i < TRI468.length / 3; i++) {
const points = [ const points = [
@ -11784,7 +11780,8 @@ async function hand(inCanvas2, result, drawOptions) {
const addHandLabel = (part, title) => { const addHandLabel = (part, title) => {
if (!part || part.length === 0 || !part[0]) if (!part || part.length === 0 || !part[0])
return; return;
ctx.fillStyle = localOptions.useDepth ? `rgba(${127.5 + 2 * part[part.length - 1][2]}, ${127.5 - 2 * part[part.length - 1][2]}, 255, 0.5)` : localOptions.color; const z = part[part.length - 1][2] || 0;
ctx.fillStyle = localOptions.useDepth ? `rgba(${127.5 + 2 * z}, ${127.5 - 2 * z}, 255, 0.5)` : localOptions.color;
ctx.fillText(title, part[part.length - 1][0] + 4, part[part.length - 1][1] + 4); ctx.fillText(title, part[part.length - 1][0] + 4, part[part.length - 1][1] + 4);
}; };
ctx.font = localOptions.font; ctx.font = localOptions.font;
@ -11801,7 +11798,8 @@ async function hand(inCanvas2, result, drawOptions) {
return; return;
for (let i = 0; i < part.length; i++) { for (let i = 0; i < part.length; i++) {
ctx.beginPath(); ctx.beginPath();
ctx.strokeStyle = localOptions.useDepth ? `rgba(${127.5 + i * part[i][2]}, ${127.5 - i * part[i][2]}, 255, 0.5)` : localOptions.color; const z = part[i][2] || 0;
ctx.strokeStyle = localOptions.useDepth ? `rgba(${127.5 + i * z}, ${127.5 - i * z}, 255, 0.5)` : localOptions.color;
ctx.moveTo(part[i > 0 ? i - 1 : 0][0], part[i > 0 ? i - 1 : 0][1]); ctx.moveTo(part[i > 0 ? i - 1 : 0][0], part[i > 0 ? i - 1 : 0][1]);
ctx.lineTo(part[i][0], part[i][1]); ctx.lineTo(part[i][0], part[i][1]);
ctx.stroke(); ctx.stroke();
@ -11980,7 +11978,7 @@ var calculateFaceAngle = (face5, imageSize) => {
return [x, y, z]; return [x, y, z];
}; };
const rotationMatrixToEulerAngle = (r) => { const rotationMatrixToEulerAngle = (r) => {
const [r00, r01, r02, r10, r11, r12, r20, r21, r22] = r; const [r00, _r01, _r02, r10, r11, r12, r20, r21, r22] = r;
let thetaX; let thetaX;
let thetaY; let thetaY;
let thetaZ; let thetaZ;
@ -12007,24 +12005,11 @@ var calculateFaceAngle = (face5, imageSize) => {
thetaZ = 0; thetaZ = 0;
return { pitch: 2 * -thetaX, yaw: 2 * -thetaY, roll: 2 * -thetaZ }; return { pitch: 2 * -thetaX, yaw: 2 * -thetaY, roll: 2 * -thetaZ };
}; };
const meshToEulerAngle = (mesh2) => {
const radians = (a1, a2, b1, b2) => Math.atan2(b2 - a2, b1 - a1);
const angle2 = {
pitch: radians(mesh2[10][1], mesh2[10][2], mesh2[152][1], mesh2[152][2]),
yaw: radians(mesh2[33][0], mesh2[33][2], mesh2[263][0], mesh2[263][2]),
roll: radians(mesh2[33][0], mesh2[33][1], mesh2[263][0], mesh2[263][1])
};
return angle2;
};
const mesh = face5.meshRaw; const mesh = face5.meshRaw;
if (!mesh || mesh.length < 300) if (!mesh || mesh.length < 300)
return { angle: { pitch: 0, yaw: 0, roll: 0 }, matrix: [1, 0, 0, 0, 1, 0, 0, 0, 1], gaze: { bearing: 0, strength: 0 } }; return { angle: { pitch: 0, yaw: 0, roll: 0 }, matrix: [1, 0, 0, 0, 1, 0, 0, 0, 1], gaze: { bearing: 0, strength: 0 } };
const size2 = Math.max(face5.boxRaw[2] * imageSize[0], face5.boxRaw[3] * imageSize[1]) / 1.5; const size2 = Math.max(face5.boxRaw[2] * imageSize[0], face5.boxRaw[3] * imageSize[1]) / 1.5;
const pts = [mesh[10], mesh[152], mesh[234], mesh[454]].map((pt) => [ const pts = [mesh[10], mesh[152], mesh[234], mesh[454]].map((pt) => [pt[0] * imageSize[0] / size2, pt[1] * imageSize[1] / size2, pt[2]]);
pt[0] * imageSize[0] / size2,
pt[1] * imageSize[1] / size2,
pt[2]
]);
const y_axis = normalize(subVectors(pts[1], pts[0])); const y_axis = normalize(subVectors(pts[1], pts[0]));
let x_axis = normalize(subVectors(pts[3], pts[2])); let x_axis = normalize(subVectors(pts[3], pts[2]));
const z_axis = normalize(crossVectors(x_axis, y_axis)); const z_axis = normalize(crossVectors(x_axis, y_axis));
@ -13328,7 +13313,7 @@ async function warmupCanvas(instance) {
const canvas3 = canvas(img.naturalWidth, img.naturalHeight); const canvas3 = canvas(img.naturalWidth, img.naturalHeight);
if (!canvas3) { if (!canvas3) {
log("Warmup: Canvas not found"); log("Warmup: Canvas not found");
resolve({}); resolve(void 0);
} else { } else {
const ctx = canvas3.getContext("2d"); const ctx = canvas3.getContext("2d");
if (ctx) if (ctx)
@ -13341,7 +13326,7 @@ async function warmupCanvas(instance) {
if (src) if (src)
img.src = src; img.src = src;
else else
resolve(null); resolve(void 0);
}); });
} }
async function warmupNode(instance) { async function warmupNode(instance) {
@ -13349,12 +13334,10 @@ async function warmupNode(instance) {
let img; let img;
if (instance.config.warmup === "face") if (instance.config.warmup === "face")
img = atob(face3); img = atob(face3);
if (instance.config.warmup === "body" || instance.config.warmup === "full") else
img = atob(body3); img = atob(body3);
if (!img)
return null;
let res; let res;
if (typeof tf35["node"] !== "undefined") { if ("node" in tf35) {
const data = tf35["node"].decodeJpeg(img); const data = tf35["node"].decodeJpeg(img);
const expanded = data.expandDims(0); const expanded = data.expandDims(0);
instance.tf.dispose(data); instance.tf.dispose(data);

View File

@ -23,12 +23,6 @@ export interface FaceDetectorConfig extends GenericConfig {
minConfidence: number, minConfidence: number,
/** minimum overlap between two detected faces before one is discarded */ /** minimum overlap between two detected faces before one is discarded */
iouThreshold: number, iouThreshold: number,
/** factor used to expand detected face before further analysis
* - default: 1.6
* - for high-quality inputs can be reduced to increase precision
* - for video inputs or low-quality inputs can be increased to allow for more flexible tracking
*/
cropFactor: number,
/** should child models perform on masked image of a face */ /** should child models perform on masked image of a face */
mask: boolean, mask: boolean,
/** should face detection return face tensor to be used in some other extenrnal model? */ /** should face detection return face tensor to be used in some other extenrnal model? */
@ -330,7 +324,6 @@ const config: Config = {
skipTime: 2500, skipTime: 2500,
minConfidence: 0.2, minConfidence: 0.2,
iouThreshold: 0.1, iouThreshold: 0.1,
cropFactor: 1.6,
mask: false, mask: false,
return: false, return: false,
}, },

View File

@ -1,6 +1,3 @@
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
const rad2deg = (theta) => Math.round((theta * 180) / Math.PI);
const calculateGaze = (face): { bearing: number, strength: number } => { 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 const radians = (pt1, pt2) => 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 }; if (!face.annotations['rightEyeIris'] || !face.annotations['leftEyeIris']) return { bearing: 0, strength: 0 };
@ -16,7 +13,6 @@ 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 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[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]]; : [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 = [ // x distance between extreme point and center point normalized with eye size
(eyeCenter[0] - irisCenter[0]) / eyeSize[0] - offsetIris[0], (eyeCenter[0] - irisCenter[0]) / eyeSize[0] - offsetIris[0],
eyeRatio * (irisCenter[1] - eyeCenter[1]) / eyeSize[1] - offsetIris[1], eyeRatio * (irisCenter[1] - eyeCenter[1]) / eyeSize[1] - offsetIris[1],
@ -24,7 +20,6 @@ const calculateGaze = (face): { bearing: number, strength: number } => {
let strength = Math.sqrt((eyeDiff[0] ** 2) + (eyeDiff[1] ** 2)); // vector length is a diagonal between two differences let strength = Math.sqrt((eyeDiff[0] ** 2) + (eyeDiff[1] ** 2)); // vector length is a diagonal between two differences
strength = Math.min(strength, face.boxRaw[2] / 2, face.boxRaw[3] / 2); // limit strength to half of box size to avoid clipping due to low precision strength = Math.min(strength, face.boxRaw[2] / 2, face.boxRaw[3] / 2); // limit strength to half of box size to avoid clipping due to low precision
const bearing = (radians([0, 0], eyeDiff) + (Math.PI / 2)) % Math.PI; // using eyeDiff instead eyeCenter/irisCenter combo due to manual adjustments and rotate clockwise 90degrees const bearing = (radians([0, 0], eyeDiff) + (Math.PI / 2)) % Math.PI; // using eyeDiff instead eyeCenter/irisCenter combo due to manual adjustments and rotate clockwise 90degrees
return { bearing, strength }; return { bearing, strength };
}; };
@ -56,7 +51,7 @@ export const calculateFaceAngle = (face, imageSize): {
// 3x3 rotation matrix to Euler angles based on https://www.geometrictools.com/Documentation/EulerAngles.pdf // 3x3 rotation matrix to Euler angles based on https://www.geometrictools.com/Documentation/EulerAngles.pdf
const rotationMatrixToEulerAngle = (r) => { const rotationMatrixToEulerAngle = (r) => {
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
const [r00, r01, r02, r10, r11, r12, r20, r21, r22] = r; const [r00, _r01, _r02, r10, r11, r12, r20, r21, r22] = r;
let thetaX: number; let thetaX: number;
let thetaY: number; let thetaY: number;
let thetaZ: number; let thetaZ: number;
@ -80,22 +75,17 @@ export const calculateFaceAngle = (face, imageSize): {
if (isNaN(thetaZ)) thetaZ = 0; if (isNaN(thetaZ)) thetaZ = 0;
return { pitch: 2 * -thetaX, yaw: 2 * -thetaY, roll: 2 * -thetaZ }; return { pitch: 2 * -thetaX, yaw: 2 * -thetaY, roll: 2 * -thetaZ };
}; };
// simple Euler angle calculation based existing 3D mesh
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars /*
const meshToEulerAngle = (mesh) => { const meshToEulerAngle = (mesh) => { // simple Euler angle calculation based existing 3D mesh
const radians = (a1, a2, b1, b2) => Math.atan2(b2 - a2, b1 - a1); const radians = (a1, a2, b1, b2) => Math.atan2(b2 - a2, b1 - a1);
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars return { // values are in radians in range of -pi/2 to pi/2 which is -90 to +90 degrees, value of 0 means center
const angle = { pitch: radians(mesh[10][1], mesh[10][2], mesh[152][1], mesh[152][2]), // looking at y,z of top and bottom points of the face // pitch is face move up/down
// values are in radians in range of -pi/2 to pi/2 which is -90 to +90 degrees, value of 0 means center yaw: radians(mesh[33][0], mesh[33][2], mesh[263][0], mesh[263][2]), // looking at x,z of outside corners of leftEye and rightEye // yaw is face turn left/right
// pitch is face move up/down roll: radians(mesh[33][0], mesh[33][1], mesh[263][0], mesh[263][1]), // looking at x,y of outside corners of leftEye and rightEye // roll is face lean left/right
pitch: radians(mesh[10][1], mesh[10][2], mesh[152][1], mesh[152][2]), // looking at y,z of top and bottom points of the face
// yaw is face turn left/right
yaw: radians(mesh[33][0], mesh[33][2], mesh[263][0], mesh[263][2]), // looking at x,z of outside corners of leftEye and rightEye
// roll is face lean left/right
roll: radians(mesh[33][0], mesh[33][1], mesh[263][0], mesh[263][1]), // looking at x,y of outside corners of leftEye and rightEye
}; };
return angle;
}; };
*/
// initialize gaze and mesh // initialize gaze and mesh
const mesh = face.meshRaw; const mesh = face.meshRaw;
@ -103,12 +93,7 @@ export const calculateFaceAngle = (face, imageSize): {
const size = Math.max(face.boxRaw[2] * imageSize[0], face.boxRaw[3] * imageSize[1]) / 1.5; const size = Math.max(face.boxRaw[2] * imageSize[0], face.boxRaw[3] * imageSize[1]) / 1.5;
// top, bottom, left, right // top, bottom, left, right
const pts = [mesh[10], mesh[152], mesh[234], mesh[454]].map((pt) => [ 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
// make the xyz coordinates proportional, independent of the image/box size
pt[0] * imageSize[0] / size,
pt[1] * imageSize[1] / size,
pt[2],
]);
const y_axis = normalize(subVectors(pts[1], pts[0])); const y_axis = normalize(subVectors(pts[1], pts[0]));
let x_axis = normalize(subVectors(pts[3], pts[2])); let x_axis = normalize(subVectors(pts[3], pts[2]));

View File

@ -13,6 +13,7 @@ import { env } from '../util/env';
import type { Point } from '../result'; import type { Point } from '../result';
const keypointsCount = 6; const keypointsCount = 6;
const faceBoxScaleFactor = 1.2;
let model: GraphModel | null; let model: GraphModel | null;
let anchors: Tensor | null = null; let anchors: Tensor | null = null;
let inputSize = 0; let inputSize = 0;
@ -54,7 +55,7 @@ function decodeBounds(boxOutputs) {
export async function getBoxes(inputImage: Tensor, config: Config) { export async function getBoxes(inputImage: Tensor, config: Config) {
// sanity check on input // sanity check on input
if ((!inputImage) || (inputImage['isDisposedInternal']) || (inputImage.shape.length !== 4) || (inputImage.shape[1] < 1) || (inputImage.shape[2] < 1)) return { boxes: [] }; if ((!inputImage) || (inputImage['isDisposedInternal']) || (inputImage.shape.length !== 4) || (inputImage.shape[1] < 1) || (inputImage.shape[2] < 1)) return [];
const t: Record<string, Tensor> = {}; const t: Record<string, Tensor> = {};
t.resized = tf.image.resizeBilinear(inputImage, [inputSize, inputSize]); t.resized = tf.image.resizeBilinear(inputImage, [inputSize, inputSize]);
@ -88,16 +89,19 @@ export async function getBoxes(inputImage: Tensor, config: Config) {
b.squeeze = tf.squeeze(b.slice); b.squeeze = tf.squeeze(b.slice);
b.landmarks = tf.reshape(b.squeeze, [keypointsCount, -1]); b.landmarks = tf.reshape(b.squeeze, [keypointsCount, -1]);
const points = await b.bbox.data(); const points = await b.bbox.data();
boxes.push({ const rawBox = {
startPoint: [points[0], points[1]] as Point, startPoint: [points[0], points[1]] as Point,
endPoint: [points[2], points[3]] as Point, endPoint: [points[2], points[3]] as Point,
landmarks: (await b.landmarks.array()) as Point[], landmarks: (await b.landmarks.array()) as Point[],
confidence, confidence,
}); };
const scaledBox = util.scaleBoxCoordinates(rawBox, [(inputImage.shape[2] || 0) / inputSize, (inputImage.shape[1] || 0) / inputSize]);
const enlargedBox = util.enlargeBox(scaledBox, faceBoxScaleFactor);
const squaredBox = util.squarifyBox(enlargedBox);
boxes.push(squaredBox);
Object.keys(b).forEach((tensor) => tf.dispose(b[tensor])); Object.keys(b).forEach((tensor) => tf.dispose(b[tensor]));
} }
} }
Object.keys(t).forEach((tensor) => tf.dispose(t[tensor])); Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));
return { boxes, scaleFactor: [inputImage.shape[2] / inputSize, inputImage.shape[1] / inputSize] }; return boxes;
} }

View File

@ -20,37 +20,32 @@ import type { FaceResult, FaceLandmark, Point } from '../result';
import type { Config } from '../config'; import type { Config } from '../config';
type DetectBox = { startPoint: Point, endPoint: Point, landmarks: Array<Point>, confidence: number }; type DetectBox = { startPoint: Point, endPoint: Point, landmarks: Array<Point>, confidence: number };
let boxCache: Array<DetectBox> = [];
const cache = {
boxes: [] as DetectBox[],
skipped: Number.MAX_SAFE_INTEGER,
timestamp: 0,
};
let model: GraphModel | null = null; let model: GraphModel | null = null;
let inputSize = 0; let inputSize = 0;
let skipped = Number.MAX_SAFE_INTEGER;
let lastTime = 0;
export async function predict(input: Tensor, config: Config): Promise<FaceResult[]> { export async function predict(input: Tensor, config: Config): Promise<FaceResult[]> {
// reset cached boxes // reset cached boxes
const skipTime = (config.face.detector?.skipTime || 0) > (now() - lastTime); const skipTime = (config.face.detector?.skipTime || 0) > (now() - cache.timestamp);
const skipFrame = skipped < (config.face.detector?.skipFrames || 0); const skipFrame = cache.skipped < (config.face.detector?.skipFrames || 0);
if (!config.skipAllowed || !skipTime || !skipFrame || boxCache.length === 0) { if (!config.skipAllowed || !skipTime || !skipFrame || cache.boxes.length === 0) {
const possibleBoxes = await blazeface.getBoxes(input, config); // get results from blazeface detector cache.boxes = await blazeface.getBoxes(input, config); // get results from blazeface detector
lastTime = now(); cache.timestamp = now();
boxCache = []; // empty cache cache.skipped = 0;
for (const possible of possibleBoxes.boxes) { // extract data from detector
const boxScaled = util.scaleBoxCoordinates(possible, possibleBoxes.scaleFactor);
const detectedWidth = (boxScaled.endPoint[0] - boxScaled.startPoint[0]) / (input.shape[2] || 1000);
const calcFactor = (config.face.detector?.cropFactor || 1.6) / (detectedWidth + 0.75) / 1.34; // detected face box is not the same size as calculated face box and scale also depends on detected face size
const boxEnlarged = util.enlargeBox(boxScaled, calcFactor);
const boxSquared = util.squarifyBox(boxEnlarged);
boxCache.push(boxSquared);
}
skipped = 0;
} else { } else {
skipped++; cache.skipped++;
} }
const faces: Array<FaceResult> = []; const faces: Array<FaceResult> = [];
const newCache: Array<DetectBox> = []; const newCache: Array<DetectBox> = [];
let id = 0; let id = 0;
for (let i = 0; i < boxCache.length; i++) { for (let i = 0; i < cache.boxes.length; i++) {
let box = boxCache[i]; const box = cache.boxes[i];
let angle = 0; let angle = 0;
let rotationMatrix; let rotationMatrix;
const face: FaceResult = { // init face result const face: FaceResult = { // init face result
@ -74,7 +69,7 @@ export async function predict(input: Tensor, config: Config): Promise<FaceResult
} }
face.boxScore = Math.round(100 * box.confidence) / 100; face.boxScore = Math.round(100 * box.confidence) / 100;
if (!config.face.mesh?.enabled) { // mesh not enabled, return resuts from detector only if (!config.face.mesh?.enabled) { // mesh not enabled, return resuts from detector only
face.box = util.getClampedBox(box, input); face.box = util.clampBox(box, input);
face.boxRaw = util.getRawBox(box, input); face.boxRaw = util.getRawBox(box, input);
face.score = face.boxScore; face.score = face.boxScore;
face.mesh = box.landmarks.map((pt) => [ face.mesh = box.landmarks.map((pt) => [
@ -99,21 +94,16 @@ export async function predict(input: Tensor, config: Config): Promise<FaceResult
face.mesh = util.transformRawCoords(rawCoords, box, angle, rotationMatrix, inputSize); // get processed mesh face.mesh = util.transformRawCoords(rawCoords, box, angle, rotationMatrix, inputSize); // get processed mesh
face.meshRaw = face.mesh.map((pt) => [pt[0] / (input.shape[2] || 0), pt[1] / (input.shape[1] || 0), (pt[2] || 0) / inputSize]); face.meshRaw = face.mesh.map((pt) => [pt[0] / (input.shape[2] || 0), pt[1] / (input.shape[1] || 0), (pt[2] || 0) / inputSize]);
for (const key of Object.keys(coords.meshAnnotations)) face.annotations[key] = coords.meshAnnotations[key].map((index) => face.mesh[index]); // add annotations for (const key of Object.keys(coords.meshAnnotations)) face.annotations[key] = coords.meshAnnotations[key].map((index) => face.mesh[index]); // add annotations
const boxCalculated = util.calculateLandmarksBoundingBox(face.mesh);
const boxEnlarged = util.enlargeBox(boxCalculated, (config.face.detector?.cropFactor || 1.6));
const boxSquared = util.squarifyBox(boxEnlarged);
box = { ...boxSquared, confidence: box.confidence }; // redefine box with mesh calculated one
face.box = util.getClampedBox(box, input); // update detected box with box around the face mesh
face.boxRaw = util.getRawBox(box, input);
face.score = face.faceScore; face.score = face.faceScore;
newCache.push(box); const calculatedBox = { ...util.calculateFaceBox(face.mesh, box), confidence: box.confidence, landmarks: box.landmarks };
tf.dispose(face.tensor); face.box = util.clampBox(calculatedBox, input);
[angle, rotationMatrix, face.tensor] = util.correctFaceRotation(config.face.detector?.rotation, box, input, inputSize); // optional rotate once more based on mesh data face.boxRaw = util.getRawBox(calculatedBox, input);
newCache.push(calculatedBox);
} }
} }
faces.push(face); faces.push(face);
} }
boxCache = [...newCache]; // reset cache cache.boxes = newCache; // reset cache
return faces; return faces;
} }

View File

@ -15,9 +15,9 @@ export const disposeBox = (t) => tf.dispose([t.startPoint, t.endPoint]);
export const getBoxSize = (box): [number, number] => [Math.abs(box.endPoint[0] - box.startPoint[0]), Math.abs(box.endPoint[1] - box.startPoint[1])]; export const getBoxSize = (box): [number, number] => [Math.abs(box.endPoint[0] - box.startPoint[0]), Math.abs(box.endPoint[1] - box.startPoint[1])];
export const getBoxCenter = (box): [number, number] => [box.startPoint[0] + (box.endPoint[0] - box.startPoint[0]) / 2, box.startPoint[1] + (box.endPoint[1] - box.startPoint[1]) / 2]; export const getBoxCenter = (box): [number, number, number] => [box.startPoint[0] + (box.endPoint[0] - box.startPoint[0]) / 2, box.startPoint[1] + (box.endPoint[1] - box.startPoint[1]) / 2, 1];
export const getClampedBox = (box, input): Box => (box ? [ export const clampBox = (box, input): Box => (box ? [
Math.trunc(Math.max(0, box.startPoint[0])), Math.trunc(Math.max(0, box.startPoint[0])),
Math.trunc(Math.max(0, box.startPoint[1])), Math.trunc(Math.max(0, box.startPoint[1])),
Math.trunc(Math.min((input.shape[2] || 0), box.endPoint[0]) - Math.max(0, box.startPoint[0])), Math.trunc(Math.min((input.shape[2] || 0), box.endPoint[0]) - Math.max(0, box.startPoint[0])),
@ -37,10 +37,11 @@ export const scaleBoxCoordinates = (box, factor) => {
return { startPoint, endPoint, landmarks: box.landmarks, confidence: box.confidence }; return { startPoint, endPoint, landmarks: box.landmarks, confidence: box.confidence };
}; };
export const cutBoxFromImageAndResize = (box, image, cropSize) => { export const cutAndResize = (box, image, cropSize) => {
const h = image.shape[1]; const h = image.shape[1];
const w = image.shape[2]; const w = image.shape[2];
const crop = tf.image.cropAndResize(image, [[box.startPoint[1] / h, box.startPoint[0] / w, box.endPoint[1] / h, box.endPoint[0] / w]], [0], cropSize); const cutBox = [box.startPoint[1] / h, box.startPoint[0] / w, box.endPoint[1] / h, box.endPoint[0] / w];
const crop = tf.image.cropAndResize(image, [cutBox], [0], cropSize);
const norm = tf.div(crop, constants.tf255); const norm = tf.div(crop, constants.tf255);
tf.dispose(crop); tf.dispose(crop);
return norm; return norm;
@ -61,9 +62,9 @@ export const squarifyBox = (box) => {
}; };
export const calculateLandmarksBoundingBox = (landmarks) => { export const calculateLandmarksBoundingBox = (landmarks) => {
const xs = landmarks.map((d) => d[0]); const x = landmarks.map((d) => d[0]);
const ys = landmarks.map((d) => d[1]); const y = landmarks.map((d) => d[1]);
return { startPoint: [Math.min(...xs), Math.min(...ys)] as Point, endPoint: [Math.max(...xs), Math.max(...ys)] as Point, landmarks }; return { startPoint: [Math.min(...x), Math.min(...y)] as Point, endPoint: [Math.max(...x), Math.max(...y)] as Point, landmarks };
}; };
export const fixedRotationMatrix = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]; export const fixedRotationMatrix = [[1, 0, 0], [0, 1, 0], [0, 0, 1]];
@ -141,19 +142,20 @@ export function generateAnchors(inputSize) {
export function transformRawCoords(coordsRaw, box, angle, rotationMatrix, inputSize) { export function transformRawCoords(coordsRaw, box, angle, rotationMatrix, inputSize) {
const boxSize = getBoxSize(box); const boxSize = getBoxSize(box);
const coordsScaled = coordsRaw.map((coord) => ([ // scaled around zero-point const coordsScaled = coordsRaw.map((coord) => ([ // scaled around zero-point
boxSize[0] / inputSize * (coord[0] - inputSize / 2), (boxSize[0] / inputSize) * (coord[0] - (inputSize / 2)),
boxSize[1] / inputSize * (coord[1] - inputSize / 2), (boxSize[1] / inputSize) * (coord[1] - (inputSize / 2)),
coord[2] || 0, (coord[2] || 0),
])); ]));
const largeAngle = angle && (angle !== 0) && (Math.abs(angle) > 0.2); const largeAngle = angle && (angle !== 0) && (Math.abs(angle) > 0.2);
const coordsRotationMatrix = largeAngle ? buildRotationMatrix(angle, [0, 0]) : fixedRotationMatrix; const coordsRotationMatrix = largeAngle ? buildRotationMatrix(angle, [0, 0]) : fixedRotationMatrix;
const coordsRotated = largeAngle ? coordsScaled.map((coord) => ([...rotatePoint(coord, coordsRotationMatrix), coord[2]])) : coordsScaled; const coordsRotated = largeAngle ? coordsScaled.map((coord) => ([...rotatePoint(coord, coordsRotationMatrix), coord[2]])) : coordsScaled;
const inverseRotationMatrix = largeAngle ? invertTransformMatrix(rotationMatrix) : fixedRotationMatrix; const inverseRotationMatrix = largeAngle ? invertTransformMatrix(rotationMatrix) : fixedRotationMatrix;
const boxCenter = [...getBoxCenter({ startPoint: box.startPoint, endPoint: box.endPoint }), 1]; const boxCenter = getBoxCenter(box);
const offsets = [dot(boxCenter, inverseRotationMatrix[0]), dot(boxCenter, inverseRotationMatrix[1])];
return coordsRotated.map((coord) => ([ return coordsRotated.map((coord) => ([
Math.round(coord[0] + dot(boxCenter, inverseRotationMatrix[0])), Math.trunc(coord[0] + offsets[0]),
Math.round(coord[1] + dot(boxCenter, inverseRotationMatrix[1])), Math.trunc(coord[1] + offsets[1]),
Math.round(coord[2] || 0), Math.trunc(coord[2] || 0),
])); ]));
} }
@ -165,21 +167,43 @@ export function correctFaceRotation(rotate, box, input, inputSize) {
let rotationMatrix = fixedRotationMatrix; // default let rotationMatrix = fixedRotationMatrix; // default
let face; // default let face; // default
if (rotate && env.kernels.includes('rotatewithoffset')) { if (rotate && env.kernels.includes('rotatewithoffset')) { // rotateWithOffset is not defined for tfjs-node
angle = computeRotation(box.landmarks[symmetryLine[0]], box.landmarks[symmetryLine[1]]); angle = computeRotation(box.landmarks[symmetryLine[0]], box.landmarks[symmetryLine[1]]);
const largeAngle = angle && (angle !== 0) && (Math.abs(angle) > 0.2); const largeAngle = angle && (angle !== 0) && (Math.abs(angle) > 0.2);
if (largeAngle) { if (largeAngle) { // perform rotation only if angle is sufficiently high
const center: Point = getBoxCenter({ startPoint: box.startPoint, endPoint: box.endPoint }); const center: Point = getBoxCenter(box);
const centerRaw: Point = [center[0] / input.shape[2], center[1] / input.shape[1]]; const centerRaw: Point = [center[0] / input.shape[2], center[1] / input.shape[1]];
const rotated = tf.image.rotateWithOffset(input, angle, 0, centerRaw); // rotateWithOffset is not defined for tfjs-node const rotated = tf.image.rotateWithOffset(input, angle, 0, centerRaw);
rotationMatrix = buildRotationMatrix(-angle, center); rotationMatrix = buildRotationMatrix(-angle, center);
face = cutBoxFromImageAndResize(box, rotated, [inputSize, inputSize]); face = cutAndResize(box, rotated, [inputSize, inputSize]);
tf.dispose(rotated); tf.dispose(rotated);
} else { } else {
face = cutBoxFromImageAndResize(box, input, [inputSize, inputSize]); face = cutAndResize(box, input, [inputSize, inputSize]);
} }
} else { } else {
face = cutBoxFromImageAndResize(box, input, [inputSize, inputSize]); face = cutAndResize(box, input, [inputSize, inputSize]);
} }
return [angle, rotationMatrix, face]; return [angle, rotationMatrix, face];
} }
export const findFaceCenter = (mesh) => {
const x = mesh.map((m) => m[0]);
const y = mesh.map((m) => m[1]);
// weighted center
/*
const sum = (arr: number[]) => arr.reduce((prev, curr) => prev + curr, 0);
return [sum(x) / mesh.length, sum(y) / mesh.length];
*/
// absolute center
return [Math.min(...x) + (Math.max(...x) - Math.min(...x)) / 2, Math.min(...y) + (Math.max(...y) - Math.min(...y)) / 2];
};
export const calculateFaceBox = (mesh, previousBox) => {
const center = findFaceCenter(mesh);
const boxSize = getBoxSize(previousBox);
const calculatedBox = {
startPoint: [center[0] - boxSize[0] / 2, center[1] - boxSize[1] / 2] as Point,
endPoint: [center[0] + boxSize[0] / 2, center[1] + boxSize[1] / 2] as Point,
};
return calculatedBox;
};

View File

@ -6,11 +6,11 @@
import { Finger, FingerCurl, FingerDirection, FingerGesture } from './fingerdef'; import { Finger, FingerCurl, FingerDirection, FingerGesture } from './fingerdef';
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
const { thumb, index, middle, ring, pinky } = Finger; export const { thumb, index, middle, ring, pinky } = Finger;
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
const { none, half, full } = FingerCurl; export const { none, half, full } = FingerCurl;
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
const { verticalUp, verticalDown, horizontalLeft, horizontalRight, diagonalUpRight, diagonalUpLeft, diagonalDownRight, diagonalDownLeft } = FingerDirection; export const { verticalUp, verticalDown, horizontalLeft, horizontalRight, diagonalUpRight, diagonalUpLeft, diagonalDownRight, diagonalDownLeft } = FingerDirection;
// describe thumbs up gesture 👍 // describe thumbs up gesture 👍
const ThumbsUp = new FingerGesture('thumbs up'); const ThumbsUp = new FingerGesture('thumbs up');

View File

@ -146,7 +146,7 @@ export class Human {
// reexport draw methods // reexport draw methods
this.draw = { this.draw = {
options: draw.options as DrawOptions, options: draw.options as DrawOptions,
canvas: (input: AnyCanvas | HTMLImageElement | HTMLMediaElement | HTMLVideoElement, output: AnyCanvas) => draw.canvas(input, output), canvas: (input: AnyCanvas | HTMLImageElement | HTMLVideoElement, output: AnyCanvas) => draw.canvas(input, output),
face: (output: AnyCanvas, result: FaceResult[], options?: Partial<DrawOptions>) => draw.face(output, result, options), face: (output: AnyCanvas, result: FaceResult[], options?: Partial<DrawOptions>) => draw.face(output, result, options),
body: (output: AnyCanvas, result: BodyResult[], options?: Partial<DrawOptions>) => draw.body(output, result, options), body: (output: AnyCanvas, result: BodyResult[], options?: Partial<DrawOptions>) => draw.body(output, result, options),
hand: (output: AnyCanvas, result: HandResult[], options?: Partial<DrawOptions>) => draw.hand(output, result, options), hand: (output: AnyCanvas, result: HandResult[], options?: Partial<DrawOptions>) => draw.hand(output, result, options),
@ -342,7 +342,7 @@ export class Human {
*/ */
async profile(input: Input, userConfig?: Partial<Config>): Promise<Record<string, number>> { async profile(input: Input, userConfig?: Partial<Config>): Promise<Record<string, number>> {
const profile = await this.tf.profile(() => this.detect(input, userConfig)); const profile = await this.tf.profile(() => this.detect(input, userConfig));
const kernels = {}; const kernels: Record<string, number> = {};
for (const kernel of profile.kernels) { // sum kernel time values per kernel for (const kernel of profile.kernels) { // sum kernel time values per kernel
if (kernels[kernel.name]) kernels[kernel.name] += kernel.kernelTimeMs; if (kernels[kernel.name]) kernels[kernel.name] += kernel.kernelTimeMs;
else kernels[kernel.name] = kernel.kernelTimeMs; else kernels[kernel.name] = kernel.kernelTimeMs;

View File

@ -24,7 +24,7 @@ const last: { inputSum: number, cacheDiff: number, sumMethod: number, inputTenso
inputTensor: undefined, inputTensor: undefined,
}; };
export function canvas(width, height): AnyCanvas { export function canvas(width: number, height: number): AnyCanvas {
let c; let c;
if (env.browser) { // browser defines canvas object if (env.browser) { // browser defines canvas object
if (env.worker) { // if runing in web worker use OffscreenCanvas if (env.worker) { // if runing in web worker use OffscreenCanvas
@ -260,7 +260,7 @@ const checksum = async (input: Tensor): Promise<number> => { // use tf sum or js
}; };
*/ */
export async function skip(config, input: Tensor) { export async function skip(config: Partial<Config>, input: Tensor) {
let skipFrame = false; let skipFrame = false;
if (config.cacheSensitivity === 0 || !input.shape || input.shape.length !== 4 || input.shape[1] > 2048 || input.shape[2] > 2048) return skipFrame; // cache disabled or input is invalid or too large for cache analysis if (config.cacheSensitivity === 0 || !input.shape || input.shape.length !== 4 || input.shape[1] > 2048 || input.shape[2] > 2048) return skipFrame; // cache disabled or input is invalid or too large for cache analysis
@ -290,12 +290,12 @@ export async function skip(config, input: Tensor) {
const diffRelative = diffSum[0] / (input.shape[1] || 1) / (input.shape[2] || 1) / 255 / 3; // squared difference relative to input resolution and averaged per channel const diffRelative = diffSum[0] / (input.shape[1] || 1) / (input.shape[2] || 1) / 255 / 3; // squared difference relative to input resolution and averaged per channel
tf.dispose([last.inputTensor, t.diff, t.squared, t.sum]); tf.dispose([last.inputTensor, t.diff, t.squared, t.sum]);
last.inputTensor = tf.clone(input); last.inputTensor = tf.clone(input);
skipFrame = diffRelative <= config.cacheSensitivity; skipFrame = diffRelative <= (config.cacheSensitivity || 0);
} }
return skipFrame; return skipFrame;
} }
export async function compare(config, input1: Tensor, input2: Tensor): Promise<number> { export async function compare(config: Partial<Config>, input1: Tensor, input2: Tensor): Promise<number> {
const t: Record<string, Tensor> = {}; const t: Record<string, Tensor> = {};
if (!input1 || !input2 || input1.shape.length !== 4 || input1.shape.length !== input2.shape.length) { if (!input1 || !input2 || input1.shape.length !== 4 || input1.shape.length !== input2.shape.length) {
if (!config.debug) log('invalid input tensor or tensor shapes do not match:', input1.shape, input2.shape); if (!config.debug) log('invalid input tensor or tensor shapes do not match:', input1.shape, input2.shape);

View File

@ -60,7 +60,7 @@ export class Models {
export function reset(instance: Human): void { export function reset(instance: Human): void {
// if (instance.config.debug) log('resetting loaded models'); // if (instance.config.debug) log('resetting loaded models');
for (const model of Object.keys(instance.models)) instance.models[model] = null; for (const model of Object.keys(instance.models)) instance.models[model as keyof Models] = null;
} }
/** Load method preloads all instance.configured models on-demand */ /** Load method preloads all instance.configured models on-demand */
@ -71,6 +71,7 @@ export async function load(instance: Human): Promise<void> {
if (!instance.models.handskeleton && instance.config.hand.landmarks && instance.config.hand.detector?.modelPath?.includes('handdetect')) [instance.models.handpose, instance.models.handskeleton] = await handpose.load(instance.config); if (!instance.models.handskeleton && instance.config.hand.landmarks && instance.config.hand.detector?.modelPath?.includes('handdetect')) [instance.models.handpose, instance.models.handskeleton] = await handpose.load(instance.config);
} }
if (instance.config.body.enabled && !instance.models.blazepose && instance.config.body?.modelPath?.includes('blazepose')) instance.models.blazepose = blazepose.loadPose(instance.config); if (instance.config.body.enabled && !instance.models.blazepose && instance.config.body?.modelPath?.includes('blazepose')) instance.models.blazepose = blazepose.loadPose(instance.config);
// @ts-ignore optional model
if (instance.config.body.enabled && !instance.models.blazeposedetect && instance.config.body['detector'] && instance.config.body['detector']['modelPath']) instance.models.blazeposedetect = blazepose.loadDetect(instance.config); if (instance.config.body.enabled && !instance.models.blazeposedetect && instance.config.body['detector'] && instance.config.body['detector']['modelPath']) instance.models.blazeposedetect = blazepose.loadDetect(instance.config);
if (instance.config.body.enabled && !instance.models.efficientpose && instance.config.body?.modelPath?.includes('efficientpose')) instance.models.efficientpose = efficientpose.load(instance.config); if (instance.config.body.enabled && !instance.models.efficientpose && instance.config.body?.modelPath?.includes('efficientpose')) instance.models.efficientpose = efficientpose.load(instance.config);
if (instance.config.body.enabled && !instance.models.movenet && instance.config.body?.modelPath?.includes('movenet')) instance.models.movenet = movenet.load(instance.config); if (instance.config.body.enabled && !instance.models.movenet && instance.config.body?.modelPath?.includes('movenet')) instance.models.movenet = movenet.load(instance.config);
@ -82,9 +83,13 @@ export async function load(instance: Human): Promise<void> {
if (instance.config.face.enabled && instance.config.face.emotion?.enabled && !instance.models.emotion) instance.models.emotion = emotion.load(instance.config); if (instance.config.face.enabled && instance.config.face.emotion?.enabled && !instance.models.emotion) instance.models.emotion = emotion.load(instance.config);
if (instance.config.face.enabled && instance.config.face.iris?.enabled && !instance.models.faceiris) instance.models.faceiris = iris.load(instance.config); if (instance.config.face.enabled && instance.config.face.iris?.enabled && !instance.models.faceiris) instance.models.faceiris = iris.load(instance.config);
if (instance.config.face.enabled && instance.config.face.mesh?.enabled && !instance.models.facemesh) instance.models.facemesh = facemesh.load(instance.config); if (instance.config.face.enabled && instance.config.face.mesh?.enabled && !instance.models.facemesh) instance.models.facemesh = facemesh.load(instance.config);
// @ts-ignore optional model
if (instance.config.face.enabled && instance.config.face['gear']?.enabled && !instance.models.gear) instance.models.gear = gear.load(instance.config); if (instance.config.face.enabled && instance.config.face['gear']?.enabled && !instance.models.gear) instance.models.gear = gear.load(instance.config);
// @ts-ignore optional model
if (instance.config.face.enabled && instance.config.face['ssrnet']?.enabled && !instance.models.ssrnetage) instance.models.ssrnetage = ssrnetAge.load(instance.config); if (instance.config.face.enabled && instance.config.face['ssrnet']?.enabled && !instance.models.ssrnetage) instance.models.ssrnetage = ssrnetAge.load(instance.config);
// @ts-ignore optional model
if (instance.config.face.enabled && instance.config.face['ssrnet']?.enabled && !instance.models.ssrnetgender) instance.models.ssrnetgender = ssrnetGender.load(instance.config); if (instance.config.face.enabled && instance.config.face['ssrnet']?.enabled && !instance.models.ssrnetgender) instance.models.ssrnetgender = ssrnetGender.load(instance.config);
// @ts-ignore optional model
if (instance.config.face.enabled && instance.config.face['mobilefacenet']?.enabled && !instance.models.mobilefacenet) instance.models.mobilefacenet = mobilefacenet.load(instance.config); if (instance.config.face.enabled && instance.config.face['mobilefacenet']?.enabled && !instance.models.mobilefacenet) instance.models.mobilefacenet = mobilefacenet.load(instance.config);
if (instance.config.hand.enabled && !instance.models.handtrack && instance.config.hand.detector?.modelPath?.includes('handtrack')) instance.models.handtrack = handtrack.loadDetect(instance.config); if (instance.config.hand.enabled && !instance.models.handtrack && instance.config.hand.detector?.modelPath?.includes('handtrack')) instance.models.handtrack = handtrack.loadDetect(instance.config);
if (instance.config.hand.enabled && instance.config.hand.landmarks && !instance.models.handskeleton && instance.config.hand.detector?.modelPath?.includes('handtrack')) instance.models.handskeleton = handtrack.loadSkeleton(instance.config); if (instance.config.hand.enabled && instance.config.hand.landmarks && !instance.models.handskeleton && instance.config.hand.detector?.modelPath?.includes('handtrack')) instance.models.handskeleton = handtrack.loadSkeleton(instance.config);
@ -94,7 +99,7 @@ export async function load(instance: Human): Promise<void> {
// models are loaded in parallel asynchronously so lets wait until they are actually loaded // models are loaded in parallel asynchronously so lets wait until they are actually loaded
for await (const model of Object.keys(instance.models)) { for await (const model of Object.keys(instance.models)) {
if (instance.models[model] && typeof instance.models[model] !== 'undefined') instance.models[model] = await instance.models[model]; if (instance.models[model as keyof Models] && typeof instance.models[model as keyof Models] !== 'undefined') instance.models[model as keyof Models] = await instance.models[model as keyof Models];
} }
} }
@ -102,44 +107,30 @@ export async function validate(instance: Human): Promise<void> {
interface Op { name: string, category: string, op: string } interface Op { name: string, category: string, op: string }
const simpleOps = ['const', 'placeholder', 'noop', 'pad', 'squeeze', 'add', 'sub', 'mul', 'div']; const simpleOps = ['const', 'placeholder', 'noop', 'pad', 'squeeze', 'add', 'sub', 'mul', 'div'];
for (const defined of Object.keys(instance.models)) { for (const defined of Object.keys(instance.models)) {
if (instance.models[defined]) { // check if model is loaded const model: GraphModel | null = instance.models[defined as keyof Models] as GraphModel | null;
let models: GraphModel[] = []; if (!model) continue;
if (Array.isArray(instance.models[defined])) { const ops: string[] = [];
models = instance.models[defined] // @ts-ignore // executor is a private method
.filter((model) => (model !== null)) const executor = model?.executor;
.map((model) => ((model && model.executor) ? model : model.model)); if (executor && executor.graph.nodes) {
} else { for (const kernel of Object.values(executor.graph.nodes)) {
models = [instance.models[defined]]; const op = (kernel as Op).op.toLowerCase();
if (!ops.includes(op)) ops.push(op);
} }
for (const model of models) { } else {
if (!model) { if (!executor && instance.config.debug) log('model signature not determined:', defined);
if (instance.config.debug) log('model marked as loaded but not defined:', defined); }
continue; const missing: string[] = [];
} for (const op of ops) {
const ops: string[] = []; if (!simpleOps.includes(op) // exclude simple ops
// @ts-ignore // executor is a private method && !instance.env.kernels.includes(op) // check actual kernel ops
const executor = model?.executor; && !instance.env.kernels.includes(op.replace('_', '')) // check variation without _
if (executor && executor.graph.nodes) { && !instance.env.kernels.includes(op.replace('native', '')) // check standard variation
for (const kernel of Object.values(executor.graph.nodes)) { && !instance.env.kernels.includes(op.replace('v2', ''))) { // check non-versioned variation
const op = (kernel as Op).op.toLowerCase(); missing.push(op);
if (!ops.includes(op)) ops.push(op);
}
} else {
if (!executor && instance.config.debug) log('model signature not determined:', defined);
}
const missing: string[] = [];
for (const op of ops) {
if (!simpleOps.includes(op) // exclude simple ops
&& !instance.env.kernels.includes(op) // check actual kernel ops
&& !instance.env.kernels.includes(op.replace('_', '')) // check variation without _
&& !instance.env.kernels.includes(op.replace('native', '')) // check standard variation
&& !instance.env.kernels.includes(op.replace('v2', ''))) { // check non-versioned variation
missing.push(op);
}
}
// log('model validation ops:', defined, ops);
if (missing.length > 0 && instance.config.debug) log('model validation:', defined, missing);
} }
} }
// log('model validation ops:', defined, ops);
if (instance.config.debug && missing.length > 0) log('model validation failed:', defined, missing);
} }
} }

View File

@ -71,7 +71,7 @@ export const options: DrawOptions = {
let drawTime = 0; let drawTime = 0;
const getCanvasContext = (input) => { const getCanvasContext = (input: AnyCanvas) => {
if (!input) log('draw error: invalid canvas'); if (!input) log('draw error: invalid canvas');
else if (!input.getContext) log('draw error: canvas context not defined'); else if (!input.getContext) log('draw error: canvas context not defined');
else { else {
@ -82,9 +82,9 @@ const getCanvasContext = (input) => {
return null; return null;
}; };
const rad2deg = (theta) => Math.round((theta * 180) / Math.PI); const rad2deg = (theta: number) => Math.round((theta * 180) / Math.PI);
function point(ctx: CanvasRenderingContext2D, x, y, z, localOptions) { function point(ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, x: number, y: number, z: number | undefined, localOptions: DrawOptions) {
z = z || 0; z = z || 0;
ctx.fillStyle = localOptions.useDepth && z ? `rgba(${127.5 + (2 * z)}, ${127.5 - (2 * z)}, 255, 0.3)` : localOptions.color; ctx.fillStyle = localOptions.useDepth && z ? `rgba(${127.5 + (2 * z)}, ${127.5 - (2 * z)}, 255, 0.3)` : localOptions.color;
ctx.beginPath(); ctx.beginPath();
@ -92,14 +92,14 @@ function point(ctx: CanvasRenderingContext2D, x, y, z, localOptions) {
ctx.fill(); ctx.fill();
} }
function rect(ctx: CanvasRenderingContext2D, x, y, width, height, localOptions) { function rect(ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, x: number, y: number, width: number, height: number, localOptions: DrawOptions) {
ctx.beginPath(); ctx.beginPath();
ctx.lineWidth = localOptions.lineWidth;
if (localOptions.useCurves) { if (localOptions.useCurves) {
const cx = (x + x + width) / 2; const cx = (x + x + width) / 2;
const cy = (y + y + height) / 2; const cy = (y + y + height) / 2;
ctx.ellipse(cx, cy, width / 2, height / 2, 0, 0, 2 * Math.PI); ctx.ellipse(cx, cy, width / 2, height / 2, 0, 0, 2 * Math.PI);
} else { } else {
ctx.lineWidth = localOptions.lineWidth;
ctx.moveTo(x + localOptions.roundRect, y); ctx.moveTo(x + localOptions.roundRect, y);
ctx.lineTo(x + width - localOptions.roundRect, y); ctx.lineTo(x + width - localOptions.roundRect, y);
ctx.quadraticCurveTo(x + width, y, x + width, y + localOptions.roundRect); ctx.quadraticCurveTo(x + width, y, x + width, y + localOptions.roundRect);
@ -114,7 +114,7 @@ function rect(ctx: CanvasRenderingContext2D, x, y, width, height, localOptions)
ctx.stroke(); ctx.stroke();
} }
function lines(ctx: CanvasRenderingContext2D, points: Point[], localOptions) { function lines(ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, points: Point[], localOptions: DrawOptions) {
if (points.length < 2) return; if (points.length < 2) return;
ctx.beginPath(); ctx.beginPath();
ctx.moveTo(points[0][0], points[0][1]); ctx.moveTo(points[0][0], points[0][1]);
@ -131,8 +131,9 @@ function lines(ctx: CanvasRenderingContext2D, points: Point[], localOptions) {
} }
} }
function curves(ctx: CanvasRenderingContext2D, points: Point[], localOptions) { function curves(ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, points: Point[], localOptions: DrawOptions) {
if (points.length < 2) return; if (points.length < 2) return;
ctx.lineWidth = localOptions.lineWidth;
if (!localOptions.useCurves || points.length <= 2) { if (!localOptions.useCurves || points.length <= 2) {
lines(ctx, points, localOptions); lines(ctx, points, localOptions);
return; return;
@ -151,7 +152,7 @@ function curves(ctx: CanvasRenderingContext2D, points: Point[], localOptions) {
} }
} }
function arrow(ctx: CanvasRenderingContext2D, from: Point, to: Point, radius = 5) { function arrow(ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, from: Point, to: Point, radius = 5) {
let angle; let angle;
let x; let x;
let y; let y;
@ -246,13 +247,13 @@ export async function face(inCanvas: AnyCanvas, result: Array<FaceResult>, drawO
ctx.fillText(labels[i], x + 4, y + 15); ctx.fillText(labels[i], x + 4, y + 15);
} }
} }
ctx.lineWidth = 1; // ctx.lineWidth = localOptions.lineWidth;
ctx.lineWidth = 2;
if (f.mesh && f.mesh.length > 0) { if (f.mesh && f.mesh.length > 0) {
if (localOptions.drawPoints) { if (localOptions.drawPoints) {
for (const pt of f.mesh) point(ctx, pt[0], pt[1], pt[2], localOptions); for (const pt of f.mesh) point(ctx, pt[0], pt[1], pt[2], localOptions);
} }
if (localOptions.drawPolygons) { if (localOptions.drawPolygons) {
ctx.lineWidth = 1;
if (f.mesh.length > 450) { if (f.mesh.length > 450) {
for (let i = 0; i < triangulation.length / 3; i++) { for (let i = 0; i < triangulation.length / 3; i++) {
const points = [ const points = [
@ -406,9 +407,10 @@ export async function hand(inCanvas: AnyCanvas, result: Array<HandResult>, drawO
} }
} }
if (localOptions.drawLabels && h.annotations) { if (localOptions.drawLabels && h.annotations) {
const addHandLabel = (part, title) => { const addHandLabel = (part: Array<Point>, title: string) => {
if (!part || part.length === 0 || !part[0]) return; if (!part || part.length === 0 || !part[0]) return;
ctx.fillStyle = localOptions.useDepth ? `rgba(${127.5 + (2 * part[part.length - 1][2])}, ${127.5 - (2 * part[part.length - 1][2])}, 255, 0.5)` : localOptions.color; const z = part[part.length - 1][2] || 0;
ctx.fillStyle = localOptions.useDepth ? `rgba(${127.5 + (2 * z)}, ${127.5 - (2 * z)}, 255, 0.5)` : localOptions.color;
ctx.fillText(title, part[part.length - 1][0] + 4, part[part.length - 1][1] + 4); ctx.fillText(title, part[part.length - 1][0] + 4, part[part.length - 1][1] + 4);
}; };
ctx.font = localOptions.font; ctx.font = localOptions.font;
@ -420,11 +422,12 @@ export async function hand(inCanvas: AnyCanvas, result: Array<HandResult>, drawO
addHandLabel(h.annotations['palm'], 'palm'); addHandLabel(h.annotations['palm'], 'palm');
} }
if (localOptions.drawPolygons && h.annotations) { if (localOptions.drawPolygons && h.annotations) {
const addHandLine = (part) => { const addHandLine = (part: Array<Point>) => {
if (!part || part.length === 0 || !part[0]) return; if (!part || part.length === 0 || !part[0]) return;
for (let i = 0; i < part.length; i++) { for (let i = 0; i < part.length; i++) {
ctx.beginPath(); ctx.beginPath();
ctx.strokeStyle = localOptions.useDepth ? `rgba(${127.5 + (i * part[i][2])}, ${127.5 - (i * part[i][2])}, 255, 0.5)` : localOptions.color; const z = part[i][2] || 0;
ctx.strokeStyle = localOptions.useDepth ? `rgba(${127.5 + (i * z)}, ${127.5 - (i * z)}, 255, 0.5)` : localOptions.color;
ctx.moveTo(part[i > 0 ? i - 1 : 0][0], part[i > 0 ? i - 1 : 0][1]); ctx.moveTo(part[i > 0 ? i - 1 : 0][0], part[i > 0 ? i - 1 : 0][1]);
ctx.lineTo(part[i][0], part[i][1]); ctx.lineTo(part[i][0], part[i][1]);
ctx.stroke(); ctx.stroke();
@ -497,7 +500,7 @@ export async function person(inCanvas: AnyCanvas, result: Array<PersonResult>, d
} }
/** draw processed canvas */ /** draw processed canvas */
export async function canvas(input: AnyCanvas | HTMLImageElement | HTMLMediaElement | HTMLVideoElement, output: AnyCanvas) { export async function canvas(input: AnyCanvas | HTMLImageElement | HTMLVideoElement, output: AnyCanvas) {
if (!input || !output) return; if (!input || !output) return;
const ctx = getCanvasContext(output); const ctx = getCanvasContext(output);
if (!ctx) return; if (!ctx) return;

View File

@ -133,11 +133,12 @@ export class Env {
this.webgl.renderer = gl.getParameter(gl.RENDERER); this.webgl.renderer = gl.getParameter(gl.RENDERER);
} }
} }
// @ts-ignore navigator.gpu is only defined when webgpu is available in browser
this.webgpu.supported = this.browser && typeof navigator['gpu'] !== 'undefined'; this.webgpu.supported = this.browser && typeof navigator['gpu'] !== 'undefined';
this.webgpu.backend = this.backends.includes('webgpu'); this.webgpu.backend = this.backends.includes('webgpu');
try { try {
// @ts-ignore navigator.gpu is only defined when webgpu is available in browser
if (this.webgpu.supported) this.webgpu.adapter = (await navigator['gpu'].requestAdapter()).name; if (this.webgpu.supported) this.webgpu.adapter = (await navigator['gpu'].requestAdapter()).name;
// enumerate kernels
} catch { } catch {
this.webgpu.supported = false; this.webgpu.supported = false;
} }

View File

@ -100,8 +100,8 @@ export function calc(newResult: Result, config: Config): Result {
for (const key of Object.keys(newResult.hand[i].annotations)) { // update annotations for (const key of Object.keys(newResult.hand[i].annotations)) { // update annotations
annotations[key] = newResult.hand[i].annotations[key] && newResult.hand[i].annotations[key][0] annotations[key] = newResult.hand[i].annotations[key] && newResult.hand[i].annotations[key][0]
? newResult.hand[i].annotations[key] ? newResult.hand[i].annotations[key]
.map((val, j) => val .map((val, j: number) => val
.map((coord, k) => ((bufferedFactor - 1) * bufferedResult.hand[i].annotations[key][j][k] + coord) / bufferedFactor)) .map((coord: number, k: number) => ((bufferedFactor - 1) * bufferedResult.hand[i].annotations[key][j][k] + coord) / bufferedFactor))
: null; : null;
} }
} }

View File

@ -1,3 +1,5 @@
import type { Config } from '../exports';
/** /**
* Simple helper functions used accross codebase * Simple helper functions used accross codebase
*/ */
@ -26,7 +28,7 @@ export const now = () => {
}; };
// helper function: checks current config validity // helper function: checks current config validity
export function validate(defaults, config, parent = 'config', msgs: Array<{ reason: string, where: string, expected?: string }> = []) { export function validate(defaults: Partial<Config>, config: Partial<Config>, parent = 'config', msgs: Array<{ reason: string, where: string, expected?: string }> = []) {
for (const key of Object.keys(config)) { for (const key of Object.keys(config)) {
if (typeof config[key] === 'object') { if (typeof config[key] === 'object') {
validate(defaults[key], config[key], key, msgs); validate(defaults[key], config[key], key, msgs);

View File

@ -30,7 +30,7 @@ async function warmupBitmap(instance: Human) {
return res; return res;
} }
async function warmupCanvas(instance: Human) { async function warmupCanvas(instance: Human): Promise<Result | undefined> {
return new Promise((resolve) => { return new Promise((resolve) => {
let src; let src;
// let size = 0; // let size = 0;
@ -57,7 +57,7 @@ async function warmupCanvas(instance: Human) {
const canvas = image.canvas(img.naturalWidth, img.naturalHeight); const canvas = image.canvas(img.naturalWidth, img.naturalHeight);
if (!canvas) { if (!canvas) {
log('Warmup: Canvas not found'); log('Warmup: Canvas not found');
resolve({}); resolve(undefined);
} else { } else {
const ctx = canvas.getContext('2d'); const ctx = canvas.getContext('2d');
if (ctx) ctx.drawImage(img, 0, 0); if (ctx) ctx.drawImage(img, 0, 0);
@ -68,18 +68,18 @@ async function warmupCanvas(instance: Human) {
} }
}; };
if (src) img.src = src; if (src) img.src = src;
else resolve(null); else resolve(undefined);
}); });
} }
async function warmupNode(instance: Human) { async function warmupNode(instance: Human): Promise<Result | undefined> {
const atob = (str: string) => Buffer.from(str, 'base64'); const atob = (str: string) => Buffer.from(str, 'base64');
let img; let img;
if (instance.config.warmup === 'face') img = atob(sample.face); if (instance.config.warmup === 'face') img = atob(sample.face);
if (instance.config.warmup === 'body' || instance.config.warmup === 'full') img = atob(sample.body); else img = atob(sample.body);
if (!img) return null;
let res; let res;
if (typeof tf['node'] !== 'undefined') { if ('node' in tf) {
// @ts-ignore tf.node may be undefined
const data = tf['node'].decodeJpeg(img); const data = tf['node'].decodeJpeg(img);
const expanded = data.expandDims(0); const expanded = data.expandDims(0);
instance.tf.dispose(data); instance.tf.dispose(data);
@ -104,7 +104,7 @@ async function warmupNode(instance: Human) {
* - only used for `webgl` and `humangl` backends * - only used for `webgl` and `humangl` backends
* @param userConfig?: Config * @param userConfig?: Config
*/ */
export async function warmup(instance: Human, userConfig?: Partial<Config>): Promise<Result> { export async function warmup(instance: Human, userConfig?: Partial<Config>): Promise<Result | undefined> {
const t0 = now(); const t0 = now();
instance.state = 'warmup'; instance.state = 'warmup';
if (userConfig) instance.config = mergeDeep(instance.config, userConfig) as Config; if (userConfig) instance.config = mergeDeep(instance.config, userConfig) as Config;

View File

@ -1,24 +1,24 @@
2021-12-22 09:46:25 INFO:  Application: {"name":"@vladmandic/human","version":"2.5.6"} 2021-12-27 10:48:11 INFO:  Application: {"name":"@vladmandic/human","version":"2.5.7"}
2021-12-22 09:46:25 INFO:  Environment: {"profile":"production","config":".build.json","package":"package.json","tsconfig":true,"eslintrc":true,"git":true} 2021-12-27 10:48:11 INFO:  Environment: {"profile":"production","config":".build.json","package":"package.json","tsconfig":true,"eslintrc":true,"git":true}
2021-12-22 09:46:25 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:  Toolchain: {"build":"0.6.6","esbuild":"0.13.15","typescript":"4.5.4","typedoc":"0.22.10","eslint":"8.5.0"}
2021-12-22 09:46:25 INFO:  Build: {"profile":"production","steps":["clean","compile","typings","typedoc","lint","changelog"]} 2021-12-27 10:48:11 INFO:  Build: {"profile":"production","steps":["clean","compile","typings","typedoc","lint","changelog"]}
2021-12-22 09:46:25 STATE: Clean: {"locations":["dist/*","types/lib/*","typedoc/*"]} 2021-12-27 10:48:11 STATE: Clean: {"locations":["dist/*","types/lib/*","typedoc/*"]}
2021-12-22 09:46:25 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":"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-22 09:46:25 STATE: Compile: {"name":"human/nodejs/cpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node.js","files":63,"inputBytes":561428,"outputBytes":464503} 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-22 09:46:25 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":"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-22 09:46:25 STATE: Compile: {"name":"human/nodejs/gpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-gpu.js","files":63,"inputBytes":561436,"outputBytes":464507} 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-22 09:46:25 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":"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-22 09:46:25 STATE: Compile: {"name":"human/nodejs/wasm","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-wasm.js","files":63,"inputBytes":561503,"outputBytes":464579} 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-22 09:46:25 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/version","format":"esm","platform":"browser","input":"tfjs/tf-version.ts","output":"dist/tfjs.version.js","files":1,"inputBytes":1063,"outputBytes":1652}
2021-12-22 09:46:25 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":"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-22 09:46:25 STATE: Compile: {"name":"human/browser/esm/nobundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm-nobundle.js","files":63,"inputBytes":561065,"outputBytes":466277} 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-22 09:46:25 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: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-22 09:46:25 STATE: Compile: {"name":"human/browser/iife/bundle","format":"iife","platform":"browser","input":"src/human.ts","output":"dist/human.js","files":63,"inputBytes":3075772,"outputBytes":1631832} 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-22 09:46:25 STATE: Compile: {"name":"human/browser/esm/bundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm.js","files":63,"inputBytes":3075772,"outputBytes":2988730} 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-22 09:46:36 STATE: Typings: {"input":"src/human.ts","output":"types/lib","files":110} 2021-12-27 10:48:25 STATE: Typings: {"input":"src/human.ts","output":"types/lib","files":110}
2021-12-22 09:46:39 STATE: TypeDoc: {"input":"src/human.ts","output":"typedoc","objects":69,"generated":true} 2021-12-27 10:48:28 STATE: TypeDoc: {"input":"src/human.ts","output":"typedoc","objects":69,"generated":true}
2021-12-22 09:46:39 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/typescript","format":"esm","platform":"browser","input":"demo/typescript/index.ts","output":"demo/typescript/index.js","files":1,"inputBytes":5864,"outputBytes":4127}
2021-12-22 09:46:39 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: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-22 09:47:02 STATE: Lint: {"locations":["*.json","src/**/*.ts","test/**/*.js","demo/**/*.js"],"files":93,"errors":0,"warnings":0} 2021-12-27 10:49:01 STATE: Lint: {"locations":["*.json","src/**/*.ts","test/**/*.js","demo/**/*.js"],"files":93,"errors":0,"warnings":0}
2021-12-22 09:47:02 STATE: ChangeLog: {"repository":"https://github.com/vladmandic/human","branch":"main","output":"CHANGELOG.md"} 2021-12-27 10:49:01 STATE: ChangeLog: {"repository":"https://github.com/vladmandic/human","branch":"main","output":"CHANGELOG.md"}
2021-12-22 09:47:02 INFO:  Done... 2021-12-27 10:49:01 INFO:  Done...

View File

@ -150,11 +150,11 @@ async function verifyDetails(human) {
verify(res.face.length === 1, 'details face length', res.face.length); verify(res.face.length === 1, 'details face length', res.face.length);
for (const face of res.face) { for (const face of res.face) {
verify(face.score > 0.9 && face.boxScore > 0.9 && face.faceScore > 0.9, 'details face score', face.score, face.boxScore, face.faceScore); verify(face.score > 0.9 && face.boxScore > 0.9 && face.faceScore > 0.9, 'details face score', face.score, face.boxScore, face.faceScore);
verify(face.age > 23 && face.age < 24 && face.gender === 'female' && face.genderScore > 0.9 && face.iris > 70 && face.iris < 80, 'details face age/gender', face.age, face.gender, face.genderScore, face.iris); verify(face.age > 25 && face.age < 30 && face.gender === 'female' && face.genderScore > 0.9 && face.iris > 70 && face.iris < 80, 'details face age/gender', face.age, face.gender, face.genderScore, face.iris);
verify(face.box.length === 4 && face.boxRaw.length === 4 && face.mesh.length === 478 && face.meshRaw.length === 478 && face.embedding.length === 1024, 'details face arrays', face.box.length, face.mesh.length, face.embedding.length); verify(face.box.length === 4 && face.boxRaw.length === 4 && face.mesh.length === 478 && face.meshRaw.length === 478 && face.embedding.length === 1024, 'details face arrays', face.box.length, face.mesh.length, face.embedding.length);
verify(face.emotion.length === 3 && face.emotion[0].score > 0.45 && face.emotion[0].emotion === 'neutral', 'details face emotion', face.emotion.length, face.emotion[0]); verify(face.emotion.length === 3 && face.emotion[0].score > 0.30 && face.emotion[0].emotion === 'fear', 'details face emotion', face.emotion.length, face.emotion[0]);
verify(face.real > 0.8, 'details face anti-spoofing', face.real); verify(face.real > 0.75, 'details face anti-spoofing', face.real);
verify(face.live > 0.8, 'details face liveness', face.live); verify(face.live > 0.75, 'details face liveness', face.live);
} }
verify(res.body.length === 1, 'details body length', res.body.length); verify(res.body.length === 1, 'details body length', res.body.length);
for (const body of res.body) { for (const body of res.body) {
@ -365,7 +365,7 @@ async function test(Human, inputConfig) {
config.body = { minConfidence: 0.0001 }; config.body = { minConfidence: 0.0001 };
config.hand = { minConfidence: 0.0001 }; config.hand = { minConfidence: 0.0001 };
res = await testDetect(human, 'samples/in/ai-body.jpg', 'default'); res = await testDetect(human, 'samples/in/ai-body.jpg', 'default');
if (!res || res?.face?.length !== 1 || res?.body?.length !== 1 || res?.hand?.length !== 2 || res?.gesture?.length !== 8) log('error', 'failed: sensitive result mismatch', res?.face?.length, res?.body?.length, res?.hand?.length, res?.gesture?.length); if (!res || res?.face?.length !== 1 || res?.body?.length !== 1 || res?.hand?.length !== 2 || res?.gesture?.length < 8) log('error', 'failed: sensitive result mismatch', res?.face?.length, res?.body?.length, res?.hand?.length, res?.gesture?.length);
else log('state', 'passed: sensitive result match'); else log('state', 'passed: sensitive result match');
// test sensitive details face // test sensitive details face
@ -373,7 +373,7 @@ async function test(Human, inputConfig) {
if (!face || face?.box?.length !== 4 || face?.mesh?.length !== 478 || face?.embedding?.length !== 1024 || face?.rotation?.matrix?.length !== 9) { if (!face || face?.box?.length !== 4 || face?.mesh?.length !== 478 || face?.embedding?.length !== 1024 || face?.rotation?.matrix?.length !== 9) {
log('error', 'failed: sensitive face result mismatch', res?.face?.length, face?.box?.length, face?.mesh?.length, face?.embedding?.length, face?.rotation?.matrix?.length); log('error', 'failed: sensitive face result mismatch', res?.face?.length, face?.box?.length, face?.mesh?.length, face?.embedding?.length, face?.rotation?.matrix?.length);
} else log('state', 'passed: sensitive face result match'); } else log('state', 'passed: sensitive face result match');
if (!face || face?.emotion?.length < 1 || face.emotion[0].score < 0.55 || face.emotion[0].emotion !== 'neutral') log('error', 'failed: sensitive face emotion result mismatch', face?.emotion); if (!face || face?.emotion?.length < 1 || face.emotion[0].score < 0.30) log('error', 'failed: sensitive face emotion result mismatch', face?.emotion);
else log('state', 'passed: sensitive face emotion result', face?.emotion); else log('state', 'passed: sensitive face emotion result', face?.emotion);
// test sensitive details body // test sensitive details body

File diff suppressed because it is too large Load Diff

View File

@ -31,7 +31,7 @@
"noImplicitThis": true, "noImplicitThis": true,
"noPropertyAccessFromIndexSignature": false, "noPropertyAccessFromIndexSignature": false,
"noUncheckedIndexedAccess": false, "noUncheckedIndexedAccess": false,
"noUnusedLocals": false, "noUnusedLocals": true,
"noUnusedParameters": true, "noUnusedParameters": true,
"preserveConstEnums": true, "preserveConstEnums": true,
"pretty": true, "pretty": true,

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Env | @vladmandic/human - v2.5.6</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.6"/><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.6</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.6</a></li><li><a href="Env.html">Env</a></li></ul><h1>Class Env</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead"> <!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Env | @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="Env.html">Env</a></li></ul><h1>Class Env</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>Env class that holds detected capabilities</p> <p>Env class that holds detected capabilities</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">Env</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>Constructors</h3><ul class="tsd-index-list"><li class="tsd-kind-constructor tsd-parent-kind-class"><a href="Env.html#constructor" class="tsd-kind-icon">constructor</a></li></ul></section><section class="tsd-index-section "><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#Canvas" class="tsd-kind-icon">Canvas</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#Image" class="tsd-kind-icon">Image</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#ImageData" class="tsd-kind-icon">Image<wbr/>Data</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#agent" class="tsd-kind-icon">agent</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#backends" class="tsd-kind-icon">backends</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#browser" class="tsd-kind-icon">browser</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#cpu" class="tsd-kind-icon">cpu</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#filter" class="tsd-kind-icon">filter</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#initial" class="tsd-kind-icon">initial</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#kernels" class="tsd-kind-icon">kernels</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#node" class="tsd-kind-icon">node</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#offscreen" class="tsd-kind-icon">offscreen</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#perfadd" class="tsd-kind-icon">perfadd</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#platform" class="tsd-kind-icon">platform</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#tfjs" class="tsd-kind-icon">tfjs</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#wasm" class="tsd-kind-icon">wasm</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#webgl" class="tsd-kind-icon">webgl</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#webgpu" class="tsd-kind-icon">webgpu</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#worker" class="tsd-kind-icon">worker</a></li></ul></section><section class="tsd-index-section "><h3>Methods</h3><ul class="tsd-index-list"><li class="tsd-kind-method tsd-parent-kind-class"><a href="Env.html#updateBackend" class="tsd-kind-icon">update<wbr/>Backend</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Env.html#updateCPU" class="tsd-kind-icon">updateCPU</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Constructors</h2><section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class"><a id="constructor" class="tsd-anchor"></a><h3>constructor</h3><ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">new <wbr/>Env<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="Env.html" class="tsd-signature-type" data-tsd-kind="Class">Env</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L81">src/util/env.ts:81</a></li></ul></aside><h4 class="tsd-returns-title">Returns <a href="Env.html" class="tsd-signature-type" data-tsd-kind="Class">Env</a></h4></li></ul></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-class"><a id="Canvas" class="tsd-anchor"></a><h3>Canvas</h3><div class="tsd-signature tsd-kind-icon">Canvas<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">undefined</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L75">src/util/env.ts:75</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">Env</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>Constructors</h3><ul class="tsd-index-list"><li class="tsd-kind-constructor tsd-parent-kind-class"><a href="Env.html#constructor" class="tsd-kind-icon">constructor</a></li></ul></section><section class="tsd-index-section "><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#Canvas" class="tsd-kind-icon">Canvas</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#Image" class="tsd-kind-icon">Image</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#ImageData" class="tsd-kind-icon">Image<wbr/>Data</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#agent" class="tsd-kind-icon">agent</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#backends" class="tsd-kind-icon">backends</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#browser" class="tsd-kind-icon">browser</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#cpu" class="tsd-kind-icon">cpu</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#filter" class="tsd-kind-icon">filter</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#initial" class="tsd-kind-icon">initial</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#kernels" class="tsd-kind-icon">kernels</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#node" class="tsd-kind-icon">node</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#offscreen" class="tsd-kind-icon">offscreen</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#perfadd" class="tsd-kind-icon">perfadd</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#platform" class="tsd-kind-icon">platform</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#tfjs" class="tsd-kind-icon">tfjs</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#wasm" class="tsd-kind-icon">wasm</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#webgl" class="tsd-kind-icon">webgl</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#webgpu" class="tsd-kind-icon">webgpu</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#worker" class="tsd-kind-icon">worker</a></li></ul></section><section class="tsd-index-section "><h3>Methods</h3><ul class="tsd-index-list"><li class="tsd-kind-method tsd-parent-kind-class"><a href="Env.html#updateBackend" class="tsd-kind-icon">update<wbr/>Backend</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Env.html#updateCPU" class="tsd-kind-icon">updateCPU</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Constructors</h2><section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class"><a id="constructor" class="tsd-anchor"></a><h3>constructor</h3><ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">new <wbr/>Env<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="Env.html" class="tsd-signature-type" data-tsd-kind="Class">Env</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L81">src/util/env.ts:81</a></li></ul></aside><h4 class="tsd-returns-title">Returns <a href="Env.html" class="tsd-signature-type" data-tsd-kind="Class">Env</a></h4></li></ul></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-class"><a id="Canvas" class="tsd-anchor"></a><h3>Canvas</h3><div class="tsd-signature tsd-kind-icon">Canvas<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">undefined</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L75">src/util/env.ts:75</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>MonkeyPatch for Canvas</p> <p>MonkeyPatch for Canvas</p>
@ -40,6 +40,6 @@
<p>Running in WebWorker thread</p> <p>Running in WebWorker thread</p>
</div></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Methods</h2><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="updateBackend" class="tsd-anchor"></a><h3>update<wbr/>Backend</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">update<wbr/>Backend<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L114">src/util/env.ts:114</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead"> </div></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Methods</h2><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="updateBackend" class="tsd-anchor"></a><h3>update<wbr/>Backend</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">update<wbr/>Backend<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L114">src/util/env.ts:114</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>update backend information</p> <p>update backend information</p>
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="updateCPU" class="tsd-anchor"></a><h3>updateCPU</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">updateCPU<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L150">src/util/env.ts:150</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead"> </div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="updateCPU" class="tsd-anchor"></a><h3>updateCPU</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">updateCPU<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L151">src/util/env.ts:151</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>update cpu information</p> <p>update cpu information</p>
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4></li></ul></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-class"><a href="Env.html" class="tsd-kind-icon">Env</a><ul><li class="tsd-kind-constructor tsd-parent-kind-class"><a href="Env.html#constructor" class="tsd-kind-icon">constructor</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#Canvas" class="tsd-kind-icon">Canvas</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#Image" class="tsd-kind-icon">Image</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#ImageData" class="tsd-kind-icon">Image<wbr/>Data</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#agent" class="tsd-kind-icon">agent</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#backends" class="tsd-kind-icon">backends</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#browser" class="tsd-kind-icon">browser</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#cpu" class="tsd-kind-icon">cpu</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#filter" class="tsd-kind-icon">filter</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#initial" class="tsd-kind-icon">initial</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#kernels" class="tsd-kind-icon">kernels</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#node" class="tsd-kind-icon">node</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#offscreen" class="tsd-kind-icon">offscreen</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#perfadd" class="tsd-kind-icon">perfadd</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#platform" class="tsd-kind-icon">platform</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#tfjs" class="tsd-kind-icon">tfjs</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#wasm" class="tsd-kind-icon">wasm</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#webgl" class="tsd-kind-icon">webgl</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#webgpu" class="tsd-kind-icon">webgpu</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#worker" class="tsd-kind-icon">worker</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Env.html#updateBackend" class="tsd-kind-icon">update<wbr/>Backend</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Env.html#updateCPU" class="tsd-kind-icon">updateCPU</a></li></ul></li></ul></nav></div></div></div><footer class=""><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li><li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="overlay"></div><script src="../assets/main.js"></script></body></html> </div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4></li></ul></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-class"><a href="Env.html" class="tsd-kind-icon">Env</a><ul><li class="tsd-kind-constructor tsd-parent-kind-class"><a href="Env.html#constructor" class="tsd-kind-icon">constructor</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#Canvas" class="tsd-kind-icon">Canvas</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#Image" class="tsd-kind-icon">Image</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#ImageData" class="tsd-kind-icon">Image<wbr/>Data</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#agent" class="tsd-kind-icon">agent</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#backends" class="tsd-kind-icon">backends</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#browser" class="tsd-kind-icon">browser</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#cpu" class="tsd-kind-icon">cpu</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#filter" class="tsd-kind-icon">filter</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#initial" class="tsd-kind-icon">initial</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#kernels" class="tsd-kind-icon">kernels</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#node" class="tsd-kind-icon">node</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#offscreen" class="tsd-kind-icon">offscreen</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#perfadd" class="tsd-kind-icon">perfadd</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#platform" class="tsd-kind-icon">platform</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#tfjs" class="tsd-kind-icon">tfjs</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#wasm" class="tsd-kind-icon">wasm</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#webgl" class="tsd-kind-icon">webgl</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#webgpu" class="tsd-kind-icon">webgpu</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Env.html#worker" class="tsd-kind-icon">worker</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Env.html#updateBackend" class="tsd-kind-icon">update<wbr/>Backend</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Env.html#updateCPU" class="tsd-kind-icon">updateCPU</a></li></ul></li></ul></nav></div></div></div><footer class=""><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li><li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="overlay"></div><script src="../assets/main.js"></script></body></html>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>GraphModel | @vladmandic/human - v2.5.6</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.6"/><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.6</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.6</a></li><li><a href="GraphModel.html">GraphModel</a></li></ul><h1>Class GraphModel</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead"> <!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>GraphModel | @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="GraphModel.html">GraphModel</a></li></ul><h1>Class GraphModel</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
<p>A <code>tf.GraphModel</code> is a directed, acyclic graph built from a <p>A <code>tf.GraphModel</code> is a directed, acyclic graph built from a
SavedModel GraphDef and allows inference execution.</p> SavedModel GraphDef and allows inference execution.</p>
</div><div><p>A <code>tf.GraphModel</code> can only be created by loading from a model converted from </div><div><p>A <code>tf.GraphModel</code> can only be created by loading from a model converted from

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Models | @vladmandic/human - v2.5.6</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.6"/><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.6</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.6</a></li><li><a href="Models.html">Models</a></li></ul><h1>Class Models</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead"> <!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Models | @vladmandic/human - v2.5.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="Models.html">Models</a></li></ul><h1>Class Models</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
<p>Instances of all possible TFJS Graph Models used by Human</p> <p>Instances of all possible TFJS Graph Models used by Human</p>
<ul> <ul>
<li>loaded as needed based on configuration</li> <li>loaded as needed based on configuration</li>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Tensor | @vladmandic/human - v2.5.6</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.6"/><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.6</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.6</a></li><li><a href="Tensor.html">Tensor</a></li></ul><h1>Class Tensor&lt;R&gt;</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead"> <!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Tensor | @vladmandic/human - v2.5.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="Tensor.html">Tensor</a></li></ul><h1>Class Tensor&lt;R&gt;</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
<p>A <code>tf.Tensor</code> object represents an immutable, multidimensional array of <p>A <code>tf.Tensor</code> object represents an immutable, multidimensional array of
numbers that has a shape and a data type.</p> numbers that has a shape and a data type.</p>
</div><div><p>For performance reasons, functions that create tensors do not necessarily </div><div><p>For performance reasons, functions that create tensors do not necessarily

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,10 +1,10 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>BodyConfig | @vladmandic/human - v2.5.6</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.6"/><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.6</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.6</a></li><li><a href="BodyConfig.html">BodyConfig</a></li></ul><h1>Interface BodyConfig</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead"> <!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>BodyConfig | @vladmandic/human - v2.5.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="BodyConfig.html">BodyConfig</a></li></ul><h1>Interface BodyConfig</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
<p>Configures all body detection specific options</p> <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"> </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> <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#L78">src/config.ts:78</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead"> </div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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> <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#L80">src/config.ts:80</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead"> </div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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">
<p>minimum confidence for a detected body before results are discarded</p> <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"> </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> <p>path to model json file</p>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>BodyKeypoint | @vladmandic/human - v2.5.6</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.6"/><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.6</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.6</a></li><li><a href="BodyKeypoint.html">BodyKeypoint</a></li></ul><h1>Interface BodyKeypoint</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead"> <!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>BodyKeypoint | @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="BodyKeypoint.html">BodyKeypoint</a></li></ul><h1>Interface BodyKeypoint</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
<p>Body Result keypoints</p> <p>Body Result keypoints</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">BodyKeypoint</span></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyKeypoint.html#part" class="tsd-kind-icon">part</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyKeypoint.html#position" class="tsd-kind-icon">position</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyKeypoint.html#positionRaw" class="tsd-kind-icon">position<wbr/>Raw</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyKeypoint.html#score" class="tsd-kind-icon">score</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="part" class="tsd-anchor"></a><h3>part</h3><div class="tsd-signature tsd-kind-icon">part<span class="tsd-signature-symbol">:</span> <a href="../index.html#BodyLandmark" class="tsd-signature-type" data-tsd-kind="Type alias">BodyLandmark</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L88">src/result.ts:88</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead"> </div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">BodyKeypoint</span></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyKeypoint.html#part" class="tsd-kind-icon">part</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyKeypoint.html#position" class="tsd-kind-icon">position</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyKeypoint.html#positionRaw" class="tsd-kind-icon">position<wbr/>Raw</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyKeypoint.html#score" class="tsd-kind-icon">score</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="part" class="tsd-anchor"></a><h3>part</h3><div class="tsd-signature tsd-kind-icon">part<span class="tsd-signature-symbol">:</span> <a href="../index.html#BodyLandmark" class="tsd-signature-type" data-tsd-kind="Type alias">BodyLandmark</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L88">src/result.ts:88</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>body part name</p> <p>body part name</p>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>BodyResult | @vladmandic/human - v2.5.6</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.6"/><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.6</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.6</a></li><li><a href="BodyResult.html">BodyResult</a></li></ul><h1>Interface BodyResult</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead"> <!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>BodyResult | @vladmandic/human - v2.5.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="BodyResult.html">BodyResult</a></li></ul><h1>Interface BodyResult</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
<p>Body results</p> <p>Body results</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">BodyResult</span></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyResult.html#annotations" class="tsd-kind-icon">annotations</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyResult.html#box" class="tsd-kind-icon">box</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyResult.html#boxRaw" class="tsd-kind-icon">box<wbr/>Raw</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyResult.html#id" class="tsd-kind-icon">id</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyResult.html#keypoints" class="tsd-kind-icon">keypoints</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyResult.html#score" class="tsd-kind-icon">score</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="annotations" class="tsd-anchor"></a><h3>annotations</h3><div class="tsd-signature tsd-kind-icon">annotations<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol">&lt;</span><a href="../index.html#BodyAnnotation" class="tsd-signature-type" data-tsd-kind="Type alias">BodyAnnotation</a><span class="tsd-signature-symbol">, </span><a href="../index.html#Point" class="tsd-signature-type" data-tsd-kind="Type alias">Point</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L110">src/result.ts:110</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead"> </div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">BodyResult</span></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyResult.html#annotations" class="tsd-kind-icon">annotations</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyResult.html#box" class="tsd-kind-icon">box</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyResult.html#boxRaw" class="tsd-kind-icon">box<wbr/>Raw</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyResult.html#id" class="tsd-kind-icon">id</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyResult.html#keypoints" class="tsd-kind-icon">keypoints</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="BodyResult.html#score" class="tsd-kind-icon">score</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="annotations" class="tsd-anchor"></a><h3>annotations</h3><div class="tsd-signature tsd-kind-icon">annotations<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol">&lt;</span><a href="../index.html#BodyAnnotation" class="tsd-signature-type" data-tsd-kind="Type alias">BodyAnnotation</a><span class="tsd-signature-symbol">, </span><a href="../index.html#Point" class="tsd-signature-type" data-tsd-kind="Type alias">Point</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L110">src/result.ts:110</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>detected body keypoints combined into annotated parts</p> <p>detected body keypoints combined into annotated parts</p>

View File

@ -1,11 +1,11 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Config | @vladmandic/human - v2.5.6</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.6"/><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.6</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.6</a></li><li><a href="Config.html">Config</a></li></ul><h1>Interface Config</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead"> <!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Config | @vladmandic/human - v2.5.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="Config.html">Config</a></li></ul><h1>Interface Config</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
<p>Configuration interface definition for <strong>Human</strong> library <p>Configuration interface definition for <strong>Human</strong> library
Contains all configurable parameters Contains all configurable parameters
Defaults: <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L262">config</a></p> 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#L235">src/config.ts:235</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead"> </div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">Config</span></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#async" class="tsd-kind-icon">async</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#backend" class="tsd-kind-icon">backend</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#body" class="tsd-kind-icon">body</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#cacheSensitivity" class="tsd-kind-icon">cache<wbr/>Sensitivity</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#deallocate" class="tsd-kind-icon">deallocate</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#debug" class="tsd-kind-icon">debug</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#face" class="tsd-kind-icon">face</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#filter" class="tsd-kind-icon">filter</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#gesture" class="tsd-kind-icon">gesture</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#hand" class="tsd-kind-icon">hand</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#modelBasePath" class="tsd-kind-icon">model<wbr/>Base<wbr/>Path</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#object" class="tsd-kind-icon">object</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#segmentation" class="tsd-kind-icon">segmentation</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#skipAllowed" class="tsd-kind-icon">skip<wbr/>Allowed</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#warmup" class="tsd-kind-icon">warmup</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#wasmPath" class="tsd-kind-icon">wasm<wbr/>Path</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="async" class="tsd-anchor"></a><h3>async</h3><div class="tsd-signature tsd-kind-icon">async<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L229">src/config.ts:229</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Perform model loading and inference concurrently or sequentially</p> <p>Perform model loading and inference concurrently or sequentially</p>
</div><div><p>default: <code>true</code></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#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="backend" class="tsd-anchor"></a><h3>backend</h3><div class="tsd-signature tsd-kind-icon">backend<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">&quot;&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;cpu&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;wasm&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;webgl&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;humangl&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;tensorflow&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;webgpu&quot;</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L211">src/config.ts:211</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Backend used for TFJS operations <p>Backend used for TFJS operations
valid build-in backends are:</p> valid build-in backends are:</p>
<ul> <ul>
@ -13,48 +13,48 @@ valid build-in backends are:</p>
<li>NodeJS: <code>cpu</code>, <code>wasm</code>, <code>tensorflow</code> <li>NodeJS: <code>cpu</code>, <code>wasm</code>, <code>tensorflow</code>
default: <code>humangl</code> for browser and <code>tensorflow</code> for nodejs</li> default: <code>humangl</code> for browser and <code>tensorflow</code> for nodejs</li>
</ul> </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#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="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">
<p>Body config <a href="BodyConfig.html">BodyConfig</a></p> <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#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="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">
<p>Cache sensitivity</p> <p>Cache sensitivity</p>
<ul> <ul>
<li>values 0..1 where 0.01 means reset cache if input changed more than 1%</li> <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> <li>set to 0 to disable caching</li>
</ul> </ul>
</div><div><p>default: 0.7</p> </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#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="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">
<p>Perform immediate garbage collection on deallocated tensors instead of caching them</p> <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#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-member tsd-kind-property tsd-parent-kind-interface"><a id="debug" class="tsd-anchor"></a><h3>debug</h3><div class="tsd-signature tsd-kind-icon">debug<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L223">src/config.ts:223</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Print debug statements to console</p> <p>Print debug statements to console</p>
</div><div><p>default: <code>true</code></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#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="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">
<p>Face config <a href="FaceConfig.html">FaceConfig</a></p> <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#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="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">
<p>Filter config <a href="FilterConfig.html">FilterConfig</a></p> <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#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="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">
<p>Gesture config <a href="GestureConfig.html">GestureConfig</a></p> <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#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="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">
<p>Hand config <a href="HandConfig.html">HandConfig</a></p> <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#L250">src/config.ts:250</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead"> </div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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">
<p>Base model path (typically starting with file://, http:// or https://) for all models</p> <p>Base model path (typically starting with file://, http:// or https://) for all models</p>
<ul> <ul>
<li>individual modelPath values are relative to this path</li> <li>individual modelPath values are relative to this path</li>
</ul> </ul>
</div><div><p>default: <code>../models/</code> for browsers and <code>file://models/</code> for nodejs</p> </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#L282">src/config.ts:282</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#L276">src/config.ts:276</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Object config <a href="ObjectConfig.html">ObjectConfig</a></p> <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#L285">src/config.ts:285</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#L279">src/config.ts:279</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Segmentation config <a href="SegmentationConfig.html">SegmentationConfig</a></p> <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#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="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">
<p>Internal Variable</p> <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#L243">src/config.ts:243</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead"> </div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="warmup" class="tsd-anchor"></a><h3>warmup</h3><div class="tsd-signature tsd-kind-icon">warmup<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">&quot;&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;face&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;body&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;none&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;full&quot;</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L237">src/config.ts:237</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>What to use for <code>human.warmup()</code></p> <p>What to use for <code>human.warmup()</code></p>
<ul> <ul>
<li>warmup pre-initializes all models for faster inference but can take significant time on startup</li> <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> <li>used by <code>webgl</code>, <code>humangl</code> and <code>webgpu</code> backends</li>
</ul> </ul>
</div><div><p>default: <code>full</code></p> </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#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="wasmPath" class="tsd-anchor"></a><h3>wasm<wbr/>Path</h3><div class="tsd-signature tsd-kind-icon">wasm<wbr/>Path<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L217">src/config.ts:217</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Path to *.wasm files if backend is set to <code>wasm</code></p> <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><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> </div></div></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../index.html">Exports</a></li><li class=" tsd-kind-namespace"><a href="../modules/Tensor.html">Tensor</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-interface"><a href="Config.html" class="tsd-kind-icon">Config</a><ul><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#async" class="tsd-kind-icon">async</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#backend" class="tsd-kind-icon">backend</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#body" class="tsd-kind-icon">body</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#cacheSensitivity" class="tsd-kind-icon">cache<wbr/>Sensitivity</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#deallocate" class="tsd-kind-icon">deallocate</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#debug" class="tsd-kind-icon">debug</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#face" class="tsd-kind-icon">face</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#filter" class="tsd-kind-icon">filter</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#gesture" class="tsd-kind-icon">gesture</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#hand" class="tsd-kind-icon">hand</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#modelBasePath" class="tsd-kind-icon">model<wbr/>Base<wbr/>Path</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#object" class="tsd-kind-icon">object</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#segmentation" class="tsd-kind-icon">segmentation</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#skipAllowed" class="tsd-kind-icon">skip<wbr/>Allowed</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#warmup" class="tsd-kind-icon">warmup</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#wasmPath" class="tsd-kind-icon">wasm<wbr/>Path</a></li></ul></li></ul></nav></div></div></div><footer class=""><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li><li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="overlay"></div><script src="../assets/main.js"></script></body></html>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FaceAntiSpoofConfig | @vladmandic/human - v2.5.6</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.6"/><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.6</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.6</a></li><li><a href="FaceAntiSpoofConfig.html">FaceAntiSpoofConfig</a></li></ul><h1>Interface FaceAntiSpoofConfig</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead"> <!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FaceAntiSpoofConfig | @vladmandic/human - v2.5.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="FaceAntiSpoofConfig.html">FaceAntiSpoofConfig</a></li></ul><h1>Interface FaceAntiSpoofConfig</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
<p>Anti-spoofing part of face configuration</p> <p>Anti-spoofing part of face configuration</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><a href="GenericConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">GenericConfig</a><ul class="tsd-hierarchy"><li><span class="target">FaceAntiSpoofConfig</span></li></ul></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section tsd-is-inherited"><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceAntiSpoofConfig.html#enabled" class="tsd-kind-icon">enabled</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceAntiSpoofConfig.html#modelPath" class="tsd-kind-icon">model<wbr/>Path</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceAntiSpoofConfig.html#skipFrames" class="tsd-kind-icon">skip<wbr/>Frames</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceAntiSpoofConfig.html#skipTime" class="tsd-kind-icon">skip<wbr/>Time</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group tsd-is-inherited"><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="enabled" class="tsd-anchor"></a><h3>enabled</h3><div class="tsd-signature tsd-kind-icon">enabled<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#enabled">enabled</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L7">src/config.ts:7</a></li></ul></aside><div class="tsd-comment tsd-typography"><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">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> <p>is module enabled?</p>

File diff suppressed because one or more lines are too long

View File

@ -1,11 +1,11 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FaceDescriptionConfig | @vladmandic/human - v2.5.6</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.6"/><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.6</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.6</a></li><li><a href="FaceDescriptionConfig.html">FaceDescriptionConfig</a></li></ul><h1>Interface FaceDescriptionConfig</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead"> <!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FaceDescriptionConfig | @vladmandic/human - v2.5.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="FaceDescriptionConfig.html">FaceDescriptionConfig</a></li></ul><h1>Interface FaceDescriptionConfig</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
<p>Description or face embedding part of face configuration</p> <p>Description or face embedding part of face configuration</p>
<ul> <ul>
<li>also used by age and gender detection</li> <li>also used by age and gender detection</li>
</ul> </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"> </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> <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#L43">src/config.ts:43</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> <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"> </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> <p>path to model json file</p>

View File

@ -1,17 +1,10 @@
<!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.6</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.6"/><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.6</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.6</a></li><li><a href="FaceDetectorConfig.html">FaceDetectorConfig</a></li></ul><h1>Interface FaceDetectorConfig</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead"> <!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FaceDetectorConfig | @vladmandic/human - v2.5.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>Dectector part of face configuration</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><a href="GenericConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">GenericConfig</a><ul class="tsd-hierarchy"><li><span class="target">FaceDetectorConfig</span></li></ul></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceDetectorConfig.html#cropFactor" class="tsd-kind-icon">crop<wbr/>Factor</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceDetectorConfig.html#enabled" class="tsd-kind-icon">enabled</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceDetectorConfig.html#iouThreshold" class="tsd-kind-icon">iou<wbr/>Threshold</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceDetectorConfig.html#mask" class="tsd-kind-icon">mask</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceDetectorConfig.html#maxDetected" class="tsd-kind-icon">max<wbr/>Detected</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceDetectorConfig.html#minConfidence" class="tsd-kind-icon">min<wbr/>Confidence</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceDetectorConfig.html#modelPath" class="tsd-kind-icon">model<wbr/>Path</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceDetectorConfig.html#return" class="tsd-kind-icon">return</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceDetectorConfig.html#rotation" class="tsd-kind-icon">rotation</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceDetectorConfig.html#skipFrames" class="tsd-kind-icon">skip<wbr/>Frames</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceDetectorConfig.html#skipTime" class="tsd-kind-icon">skip<wbr/>Time</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="cropFactor" class="tsd-anchor"></a><h3>crop<wbr/>Factor</h3><div class="tsd-signature tsd-kind-icon">crop<wbr/>Factor<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L31">src/config.ts:31</a></li></ul></aside><div class="tsd-comment tsd-typography"><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">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>factor used to expand detected face before further analysis</p>
<ul>
<li>default: 1.6</li>
<li>for high-quality inputs can be reduced to increase precision</li>
<li>for video inputs or low-quality inputs can be increased to allow for more flexible tracking</li>
</ul>
</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> <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#L25">src/config.ts:25</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> <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#L33">src/config.ts:33</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead"> </div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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">
<p>should child models perform on masked image of a face</p> <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#L21">src/config.ts:21</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>maximum number of detected faces</p> <p>maximum number of detected faces</p>
@ -19,7 +12,7 @@
<p>minimum confidence for a detected face before results are discarded</p> <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"> </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> <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#L35">src/config.ts:35</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead"> </div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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> <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"> </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> <p>is face rotation correction performed after detecting face?</p>
@ -27,4 +20,4 @@
<p>how many max frames to go without re-running model if cached results are acceptable</p> <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"> </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>how many max miliseconds to go without re-running model if cached results are acceptable</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"><a href="FaceDetectorConfig.html#cropFactor" class="tsd-kind-icon">crop<wbr/>Factor</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceDetectorConfig.html#enabled" class="tsd-kind-icon">enabled</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceDetectorConfig.html#iouThreshold" class="tsd-kind-icon">iou<wbr/>Threshold</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceDetectorConfig.html#mask" class="tsd-kind-icon">mask</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceDetectorConfig.html#maxDetected" class="tsd-kind-icon">max<wbr/>Detected</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceDetectorConfig.html#minConfidence" class="tsd-kind-icon">min<wbr/>Confidence</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceDetectorConfig.html#modelPath" class="tsd-kind-icon">model<wbr/>Path</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceDetectorConfig.html#return" class="tsd-kind-icon">return</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="FaceDetectorConfig.html#rotation" class="tsd-kind-icon">rotation</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceDetectorConfig.html#skipFrames" class="tsd-kind-icon">skip<wbr/>Frames</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceDetectorConfig.html#skipTime" class="tsd-kind-icon">skip<wbr/>Time</a></li></ul></li></ul></nav></div></div></div><footer class=""><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li><li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="overlay"></div><script src="../assets/main.js"></script></body></html> </div></div></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../index.html">Exports</a></li><li class=" tsd-kind-namespace"><a href="../modules/Tensor.html">Tensor</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-interface"><a href="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

@ -1,8 +1,8 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FaceEmotionConfig | @vladmandic/human - v2.5.6</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.6"/><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.6</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.6</a></li><li><a href="FaceEmotionConfig.html">FaceEmotionConfig</a></li></ul><h1>Interface FaceEmotionConfig</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead"> <!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FaceEmotionConfig | @vladmandic/human - v2.5.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="FaceEmotionConfig.html">FaceEmotionConfig</a></li></ul><h1>Interface FaceEmotionConfig</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
<p>Emotion part of face configuration</p> <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"> </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> <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#L55">src/config.ts:55</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead"> </div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="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">
<p>minimum confidence for a detected face before results are discarded</p> <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"> </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> <p>path to model json file</p>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FaceIrisConfig | @vladmandic/human - v2.5.6</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.6"/><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.6</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.6</a></li><li><a href="FaceIrisConfig.html">FaceIrisConfig</a></li></ul><h1>Interface FaceIrisConfig</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead"> <!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FaceIrisConfig | @vladmandic/human - v2.5.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="FaceIrisConfig.html">FaceIrisConfig</a></li></ul><h1>Interface FaceIrisConfig</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
<p>Iris part of face configuration</p> <p>Iris part of face configuration</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><a href="GenericConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">GenericConfig</a><ul class="tsd-hierarchy"><li><span class="target">FaceIrisConfig</span></li></ul></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section tsd-is-inherited"><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceIrisConfig.html#enabled" class="tsd-kind-icon">enabled</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceIrisConfig.html#modelPath" class="tsd-kind-icon">model<wbr/>Path</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceIrisConfig.html#skipFrames" class="tsd-kind-icon">skip<wbr/>Frames</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceIrisConfig.html#skipTime" class="tsd-kind-icon">skip<wbr/>Time</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group tsd-is-inherited"><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="enabled" class="tsd-anchor"></a><h3>enabled</h3><div class="tsd-signature tsd-kind-icon">enabled<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#enabled">enabled</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L7">src/config.ts:7</a></li></ul></aside><div class="tsd-comment tsd-typography"><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">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> <p>is module enabled?</p>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FaceLivenessConfig | @vladmandic/human - v2.5.6</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.6"/><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.6</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.6</a></li><li><a href="FaceLivenessConfig.html">FaceLivenessConfig</a></li></ul><h1>Interface FaceLivenessConfig</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead"> <!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FaceLivenessConfig | @vladmandic/human - v2.5.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="FaceLivenessConfig.html">FaceLivenessConfig</a></li></ul><h1>Interface FaceLivenessConfig</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
<p>Liveness part of face configuration</p> <p>Liveness part of face configuration</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><a href="GenericConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">GenericConfig</a><ul class="tsd-hierarchy"><li><span class="target">FaceLivenessConfig</span></li></ul></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section tsd-is-inherited"><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceLivenessConfig.html#enabled" class="tsd-kind-icon">enabled</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceLivenessConfig.html#modelPath" class="tsd-kind-icon">model<wbr/>Path</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceLivenessConfig.html#skipFrames" class="tsd-kind-icon">skip<wbr/>Frames</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceLivenessConfig.html#skipTime" class="tsd-kind-icon">skip<wbr/>Time</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group tsd-is-inherited"><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="enabled" class="tsd-anchor"></a><h3>enabled</h3><div class="tsd-signature tsd-kind-icon">enabled<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#enabled">enabled</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L7">src/config.ts:7</a></li></ul></aside><div class="tsd-comment tsd-typography"><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">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> <p>is module enabled?</p>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FaceMeshConfig | @vladmandic/human - v2.5.6</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.6"/><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.6</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.6</a></li><li><a href="FaceMeshConfig.html">FaceMeshConfig</a></li></ul><h1>Interface FaceMeshConfig</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead"> <!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FaceMeshConfig | @vladmandic/human - v2.5.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="FaceMeshConfig.html">FaceMeshConfig</a></li></ul><h1>Interface FaceMeshConfig</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
<p>Mesh part of face configuration</p> <p>Mesh part of face configuration</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><a href="GenericConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">GenericConfig</a><ul class="tsd-hierarchy"><li><span class="target">FaceMeshConfig</span></li></ul></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section tsd-is-inherited"><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceMeshConfig.html#enabled" class="tsd-kind-icon">enabled</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceMeshConfig.html#modelPath" class="tsd-kind-icon">model<wbr/>Path</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceMeshConfig.html#skipFrames" class="tsd-kind-icon">skip<wbr/>Frames</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="FaceMeshConfig.html#skipTime" class="tsd-kind-icon">skip<wbr/>Time</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group tsd-is-inherited"><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="enabled" class="tsd-anchor"></a><h3>enabled</h3><div class="tsd-signature tsd-kind-icon">enabled<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><p>Inherited from <a href="GenericConfig.html">GenericConfig</a>.<a href="GenericConfig.html#enabled">enabled</a></p><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L7">src/config.ts:7</a></li></ul></aside><div class="tsd-comment tsd-typography"><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">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> <p>is module enabled?</p>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FaceResult | @vladmandic/human - v2.5.6</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.6"/><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.6</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.6</a></li><li><a href="FaceResult.html">FaceResult</a></li></ul><h1>Interface FaceResult</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead"> <!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FaceResult | @vladmandic/human - v2.5.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="FaceResult.html">FaceResult</a></li></ul><h1>Interface FaceResult</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
<p>Face results</p> <p>Face results</p>
<ul> <ul>
<li>Combined results of face detector, face mesh, age, gender, emotion, embedding, iris models</li> <li>Combined results of face detector, face mesh, age, gender, emotion, embedding, iris models</li>

View File

@ -1,54 +1,54 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FilterConfig | @vladmandic/human - v2.5.6</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.6"/><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.6</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.6</a></li><li><a href="FilterConfig.html">FilterConfig</a></li></ul><h1>Interface FilterConfig</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead"> <!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FilterConfig | @vladmandic/human - v2.5.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="FilterConfig.html">FilterConfig</a></li></ul><h1>Interface FilterConfig</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
<p>Run input through image filters before inference</p> <p>Run input through image filters before inference</p>
<ul> <ul>
<li>available only in Browser environments</li> <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> <li>image filters run with near-zero latency as they are executed on the GPU using WebGL</li>
</ul> </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#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-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">
<p>range: 0 (no blur) to N (blur radius in pixels)</p> <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#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-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">
<p>range: -1 (darken) to 1 (lighten)</p> <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#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="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">
<p>range: -1 (reduce contrast) to 1 (increase contrast)</p> <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#L145">src/config.ts:145</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#L139">src/config.ts:139</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>are image filters enabled?</p> <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#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="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">
<p>perform image histogram equalization</p> <p>perform image histogram equalization</p>
<ul> <ul>
<li>equalization is performed on input as a whole and detected face before its passed for further analysis</li> <li>equalization is performed on input as a whole and detected face before its passed for further analysis</li>
</ul> </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#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="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">
<p>flip input as mirror image</p> <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#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="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">
<p>resize input height</p> <p>resize input height</p>
<ul> <ul>
<li>if both width and height are set to 0, there is no resizing</li> <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 just one is set, second one is scaled automatically</li>
<li>if both are set, values are used as-is</li> <li>if both are set, values are used as-is</li>
</ul> </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#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="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">
<p>range: 0 (no change) to 360 (hue rotation in degrees)</p> <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#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="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">
<p>image kodachrome colors</p> <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#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="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">
<p>image negative</p> <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#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-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">
<p>range: 0 (no pixelate) to N (number of pixels to pixelate)</p> <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#L189">src/config.ts:189</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#L183">src/config.ts:183</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>image polaroid camera effect</p> <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#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="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">
<p>return processed canvas imagedata in result</p> <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#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="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">
<p>range: -1 (reduce saturation) to 1 (increase saturation)</p> <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#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="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">
<p>image sepia colors</p> <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#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="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">
<p>range: 0 (no sharpening) to 1 (maximum sharpening)</p> <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#L187">src/config.ts:187</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#L181">src/config.ts:181</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>image technicolor colors</p> <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#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="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">
<p>image vintage colors</p> <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#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="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">
<p>resize input width</p> <p>resize input width</p>
<ul> <ul>
<li>if both width and height are set to 0, there is no resizing</li> <li>if both width and height are set to 0, there is no resizing</li>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>GenericConfig | @vladmandic/human - v2.5.6</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.6"/><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.6</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.6</a></li><li><a href="GenericConfig.html">GenericConfig</a></li></ul><h1>Interface GenericConfig</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead"> <!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>GenericConfig | @vladmandic/human - v2.5.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="GenericConfig.html">GenericConfig</a></li></ul><h1>Interface GenericConfig</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
<p>Generic config type inherited by all module types</p> <p>Generic config type inherited by all module types</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">GenericConfig</span><ul class="tsd-hierarchy"><li><a href="FaceDetectorConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">FaceDetectorConfig</a></li><li><a href="FaceMeshConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">FaceMeshConfig</a></li><li><a href="FaceIrisConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">FaceIrisConfig</a></li><li><a href="FaceDescriptionConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">FaceDescriptionConfig</a></li><li><a href="FaceEmotionConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">FaceEmotionConfig</a></li><li><a href="FaceAntiSpoofConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">FaceAntiSpoofConfig</a></li><li><a href="FaceLivenessConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">FaceLivenessConfig</a></li><li><a href="FaceConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">FaceConfig</a></li><li><a href="BodyConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">BodyConfig</a></li><li><a href="HandConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">HandConfig</a></li><li><a href="ObjectConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">ObjectConfig</a></li><li><a href="SegmentationConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">SegmentationConfig</a></li></ul></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-interface"><a href="GenericConfig.html#enabled" class="tsd-kind-icon">enabled</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="GenericConfig.html#modelPath" class="tsd-kind-icon">model<wbr/>Path</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="GenericConfig.html#skipFrames" class="tsd-kind-icon">skip<wbr/>Frames</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="GenericConfig.html#skipTime" class="tsd-kind-icon">skip<wbr/>Time</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="enabled" class="tsd-anchor"></a><h3>enabled</h3><div class="tsd-signature tsd-kind-icon">enabled<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L7">src/config.ts:7</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead"> </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> <p>is module enabled?</p>

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.6</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.6"/><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.6</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.6</a></li><li><a href="GestureConfig.html">GestureConfig</a></li></ul><h1>Interface GestureConfig</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead"> <!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>GestureConfig | @vladmandic/human - v2.5.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> <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#L197">src/config.ts:197</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#L191">src/config.ts:191</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>is gesture detection enabled?</p> <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> </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,22 +1,22 @@
<!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.6</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.6"/><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.6</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.6</a></li><li><a href="HandConfig.html">HandConfig</a></li></ul><h1>Interface HandConfig</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead"> <!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>HandConfig | @vladmandic/human - v2.5.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> <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#L108">src/config.ts:108</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#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">
<p>path to hand detector model json</p> <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"> </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> <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#L103">src/config.ts:103</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#L97">src/config.ts:97</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> <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#L107">src/config.ts:107</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#L101">src/config.ts:101</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> <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#L105">src/config.ts:105</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#L99">src/config.ts:99</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>maximum number of detected hands</p> <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#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="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">
<p>minimum confidence for a detected hand before results are discarded</p> <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"> </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> <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#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="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>should hand rotation correction be performed after hand detection?</p> <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#L112">src/config.ts:112</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#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">
<p>path to hand skeleton model json</p> <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"> </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> <p>how many max frames to go without re-running model if cached results are acceptable</p>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>HandResult | @vladmandic/human - v2.5.6</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.6"/><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.6</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.6</a></li><li><a href="HandResult.html">HandResult</a></li></ul><h1>Interface HandResult</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead"> <!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>HandResult | @vladmandic/human - v2.5.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="HandResult.html">HandResult</a></li></ul><h1>Interface HandResult</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
<p>Hand results</p> <p>Hand results</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">HandResult</span></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandResult.html#annotations" class="tsd-kind-icon">annotations</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandResult.html#box" class="tsd-kind-icon">box</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandResult.html#boxRaw" class="tsd-kind-icon">box<wbr/>Raw</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandResult.html#boxScore" class="tsd-kind-icon">box<wbr/>Score</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandResult.html#fingerScore" class="tsd-kind-icon">finger<wbr/>Score</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandResult.html#id" class="tsd-kind-icon">id</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandResult.html#keypoints" class="tsd-kind-icon">keypoints</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandResult.html#label" class="tsd-kind-icon">label</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandResult.html#landmarks" class="tsd-kind-icon">landmarks</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandResult.html#score" class="tsd-kind-icon">score</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="annotations" class="tsd-anchor"></a><h3>annotations</h3><div class="tsd-signature tsd-kind-icon">annotations<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol">&lt;</span><a href="../index.html#Finger" class="tsd-signature-type" data-tsd-kind="Type alias">Finger</a><span class="tsd-signature-symbol">, </span><a href="../index.html#Point" class="tsd-signature-type" data-tsd-kind="Type alias">Point</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L137">src/result.ts:137</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead"> </div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">HandResult</span></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandResult.html#annotations" class="tsd-kind-icon">annotations</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandResult.html#box" class="tsd-kind-icon">box</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandResult.html#boxRaw" class="tsd-kind-icon">box<wbr/>Raw</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandResult.html#boxScore" class="tsd-kind-icon">box<wbr/>Score</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandResult.html#fingerScore" class="tsd-kind-icon">finger<wbr/>Score</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandResult.html#id" class="tsd-kind-icon">id</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandResult.html#keypoints" class="tsd-kind-icon">keypoints</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandResult.html#label" class="tsd-kind-icon">label</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandResult.html#landmarks" class="tsd-kind-icon">landmarks</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="HandResult.html#score" class="tsd-kind-icon">score</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="annotations" class="tsd-anchor"></a><h3>annotations</h3><div class="tsd-signature tsd-kind-icon">annotations<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol">&lt;</span><a href="../index.html#Finger" class="tsd-signature-type" data-tsd-kind="Type alias">Finger</a><span class="tsd-signature-symbol">, </span><a href="../index.html#Point" class="tsd-signature-type" data-tsd-kind="Type alias">Point</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L137">src/result.ts:137</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>detected hand keypoints combined into annotated parts</p> <p>detected hand keypoints combined into annotated parts</p>

View File

@ -1,12 +1,12 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>ObjectConfig | @vladmandic/human - v2.5.6</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.6"/><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.6</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.6</a></li><li><a href="ObjectConfig.html">ObjectConfig</a></li></ul><h1>Interface ObjectConfig</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead"> <!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>ObjectConfig | @vladmandic/human - v2.5.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="ObjectConfig.html">ObjectConfig</a></li></ul><h1>Interface ObjectConfig</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
<p>Configures all object detection specific options</p> <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"> </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> <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#L123">src/config.ts:123</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#L117">src/config.ts:117</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> <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#L125">src/config.ts:125</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#L119">src/config.ts:119</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>maximum number of detected objects</p> <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#L121">src/config.ts:121</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#L115">src/config.ts:115</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> <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"> </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> <p>path to model json file</p>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>ObjectResult | @vladmandic/human - v2.5.6</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.6"/><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.6</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.6</a></li><li><a href="ObjectResult.html">ObjectResult</a></li></ul><h1>Interface ObjectResult</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead"> <!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>ObjectResult | @vladmandic/human - v2.5.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="ObjectResult.html">ObjectResult</a></li></ul><h1>Interface ObjectResult</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
<p>Object results</p> <p>Object results</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">ObjectResult</span></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-interface"><a href="ObjectResult.html#box" class="tsd-kind-icon">box</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="ObjectResult.html#boxRaw" class="tsd-kind-icon">box<wbr/>Raw</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="ObjectResult.html#class" class="tsd-kind-icon">class</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="ObjectResult.html#id" class="tsd-kind-icon">id</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="ObjectResult.html#label" class="tsd-kind-icon">label</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="ObjectResult.html#score" class="tsd-kind-icon">score</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="box" class="tsd-anchor"></a><h3>box</h3><div class="tsd-signature tsd-kind-icon">box<span class="tsd-signature-symbol">:</span> <a href="../index.html#Box" class="tsd-signature-type" data-tsd-kind="Type alias">Box</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L160">src/result.ts:160</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead"> </div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">ObjectResult</span></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-interface"><a href="ObjectResult.html#box" class="tsd-kind-icon">box</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="ObjectResult.html#boxRaw" class="tsd-kind-icon">box<wbr/>Raw</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="ObjectResult.html#class" class="tsd-kind-icon">class</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="ObjectResult.html#id" class="tsd-kind-icon">id</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="ObjectResult.html#label" class="tsd-kind-icon">label</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="ObjectResult.html#score" class="tsd-kind-icon">score</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="box" class="tsd-anchor"></a><h3>box</h3><div class="tsd-signature tsd-kind-icon">box<span class="tsd-signature-symbol">:</span> <a href="../index.html#Box" class="tsd-signature-type" data-tsd-kind="Type alias">Box</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L160">src/result.ts:160</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>detected object box</p> <p>detected object box</p>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>PersonResult | @vladmandic/human - v2.5.6</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.6"/><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.6</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.6</a></li><li><a href="PersonResult.html">PersonResult</a></li></ul><h1>Interface PersonResult</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead"> <!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>PersonResult | @vladmandic/human - v2.5.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="PersonResult.html">PersonResult</a></li></ul><h1>Interface PersonResult</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
<p>Person getter</p> <p>Person getter</p>
<ul> <ul>
<li>Triggers combining all individual results into a virtual person object</li> <li>Triggers combining all individual results into a virtual person object</li>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Result | @vladmandic/human - v2.5.6</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.6"/><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.6</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.6</a></li><li><a href="Result.html">Result</a></li></ul><h1>Interface Result</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead"> <!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Result | @vladmandic/human - v2.5.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="Result.html">Result</a></li></ul><h1>Interface Result</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
<p>Result interface definition for <strong>Human</strong> library</p> <p>Result interface definition for <strong>Human</strong> library</p>
</div><div><p>Contains all possible detection results</p> </div><div><p>Contains all possible detection results</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">Result</span></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#body" class="tsd-kind-icon">body</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#canvas" class="tsd-kind-icon">canvas</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#error" class="tsd-kind-icon">error</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#face" class="tsd-kind-icon">face</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#gesture" class="tsd-kind-icon">gesture</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#hand" class="tsd-kind-icon">hand</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#object" class="tsd-kind-icon">object</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#performance" class="tsd-kind-icon">performance</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#persons" class="tsd-kind-icon">persons</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#timestamp" class="tsd-kind-icon">timestamp</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="body" class="tsd-anchor"></a><h3>body</h3><div class="tsd-signature tsd-kind-icon">body<span class="tsd-signature-symbol">:</span> <a href="BodyResult.html" class="tsd-signature-type" data-tsd-kind="Interface">BodyResult</a><span class="tsd-signature-symbol">[]</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L205">src/result.ts:205</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead"> </div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">Result</span></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#body" class="tsd-kind-icon">body</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#canvas" class="tsd-kind-icon">canvas</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#error" class="tsd-kind-icon">error</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#face" class="tsd-kind-icon">face</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#gesture" class="tsd-kind-icon">gesture</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#hand" class="tsd-kind-icon">hand</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#object" class="tsd-kind-icon">object</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#performance" class="tsd-kind-icon">performance</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#persons" class="tsd-kind-icon">persons</a></li><li class="tsd-kind-property tsd-parent-kind-interface"><a href="Result.html#timestamp" class="tsd-kind-icon">timestamp</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="body" class="tsd-anchor"></a><h3>body</h3><div class="tsd-signature tsd-kind-icon">body<span class="tsd-signature-symbol">:</span> <a href="BodyResult.html" class="tsd-signature-type" data-tsd-kind="Interface">BodyResult</a><span class="tsd-signature-symbol">[]</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/result.ts#L205">src/result.ts:205</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">

View File

@ -1,10 +1,10 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>SegmentationConfig | @vladmandic/human - v2.5.6</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.6"/><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.6</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.6</a></li><li><a href="SegmentationConfig.html">SegmentationConfig</a></li></ul><h1>Interface SegmentationConfig</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead"> <!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>SegmentationConfig | @vladmandic/human - v2.5.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="SegmentationConfig.html">SegmentationConfig</a></li></ul><h1>Interface SegmentationConfig</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
<p>Configures all body segmentation module <p>Configures all body segmentation module
removes background from input containing person removes background from input containing person
if segmentation is enabled it will run as preprocessing task before any other model 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 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> 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#L136">src/config.ts:136</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#L130">src/config.ts:130</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> <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"> </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> <p>is module enabled?</p>

View File

@ -1 +1 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Tensor | @vladmandic/human - v2.5.6</title><meta name="description" content="Documentation for @vladmandic/human - v2.5.6"/><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.6</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.6</a></li><li><a href="Tensor.html">Tensor</a></li></ul><h1>Namespace Tensor</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../index.html">Exports</a></li><li class="current tsd-kind-namespace"><a href="Tensor.html">Tensor</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul></ul></nav></div></div></div><footer class=""><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li><li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="overlay"></div><script src="../assets/main.js"></script></body></html> <!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Tensor | @vladmandic/human - v2.5.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="Tensor.html">Tensor</a></li></ul><h1>Namespace Tensor</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../index.html">Exports</a></li><li class="current tsd-kind-namespace"><a href="Tensor.html">Tensor</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul></ul></nav></div></div></div><footer class=""><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li><li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="overlay"></div><script src="../assets/main.js"></script></body></html>

10
types/human.d.ts vendored
View File

@ -137,7 +137,7 @@ declare function browserFiles(files: File[]): IOHandler;
declare function browserHTTPRequest(path: string, loadOptions?: LoadOptions): IOHandler; declare function browserHTTPRequest(path: string, loadOptions?: LoadOptions): IOHandler;
/** draw processed canvas */ /** draw processed canvas */
declare function canvas(input: AnyCanvas | HTMLImageElement | HTMLMediaElement | HTMLVideoElement, output: AnyCanvas): Promise<void>; declare function canvas(input: AnyCanvas | HTMLImageElement | HTMLVideoElement, output: AnyCanvas): Promise<void>;
/** /**
* Concatenate a number of ArrayBuffers into one. * Concatenate a number of ArrayBuffers into one.
@ -512,12 +512,6 @@ export declare interface FaceDetectorConfig extends GenericConfig {
minConfidence: number; minConfidence: number;
/** minimum overlap between two detected faces before one is discarded */ /** minimum overlap between two detected faces before one is discarded */
iouThreshold: number; iouThreshold: number;
/** factor used to expand detected face before further analysis
* - default: 1.6
* - for high-quality inputs can be reduced to increase precision
* - for video inputs or low-quality inputs can be increased to allow for more flexible tracking
*/
cropFactor: number;
/** should child models perform on masked image of a face */ /** should child models perform on masked image of a face */
mask: boolean; mask: boolean;
/** should face detection return face tensor to be used in some other extenrnal model? */ /** should face detection return face tensor to be used in some other extenrnal model? */
@ -1249,7 +1243,7 @@ declare class Human {
* @param userConfig - {@link Config} * @param userConfig - {@link Config}
* @returns result - {@link Result} * @returns result - {@link Result}
*/ */
warmup(userConfig?: Partial<Config>): Promise<Result>; warmup(userConfig?: Partial<Config>): Promise<Result | undefined>;
/** Run detect with tensorflow profiling /** Run detect with tensorflow profiling
* - result object will contain total exeuction time information for top-20 kernels * - result object will contain total exeuction time information for top-20 kernels
* - actual detection object can be accessed via `human.result` * - actual detection object can be accessed via `human.result`