added diagnostics output

pull/50/head
Vladimir Mandic 2020-10-17 11:43:04 -04:00
parent 3776c29c12
commit cd36d9f546
14 changed files with 151 additions and 143 deletions

View File

@ -349,6 +349,7 @@ result = {
],
performance = { // performance data of last execution for each module measuredin miliseconds
config, // time to parse configuration
backend, // time to initialize tf backend
load, // time to load models
sanity, // time for input verification
body, // model time

11
dist/human.cjs vendored
View File

@ -5306,9 +5306,6 @@ async function detect(input, userConfig = {}) {
perf.sanity = Math.trunc(now() - timeStamp);
return new Promise(async (resolve) => {
const timeStart = now();
const loadedModels = Object.values(models).filter((a) => a).length;
if (loadedModels === 0)
log("Human library starting");
timeStamp = now();
if (tf.getBackend() !== config.backend) {
state = "backend";
@ -5316,7 +5313,13 @@ async function detect(input, userConfig = {}) {
await tf.setBackend(config.backend);
await tf.ready();
}
perf.body = Math.trunc(now() - timeStamp);
perf.backend = Math.trunc(now() - timeStamp);
const loadedModels = Object.values(models).filter((a) => a).length;
if (loadedModels === 0) {
log("Human library starting");
log("Configuration:", config);
log("Flags:", tf.ENV.flags);
}
timeStamp = now();
state = "load";
await load();

8
dist/human.cjs.json vendored
View File

@ -116,7 +116,7 @@
"imports": []
},
"src/index.js": {
"bytes": 7437,
"bytes": 7526,
"imports": [
{
"path": "src/facemesh/facemesh.js"
@ -253,7 +253,7 @@
"dist/human.cjs.map": {
"imports": [],
"inputs": {},
"bytes": 219752
"bytes": 219894
},
"dist/human.cjs": {
"imports": [],
@ -346,10 +346,10 @@
"bytesInOutput": 2748
},
"src/index.js": {
"bytesInOutput": 6431
"bytesInOutput": 6514
}
},
"bytes": 134024
"bytes": 134107
}
}
}

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": []
},
"src/index.js": {
"bytes": 7437,
"bytes": 7526,
"imports": [
{
"path": "src/facemesh/facemesh.js"
@ -253,7 +253,7 @@
"dist/human.esm-nobundle.js.map": {
"imports": [],
"inputs": {},
"bytes": 198045
"bytes": 198188
},
"dist/human.esm-nobundle.js": {
"imports": [],
@ -313,7 +313,7 @@
"bytesInOutput": 608
},
"src/posenet/util.js": {
"bytesInOutput": 1843
"bytesInOutput": 1850
},
"src/posenet/modelPoseNet.js": {
"bytesInOutput": 885
@ -346,10 +346,10 @@
"bytesInOutput": 2275
},
"src/index.js": {
"bytesInOutput": 3513
"bytesInOutput": 3564
}
},
"bytes": 69346
"bytes": 69404
}
}
}

108
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": []
},
"src/index.js": {
"bytes": 7437,
"bytes": 7526,
"imports": [
{
"path": "node_modules/@tensorflow/tfjs/dist/tf.node.js"
@ -464,7 +464,7 @@
"dist/human.esm.js.map": {
"imports": [],
"inputs": {},
"bytes": 4959096
"bytes": 4959239
},
"dist/human.esm.js": {
"imports": [],
@ -614,10 +614,10 @@
"bytesInOutput": 2276
},
"src/index.js": {
"bytesInOutput": 3608
"bytesInOutput": 3669
}
},
"bytes": 1106263
"bytes": 1106324
}
}
}

108
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": []
},
"src/index.js": {
"bytes": 7437,
"bytes": 7526,
"imports": [
{
"path": "node_modules/@tensorflow/tfjs/dist/tf.node.js"
@ -464,7 +464,7 @@
"dist/human.js.map": {
"imports": [],
"inputs": {},
"bytes": 4959096
"bytes": 4959239
},
"dist/human.js": {
"imports": [],
@ -614,10 +614,10 @@
"bytesInOutput": 2276
},
"src/index.js": {
"bytesInOutput": 3608
"bytesInOutput": 3669
}
},
"bytes": 1106272
"bytes": 1106333
}
}
}

View File

@ -110,10 +110,6 @@ async function detect(input, userConfig = {}) {
return new Promise(async (resolve) => {
const timeStart = now();
// check number of loaded models
const loadedModels = Object.values(models).filter((a) => a).length;
if (loadedModels === 0) log('Human library starting');
// configure backend
timeStamp = now();
if (tf.getBackend() !== config.backend) {
@ -122,7 +118,15 @@ async function detect(input, userConfig = {}) {
await tf.setBackend(config.backend);
await tf.ready();
}
perf.body = Math.trunc(now() - timeStamp);
perf.backend = Math.trunc(now() - timeStamp);
// check number of loaded models
const loadedModels = Object.values(models).filter((a) => a).length;
if (loadedModels === 0) {
log('Human library starting');
log('Configuration:', config);
log('Flags:', tf.ENV.flags);
}
// load models if enabled
timeStamp = now();