mirror of https://github.com/vladmandic/human
fix(src): typo
parent
9bc8832166
commit
da48dcb449
|
@ -9,11 +9,11 @@ export interface GenericConfig {
|
||||||
modelPath: string,
|
modelPath: string,
|
||||||
/** how many max frames to go without re-running model if cached results are acceptable */
|
/** how many max frames to go without re-running model if cached results are acceptable */
|
||||||
skipFrames: number,
|
skipFrames: number,
|
||||||
/** how many max miliseconds to go without re-running model if cached results are acceptable */
|
/** how many max milliseconds to go without re-running model if cached results are acceptable */
|
||||||
skipTime: number,
|
skipTime: number,
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Dectector part of face configuration */
|
/** Detector part of face configuration */
|
||||||
export interface FaceDetectorConfig extends GenericConfig {
|
export interface FaceDetectorConfig extends GenericConfig {
|
||||||
/** is face rotation correction performed after detecting face? */
|
/** is face rotation correction performed after detecting face? */
|
||||||
rotation: boolean,
|
rotation: boolean,
|
||||||
|
@ -68,7 +68,7 @@ export interface FaceConfig extends GenericConfig {
|
||||||
|
|
||||||
/** Configures all body detection specific options */
|
/** Configures all body detection specific options */
|
||||||
export interface BodyConfig extends GenericConfig {
|
export interface BodyConfig extends GenericConfig {
|
||||||
/** maximum numboer of detected bodies */
|
/** maximum number of detected bodies */
|
||||||
maxDetected: number,
|
maxDetected: number,
|
||||||
/** minimum confidence for a detected body before results are discarded */
|
/** minimum confidence for a detected body before results are discarded */
|
||||||
minConfidence: number,
|
minConfidence: number,
|
||||||
|
|
|
@ -216,7 +216,7 @@ export async function predict(input: Tensor, config: Config): Promise<HandResult
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (let i = 0; i < cache.hands.length; i++) { // replace deteced boxes with calculated boxes in final output
|
for (let i = 0; i < cache.hands.length; i++) { // replace detected boxes with calculated boxes in final output
|
||||||
const bbox = box.calc(cache.hands[i].keypoints, outputSize);
|
const bbox = box.calc(cache.hands[i].keypoints, outputSize);
|
||||||
cache.hands[i].box = bbox.box;
|
cache.hands[i].box = bbox.box;
|
||||||
cache.hands[i].boxRaw = bbox.boxRaw;
|
cache.hands[i].boxRaw = bbox.boxRaw;
|
||||||
|
|
|
@ -41,7 +41,7 @@ export function join(faces: Array<FaceResult>, bodies: Array<BodyResult>, hands:
|
||||||
else if (gesture['hand'] !== undefined && gesture['hand'] === person.hands?.right?.id) person.gestures?.push(gesture);
|
else if (gesture['hand'] !== undefined && gesture['hand'] === person.hands?.right?.id) person.gestures?.push(gesture);
|
||||||
}
|
}
|
||||||
|
|
||||||
// create new overarching box from all boxes beloning to person
|
// create new overarching box from all boxes belonging to person
|
||||||
const x: number[] = [];
|
const x: number[] = [];
|
||||||
const y: number[] = [];
|
const y: number[] = [];
|
||||||
const extractXY = (box: Box | undefined) => { // extract all [x, y] coordinates from boxes [x, y, width, height]
|
const extractXY = (box: Box | undefined) => { // extract all [x, y] coordinates from boxes [x, y, width, height]
|
||||||
|
|
|
@ -44,7 +44,7 @@ export function validate(defaults: Partial<Config>, config: Partial<Config>, par
|
||||||
return msgs;
|
return msgs;
|
||||||
}
|
}
|
||||||
|
|
||||||
// helper function: perform deep merge of multiple objects so it allows full inheriance with overrides
|
// helper function: perform deep merge of multiple objects so it allows full inheritance with overrides
|
||||||
export function mergeDeep(...objects) {
|
export function mergeDeep(...objects) {
|
||||||
const isObject = (obj) => obj && typeof obj === 'object';
|
const isObject = (obj) => obj && typeof obj === 'object';
|
||||||
return objects.reduce((prev, obj) => {
|
return objects.reduce((prev, obj) => {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Warmup algorithm that uses embedded images to excercise loaded models for faster future inference
|
* Warmup algorithm that uses embedded images to exercise loaded models for faster future inference
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { log, now, mergeDeep } from './util/util';
|
import { log, now, mergeDeep } from './util/util';
|
||||||
|
|
Loading…
Reference in New Issue