add tensorflow library detection

pull/293/head
Vladimir Mandic 2022-08-15 11:40:15 -04:00
parent cc1b1ae5e6
commit a8c613c903
23 changed files with 1153 additions and 1129 deletions

View File

@ -9,7 +9,7 @@
## Changelog
### **HEAD -> main** 2022/08/12 mandic00@live.com
### **HEAD -> main** 2022/08/15 mandic00@live.com
- enumerate additional models
- release refresh

10
TODO.md
View File

@ -57,7 +57,8 @@ Model is supported using `WebGL` backend in browser
Models can be downloaded from <https://github.com/vladmandic/insightface>
- Add `human.check()` which validates all kernel ops for currently loaded models with currently selected backend
Example: `console.error(human.check());`
- Add underlying tensorflow library version detection to `human.env`
- Add underlying **tensorflow** library version detection when running in NodeJS to
`human.env` and check if **GPU** is used for acceleration
Example: `console.log(human.env.tensorflow)`
- Host models in <human-models>
Models can be directly used without downloading to local storage
@ -72,10 +73,11 @@ Model is supported using `WebGL` backend in browser
- Fix `demo/multithread/node-multiprocess.js` demo
- Fix `human.match` when using mixed descriptor lengths
- Fix WASM feature detection issue in TFJS with Edge/Chromium
Example: `console.log(human.env.wasm)`
- Increased test coverage
**NodeJS**: Run using `npm run test`
**Browser**: Run using `demo/browser.html`
**NodeJS**: Run using: `npm run test`
**Browser**: Run using: `demo/browser.html`
- Increase availability of alternative models
See `models/model.json` for full list
- Update profiling methods in `human.profile()`
- Update project dependencies
- Update project dependencies to latest versions

3
dist/human.d.ts vendored
View File

@ -449,9 +449,10 @@ export declare class Env {
offscreen: undefined | boolean;
/** Are performance counter instant values or additive */
perfadd: boolean;
/** If using tfjs-node get version of underlying tensorflow shared library */
/** If using tfjs-node get version of underlying tensorflow shared library and if gpu acceleration is enabled */
tensorflow: {
version: undefined | string;
gpu: undefined | boolean;
};
/** WASM detected capabilities */
wasm: {

View File

@ -449,9 +449,10 @@ export declare class Env {
offscreen: undefined | boolean;
/** Are performance counter instant values or additive */
perfadd: boolean;
/** If using tfjs-node get version of underlying tensorflow shared library */
/** If using tfjs-node get version of underlying tensorflow shared library and if gpu acceleration is enabled */
tensorflow: {
version: undefined | string;
gpu: undefined | boolean;
};
/** WASM detected capabilities */
wasm: {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

3
dist/human.esm.d.ts vendored
View File

@ -449,9 +449,10 @@ export declare class Env {
offscreen: undefined | boolean;
/** Are performance counter instant values or additive */
perfadd: boolean;
/** If using tfjs-node get version of underlying tensorflow shared library */
/** If using tfjs-node get version of underlying tensorflow shared library and if gpu acceleration is enabled */
tensorflow: {
version: undefined | string;
gpu: undefined | boolean;
};
/** WASM detected capabilities */
wasm: {

10
dist/human.esm.js vendored
View File

@ -73430,7 +73430,10 @@ var Env = class {
__publicField(this, "tfjs");
__publicField(this, "offscreen");
__publicField(this, "perfadd", false);
__publicField(this, "tensorflow", { version: void 0 });
__publicField(this, "tensorflow", {
version: void 0,
gpu: void 0
});
__publicField(this, "wasm", {
supported: void 0,
backend: void 0,
@ -73479,7 +73482,10 @@ var Env = class {
}
async updateBackend() {
this.backends = Object.keys(engine().registryFactory);
this.tensorflow = { version: backend()["binding"] ? backend()["binding"]["TF_Version"] : void 0 };
this.tensorflow = {
version: backend()["binding"] ? backend()["binding"]["TF_Version"] : void 0,
gpu: backend()["binding"] ? backend()["binding"].isUsingGpuDevice() : void 0
};
this.wasm.supported = typeof WebAssembly !== "undefined";
this.wasm.backend = this.backends.includes("wasm");
if (this.wasm.supported && this.wasm.backend && getBackend() === "wasm") {

File diff suppressed because one or more lines are too long

132
dist/human.js vendored

File diff suppressed because one or more lines are too long

View File

@ -449,9 +449,10 @@ export declare class Env {
offscreen: undefined | boolean;
/** Are performance counter instant values or additive */
perfadd: boolean;
/** If using tfjs-node get version of underlying tensorflow shared library */
/** If using tfjs-node get version of underlying tensorflow shared library and if gpu acceleration is enabled */
tensorflow: {
version: undefined | string;
gpu: undefined | boolean;
};
/** WASM detected capabilities */
wasm: {

File diff suppressed because one or more lines are too long

View File

@ -449,9 +449,10 @@ export declare class Env {
offscreen: undefined | boolean;
/** Are performance counter instant values or additive */
perfadd: boolean;
/** If using tfjs-node get version of underlying tensorflow shared library */
/** If using tfjs-node get version of underlying tensorflow shared library and if gpu acceleration is enabled */
tensorflow: {
version: undefined | string;
gpu: undefined | boolean;
};
/** WASM detected capabilities */
wasm: {

File diff suppressed because one or more lines are too long

View File

@ -449,9 +449,10 @@ export declare class Env {
offscreen: undefined | boolean;
/** Are performance counter instant values or additive */
perfadd: boolean;
/** If using tfjs-node get version of underlying tensorflow shared library */
/** If using tfjs-node get version of underlying tensorflow shared library and if gpu acceleration is enabled */
tensorflow: {
version: undefined | string;
gpu: undefined | boolean;
};
/** WASM detected capabilities */
wasm: {

8
dist/human.node.js vendored

File diff suppressed because one or more lines are too long

View File

@ -27,10 +27,14 @@ export class Env {
offscreen: undefined | boolean;
/** Are performance counter instant values or additive */
perfadd: boolean = false;
/** If using tfjs-node get version of underlying tensorflow shared library */
/** If using tfjs-node get version of underlying tensorflow shared library and if gpu acceleration is enabled */
tensorflow: {
version: undefined | string,
} = { version: undefined };
gpu: undefined | boolean,
} = {
version: undefined,
gpu: undefined,
};
/** WASM detected capabilities */
wasm: {
supported: undefined | boolean,
@ -119,7 +123,10 @@ export class Env {
async updateBackend() {
// analyze backends
this.backends = Object.keys(tf.engine().registryFactory);
this.tensorflow = { version: (tf.backend()['binding'] ? tf.backend()['binding']['TF_Version'] : undefined) };
this.tensorflow = {
version: (tf.backend()['binding'] ? tf.backend()['binding']['TF_Version'] : undefined),
gpu: (tf.backend()['binding'] ? tf.backend()['binding'].isUsingGpuDevice() : undefined),
};
this.wasm.supported = typeof WebAssembly !== 'undefined';
this.wasm.backend = this.backends.includes('wasm');
if (this.wasm.supported && this.wasm.backend && tf.getBackend() === 'wasm') {

View File

@ -1,39 +1,39 @@
2022-08-15 11:28:08 DATA:  Build {"name":"@vladmandic/human","version":"2.9.3"}
2022-08-15 11:28:08 INFO:  Application: {"name":"@vladmandic/human","version":"2.9.3"}
2022-08-15 11:28:08 INFO:  Environment: {"profile":"production","config":".build.json","package":"package.json","tsconfig":true,"eslintrc":true,"git":true}
2022-08-15 11:28:08 INFO:  Toolchain: {"build":"0.7.9","esbuild":"0.15.3","typescript":"4.7.4","typedoc":"0.23.10","eslint":"8.22.0"}
2022-08-15 11:28:08 INFO:  Build: {"profile":"production","steps":["clean","compile","typings","typedoc","lint","changelog"]}
2022-08-15 11:28:08 STATE: Clean: {"locations":["dist/*","types/lib/*","typedoc/*"]}
2022-08-15 11:28:08 STATE: Compile: {"name":"tfjs/nodejs/cpu","format":"cjs","platform":"node","input":"tfjs/tf-node.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":102,"outputBytes":608}
2022-08-15 11:28:08 STATE: Compile: {"name":"human/nodejs/cpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node.js","files":75,"inputBytes":655247,"outputBytes":307391}
2022-08-15 11:28:08 STATE: Compile: {"name":"tfjs/nodejs/gpu","format":"cjs","platform":"node","input":"tfjs/tf-node-gpu.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":110,"outputBytes":612}
2022-08-15 11:28:08 STATE: Compile: {"name":"human/nodejs/gpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-gpu.js","files":75,"inputBytes":655251,"outputBytes":307395}
2022-08-15 11:28:08 STATE: Compile: {"name":"tfjs/nodejs/wasm","format":"cjs","platform":"node","input":"tfjs/tf-node-wasm.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":149,"outputBytes":664}
2022-08-15 11:28:08 STATE: Compile: {"name":"human/nodejs/wasm","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-wasm.js","files":75,"inputBytes":655303,"outputBytes":307445}
2022-08-15 11:28:08 STATE: Compile: {"name":"tfjs/browser/version","format":"esm","platform":"browser","input":"tfjs/tf-version.ts","output":"dist/tfjs.version.js","files":1,"inputBytes":1069,"outputBytes":358}
2022-08-15 11:28:08 STATE: Compile: {"name":"tfjs/browser/esm/nobundle","format":"esm","platform":"browser","input":"tfjs/tf-browser.ts","output":"dist/tfjs.esm.js","files":2,"inputBytes":1032,"outputBytes":583}
2022-08-15 11:28:08 STATE: Compile: {"name":"human/browser/esm/nobundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm-nobundle.js","files":75,"inputBytes":655222,"outputBytes":306242}
2022-08-15 11:28:09 STATE: Compile: {"name":"tfjs/browser/esm/custom","format":"esm","platform":"browser","input":"tfjs/tf-custom.ts","output":"dist/tfjs.esm.js","files":11,"inputBytes":1271,"outputBytes":2787569}
2022-08-15 11:28:09 STATE: Compile: {"name":"human/browser/iife/bundle","format":"iife","platform":"browser","input":"src/human.ts","output":"dist/human.js","files":75,"inputBytes":3442208,"outputBytes":1669116}
2022-08-15 11:28:09 STATE: Compile: {"name":"human/browser/esm/bundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm.js","files":75,"inputBytes":3442208,"outputBytes":3072985}
2022-08-15 11:28:14 STATE: Typings: {"input":"src/human.ts","output":"types/lib","files":30}
2022-08-15 11:28:15 STATE: TypeDoc: {"input":"src/human.ts","output":"typedoc","objects":77,"generated":true}
2022-08-15 11:28:15 STATE: Compile: {"name":"demo/typescript","format":"esm","platform":"browser","input":"demo/typescript/index.ts","output":"demo/typescript/index.js","files":1,"inputBytes":6716,"outputBytes":3141}
2022-08-15 11:28:15 STATE: Compile: {"name":"demo/faceid","format":"esm","platform":"browser","input":"demo/faceid/index.ts","output":"demo/faceid/index.js","files":2,"inputBytes":15629,"outputBytes":7798}
2022-08-15 11:28:24 STATE: Lint: {"locations":["*.json","src/**/*.ts","test/**/*.js","demo/**/*.js"],"files":109,"errors":0,"warnings":0}
2022-08-15 11:28:24 STATE: ChangeLog: {"repository":"https://github.com/vladmandic/human","branch":"main","output":"CHANGELOG.md"}
2022-08-15 11:28:24 STATE: Copy: {"input":"tfjs/tfjs.esm.d.ts"}
2022-08-15 11:28:24 INFO:  Done...
2022-08-15 11:28:24 STATE: API-Extractor: {"succeeeded":true,"errors":0,"warnings":198}
2022-08-15 11:28:24 STATE: Copy: {"input":"types/human.d.ts"}
2022-08-15 11:28:24 INFO:  Analyze models: {"folders":8,"result":"models/models.json"}
2022-08-15 11:28:24 STATE: Models {"folder":"./models","models":13}
2022-08-15 11:28:24 STATE: Models {"folder":"../human-models/models","models":42}
2022-08-15 11:28:24 STATE: Models {"folder":"../blazepose/model/","models":4}
2022-08-15 11:28:24 STATE: Models {"folder":"../anti-spoofing/model","models":1}
2022-08-15 11:28:24 STATE: Models {"folder":"../efficientpose/models","models":3}
2022-08-15 11:28:24 STATE: Models {"folder":"../insightface/models","models":5}
2022-08-15 11:28:24 STATE: Models {"folder":"../movenet/models","models":3}
2022-08-15 11:28:24 STATE: Models {"folder":"../nanodet/models","models":4}
2022-08-15 11:28:25 STATE: Models: {"count":57,"totalSize":383017442}
2022-08-15 11:28:25 INFO:  Human Build complete... {"logFile":"test/build.log"}
2022-08-15 11:36:04 DATA:  Build {"name":"@vladmandic/human","version":"2.9.3"}
2022-08-15 11:36:04 INFO:  Application: {"name":"@vladmandic/human","version":"2.9.3"}
2022-08-15 11:36:04 INFO:  Environment: {"profile":"production","config":".build.json","package":"package.json","tsconfig":true,"eslintrc":true,"git":true}
2022-08-15 11:36:04 INFO:  Toolchain: {"build":"0.7.9","esbuild":"0.15.3","typescript":"4.7.4","typedoc":"0.23.10","eslint":"8.22.0"}
2022-08-15 11:36:04 INFO:  Build: {"profile":"production","steps":["clean","compile","typings","typedoc","lint","changelog"]}
2022-08-15 11:36:04 STATE: Clean: {"locations":["dist/*","types/lib/*","typedoc/*"]}
2022-08-15 11:36:04 STATE: Compile: {"name":"tfjs/nodejs/cpu","format":"cjs","platform":"node","input":"tfjs/tf-node.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":102,"outputBytes":608}
2022-08-15 11:36:04 STATE: Compile: {"name":"human/nodejs/cpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node.js","files":75,"inputBytes":655451,"outputBytes":307474}
2022-08-15 11:36:04 STATE: Compile: {"name":"tfjs/nodejs/gpu","format":"cjs","platform":"node","input":"tfjs/tf-node-gpu.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":110,"outputBytes":612}
2022-08-15 11:36:04 STATE: Compile: {"name":"human/nodejs/gpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-gpu.js","files":75,"inputBytes":655455,"outputBytes":307478}
2022-08-15 11:36:04 STATE: Compile: {"name":"tfjs/nodejs/wasm","format":"cjs","platform":"node","input":"tfjs/tf-node-wasm.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":149,"outputBytes":664}
2022-08-15 11:36:04 STATE: Compile: {"name":"human/nodejs/wasm","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-wasm.js","files":75,"inputBytes":655507,"outputBytes":307528}
2022-08-15 11:36:04 STATE: Compile: {"name":"tfjs/browser/version","format":"esm","platform":"browser","input":"tfjs/tf-version.ts","output":"dist/tfjs.version.js","files":1,"inputBytes":1069,"outputBytes":358}
2022-08-15 11:36:04 STATE: Compile: {"name":"tfjs/browser/esm/nobundle","format":"esm","platform":"browser","input":"tfjs/tf-browser.ts","output":"dist/tfjs.esm.js","files":2,"inputBytes":1032,"outputBytes":583}
2022-08-15 11:36:04 STATE: Compile: {"name":"human/browser/esm/nobundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm-nobundle.js","files":75,"inputBytes":655426,"outputBytes":306323}
2022-08-15 11:36:04 STATE: Compile: {"name":"tfjs/browser/esm/custom","format":"esm","platform":"browser","input":"tfjs/tf-custom.ts","output":"dist/tfjs.esm.js","files":11,"inputBytes":1271,"outputBytes":2787569}
2022-08-15 11:36:04 STATE: Compile: {"name":"human/browser/iife/bundle","format":"iife","platform":"browser","input":"src/human.ts","output":"dist/human.js","files":75,"inputBytes":3442412,"outputBytes":1669183}
2022-08-15 11:36:04 STATE: Compile: {"name":"human/browser/esm/bundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm.js","files":75,"inputBytes":3442412,"outputBytes":3073108}
2022-08-15 11:36:09 STATE: Typings: {"input":"src/human.ts","output":"types/lib","files":30}
2022-08-15 11:36:11 STATE: TypeDoc: {"input":"src/human.ts","output":"typedoc","objects":77,"generated":true}
2022-08-15 11:36:11 STATE: Compile: {"name":"demo/typescript","format":"esm","platform":"browser","input":"demo/typescript/index.ts","output":"demo/typescript/index.js","files":1,"inputBytes":6716,"outputBytes":3141}
2022-08-15 11:36:11 STATE: Compile: {"name":"demo/faceid","format":"esm","platform":"browser","input":"demo/faceid/index.ts","output":"demo/faceid/index.js","files":2,"inputBytes":15629,"outputBytes":7798}
2022-08-15 11:36:19 STATE: Lint: {"locations":["*.json","src/**/*.ts","test/**/*.js","demo/**/*.js"],"files":109,"errors":0,"warnings":0}
2022-08-15 11:36:19 STATE: ChangeLog: {"repository":"https://github.com/vladmandic/human","branch":"main","output":"CHANGELOG.md"}
2022-08-15 11:36:19 STATE: Copy: {"input":"tfjs/tfjs.esm.d.ts"}
2022-08-15 11:36:19 INFO:  Done...
2022-08-15 11:36:20 STATE: API-Extractor: {"succeeeded":true,"errors":0,"warnings":198}
2022-08-15 11:36:20 STATE: Copy: {"input":"types/human.d.ts"}
2022-08-15 11:36:20 INFO:  Analyze models: {"folders":8,"result":"models/models.json"}
2022-08-15 11:36:20 STATE: Models {"folder":"./models","models":13}
2022-08-15 11:36:20 STATE: Models {"folder":"../human-models/models","models":42}
2022-08-15 11:36:20 STATE: Models {"folder":"../blazepose/model/","models":4}
2022-08-15 11:36:20 STATE: Models {"folder":"../anti-spoofing/model","models":1}
2022-08-15 11:36:20 STATE: Models {"folder":"../efficientpose/models","models":3}
2022-08-15 11:36:20 STATE: Models {"folder":"../insightface/models","models":5}
2022-08-15 11:36:20 STATE: Models {"folder":"../movenet/models","models":3}
2022-08-15 11:36:20 STATE: Models {"folder":"../nanodet/models","models":4}
2022-08-15 11:36:20 STATE: Models: {"count":57,"totalSize":383017442}
2022-08-15 11:36:20 INFO:  Human Build complete... {"logFile":"test/build.log"}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -68,7 +68,7 @@
<li class="tsd-description">
<h4 class="tsd-returns-title">Returns <a href="Env.html" class="tsd-signature-type" data-tsd-kind="Class">Env</a></h4><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L85">src/util/env.ts:85</a></li></ul></aside></li></ul></section></section>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L89">src/util/env.ts:89</a></li></ul></aside></li></ul></section></section>
<section class="tsd-panel-group tsd-member-group">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="Canvas" class="tsd-anchor"></a>
@ -77,21 +77,21 @@
<div class="tsd-comment tsd-typography"><p>MonkeyPatch for Canvas</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L79">src/util/env.ts:79</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L83">src/util/env.ts:83</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="Image" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>Image</span><a href="#Image" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">Image<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">undefined</span></div>
<div class="tsd-comment tsd-typography"><p>MonkeyPatch for Image</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L81">src/util/env.ts:81</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L85">src/util/env.ts:85</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="ImageData" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>Image<wbr/>Data</span><a href="#ImageData" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">Image<wbr/>Data<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">undefined</span></div>
<div class="tsd-comment tsd-typography"><p>MonkeyPatch for ImageData</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L83">src/util/env.ts:83</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L87">src/util/env.ts:87</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="agent" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>agent</span><a href="#agent" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">agent<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &#39;&#39;</span></div>
@ -126,7 +126,7 @@
<li class="tsd-parameter">
<h5>model<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span></h5></li></ul></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L69">src/util/env.ts:69</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L73">src/util/env.ts:73</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="filter" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>filter</span><a href="#filter" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">filter<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">boolean</span></div>
@ -147,7 +147,7 @@
<div class="tsd-comment tsd-typography"><p>List of supported kernels for current backend</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L77">src/util/env.ts:77</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L81">src/util/env.ts:81</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="node" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>node</span><a href="#node" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">node<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
@ -178,13 +178,15 @@
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L13">src/util/env.ts:13</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="tensorflow" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>tensorflow</span><a href="#tensorflow" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">tensorflow<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>version<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol"> = ...</span></div>
<div class="tsd-comment tsd-typography"><p>If using tfjs-node get version of underlying tensorflow shared library</p>
<div class="tsd-signature">tensorflow<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>gpu<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>version<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol"> = ...</span></div>
<div class="tsd-comment tsd-typography"><p>If using tfjs-node get version of underlying tensorflow shared library and if gpu acceleration is enabled</p>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>gpu<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">boolean</span></h5></li>
<li class="tsd-parameter">
<h5>version<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span></h5></li></ul></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L31">src/util/env.ts:31</a></li></ul></aside></section>
@ -217,7 +219,7 @@
<li class="tsd-parameter">
<h5>supported<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">boolean</span></h5></li></ul></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L35">src/util/env.ts:35</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L39">src/util/env.ts:39</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="webgl" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>webgl</span><a href="#webgl" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">webgl<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>backend<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>renderer<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>supported<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>version<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol"> = ...</span></div>
@ -235,7 +237,7 @@
<li class="tsd-parameter">
<h5>version<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span></h5></li></ul></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L47">src/util/env.ts:47</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L51">src/util/env.ts:51</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="webgpu" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>webgpu</span><a href="#webgpu" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">webgpu<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>adapter<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>backend<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>supported<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol"> = ...</span></div>
@ -251,7 +253,7 @@
<li class="tsd-parameter">
<h5>supported<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">boolean</span></h5></li></ul></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L59">src/util/env.ts:59</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L63">src/util/env.ts:63</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="worker" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>worker</span><a href="#worker" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">worker<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
@ -270,7 +272,7 @@
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L119">src/util/env.ts:119</a></li></ul></aside></li></ul></section>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L123">src/util/env.ts:123</a></li></ul></aside></li></ul></section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="updateCPU" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>updateCPU</span><a href="#updateCPU" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
@ -280,7 +282,7 @@
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L157">src/util/env.ts:157</a></li></ul></aside></li></ul></section></section></div>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L164">src/util/env.ts:164</a></li></ul></aside></li></ul></section></section></div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<div class="tsd-navigation settings">
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">

View File

@ -15,7 +15,7 @@
<h1>Variable env<code class="tsd-tag ts-flagConst">Const</code> </h1></div>
<div class="tsd-signature">env<span class="tsd-signature-symbol">:</span> <a href="../classes/Env.html" class="tsd-signature-type" data-tsd-kind="Class">Env</a><span class="tsd-signature-symbol"> = ...</span></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L176">src/util/env.ts:176</a></li></ul></aside></div>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/util/env.ts#L183">src/util/env.ts:183</a></li></ul></aside></div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<div class="tsd-navigation settings">
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">

3
types/human.d.ts vendored
View File

@ -449,9 +449,10 @@ export declare class Env {
offscreen: undefined | boolean;
/** Are performance counter instant values or additive */
perfadd: boolean;
/** If using tfjs-node get version of underlying tensorflow shared library */
/** If using tfjs-node get version of underlying tensorflow shared library and if gpu acceleration is enabled */
tensorflow: {
version: undefined | string;
gpu: undefined | boolean;
};
/** WASM detected capabilities */
wasm: {