mirror of https://github.com/vladmandic/human
added diagnostics output
parent
3776c29c12
commit
cd36d9f546
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
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
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
14
src/index.js
14
src/index.js
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue