rebuild full

pull/280/head
Vladimir Mandic 2021-08-17 18:49:49 -04:00
parent 6854256668
commit 9ae7f21c81
2 changed files with 7 additions and 4 deletions

View File

@ -11,6 +11,7 @@ Repository: **<git+https://github.com/vladmandic/human.git>**
### **HEAD -> main** 2021/08/17 mandic00@live.com ### **HEAD -> main** 2021/08/17 mandic00@live.com
- improve face box caching
- strict type checks - strict type checks
- add webgu checks - add webgu checks
- experimental webgpu support - experimental webgpu support

View File

@ -70,7 +70,9 @@ const calculateFaceAngle = (face, imageSize): {
const rotationMatrixToEulerAngle = (r) => { const rotationMatrixToEulerAngle = (r) => {
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
const [r00, r01, r02, r10, r11, r12, r20, r21, r22] = r; const [r00, r01, r02, r10, r11, r12, r20, r21, r22] = r;
let thetaX; let thetaY; let thetaZ; let thetaX: number;
let thetaY: number;
let thetaZ: number;
if (r10 < 1) { // YZX calculation if (r10 < 1) { // YZX calculation
if (r10 > -1) { if (r10 > -1) {
thetaZ = Math.asin(r10); thetaZ = Math.asin(r10);
@ -86,9 +88,9 @@ const calculateFaceAngle = (face, imageSize): {
thetaY = Math.atan2(r21, r22); thetaY = Math.atan2(r21, r22);
thetaX = 0; thetaX = 0;
} }
if (!isNaN(thetaX)) thetaX = 0; if (isNaN(thetaX)) thetaX = 0;
if (!isNaN(thetaY)) thetaY = 0; if (isNaN(thetaY)) thetaY = 0;
if (!isNaN(thetaZ)) thetaZ = 0; if (isNaN(thetaZ)) thetaZ = 0;
return { pitch: 2 * -thetaX, yaw: 2 * -thetaY, roll: 2 * -thetaZ }; return { pitch: 2 * -thetaX, yaw: 2 * -thetaY, roll: 2 * -thetaZ };
}; };
// simple Euler angle calculation based existing 3D mesh // simple Euler angle calculation based existing 3D mesh