mirror of https://github.com/vladmandic/human
remove iris coords if iris is disabled
parent
34cf0f7fd2
commit
e63eb072fc
|
@ -6,7 +6,7 @@ import GLBench from './gl-bench.js';
|
||||||
const userConfig = {}; // add any user configuration overrides
|
const userConfig = {}; // add any user configuration overrides
|
||||||
/*
|
/*
|
||||||
const userConfig = {
|
const userConfig = {
|
||||||
face: { enabled: false },
|
face: { enabled: true, iris: { enabled: false } },
|
||||||
body: { enabled: true },
|
body: { enabled: true },
|
||||||
hand: { enabled: false },
|
hand: { enabled: false },
|
||||||
};
|
};
|
||||||
|
|
|
@ -307,6 +307,10 @@ class Human {
|
||||||
|
|
||||||
// calculate iris distance
|
// calculate iris distance
|
||||||
// iris: array[ center, left, top, right, bottom]
|
// iris: array[ center, left, top, right, bottom]
|
||||||
|
if (!this.config.face.iris.enabled) {
|
||||||
|
delete face.annotations.leftEyeIris;
|
||||||
|
delete face.annotations.rightEyeIris;
|
||||||
|
}
|
||||||
const irisSize = (face.annotations.leftEyeIris && face.annotations.rightEyeIris)
|
const irisSize = (face.annotations.leftEyeIris && face.annotations.rightEyeIris)
|
||||||
/* average human iris size is 11.7mm */
|
/* average human iris size is 11.7mm */
|
||||||
? 11.7 * Math.max(Math.abs(face.annotations.leftEyeIris[3][0] - face.annotations.leftEyeIris[1][0]), Math.abs(face.annotations.rightEyeIris[4][1] - face.annotations.rightEyeIris[2][1]))
|
? 11.7 * Math.max(Math.abs(face.annotations.leftEyeIris[3][0] - face.annotations.leftEyeIris[1][0]), Math.abs(face.annotations.rightEyeIris[4][1] - face.annotations.rightEyeIris[2][1]))
|
||||||
|
|
Loading…
Reference in New Issue