add z axis scaling

pull/50/head
Vladimir Mandic 2020-12-16 19:16:54 -05:00
parent 1a73761da0
commit 005938b85e
18 changed files with 78 additions and 78 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
{
"inputs": {
"dist/human.esm.js": {
"bytes": 1839401,
"bytes": 1839457,
"imports": []
},
"demo/draw.js": {
@ -38,14 +38,14 @@
"dist/demo-browser-index.js.map": {
"imports": [],
"inputs": {},
"bytes": 2199701
"bytes": 2199810
},
"dist/demo-browser-index.js": {
"imports": [],
"exports": [],
"inputs": {
"dist/human.esm.js": {
"bytesInOutput": 1832161
"bytesInOutput": 1832217
},
"demo/draw.js": {
"bytesInOutput": 7726
@ -60,7 +60,7 @@
"bytesInOutput": 19539
}
},
"bytes": 1885997
"bytes": 1886053
}
}
}

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

8
dist/human.esm.json vendored
View File

@ -287,7 +287,7 @@
"imports": []
},
"src/hand/handpipeline.js": {
"bytes": 7886,
"bytes": 7951,
"imports": [
{
"path": "dist/tfjs.esm.js"
@ -419,7 +419,7 @@
"dist/human.esm.js.map": {
"imports": [],
"inputs": {},
"bytes": 2106203
"bytes": 2106312
},
"dist/human.esm.js": {
"imports": [],
@ -497,7 +497,7 @@
"bytesInOutput": 2742
},
"src/hand/handpipeline.js": {
"bytesInOutput": 4459
"bytesInOutput": 4515
},
"src/hand/anchors.js": {
"bytesInOutput": 127032
@ -542,7 +542,7 @@
"bytesInOutput": 21
}
},
"bytes": 1839401
"bytes": 1839457
}
}
}

2
dist/human.js vendored

File diff suppressed because one or more lines are too long

4
dist/human.js.map vendored

File diff suppressed because one or more lines are too long

8
dist/human.json vendored
View File

@ -287,7 +287,7 @@
"imports": []
},
"src/hand/handpipeline.js": {
"bytes": 7886,
"bytes": 7951,
"imports": [
{
"path": "dist/tfjs.esm.js"
@ -419,7 +419,7 @@
"dist/human.js.map": {
"imports": [],
"inputs": {},
"bytes": 2123326
"bytes": 2123435
},
"dist/human.js": {
"imports": [],
@ -495,7 +495,7 @@
"bytesInOutput": 2742
},
"src/hand/handpipeline.js": {
"bytesInOutput": 4459
"bytesInOutput": 4515
},
"src/hand/anchors.js": {
"bytesInOutput": 127032
@ -540,7 +540,7 @@
"bytesInOutput": 21
}
},
"bytes": 1839475
"bytes": 1839531
}
}
}

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.node.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

78
dist/human.node.json vendored
View File

