log initialization

pull/50/head
Vladimir Mandic 2020-10-20 07:58:20 -04:00
parent bb56ebac85
commit 7c4cf75d73
13 changed files with 383 additions and 380 deletions

9
dist/human.cjs vendored
View File

@ -5777,7 +5777,7 @@ var require_config = __commonJS((exports2) => {
var require_package = __commonJS((exports2, module2) => { var require_package = __commonJS((exports2, module2) => {
module2.exports = { module2.exports = {
name: "@vladmandic/human", name: "@vladmandic/human",
version: "0.3.9", version: "0.4.1",
description: "human: 3D Face Detection, Iris Tracking and Age & Gender Prediction", description: "human: 3D Face Detection, Iris Tracking and Age & Gender Prediction",
sideEffects: false, sideEffects: false,
main: "dist/human.cjs", main: "dist/human.cjs",
@ -5816,7 +5816,7 @@ var require_package = __commonJS((exports2, module2) => {
scripts: { scripts: {
start: "node --trace-warnings --unhandled-rejections=strict --trace-uncaught --no-deprecation src/node.js", start: "node --trace-warnings --unhandled-rejections=strict --trace-uncaught --no-deprecation src/node.js",
lint: "eslint src/*.js demo/*.js", lint: "eslint src/*.js demo/*.js",
"build-iife": "esbuild --bundle --platform=browser --sourcemap --target=esnext --format=iife --minify --external:fs --global-name=human --metafile=dist/human.json --outfile=dist/human.js src/human.js", "build-iife": "esbuild --bundle --platform=browser --sourcemap --target=esnext --format=iife --minify --external:fs --global-name=Human --metafile=dist/human.json --outfile=dist/human.js src/human.js",
"build-esm-bundle": "esbuild --bundle --platform=browser --sourcemap --target=esnext --format=esm --minify --external:fs --metafile=dist/human.esm.json --outfile=dist/human.esm.js src/human.js", "build-esm-bundle": "esbuild --bundle --platform=browser --sourcemap --target=esnext --format=esm --minify --external:fs --metafile=dist/human.esm.json --outfile=dist/human.esm.js src/human.js",
"build-esm-nobundle": "esbuild --bundle --platform=browser --sourcemap --target=esnext --format=esm --minify --external:@tensorflow --external:fs --metafile=dist/human.esm-nobundle.json --outfile=dist/human.esm-nobundle.js src/human.js", "build-esm-nobundle": "esbuild --bundle --platform=browser --sourcemap --target=esnext --format=esm --minify --external:@tensorflow --external:fs --metafile=dist/human.esm-nobundle.json --outfile=dist/human.esm-nobundle.js src/human.js",
"build-node": "esbuild --bundle --platform=node --sourcemap --target=esnext --format=cjs --external:@tensorflow --metafile=dist/human.cjs.json --outfile=dist/human.cjs src/human.js", "build-node": "esbuild --bundle --platform=node --sourcemap --target=esnext --format=cjs --external:@tensorflow --metafile=dist/human.cjs.json --outfile=dist/human.cjs src/human.js",
@ -5852,6 +5852,7 @@ const handpose = require_handpose();
const fxImage = require_imagefx(); const fxImage = require_imagefx();
const defaults = require_config().default; const defaults = require_config().default;
const app = require_package(); const app = require_package();
let first = true;
const override = { const override = {
face: {detector: {skipFrames: 0}, age: {skipFrames: 0}, emotion: {skipFrames: 0}}, face: {detector: {skipFrames: 0}, age: {skipFrames: 0}, emotion: {skipFrames: 0}},
hand: {skipFrames: 0} hand: {skipFrames: 0}
@ -6038,11 +6039,11 @@ class Human {
await tf.ready(); await tf.ready();
} }
perf.backend = Math.trunc(now() - timeStamp); perf.backend = Math.trunc(now() - timeStamp);
const loadedModels = Object.values(this.models).filter((a) => a).length; if (first) {
if (loadedModels === 0) {
this.log("Human library starting"); this.log("Human library starting");
this.log("Configuration:", this.config); this.log("Configuration:", this.config);
this.log("Flags:", tf.ENV.flags); this.log("Flags:", tf.ENV.flags);
first = false;
} }
timeStamp = now(); timeStamp = now();
this.state = "load"; this.state = "load";

8
dist/human.cjs.json vendored
View File

@ -116,7 +116,7 @@
"imports": [] "imports": []
}, },
"src/human.js": { "src/human.js": {
"bytes": 11405, "bytes": 11355,
"imports": [ "imports": [
{ {
"path": "src/facemesh/facemesh.js" "path": "src/facemesh/facemesh.js"
@ -260,7 +260,7 @@
"dist/human.cjs.map": { "dist/human.cjs.map": {
"imports": [], "imports": [],
"inputs": {}, "inputs": {},
"bytes": 264025 "bytes": 263891
}, },
"dist/human.cjs": { "dist/human.cjs": {
"imports": [], "imports": [],
@ -359,10 +359,10 @@
"bytesInOutput": 47 "bytesInOutput": 47
}, },
"src/human.js": { "src/human.js": {
"bytesInOutput": 10244 "bytesInOutput": 10193
} }
}, },
"bytes": 154612 "bytes": 154561
} }
} }
} }

4
dist/human.cjs.map vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -116,7 +116,7 @@
"imports": [] "imports": []
}, },
"src/human.js": { "src/human.js": {
"bytes": 11405, "bytes": 11355,
"imports": [ "imports": [
{ {
"path": "src/facemesh/facemesh.js" "path": "src/facemesh/facemesh.js"
@ -260,7 +260,7 @@
"dist/human.esm-nobundle.js.map": { "dist/human.esm-nobundle.js.map": {
"imports": [], "imports": [],
"inputs": {}, "inputs": {},
"bytes": 228083 "bytes": 228002
}, },
"dist/human.esm-nobundle.js": { "dist/human.esm-nobundle.js": {
"imports": [], "imports": [],
@ -356,13 +356,13 @@
"bytesInOutput": 2304 "bytesInOutput": 2304
}, },
"src/human.js": { "src/human.js": {
"bytesInOutput": 6417 "bytesInOutput": 6381
}, },
"src/human.js": { "src/human.js": {
"bytesInOutput": 0 "bytesInOutput": 0
} }
}, },
"bytes": 81881 "bytes": 81845
} }
} }
} }

344
dist/human.esm.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

8
dist/human.esm.json vendored
View File

@ -291,7 +291,7 @@
"imports": [] "imports": []
}, },
"src/human.js": { "src/human.js": {
"bytes": 11405, "bytes": 11355,
"imports": [ "imports": [
{ {
"path": "node_modules/@tensorflow/tfjs/dist/tf.node.js" "path": "node_modules/@tensorflow/tfjs/dist/tf.node.js"
@ -468,7 +468,7 @@
"dist/human.esm.js.map": { "dist/human.esm.js.map": {
"imports": [], "imports": [],
"inputs": {}, "inputs": {},
"bytes": 4989135 "bytes": 4989054
}, },
"dist/human.esm.js": { "dist/human.esm.js": {
"imports": [], "imports": [],
@ -621,13 +621,13 @@
"bytesInOutput": 2305 "bytesInOutput": 2305
}, },
"src/human.js": { "src/human.js": {
"bytesInOutput": 6434 "bytesInOutput": 6398
}, },
"src/human.js": { "src/human.js": {
"bytesInOutput": 0 "bytesInOutput": 0
} }
}, },
"bytes": 1118731 "bytes": 1118695
} }
} }
} }

344
dist/human.js vendored

File diff suppressed because one or more lines are too long

4
dist/human.js.map vendored

File diff suppressed because one or more lines are too long

8
dist/human.json vendored
View File

@ -291,7 +291,7 @@
"imports": [] "imports": []
}, },
"src/human.js": { "src/human.js": {
"bytes": 11405, "bytes": 11355,
"imports": [ "imports": [
{ {
"path": "node_modules/@tensorflow/tfjs/dist/tf.node.js" "path": "node_modules/@tensorflow/tfjs/dist/tf.node.js"
@ -468,7 +468,7 @@
"dist/human.js.map": { "dist/human.js.map": {
"imports": [], "imports": [],
"inputs": {}, "inputs": {},
"bytes": 4989136 "bytes": 4989055
}, },
"dist/human.js": { "dist/human.js": {
"imports": [], "imports": [],
@ -621,10 +621,10 @@
"bytesInOutput": 2305 "bytesInOutput": 2305
}, },
"src/human.js": { "src/human.js": {
"bytesInOutput": 6476 "bytesInOutput": 6440
} }
}, },
"bytes": 1118780 "bytes": 1118744
} }
} }
} }

View File

@ -8,6 +8,8 @@ const fxImage = require('./imagefx.js');
const defaults = require('../config.js').default; const defaults = require('../config.js').default;
const app = require('../package.json'); const app = require('../package.json');
let first = true;
// static config override for non-video detection // static config override for non-video detection
const override = { const override = {
face: { detector: { skipFrames: 0 }, age: { skipFrames: 0 }, emotion: { skipFrames: 0 } }, face: { detector: { skipFrames: 0 }, age: { skipFrames: 0 }, emotion: { skipFrames: 0 } },
@ -199,11 +201,11 @@ class Human {
perf.backend = Math.trunc(now() - timeStamp); perf.backend = Math.trunc(now() - timeStamp);
// check number of loaded models // check number of loaded models
const loadedModels = Object.values(this.models).filter((a) => a).length; if (first) {
if (loadedModels === 0) {
this.log('Human library starting'); this.log('Human library starting');
this.log('Configuration:', this.config); this.log('Configuration:', this.config);
this.log('Flags:', tf.ENV.flags); this.log('Flags:', tf.ENV.flags);
first = false;
} }
// load models if enabled // load models if enabled