mirror of https://github.com/vladmandic/human
update angle calculations
parent
a8bd46e6fe
commit
6058e29b90
|
@ -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
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -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) => {
|
||||
|
|
|
@ -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) => {
|
||||
|
|
|
@ -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) => {
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
2021-08-17 09:13:13 [36mINFO: [39m @vladmandic/human version 2.1.3
|
||||
2021-08-17 09:13:13 [36mINFO: [39m User: vlado Platform: linux Arch: x64 Node: v16.5.0
|
||||
2021-08-17 09:13:13 [36mINFO: [39m 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 [36mINFO: [39m Clean: ["dist/*","types/*","typedoc/*"]
|
||||
2021-08-17 09:13:13 [36mINFO: [39m Build: file startup all type: production config: {"minifyWhitespace":true,"minifyIdentifiers":true,"minifySyntax":true}
|
||||
2021-08-17 09:13:13 [35mSTATE:[39m target: node type: tfjs: {"imports":1,"importBytes":102,"outputBytes":1303,"outputFiles":"dist/tfjs.esm.js"}
|
||||
2021-08-17 09:13:13 [35mSTATE:[39m target: node type: node: {"imports":42,"importBytes":436765,"outputBytes":379694,"outputFiles":"dist/human.node.js"}
|
||||
2021-08-17 09:13:13 [35mSTATE:[39m target: nodeGPU type: tfjs: {"imports":1,"importBytes":110,"outputBytes":1311,"outputFiles":"dist/tfjs.esm.js"}
|
||||
2021-08-17 09:13:13 [35mSTATE:[39m target: nodeGPU type: node: {"imports":42,"importBytes":436773,"outputBytes":379698,"outputFiles":"dist/human.node-gpu.js"}
|
||||
2021-08-17 09:13:13 [35mSTATE:[39m target: nodeWASM type: tfjs: {"imports":1,"importBytes":149,"outputBytes":1378,"outputFiles":"dist/tfjs.esm.js"}
|
||||
2021-08-17 09:13:13 [35mSTATE:[39m target: nodeWASM type: node: {"imports":42,"importBytes":436840,"outputBytes":379770,"outputFiles":"dist/human.node-wasm.js"}
|
||||
2021-08-17 09:13:13 [35mSTATE:[39m target: browserNoBundle type: tfjs: {"imports":1,"importBytes":2168,"outputBytes":1242,"outputFiles":"dist/tfjs.esm.js"}
|
||||
2021-08-17 09:13:13 [35mSTATE:[39m target: browserNoBundle type: esm: {"imports":42,"importBytes":436704,"outputBytes":249130,"outputFiles":"dist/human.esm-nobundle.js"}
|
||||
2021-08-17 09:13:13 [35mSTATE:[39m 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 [35mSTATE:[39m target: browserBundle type: iife: {"imports":42,"importBytes":2770163,"outputBytes":1379498,"outputFiles":"dist/human.js"}
|
||||
2021-08-17 09:13:14 [35mSTATE:[39m target: browserBundle type: esm: {"imports":42,"importBytes":2770163,"outputBytes":1379490,"outputFiles":"dist/human.esm.js"}
|
||||
2021-08-17 09:13:14 [36mINFO: [39m Running Linter: ["server/","src/","tfjs/","test/","demo/"]
|
||||
2021-08-17 09:13:38 [36mINFO: [39m Linter complete: files: 77 errors: 0 warnings: 0
|
||||
2021-08-17 09:13:38 [36mINFO: [39m Generate ChangeLog: ["/home/vlado/dev/human/CHANGELOG.md"]
|
||||
2021-08-17 09:13:38 [36mINFO: [39m Generate Typings: ["src/human.ts"] outDir: ["types"]
|
||||
2021-08-17 09:13:53 [36mINFO: [39m Generate TypeDocs: ["src/human.ts"] outDir: ["typedoc"]
|
||||
2021-08-17 09:14:06 [36mINFO: [39m Documentation generated at /home/vlado/dev/human/typedoc 1
|
||||
2021-08-17 18:45:39 [36mINFO: [39m @vladmandic/human version 2.1.3
|
||||
2021-08-17 18:45:39 [36mINFO: [39m User: vlado Platform: linux Arch: x64 Node: v16.5.0
|
||||
2021-08-17 18:45:39 [36mINFO: [39m 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 [36mINFO: [39m Clean: ["dist/*","types/*","typedoc/*"]
|
||||
2021-08-17 18:45:39 [36mINFO: [39m Build: file startup all type: production config: {"minifyWhitespace":true,"minifyIdentifiers":true,"minifySyntax":true}
|
||||
2021-08-17 18:45:39 [35mSTATE:[39m target: node type: tfjs: {"imports":1,"importBytes":102,"outputBytes":1303,"outputFiles":"dist/tfjs.esm.js"}
|
||||
2021-08-17 18:45:39 [35mSTATE:[39m target: node type: node: {"imports":42,"importBytes":436873,"outputBytes":379820,"outputFiles":"dist/human.node.js"}
|
||||
2021-08-17 18:45:39 [35mSTATE:[39m target: nodeGPU type: tfjs: {"imports":1,"importBytes":110,"outputBytes":1311,"outputFiles":"dist/tfjs.esm.js"}
|
||||
2021-08-17 18:45:39 [35mSTATE:[39m target: nodeGPU type: node: {"imports":42,"importBytes":436881,"outputBytes":379824,"outputFiles":"dist/human.node-gpu.js"}
|
||||
2021-08-17 18:45:39 [35mSTATE:[39m target: nodeWASM type: tfjs: {"imports":1,"importBytes":149,"outputBytes":1378,"outputFiles":"dist/tfjs.esm.js"}
|
||||
2021-08-17 18:45:39 [35mSTATE:[39m target: nodeWASM type: node: {"imports":42,"importBytes":436948,"outputBytes":379896,"outputFiles":"dist/human.node-wasm.js"}
|
||||
2021-08-17 18:45:39 [35mSTATE:[39m target: browserNoBundle type: tfjs: {"imports":1,"importBytes":2168,"outputBytes":1242,"outputFiles":"dist/tfjs.esm.js"}
|
||||
2021-08-17 18:45:39 [35mSTATE:[39m target: browserNoBundle type: esm: {"imports":42,"importBytes":436812,"outputBytes":249178,"outputFiles":"dist/human.esm-nobundle.js"}
|
||||
2021-08-17 18:45:40 [35mSTATE:[39m 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 [35mSTATE:[39m target: browserBundle type: iife: {"imports":42,"importBytes":2770271,"outputBytes":1379546,"outputFiles":"dist/human.js"}
|
||||
2021-08-17 18:45:41 [35mSTATE:[39m target: browserBundle type: esm: {"imports":42,"importBytes":2770271,"outputBytes":1379538,"outputFiles":"dist/human.esm.js"}
|
||||
2021-08-17 18:45:41 [36mINFO: [39m Running Linter: ["server/","src/","tfjs/","test/","demo/"]
|
||||
2021-08-17 18:46:02 [36mINFO: [39m Linter complete: files: 77 errors: 0 warnings: 0
|
||||
2021-08-17 18:46:02 [36mINFO: [39m Generate ChangeLog: ["/home/vlado/dev/human/CHANGELOG.md"]
|
||||
2021-08-17 18:46:02 [36mINFO: [39m Generate Typings: ["src/human.ts"] outDir: ["types"]
|
||||
2021-08-17 18:46:14 [36mINFO: [39m Generate TypeDocs: ["src/human.ts"] outDir: ["typedoc"]
|
||||
2021-08-17 18:46:26 [36mINFO: [39m Documentation generated at /home/vlado/dev/human/typedoc 1
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue