add model load exception handling

pull/293/head
Vladimir Mandic 2022-08-30 10:34:56 -04:00
parent 22755355f7
commit 1d00e154b0
28 changed files with 5418 additions and 63352 deletions

View File

@ -158,6 +158,7 @@
"dist",
"demo/helpers/*.js",
"demo/typescript/*.js",
"demo/faceid/*.js"
"demo/faceid/*.js",
"typedoc"
]
}

View File

@ -9,7 +9,10 @@
## Changelog
### **HEAD -> main** 2022/08/24 mandic00@live.com
### **HEAD -> main** 2022/08/30 mandic00@live.com
### **origin/main** 2022/08/28 mandic00@live.com
- expand type safety
- full eslint rule rewrite

View File

@ -350,7 +350,7 @@ For more info, see [**Configuration Details**](https://github.com/vladmandic/hum
<br><hr><br>
`Human` library is written in `TypeScript` [4.7](https://www.typescriptlang.org/docs/handbook/intro.html)
`Human` library is written in `TypeScript` [4.8](https://www.typescriptlang.org/docs/handbook/intro.html)
Conforming to latest `JavaScript` [ECMAScript version 2022](https://262.ecma-international.org/) standard
Build target is `JavaScript` [EMCAScript version 2018](https://262.ecma-international.org/11.0/)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -4,109 +4,6 @@
author: <https://github.com/vladmandic>'
*/
// demo/typescript/index.ts
import * as H from "../../dist/human.esm.js";
var humanConfig = {
async: false,
modelBasePath: "../../models",
filter: { enabled: true, equalization: false, flip: false },
face: { enabled: true, detector: { rotation: false }, mesh: { enabled: true }, attention: { enabled: false }, iris: { enabled: true }, description: { enabled: true }, emotion: { enabled: true } },
body: { enabled: true },
hand: { enabled: true },
object: { enabled: false },
gesture: { enabled: true }
};
var human = new H.Human(humanConfig);
human.env.perfadd = false;
human.draw.options.font = 'small-caps 18px "Lato"';
human.draw.options.lineHeight = 20;
var dom = {
video: document.getElementById("video"),
canvas: document.getElementById("canvas"),
log: document.getElementById("log"),
fps: document.getElementById("status"),
perf: document.getElementById("performance")
};
var timestamp = { detect: 0, draw: 0, tensors: 0, start: 0 };
var fps = { detectFPS: 0, drawFPS: 0, frames: 0, averageMs: 0 };
var log = (...msg) => {
dom.log.innerText += msg.join(" ") + "\n";
console.log(...msg);
};
var status = (msg) => dom.fps.innerText = msg;
var perf = (msg) => dom.perf.innerText = "tensors:" + human.tf.memory().numTensors.toString() + " | performance: " + JSON.stringify(msg).replace(/"|{|}/g, "").replace(/,/g, " | ");
async function webCam() {
status("starting webcam...");
const options = { audio: false, video: { facingMode: "user", resizeMode: "none", width: { ideal: document.body.clientWidth }, height: { ideal: document.body.clientHeight } } };
const stream = await navigator.mediaDevices.getUserMedia(options);
const ready = new Promise((resolve) => {
dom.video.onloadeddata = () => resolve(true);
});
dom.video.srcObject = stream;
void dom.video.play();
await ready;
dom.canvas.width = dom.video.videoWidth;
dom.canvas.height = dom.video.videoHeight;
const track = stream.getVideoTracks()[0];
const capabilities = track.getCapabilities ? track.getCapabilities() : "";
const settings = track.getSettings ? track.getSettings() : "";
const constraints = track.getConstraints ? track.getConstraints() : "";
log("video:", dom.video.videoWidth, dom.video.videoHeight, track.label, { stream, track, settings, constraints, capabilities });
dom.canvas.onclick = () => {
if (dom.video.paused)
void dom.video.play();
else
dom.video.pause();
};
}
async function detectionLoop() {
if (!dom.video.paused) {
if (timestamp.start === 0)
timestamp.start = human.now();
await human.detect(dom.video);
const tensors = human.tf.memory().numTensors;
if (tensors - timestamp.tensors !== 0)
log("allocated tensors:", tensors - timestamp.tensors);
timestamp.tensors = tensors;
fps.detectFPS = Math.round(1e3 * 1e3 / (human.now() - timestamp.detect)) / 1e3;
fps.frames++;
fps.averageMs = Math.round(1e3 * (human.now() - timestamp.start) / fps.frames) / 1e3;
if (fps.frames % 100 === 0 && !dom.video.paused)
log("performance", { ...fps, tensors: timestamp.tensors });
}
timestamp.detect = human.now();
requestAnimationFrame(detectionLoop);
}
async function drawLoop() {
if (!dom.video.paused) {
const interpolated = human.next(human.result);
if (human.config.filter.flip)
human.draw.canvas(interpolated.canvas, dom.canvas);
else
human.draw.canvas(dom.video, dom.canvas);
await human.draw.all(dom.canvas, interpolated);
perf(interpolated.performance);
}
const now = human.now();
fps.drawFPS = Math.round(1e3 * 1e3 / (now - timestamp.draw)) / 1e3;
timestamp.draw = now;
status(dom.video.paused ? "paused" : `fps: ${fps.detectFPS.toFixed(1).padStart(5, " ")} detect | ${fps.drawFPS.toFixed(1).padStart(5, " ")} draw`);
setTimeout(drawLoop, 30);
}
async function main() {
log("human version:", human.version, "| tfjs version:", human.tf.version["tfjs-core"]);
log("platform:", human.env.platform, "| agent:", human.env.agent);
status("loading...");
await human.load();
log("backend:", human.tf.getBackend(), "| available:", human.env.backends);
log("models stats:", human.getModelStats());
log("models loaded:", Object.values(human.models).filter((model) => model !== null).length);
status("initializing...");
await human.warmup();
await webCam();
await detectionLoop();
await drawLoop();
}
window.onload = main;
import*as c from"../../dist/human.esm.js";var w={async:!1,modelBasePath:"../../models",filter:{enabled:!0,equalization:!1,flip:!1},face:{enabled:!0,detector:{rotation:!1},mesh:{enabled:!0},attention:{enabled:!1},iris:{enabled:!0},description:{enabled:!0},emotion:{enabled:!0}},body:{enabled:!0},hand:{enabled:!0},object:{enabled:!1},gesture:{enabled:!0}},e=new c.Human(w);e.env.perfadd=!1;e.draw.options.font='small-caps 18px "Lato"';e.draw.options.lineHeight=20;var t={video:document.getElementById("video"),canvas:document.getElementById("canvas"),log:document.getElementById("log"),fps:document.getElementById("status"),perf:document.getElementById("performance")},n={detect:0,draw:0,tensors:0,start:0},o={detectFPS:0,drawFPS:0,frames:0,averageMs:0},i=(...a)=>{t.log.innerText+=a.join(" ")+`
`,console.log(...a)},r=a=>t.fps.innerText=a,b=a=>t.perf.innerText="tensors:"+e.tf.memory().numTensors.toString()+" | performance: "+JSON.stringify(a).replace(/"|{|}/g,"").replace(/,/g," | ");async function h(){r("starting webcam...");let a={audio:!1,video:{facingMode:"user",resizeMode:"none",width:{ideal:document.body.clientWidth},height:{ideal:document.body.clientHeight}}},d=await navigator.mediaDevices.getUserMedia(a),f=new Promise(p=>{t.video.onloadeddata=()=>p(!0)});t.video.srcObject=d,t.video.play(),await f,t.canvas.width=t.video.videoWidth,t.canvas.height=t.video.videoHeight;let s=d.getVideoTracks()[0],v=s.getCapabilities?s.getCapabilities():"",g=s.getSettings?s.getSettings():"",u=s.getConstraints?s.getConstraints():"";i("video:",t.video.videoWidth,t.video.videoHeight,s.label,{stream:d,track:s,settings:g,constraints:u,capabilities:v}),t.canvas.onclick=()=>{t.video.paused?t.video.play():t.video.pause()}}async function l(){if(!t.video.paused){n.start===0&&(n.start=e.now()),await e.detect(t.video);let a=e.tf.memory().numTensors;a-n.tensors!==0&&i("allocated tensors:",a-n.tensors),n.tensors=a,o.detectFPS=Math.round(1e3*1e3/(e.now()-n.detect))/1e3,o.frames++,o.averageMs=Math.round(1e3*(e.now()-n.start)/o.frames)/1e3,o.frames%100===0&&!t.video.paused&&i("performance",{...o,tensors:n.tensors})}n.detect=e.now(),requestAnimationFrame(l)}async function m(){if(!t.video.paused){let d=e.next(e.result);e.config.filter.flip?e.draw.canvas(d.canvas,t.canvas):e.draw.canvas(t.video,t.canvas),await e.draw.all(t.canvas,d),b(d.performance)}let a=e.now();o.drawFPS=Math.round(1e3*1e3/(a-n.draw))/1e3,n.draw=a,r(t.video.paused?"paused":`fps: ${o.detectFPS.toFixed(1).padStart(5," ")} detect | ${o.drawFPS.toFixed(1).padStart(5," ")} draw`),setTimeout(m,30)}async function M(){i("human version:",e.version,"| tfjs version:",e.tf.version["tfjs-core"]),i("platform:",e.env.platform,"| agent:",e.env.agent),r("loading..."),await e.load(),i("backend:",e.tf.getBackend(),"| available:",e.env.backends),i("models stats:",e.getModelStats()),i("models loaded:",Object.values(e.models).filter(a=>a!==null).length),r("initializing..."),await e.warmup(),await h(),await l(),await m()}window.onload=M;
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

4
dist/human.d.ts vendored
View File

@ -212,6 +212,10 @@ export declare interface Config {
* default: 0.7
*/
cacheSensitivity: number;
/** Software Kernels
* Registers software kernel ops running on CPU when accelerated version of kernel is not found in the current backend
*/
softwareKernels: boolean;
/** Perform immediate garbage collection on deallocated tensors instead of caching them */
deallocate: boolean;
/** Internal Variable */

View File

@ -212,6 +212,10 @@ export declare interface Config {
* default: 0.7
*/
cacheSensitivity: number;
/** Software Kernels
* Registers software kernel ops running on CPU when accelerated version of kernel is not found in the current backend
*/
softwareKernels: boolean;
/** Perform immediate garbage collection on deallocated tensors instead of caching them */
deallocate: boolean;
/** Internal Variable */

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

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

@ -212,6 +212,10 @@ export declare interface Config {
* default: 0.7
*/
cacheSensitivity: number;
/** Software Kernels
* Registers software kernel ops running on CPU when accelerated version of kernel is not found in the current backend
*/
softwareKernels: boolean;
/** Perform immediate garbage collection on deallocated tensors instead of caching them */
deallocate: boolean;
/** Internal Variable */

5794
dist/human.esm.js vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -212,6 +212,10 @@ export declare interface Config {
* default: 0.7
*/
cacheSensitivity: number;
/** Software Kernels
* Registers software kernel ops running on CPU when accelerated version of kernel is not found in the current backend
*/
softwareKernels: boolean;
/** Perform immediate garbage collection on deallocated tensors instead of caching them */
deallocate: boolean;
/** Internal Variable */

13984
dist/human.node-gpu.js vendored

File diff suppressed because one or more lines are too long

View File

@ -212,6 +212,10 @@ export declare interface Config {
* default: 0.7
*/
cacheSensitivity: number;
/** Software Kernels
* Registers software kernel ops running on CPU when accelerated version of kernel is not found in the current backend
*/
softwareKernels: boolean;
/** Perform immediate garbage collection on deallocated tensors instead of caching them */
deallocate: boolean;
/** Internal Variable */

13985
dist/human.node-wasm.js vendored

File diff suppressed because one or more lines are too long

View File

@ -212,6 +212,10 @@ export declare interface Config {
* default: 0.7
*/
cacheSensitivity: number;
/** Software Kernels
* Registers software kernel ops running on CPU when accelerated version of kernel is not found in the current backend
*/
softwareKernels: boolean;
/** Perform immediate garbage collection on deallocated tensors instead of caching them */
deallocate: boolean;
/** Internal Variable */

13984
dist/human.node.js vendored

File diff suppressed because one or more lines are too long

4684
dist/tfjs.esm.js vendored

File diff suppressed because it is too large Load Diff

36
dist/tfjs.version.js vendored
View File

@ -4,38 +4,4 @@
author: <https://github.com/vladmandic>'
*/
// node_modules/.pnpm/@tensorflow+tfjs@3.20.0_seedrandom@3.0.5/node_modules/@tensorflow/tfjs/package.json
var version = "3.20.0";
// node_modules/.pnpm/@tensorflow+tfjs-core@3.20.0/node_modules/@tensorflow/tfjs-core/package.json
var version2 = "3.20.0";
// node_modules/.pnpm/@tensorflow+tfjs-data@3.20.0_k7dauiu3y265wd6lcplf62oi7i/node_modules/@tensorflow/tfjs-data/package.json
var version3 = "3.20.0";
// node_modules/.pnpm/@tensorflow+tfjs-layers@3.20.0_au2niqrxqvhsnv4oetlud656gy/node_modules/@tensorflow/tfjs-layers/package.json
var version4 = "3.20.0";
// node_modules/.pnpm/@tensorflow+tfjs-converter@3.20.0_au2niqrxqvhsnv4oetlud656gy/node_modules/@tensorflow/tfjs-converter/package.json
var version5 = "3.20.0";
// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.20.0_au2niqrxqvhsnv4oetlud656gy/node_modules/@tensorflow/tfjs-backend-webgl/package.json
var version6 = "3.20.0";
// node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.20.0_au2niqrxqvhsnv4oetlud656gy/node_modules/@tensorflow/tfjs-backend-wasm/package.json
var version7 = "3.20.0";
// tfjs/tf-version.ts
var version8 = {
tfjs: version,
"tfjs-core": version2,
"tfjs-data": version3,
"tfjs-layers": version4,
"tfjs-converter": version5,
"tfjs-backend-webgl": version6,
"tfjs-backend-wasm": version7
};
export {
version8 as version
};
var e="3.20.0";var s="3.20.0";var t="3.20.0";var i="3.20.0";var n="3.20.0";var r="3.20.0";var l="3.20.0";var V={tfjs:e,"tfjs-core":s,"tfjs-data":t,"tfjs-layers":i,"tfjs-converter":n,"tfjs-backend-webgl":r,"tfjs-backend-wasm":l};export{V as version};

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -25,7 +25,7 @@
<h5>newInstance: <a href="../classes/Human.html" class="tsd-signature-type" data-tsd-kind="Class">Human</a></h5></li></ul></div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">{ </span>missing<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>name<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></h4><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/models.ts#L183">src/models.ts:183</a></li></ul></aside></li></ul></section></div>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/models.ts#L185">src/models.ts:185</a></li></ul></aside></li></ul></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

@ -46,6 +46,7 @@ Defaults: <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L
<a href="Config.html#object" class="tsd-index-link tsd-kind-property tsd-parent-kind-interface"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg><span>object</span></a>
<a href="Config.html#segmentation" class="tsd-index-link tsd-kind-property tsd-parent-kind-interface"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg><span>segmentation</span></a>
<a href="Config.html#skipAllowed" class="tsd-index-link tsd-kind-property tsd-parent-kind-interface"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg><span>skip<wbr/>Allowed</span></a>
<a href="Config.html#softwareKernels" class="tsd-index-link tsd-kind-property tsd-parent-kind-interface"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg><span>software<wbr/>Kernels</span></a>
<a href="Config.html#validateModels" class="tsd-index-link tsd-kind-property tsd-parent-kind-interface"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg><span>validate<wbr/>Models</span></a>
<a href="Config.html#warmup" class="tsd-index-link tsd-kind-property tsd-parent-kind-interface"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg><span>warmup</span></a>
<a href="Config.html#wasmPath" class="tsd-index-link tsd-kind-property tsd-parent-kind-interface"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg><span>wasm<wbr/>Path</span></a>
@ -80,7 +81,7 @@ default: <code>humangl</code> for browser and <code>tensorflow</code> for nodejs
<div class="tsd-comment tsd-typography"><p>Body config <a href="BodyConfig.html">BodyConfig</a></p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L305">src/config.ts:305</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L310">src/config.ts:310</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="cacheModels" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>cache<wbr/>Models</span><a href="#cacheModels" 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">cache<wbr/>Models<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
@ -107,7 +108,7 @@ default: true if indexdb is available (browsers), false if its not (nodejs)</p>
<div class="tsd-comment tsd-typography"><p>Perform immediate garbage collection on deallocated tensors instead of caching them</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L290">src/config.ts:290</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L295">src/config.ts:295</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="debug" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>debug</span><a href="#debug" 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">debug<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
@ -122,28 +123,28 @@ default: true if indexdb is available (browsers), false if its not (nodejs)</p>
<div class="tsd-comment tsd-typography"><p>Face config <a href="FaceConfig.html">FaceConfig</a></p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L302">src/config.ts:302</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L307">src/config.ts:307</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><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">Partial</span><span class="tsd-signature-symbol">&lt;</span><a href="FilterConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">FilterConfig</a><span class="tsd-signature-symbol">&gt;</span></div>
<div class="tsd-comment tsd-typography"><p>Filter config <a href="FilterConfig.html">FilterConfig</a></p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L296">src/config.ts:296</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L301">src/config.ts:301</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="gesture" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>gesture</span><a href="#gesture" 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">gesture<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol">&lt;</span><a href="GestureConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">GestureConfig</a><span class="tsd-signature-symbol">&gt;</span></div>
<div class="tsd-comment tsd-typography"><p>Gesture config <a href="GestureConfig.html">GestureConfig</a></p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L299">src/config.ts:299</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L304">src/config.ts:304</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="hand" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>hand</span><a href="#hand" 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">hand<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol">&lt;</span><a href="HandConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">HandConfig</a><span class="tsd-signature-symbol">&gt;</span></div>
<div class="tsd-comment tsd-typography"><p>Hand config <a href="HandConfig.html">HandConfig</a></p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L308">src/config.ts:308</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L313">src/config.ts:313</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="modelBasePath" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>model<wbr/>Base<wbr/>Path</span><a href="#modelBasePath" 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">model<wbr/>Base<wbr/>Path<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
@ -161,21 +162,29 @@ default: true if indexdb is available (browsers), false if its not (nodejs)</p>
<div class="tsd-comment tsd-typography"><p>Object config <a href="ObjectConfig.html">ObjectConfig</a></p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L311">src/config.ts:311</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L316">src/config.ts:316</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="segmentation" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>segmentation</span><a href="#segmentation" 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">segmentation<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol">&lt;</span><a href="SegmentationConfig.html" class="tsd-signature-type" data-tsd-kind="Interface">SegmentationConfig</a><span class="tsd-signature-symbol">&gt;</span></div>
<div class="tsd-comment tsd-typography"><p>Segmentation config <a href="SegmentationConfig.html">SegmentationConfig</a></p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L314">src/config.ts:314</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L319">src/config.ts:319</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="skipAllowed" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>skip<wbr/>Allowed</span><a href="#skipAllowed" 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">skip<wbr/>Allowed<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<div class="tsd-comment tsd-typography"><p>Internal Variable</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L293">src/config.ts:293</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L298">src/config.ts:298</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="softwareKernels" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>software<wbr/>Kernels</span><a href="#softwareKernels" 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">software<wbr/>Kernels<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<div class="tsd-comment tsd-typography"><p>Software Kernels
Registers software kernel ops running on CPU when accelerated version of kernel is not found in the current backend</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L292">src/config.ts:292</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="validateModels" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>validate<wbr/>Models</span><a href="#validateModels" 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">validate<wbr/>Models<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
@ -254,6 +263,7 @@ any errors will be printed on console but will be treated as non-fatal</p>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#object" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg>object</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#segmentation" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg>segmentation</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#skipAllowed" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg>skip<wbr/>Allowed</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#softwareKernels" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg>software<wbr/>Kernels</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#validateModels" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg>validate<wbr/>Models</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#warmup" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg>warmup</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="Config.html#wasmPath" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg>wasm<wbr/>Path</a></li>

View File

@ -19,7 +19,7 @@
</ul>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L318">src/config.ts:318</a></li></ul></aside></div>
<li>Defined in <a href="https://github.com/vladmandic/human/blob/main/src/config.ts#L323">src/config.ts:323</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">

4
types/human.d.ts vendored
View File

@ -212,6 +212,10 @@ export declare interface Config {
* default: 0.7
*/
cacheSensitivity: number;
/** Software Kernels
* Registers software kernel ops running on CPU when accelerated version of kernel is not found in the current backend
*/
softwareKernels: boolean;
/** Perform immediate garbage collection on deallocated tensors instead of caching them */
deallocate: boolean;
/** Internal Variable */