diff --git a/demo/browser.js b/demo/browser.js index 412dbdea..17de5bf3 100644 --- a/demo/browser.js +++ b/demo/browser.js @@ -6,7 +6,7 @@ import GLBench from './gl-bench.js'; const userConfig = {}; // add any user configuration overrides /* const userConfig = { - face: { enabled: false }, + face: { enabled: true, iris: { enabled: false } }, body: { enabled: true }, hand: { enabled: false }, }; diff --git a/src/human.js b/src/human.js index 5ad54013..feab8a18 100644 --- a/src/human.js +++ b/src/human.js @@ -307,6 +307,10 @@ class Human { // calculate iris distance // 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) /* 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]))