update angle calculations

pull/193/head
Vladimir Mandic 2021-08-17 18:46:50 -04:00
parent a8bd46e6fe
commit 6058e29b90
11 changed files with 96 additions and 76 deletions

View File

@ -11,9 +11,8 @@ Repository: **<git+https://github.com/vladmandic/human.git>**
### **HEAD -> main** 2021/08/17 mandic00@live.com
### **origin/main** 2021/08/15 mandic00@live.com
- strict type checks
- add webgu checks
- experimental webgpu support
- add experimental webgu demo
- add backend initialization checks

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

46
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

46
dist/human.js vendored

File diff suppressed because one or more lines are too long

View File

@ -9723,6 +9723,12 @@ var calculateFaceAngle = (face5, imageSize) => {
thetaY = Math.atan2(r21, r22);
thetaX = 0;
}
if (!isNaN(thetaX))
thetaX = 0;
if (!isNaN(thetaY))
thetaY = 0;
if (!isNaN(thetaZ))
thetaZ = 0;
return { pitch: 2 * -thetaX, yaw: 2 * -thetaY, roll: 2 * -thetaZ };
};
const meshToEulerAngle = (mesh2) => {

View File

@ -9724,6 +9724,12 @@ var calculateFaceAngle = (face5, imageSize) => {
thetaY = Math.atan2(r21, r22);
thetaX = 0;
}
if (!isNaN(thetaX))
thetaX = 0;
if (!isNaN(thetaY))
thetaY = 0;
if (!isNaN(thetaZ))
thetaZ = 0;
return { pitch: 2 * -thetaX, yaw: 2 * -thetaY, roll: 2 * -thetaZ };
};
const meshToEulerAngle = (mesh2) => {

6
dist/human.node.js vendored
View File

@ -9723,6 +9723,12 @@ var calculateFaceAngle = (face5, imageSize) => {
thetaY = Math.atan2(r21, r22);
thetaX = 0;
}
if (!isNaN(thetaX))
thetaX = 0;
if (!isNaN(thetaY))
thetaY = 0;
if (!isNaN(thetaZ))
thetaZ = 0;
return { pitch: 2 * -thetaX, yaw: 2 * -thetaY, roll: 2 * -thetaZ };
};
const meshToEulerAngle = (mesh2) => {

View File

@ -1,22 +1,22 @@
2021-08-17 09:13:13 INFO:  @vladmandic/human version 2.1.3
2021-08-17 09:13:13 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.5.0
2021-08-17 09:13:13 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 09:13:13 INFO:  Clean: ["dist/*","types/*","typedoc/*"]
2021-08-17 09:13:13 INFO:  Build: file startup all type: production config: {"minifyWhitespace":true,"minifyIdentifiers":true,"minifySyntax":true}
2021-08-17 09:13:13 STATE: target: node type: tfjs: {"imports":1,"importBytes":102,"outputBytes":1303,"outputFiles":"dist/tfjs.esm.js"}
2021-08-17 09:13:13 STATE: target: node type: node: {"imports":42,"importBytes":436765,"outputBytes":379694,"outputFiles":"dist/human.node.js"}
2021-08-17 09:13:13 STATE: target: nodeGPU type: tfjs: {"imports":1,"importBytes":110,"outputBytes":1311,"outputFiles":"dist/tfjs.esm.js"}
2021-08-17 09:13:13 STATE: target: nodeGPU type: node: {"imports":42,"importBytes":436773,"outputBytes":379698,"outputFiles":"dist/human.node-gpu.js"}
2021-08-17 09:13:13 STATE: target: nodeWASM type: tfjs: {"imports":1,"importBytes":149,"outputBytes":1378,"outputFiles":"dist/tfjs.esm.js"}
2021-08-17 09:13:13 STATE: target: nodeWASM type: node: {"imports":42,"importBytes":436840,"outputBytes":379770,"outputFiles":"dist/human.node-wasm.js"}
2021-08-17 09:13:13 STATE: target: browserNoBundle type: tfjs: {"imports":1,"importBytes":2168,"outputBytes":1242,"outputFiles":"dist/tfjs.esm.js"}
2021-08-17 09:13:13 STATE: target: browserNoBundle type: esm: {"imports":42,"importBytes":436704,"outputBytes":249130,"outputFiles":"dist/human.esm-nobundle.js"}
2021-08-17 09:13:13 STATE: target: browserBundle type: tfjs: {"modules":1170,"moduleBytes":4145868,"imports":7,"importBytes":2168,"outputBytes":2334701,"outputFiles":"dist/tfjs.esm.js"}
2021-08-17 09:13:14 STATE: target: browserBundle type: iife: {"imports":42,"importBytes":2770163,"outputBytes":1379498,"outputFiles":"dist/human.js"}
2021-08-17 09:13:14 STATE: target: browserBundle type: esm: {"imports":42,"importBytes":2770163,"outputBytes":1379490,"outputFiles":"dist/human.esm.js"}
2021-08-17 09:13:14 INFO:  Running Linter: ["server/","src/","tfjs/","test/","demo/"]
2021-08-17 09:13:38 INFO:  Linter complete: files: 77 errors: 0 warnings: 0
2021-08-17 09:13:38 INFO:  Generate ChangeLog: ["/home/vlado/dev/human/CHANGELOG.md"]
2021-08-17 09:13:38 INFO:  Generate Typings: ["src/human.ts"] outDir: ["types"]
2021-08-17 09:13:53 INFO:  Generate TypeDocs: ["src/human.ts"] outDir: ["typedoc"]
2021-08-17 09:14:06 INFO:  Documentation generated at /home/vlado/dev/human/typedoc 1
2021-08-17 18:45:39 INFO:  @vladmandic/human version 2.1.3
2021-08-17 18:45:39 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.5.0
2021-08-17 18:45:39 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:45:39 INFO:  Clean: ["dist/*","types/*","typedoc/*"]
2021-08-17 18:45:39 INFO:  Build: file startup all type: production config: {"minifyWhitespace":true,"minifyIdentifiers":true,"minifySyntax":true}
2021-08-17 18:45:39 STATE: target: node type: tfjs: {"imports":1,"importBytes":102,"outputBytes":1303,"outputFiles":"dist/tfjs.esm.js"}
2021-08-17 18:45:39 STATE: target: node type: node: {"imports":42,"importBytes":436873,"outputBytes":379820,"outputFiles":"dist/human.node.js"}
2021-08-17 18:45:39 STATE: target: nodeGPU type: tfjs: {"imports":1,"importBytes":110,"outputBytes":1311,"outputFiles":"dist/tfjs.esm.js"}
2021-08-17 18:45:39 STATE: target: nodeGPU type: node: {"imports":42,"importBytes":436881,"outputBytes":379824,"outputFiles":"dist/human.node-gpu.js"}
2021-08-17 18:45:39 STATE: target: nodeWASM type: tfjs: {"imports":1,"importBytes":149,"outputBytes":1378,"outputFiles":"dist/tfjs.esm.js"}
2021-08-17 18:45:39 STATE: target: nodeWASM type: node: {"imports":42,"importBytes":436948,"outputBytes":379896,"outputFiles":"dist/human.node-wasm.js"}
2021-08-17 18:45:39 STATE: target: browserNoBundle type: tfjs: {"imports":1,"importBytes":2168,"outputBytes":1242,"outputFiles":"dist/tfjs.esm.js"}
2021-08-17 18:45:39 STATE: target: browserNoBundle type: esm: {"imports":42,"importBytes":436812,"outputBytes":249178,"outputFiles":"dist/human.esm-nobundle.js"}
2021-08-17 18:45:40 STATE: target: browserBundle type: tfjs: {"modules":1170,"moduleBytes":4145868,"imports":7,"importBytes":2168,"outputBytes":2334701,"outputFiles":"dist/tfjs.esm.js"}
2021-08-17 18:45:40 STATE: target: browserBundle type: iife: {"imports":42,"importBytes":2770271,"outputBytes":1379546,"outputFiles":"dist/human.js"}
2021-08-17 18:45:41 STATE: target: browserBundle type: esm: {"imports":42,"importBytes":2770271,"outputBytes":1379538,"outputFiles":"dist/human.esm.js"}
2021-08-17 18:45:41 INFO:  Running Linter: ["server/","src/","tfjs/","test/","demo/"]
2021-08-17 18:46:02 INFO:  Linter complete: files: 77 errors: 0 warnings: 0
2021-08-17 18:46:02 INFO:  Generate ChangeLog: ["/home/vlado/dev/human/CHANGELOG.md"]
2021-08-17 18:46:02 INFO:  Generate Typings: ["src/human.ts"] outDir: ["types"]
2021-08-17 18:46:14 INFO:  Generate TypeDocs: ["src/human.ts"] outDir: ["typedoc"]
2021-08-17 18:46:26 INFO:  Documentation generated at /home/vlado/dev/human/typedoc 1

View File

@ -86,6 +86,9 @@ const calculateFaceAngle = (face, imageSize): {
thetaY = Math.atan2(r21, r22);
thetaX = 0;
}
if (!isNaN(thetaX)) thetaX = 0;
if (!isNaN(thetaY)) thetaY = 0;
if (!isNaN(thetaZ)) thetaZ = 0;
return { pitch: 2 * -thetaX, yaw: 2 * -thetaY, roll: 2 * -thetaZ };
};
// simple Euler angle calculation based existing 3D mesh