@ -148,30 +148,19 @@
]
},
"src/body/modelBase.js": {
"bytes": 889,
"bytes": 1343,
"imports": [
{
"path": "dist/tfjs.esm.js"
}
]
},
"src/body/modelMobileNet.js": {
"bytes": 599,
"imports": [
{
"path": "dist/tfjs.esm.js"
},
{
"path": "src/body/modelBase.js"
}
]
},
"src/body/heapSort.js": {
"bytes": 1590,
"imports": []
},
"src/body/buildParts.js": {
"bytes": 2035,
"bytes": 1775,
"imports": [
{
"path": "src/body/heapSort.js"
@ -179,7 +168,7 @@
]
},
"src/body/keypoints.js": {
"bytes": 2291,
"bytes": 2011,
"imports": []
},
"src/body/vectors.js": {
@ -190,19 +179,33 @@
}
]
},
"src/body/decoders.js": {
"bytes": 2083,
"imports": [
{
"path": "dist/tfjs.esm.js"
},
{
"path": "src/body/keypoints.js"
}
]
},
"src/body/decodePose.js": {
"bytes": 4530,
"bytes": 5216,
"imports": [
{
"path": "src/body/keypoints.js"
},
{
"path": "src/body/vectors.js"
},
{
"path": "src/body/decoders.js"
}
]
},
"src/body/decodeMultiple.js": {
"bytes": 5608,
"bytes": 2303,
"imports": [
{
"path": "src/body/buildParts.js"
@ -224,7 +227,7 @@
]
},
"src/body/modelPoseNet.js": {
"bytes": 1905,
"bytes": 2395,
"imports": [
{
"path": "src/log.js"
@ -233,28 +236,25 @@
"path": "dist/tfjs.esm.js"
},
{
"path": "src/body/modelMobileNet.js"
"path": "src/body/modelBase.js"
},
{
"path": "src/body/decodeMultiple.js"
},
{
"path": "src/body/decodePose.js"
},
{
"path": "src/body/util.js"
}
]
},
"src/body/posenet.js": {
"bytes": 830,
"bytes": 614,
"imports": [
{
"path": "src/body/modelMobileNet.js"
},
{
"path": "src/body/modelPoseNet.js"
},
{
"path": "src/body/decodeMultiple.js"
},
{
"path": "src/body/keypoints.js"
},
@ -287,7 +287,7 @@
"imports": []
},
"src/hand/handpipeline.js": {
"bytes": 7886,
"bytes": 7951,
"imports": [
{
"path": "dist/tfjs.esm.js"
@ -350,7 +350,7 @@
]
},
"config.js": {
"bytes": 9241,
"bytes": 9530,
"imports": []
},
"src/sample.js": {
@ -419,7 +419,7 @@
"dist/human.node-gpu.js.map": {
"imports": [],
"inputs": {},
"bytes": 778529
"bytes": 779986
},
"dist/human.node-gpu.js": {
"imports": [],
@ -462,10 +462,7 @@
"bytesInOutput": 1369
},
"src/body/modelBase.js": {
"bytesInOutput": 652
},
"src/body/modelMobileNet.js": {
"bytesInOutput": 418
"bytesInOutput": 1116
},
"src/body/heapSort.js": {
"bytesInOutput": 1139
@ -479,26 +476,29 @@
"src/body/vectors.js": {
"bytesInOutput": 1042
},
"src/body/decoders.js": {
"bytesInOutput": 1793
},
"src/body/decodePose.js": {
"bytesInOutput": 3113
"bytesInOutput": 4164
},
"src/body/decodeMultiple.js": {
"bytesInOutput": 1686
"bytesInOutput": 1700
},
"src/body/util.js": {
"bytesInOutput": 1918
},
"src/body/modelPoseNet.js": {
"bytesInOutput": 1607
"bytesInOutput": 2030
},
"src/body/posenet.js": {
"bytesInOutput": 846
"bytesInOutput": 634
},
"src/hand/handdetector.js": {
"bytesInOutput": 2880
},
"src/hand/handpipeline.js": {
"bytesInOutput": 4503
"bytesInOutput": 4559
},
"src/hand/anchors.js": {
"bytesInOutput": 127034
@ -531,7 +531,7 @@
"bytesInOutput": 1790
},
"config.js": {
"bytesInOutput": 1454
"bytesInOutput": 1492
},
"src/sample.js": {
"bytesInOutput": 55295
@ -540,7 +540,7 @@
"bytesInOutput": 20
}
},
"bytes": 306571
"bytes": 309780
}
}
}

View File

@ -59,11 +59,11 @@ class HandPipeline {
transformRawCoords(rawCoords, box2, angle, rotationMatrix) {
const boxSize = box.getBoxSize(box2);
const scaleFactor = [boxSize[0] / this.inputSize, boxSize[1] / this.inputSize];
const scaleFactor = [boxSize[0] / this.inputSize, boxSize[1] / this.inputSize, (boxSize[0] + boxSize[1]) / this.inputSize / 2];
const coordsScaled = rawCoords.map((coord) => [
scaleFactor[0] * (coord[0] - this.inputSize / 2),
scaleFactor[1] * (coord[1] - this.inputSize / 2),
coord[2],
scaleFactor[2] * coord[2],
]);
const coordsRotationMatrix = util.buildRotationMatrix(angle, [0, 0]);
const coordsRotated = coordsScaled.map((coord) => {

2
wiki

@ -1 +1 @@
Subproject commit 57cd392ca982309419d6a00b7aa6174605c950f6
Subproject commit 489063ec16cf35ff3c91e3f90d44fa8351210aea