Skip to content
Vladimir Mandic edited this page Sep 12, 2021 · 6 revisions

Diagnostics

Get human version

console.log(human.version);
2.2.0

Enable console debug output

const human = new Human({ debug: true })

Get current configuration

console.log(human.config)
{
  backend: 'tensorflow',
  modelBasePath: 'file://models/',
  wasmPath: 'https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]/dist/',
  debug: true,
  ...
}

Get current environment details

console.log(human.env)
{
  "browser": true,
  "node": false,
  "worker": false,
  "platform": "Windows NT 10.0; Win64; x64",
  "agent": "Mozilla/5.0 AppleWebKit/537.36 Chrome/95.0.4629.0 Safari/537.36 Edg/95.0.1011.0",
  "backends": ["cpu","webgl","wasm"],
  "tfjs": {"version":"3.9.0"},
  "wasm": {"supported":true,"simd":true,"multithread":true},
  "webgl": {"supported":true,"version":"WebGL 2.0 (OpenGL ES 3.0 Chromium)","renderer":"WebKit WebGL"},
  "webgpu": {"supported":true,"adapter":"Default"},
  "kernels": [...]
}

Get list of all models

  const models = Object.keys(human.models).map((model) => ({ name: model, loaded: (human.models[model] !== null) }));
  console.log(models);
[
  { name: 'face', loaded: true },
  { name: 'posenet', loaded: false },
  { name: 'blazepose', loaded: false },
  { name: 'efficientpose', loaded: false },
  { name: 'movenet', loaded: true },
  { name: 'handpose', loaded: true },
  { name: 'age', loaded: false },
  { name: 'gender', loaded: false },
  { name: 'emotion', loaded: true },
  { name: 'embedding', loaded: false },
  { name: 'nanodet', loaded: false },
  { name: 'centernet', loaded: false },
  { name: 'faceres', loaded: true },
  { name: 'segmentation', loaded: false },
]

Get memory usage information

  console.log(human.tf.engine().memory()));
{
  numTensors: 1053, numDataBuffers: 1053, numBytes: 42736024
}

Get current TensorFlow flags

  console.log(human.tf.ENV.flags);
{
  IS_BROWSER: false, IS_NODE: true, DEBUG: false, CPU_HANDOFF_SIZE_THRESHOLD: 128, PROD: true
}

Get performance information

  const result = await human.detect(input);
  console.log(result.performance);
  {
    backend: 1, load: 283, image: 1, frames: 1, cached: 0, changed: 1, total: 947, draw: 0,
    face: 390, emotion: 15, embedding: 97, body: 97, hand: 142, object: 312, gesture: 0
  }
Clone this wiki locally