fix interpolation overflow

pull/193/head
Vladimir Mandic 2021-08-18 14:28:31 -04:00
parent d015677efa
commit db00c45278
10 changed files with 33 additions and 33 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
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

2
dist/human.js vendored

File diff suppressed because one or more lines are too long

View File

@ -10549,7 +10549,7 @@ function calc(newResult) {
if (!newResult) if (!newResult)
return { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0 }; return { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0 };
const elapsed = Date.now() - newResult.timestamp; const elapsed = Date.now() - newResult.timestamp;
const bufferedFactor = elapsed < 1e3 ? 8 - Math.log(elapsed) : 1; const bufferedFactor = elapsed < 1e3 ? 8 - Math.log(elapsed + 1) : 1;
bufferedResult.canvas = newResult.canvas; bufferedResult.canvas = newResult.canvas;
if (!bufferedResult.body || newResult.body.length !== bufferedResult.body.length) { if (!bufferedResult.body || newResult.body.length !== bufferedResult.body.length) {
bufferedResult.body = JSON.parse(JSON.stringify(newResult.body)); bufferedResult.body = JSON.parse(JSON.stringify(newResult.body));

View File

@ -10550,7 +10550,7 @@ function calc(newResult) {
if (!newResult) if (!newResult)
return { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0 }; return { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0 };
const elapsed = Date.now() - newResult.timestamp; const elapsed = Date.now() - newResult.timestamp;
const bufferedFactor = elapsed < 1e3 ? 8 - Math.log(elapsed) : 1; const bufferedFactor = elapsed < 1e3 ? 8 - Math.log(elapsed + 1) : 1;
bufferedResult.canvas = newResult.canvas; bufferedResult.canvas = newResult.canvas;
if (!bufferedResult.body || newResult.body.length !== bufferedResult.body.length) { if (!bufferedResult.body || newResult.body.length !== bufferedResult.body.length) {
bufferedResult.body = JSON.parse(JSON.stringify(newResult.body)); bufferedResult.body = JSON.parse(JSON.stringify(newResult.body));

2
dist/human.node.js vendored
View File

@ -10549,7 +10549,7 @@ function calc(newResult) {
if (!newResult) if (!newResult)
return { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0 }; return { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0 };
const elapsed = Date.now() - newResult.timestamp; const elapsed = Date.now() - newResult.timestamp;
const bufferedFactor = elapsed < 1e3 ? 8 - Math.log(elapsed) : 1; const bufferedFactor = elapsed < 1e3 ? 8 - Math.log(elapsed + 1) : 1;
bufferedResult.canvas = newResult.canvas; bufferedResult.canvas = newResult.canvas;
if (!bufferedResult.body || newResult.body.length !== bufferedResult.body.length) { if (!bufferedResult.body || newResult.body.length !== bufferedResult.body.length) {
bufferedResult.body = JSON.parse(JSON.stringify(newResult.body)); bufferedResult.body = JSON.parse(JSON.stringify(newResult.body));

View File

@ -1,22 +1,22 @@
2021-08-17 18:48:58 INFO:  @vladmandic/human version 2.1.3 2021-08-18 14:27:34 INFO:  @vladmandic/human version 2.1.3
2021-08-17 18:48:58 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.5.0 2021-08-18 14:27:34 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.5.0
2021-08-17 18:48:58 INFO:  Toolchain: {"tfjs":"3.8.0","esbuild":"0.12.20","typescript":"4.3.5","typedoc":"0.21.5","eslint":"7.32.0"} 2021-08-18 14:27:34 INFO:  Toolchain: {"tfjs":"3.8.0","esbuild":"0.12.20","typescript":"4.3.5","typedoc":"0.21.5","eslint":"7.32.0"}
2021-08-17 18:48:58 INFO:  Clean: ["dist/*","types/*","typedoc/*"] 2021-08-18 14:27:34 INFO:  Clean: ["dist/*","types/*","typedoc/*"]
2021-08-17 18:48:58 INFO:  Build: file startup all type: production config: {"minifyWhitespace":true,"minifyIdentifiers":true,"minifySyntax":true} 2021-08-18 14:27:34 INFO:  Build: file startup all type: production config: {"minifyWhitespace":true,"minifyIdentifiers":true,"minifySyntax":true}
2021-08-17 18:48:58 STATE: target: node type: tfjs: {"imports":1,"importBytes":102,"outputBytes":1303,"outputFiles":"dist/tfjs.esm.js"} 2021-08-18 14:27:34 STATE: target: node type: tfjs: {"imports":1,"importBytes":102,"outputBytes":1303,"outputFiles":"dist/tfjs.esm.js"}
2021-08-17 18:48:58 STATE: target: node type: node: {"imports":42,"importBytes":436902,"outputBytes":379817,"outputFiles":"dist/human.node.js"} 2021-08-18 14:27:34 STATE: target: node type: node: {"imports":42,"importBytes":436906,"outputBytes":379821,"outputFiles":"dist/human.node.js"}
2021-08-17 18:48:58 STATE: target: nodeGPU type: tfjs: {"imports":1,"importBytes":110,"outputBytes":1311,"outputFiles":"dist/tfjs.esm.js"} 2021-08-18 14:27:34 STATE: target: nodeGPU type: tfjs: {"imports":1,"importBytes":110,"outputBytes":1311,"outputFiles":"dist/tfjs.esm.js"}
2021-08-17 18:48:58 STATE: target: nodeGPU type: node: {"imports":42,"importBytes":436910,"outputBytes":379821,"outputFiles":"dist/human.node-gpu.js"} 2021-08-18 14:27:34 STATE: target: nodeGPU type: node: {"imports":42,"importBytes":436914,"outputBytes":379825,"outputFiles":"dist/human.node-gpu.js"}
2021-08-17 18:48:58 STATE: target: nodeWASM type: tfjs: {"imports":1,"importBytes":149,"outputBytes":1378,"outputFiles":"dist/tfjs.esm.js"} 2021-08-18 14:27:34 STATE: target: nodeWASM type: tfjs: {"imports":1,"importBytes":149,"outputBytes":1378,"outputFiles":"dist/tfjs.esm.js"}
2021-08-17 18:48:58 STATE: target: nodeWASM type: node: {"imports":42,"importBytes":436977,"outputBytes":379893,"outputFiles":"dist/human.node-wasm.js"} 2021-08-18 14:27:34 STATE: target: nodeWASM type: node: {"imports":42,"importBytes":436981,"outputBytes":379897,"outputFiles":"dist/human.node-wasm.js"}
2021-08-17 18:48:58 STATE: target: browserNoBundle type: tfjs: {"imports":1,"importBytes":2168,"outputBytes":1242,"outputFiles":"dist/tfjs.esm.js"} 2021-08-18 14:27:34 STATE: target: browserNoBundle type: tfjs: {"imports":1,"importBytes":2168,"outputBytes":1242,"outputFiles":"dist/tfjs.esm.js"}
2021-08-17 18:48:58 STATE: target: browserNoBundle type: esm: {"imports":42,"importBytes":436841,"outputBytes":249178,"outputFiles":"dist/human.esm-nobundle.js"} 2021-08-18 14:27:34 STATE: target: browserNoBundle type: esm: {"imports":42,"importBytes":436845,"outputBytes":249180,"outputFiles":"dist/human.esm-nobundle.js"}
2021-08-17 18:48:59 STATE: target: browserBundle type: tfjs: {"modules":1170,"moduleBytes":4145868,"imports":7,"importBytes":2168,"outputBytes":2334701,"outputFiles":"dist/tfjs.esm.js"} 2021-08-18 14:27:35 STATE: target: browserBundle type: tfjs: {"modules":1170,"moduleBytes":4145868,"imports":7,"importBytes":2168,"outputBytes":2334701,"outputFiles":"dist/tfjs.esm.js"}
2021-08-17 18:48:59 STATE: target: browserBundle type: iife: {"imports":42,"importBytes":2770300,"outputBytes":1379546,"outputFiles":"dist/human.js"} 2021-08-18 14:27:35 STATE: target: browserBundle type: iife: {"imports":42,"importBytes":2770304,"outputBytes":1379548,"outputFiles":"dist/human.js"}
2021-08-17 18:49:00 STATE: target: browserBundle type: esm: {"imports":42,"importBytes":2770300,"outputBytes":1379538,"outputFiles":"dist/human.esm.js"} 2021-08-18 14:27:35 STATE: target: browserBundle type: esm: {"imports":42,"importBytes":2770304,"outputBytes":1379540,"outputFiles":"dist/human.esm.js"}
2021-08-17 18:49:00 INFO:  Running Linter: ["server/","src/","tfjs/","test/","demo/"] 2021-08-18 14:27:35 INFO:  Running Linter: ["server/","src/","tfjs/","test/","demo/"]
2021-08-17 18:49:20 INFO:  Linter complete: files: 77 errors: 0 warnings: 0 2021-08-18 14:27:55 INFO:  Linter complete: files: 77 errors: 0 warnings: 0
2021-08-17 18:49:20 INFO:  Generate ChangeLog: ["/home/vlado/dev/human/CHANGELOG.md"] 2021-08-18 14:27:55 INFO:  Generate ChangeLog: ["/home/vlado/dev/human/CHANGELOG.md"]
2021-08-17 18:49:20 INFO:  Generate Typings: ["src/human.ts"] outDir: ["types"] 2021-08-18 14:27:55 INFO:  Generate Typings: ["src/human.ts"] outDir: ["types"]
2021-08-17 18:49:32 INFO:  Generate TypeDocs: ["src/human.ts"] outDir: ["typedoc"] 2021-08-18 14:28:08 INFO:  Generate TypeDocs: ["src/human.ts"] outDir: ["typedoc"]
2021-08-17 18:49:43 INFO:  Documentation generated at /home/vlado/dev/human/typedoc 1 2021-08-18 14:28:19 INFO:  Documentation generated at /home/vlado/dev/human/typedoc 1

View File

@ -20,7 +20,7 @@ export function calc(newResult: Result): Result {
// - at 500ms delay buffer = ~1.8 => 55% towards live data // - at 500ms delay buffer = ~1.8 => 55% towards live data
// - at 750ms delay buffer = ~1.4 => 71% towards live data // - at 750ms delay buffer = ~1.4 => 71% towards live data
// - at 1sec delay buffer = 1 which means live data is used // - at 1sec delay buffer = 1 which means live data is used
const bufferedFactor = elapsed < 1000 ? 8 - Math.log(elapsed) : 1; const bufferedFactor = elapsed < 1000 ? 8 - Math.log(elapsed + 1) : 1;
bufferedResult.canvas = newResult.canvas; bufferedResult.canvas = newResult.canvas;