mirror of https://github.com/vladmandic/human
added blazepose-upper
parent
f1f00e8bf1
commit
17dc287e15
Binary file not shown.
After Width: | Height: | Size: 41 KiB |
|
@ -137,7 +137,7 @@ export default {
|
||||||
|
|
||||||
body: {
|
body: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
modelPath: '../models/posenet.json', // can be 'posenet' or 'blazepose'
|
modelPath: '../models/posenet.json', // can be 'posenet', 'blazepose' or 'blazepose-upper'
|
||||||
inputSize: 257, // fixed value, 257 for posenet and 256 for blazepose
|
inputSize: 257, // fixed value, 257 for posenet and 256 for blazepose
|
||||||
maxDetections: 10, // maximum number of people detected in the input
|
maxDetections: 10, // maximum number of people detected in the input
|
||||||
// should be set to the minimum number for performance
|
// should be set to the minimum number for performance
|
||||||
|
|
|
@ -8,20 +8,18 @@ import draw from './draw.js';
|
||||||
import Menu from './menu.js';
|
import Menu from './menu.js';
|
||||||
import GLBench from './gl-bench.js';
|
import GLBench from './gl-bench.js';
|
||||||
|
|
||||||
const userConfig = {}; // add any user configuration overrides
|
// const userConfig = {}; // add any user configuration overrides
|
||||||
|
|
||||||
/*
|
|
||||||
const userConfig = {
|
const userConfig = {
|
||||||
backend: 'wasm',
|
backend: 'wasm',
|
||||||
async: false,
|
async: false,
|
||||||
warmup: 'full',
|
warmup: 'full',
|
||||||
videoOptimized: false,
|
videoOptimized: false,
|
||||||
face: { enabled: true, iris: { enabled: true }, mesh: { enabled: true }, age: { enabled: true }, gender: { enabled: true }, emotion: { enabled: true }, embedding: { enabled: true } },
|
face: { enabled: false, iris: { enabled: true }, mesh: { enabled: true }, age: { enabled: true }, gender: { enabled: true }, emotion: { enabled: true }, embedding: { enabled: true } },
|
||||||
hand: { enabled: true },
|
hand: { enabled: false },
|
||||||
gestures: { enabled: true },
|
gestures: { enabled: true },
|
||||||
body: { enabled: true, modelType: 'blazepose', modelPath: '../models/blazepose.json' },
|
body: { enabled: true, modelType: 'blazepose', modelPath: '../models/blazepose-upper.json' },
|
||||||
};
|
};
|
||||||
*/
|
|
||||||
|
|
||||||
const human = new Human(userConfig);
|
const human = new Human(userConfig);
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"dist/human.esm.js": {
|
"dist/human.esm.js": {
|
||||||
"bytes": 1341917,
|
"bytes": 1342423,
|
||||||
"imports": []
|
"imports": []
|
||||||
},
|
},
|
||||||
"demo/draw.js": {
|
"demo/draw.js": {
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
"imports": []
|
"imports": []
|
||||||
},
|
},
|
||||||
"demo/browser.js": {
|
"demo/browser.js": {
|
||||||
"bytes": 28101,
|
"bytes": 28106,
|
||||||
"imports": [
|
"imports": [
|
||||||
{
|
{
|
||||||
"path": "dist/human.esm.js",
|
"path": "dist/human.esm.js",
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
"imports": [],
|
"imports": [],
|
||||||
"exports": [],
|
"exports": [],
|
||||||
"inputs": {},
|
"inputs": {},
|
||||||
"bytes": 2051266
|
"bytes": 2052559
|
||||||
},
|
},
|
||||||
"dist/demo-browser-index.js": {
|
"dist/demo-browser-index.js": {
|
||||||
"imports": [],
|
"imports": [],
|
||||||
|
@ -51,7 +51,7 @@
|
||||||
"entryPoint": "demo/browser.js",
|
"entryPoint": "demo/browser.js",
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"dist/human.esm.js": {
|
"dist/human.esm.js": {
|
||||||
"bytesInOutput": 1334439
|
"bytesInOutput": 1334941
|
||||||
},
|
},
|
||||||
"demo/draw.js": {
|
"demo/draw.js": {
|
||||||
"bytesInOutput": 7178
|
"bytesInOutput": 7178
|
||||||
|
@ -63,10 +63,10 @@
|
||||||
"bytesInOutput": 6759
|
"bytesInOutput": 6759
|
||||||
},
|
},
|
||||||
"demo/browser.js": {
|
"demo/browser.js": {
|
||||||
"bytesInOutput": 18268
|
"bytesInOutput": 18581
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bytes": 1384725
|
"bytes": 1385540
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
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
|
@ -5,7 +5,7 @@
|
||||||
"imports": []
|
"imports": []
|
||||||
},
|
},
|
||||||
"dist/tfjs.esm.js": {
|
"dist/tfjs.esm.js": {
|
||||||
"bytes": 1065627,
|
"bytes": 1065682,
|
||||||
"imports": []
|
"imports": []
|
||||||
},
|
},
|
||||||
"src/tfjs/backend.ts": {
|
"src/tfjs/backend.ts": {
|
||||||
|
@ -383,8 +383,12 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"src/blazepose/annotations.ts": {
|
||||||
|
"bytes": 1108,
|
||||||
|
"imports": []
|
||||||
|
},
|
||||||
"src/blazepose/blazepose.ts": {
|
"src/blazepose/blazepose.ts": {
|
||||||
"bytes": 3327,
|
"bytes": 2879,
|
||||||
"imports": [
|
"imports": [
|
||||||
{
|
{
|
||||||
"path": "src/log.ts",
|
"path": "src/log.ts",
|
||||||
|
@ -397,6 +401,10 @@
|
||||||
{
|
{
|
||||||
"path": "src/profile.ts",
|
"path": "src/profile.ts",
|
||||||
"kind": "import-statement"
|
"kind": "import-statement"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "src/blazepose/annotations.ts",
|
||||||
|
"kind": "import-statement"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -426,7 +434,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"config.js": {
|
"config.js": {
|
||||||
"bytes": 10403,
|
"bytes": 10422,
|
||||||
"imports": []
|
"imports": []
|
||||||
},
|
},
|
||||||
"src/sample.ts": {
|
"src/sample.ts": {
|
||||||
|
@ -438,7 +446,7 @@
|
||||||
"imports": []
|
"imports": []
|
||||||
},
|
},
|
||||||
"src/human.ts": {
|
"src/human.ts": {
|
||||||
"bytes": 21042,
|
"bytes": 21043,
|
||||||
"imports": [
|
"imports": [
|
||||||
{
|
{
|
||||||
"path": "src/log.ts",
|
"path": "src/log.ts",
|
||||||
|
@ -520,7 +528,7 @@
|
||||||
"imports": [],
|
"imports": [],
|
||||||
"exports": [],
|
"exports": [],
|
||||||
"inputs": {},
|
"inputs": {},
|
||||||
"bytes": 1948302
|
"bytes": 1949289
|
||||||
},
|
},
|
||||||
"dist/human.esm.js": {
|
"dist/human.esm.js": {
|
||||||
"imports": [],
|
"imports": [],
|
||||||
|
@ -539,7 +547,7 @@
|
||||||
"bytesInOutput": 252
|
"bytesInOutput": 252
|
||||||
},
|
},
|
||||||
"dist/tfjs.esm.js": {
|
"dist/tfjs.esm.js": {
|
||||||
"bytesInOutput": 1056636
|
"bytesInOutput": 1056695
|
||||||
},
|
},
|
||||||
"src/tfjs/backend.ts": {
|
"src/tfjs/backend.ts": {
|
||||||
"bytesInOutput": 1053
|
"bytesInOutput": 1053
|
||||||
|
@ -626,7 +634,10 @@
|
||||||
"bytesInOutput": 126985
|
"bytesInOutput": 126985
|
||||||
},
|
},
|
||||||
"src/blazepose/blazepose.ts": {
|
"src/blazepose/blazepose.ts": {
|
||||||
"bytesInOutput": 1613
|
"bytesInOutput": 1153
|
||||||
|
},
|
||||||
|
"src/blazepose/annotations.ts": {
|
||||||
|
"bytesInOutput": 860
|
||||||
},
|
},
|
||||||
"src/gesture/gesture.ts": {
|
"src/gesture/gesture.ts": {
|
||||||
"bytesInOutput": 2391
|
"bytesInOutput": 2391
|
||||||
|
@ -647,7 +658,7 @@
|
||||||
"bytesInOutput": 2596
|
"bytesInOutput": 2596
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bytes": 1341917
|
"bytes": 1342423
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
"imports": []
|
"imports": []
|
||||||
},
|
},
|
||||||
"dist/tfjs.esm.js": {
|
"dist/tfjs.esm.js": {
|
||||||
"bytes": 1065627,
|
"bytes": 1065682,
|
||||||
"imports": []
|
"imports": []
|
||||||
},
|
},
|
||||||
"src/tfjs/backend.ts": {
|
"src/tfjs/backend.ts": {
|
||||||
|
@ -383,8 +383,12 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"src/blazepose/annotations.ts": {
|
||||||
|
"bytes": 1108,
|
||||||
|
"imports": []
|
||||||
|
},
|
||||||
"src/blazepose/blazepose.ts": {
|
"src/blazepose/blazepose.ts": {
|
||||||
"bytes": 3327,
|
"bytes": 2879,
|
||||||
"imports": [
|
"imports": [
|
||||||
{
|
{
|
||||||
"path": "src/log.ts",
|
"path": "src/log.ts",
|
||||||
|
@ -397,6 +401,10 @@
|
||||||
{
|
{
|
||||||
"path": "src/profile.ts",
|
"path": "src/profile.ts",
|
||||||
"kind": "import-statement"
|
"kind": "import-statement"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "src/blazepose/annotations.ts",
|
||||||
|
"kind": "import-statement"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -426,7 +434,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"config.js": {
|
"config.js": {
|
||||||
"bytes": 10403,
|
"bytes": 10422,
|
||||||
"imports": []
|
"imports": []
|
||||||
},
|
},
|
||||||
"src/sample.ts": {
|
"src/sample.ts": {
|
||||||
|
@ -438,7 +446,7 @@
|
||||||
"imports": []
|
"imports": []
|
||||||
},
|
},
|
||||||
"src/human.ts": {
|
"src/human.ts": {
|
||||||
"bytes": 21042,
|
"bytes": 21043,
|
||||||
"imports": [
|
"imports": [
|
||||||
{
|
{
|
||||||
"path": "src/log.ts",
|
"path": "src/log.ts",
|
||||||
|
@ -520,7 +528,7 @@
|
||||||
"imports": [],
|
"imports": [],
|
||||||
"exports": [],
|
"exports": [],
|
||||||
"inputs": {},
|
"inputs": {},
|
||||||
"bytes": 1948313
|
"bytes": 1949300
|
||||||
},
|
},
|
||||||
"dist/human.ts": {
|
"dist/human.ts": {
|
||||||
"imports": [],
|
"imports": [],
|
||||||
|
@ -540,7 +548,7 @@
|
||||||
"bytesInOutput": 252
|
"bytesInOutput": 252
|
||||||
},
|
},
|
||||||
"dist/tfjs.esm.js": {
|
"dist/tfjs.esm.js": {
|
||||||
"bytesInOutput": 1056636
|
"bytesInOutput": 1056695
|
||||||
},
|
},
|
||||||
"src/tfjs/backend.ts": {
|
"src/tfjs/backend.ts": {
|
||||||
"bytesInOutput": 1053
|
"bytesInOutput": 1053
|
||||||
|
@ -624,7 +632,10 @@
|
||||||
"bytesInOutput": 126985
|
"bytesInOutput": 126985
|
||||||
},
|
},
|
||||||
"src/blazepose/blazepose.ts": {
|
"src/blazepose/blazepose.ts": {
|
||||||
"bytesInOutput": 1613
|
"bytesInOutput": 1153
|
||||||
|
},
|
||||||
|
"src/blazepose/annotations.ts": {
|
||||||
|
"bytesInOutput": 860
|
||||||
},
|
},
|
||||||
"src/gesture/gesture.ts": {
|
"src/gesture/gesture.ts": {
|
||||||
"bytesInOutput": 2391
|
"bytesInOutput": 2391
|
||||||
|
@ -645,7 +656,7 @@
|
||||||
"bytesInOutput": 2596
|
"bytesInOutput": 2596
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bytes": 1341959
|
"bytes": 1342465
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
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
|
@ -5,7 +5,7 @@
|
||||||
"imports": []
|
"imports": []
|
||||||
},
|
},
|
||||||
"dist/tfjs.esm.js": {
|
"dist/tfjs.esm.js": {
|
||||||
"bytes": 690,
|
"bytes": 737,
|
||||||
"imports": []
|
"imports": []
|
||||||
},
|
},
|
||||||
"src/tfjs/backend.ts": {
|
"src/tfjs/backend.ts": {
|
||||||
|
@ -383,8 +383,12 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"src/blazepose/annotations.ts": {
|
||||||
|
"bytes": 1108,
|
||||||
|
"imports": []
|
||||||
|
},
|
||||||
"src/blazepose/blazepose.ts": {
|
"src/blazepose/blazepose.ts": {
|
||||||
"bytes": 3327,
|
"bytes": 2879,
|
||||||
"imports": [
|
"imports": [
|
||||||
{
|
{
|
||||||
"path": "src/log.ts",
|
"path": "src/log.ts",
|
||||||
|
@ -397,6 +401,10 @@
|
||||||
{
|
{
|
||||||
"path": "src/profile.ts",
|
"path": "src/profile.ts",
|
||||||
"kind": "import-statement"
|
"kind": "import-statement"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "src/blazepose/annotations.ts",
|
||||||
|
"kind": "import-statement"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -426,7 +434,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"config.js": {
|
"config.js": {
|
||||||
"bytes": 10403,
|
"bytes": 10422,
|
||||||
"imports": []
|
"imports": []
|
||||||
},
|
},
|
||||||
"src/sample.ts": {
|
"src/sample.ts": {
|
||||||
|
@ -438,7 +446,7 @@
|
||||||
"imports": []
|
"imports": []
|
||||||
},
|
},
|
||||||
"src/human.ts": {
|
"src/human.ts": {
|
||||||
"bytes": 21042,
|
"bytes": 21043,
|
||||||
"imports": [
|
"imports": [
|
||||||
{
|
{
|
||||||
"path": "src/log.ts",
|
"path": "src/log.ts",
|
||||||
|
@ -520,7 +528,7 @@
|
||||||
"imports": [],
|
"imports": [],
|
||||||
"exports": [],
|
"exports": [],
|
||||||
"inputs": {},
|
"inputs": {},
|
||||||
"bytes": 715070
|
"bytes": 716046
|
||||||
},
|
},
|
||||||
"dist/human.node-gpu.js": {
|
"dist/human.node-gpu.js": {
|
||||||
"imports": [],
|
"imports": [],
|
||||||
|
@ -528,7 +536,7 @@
|
||||||
"entryPoint": "src/human.ts",
|
"entryPoint": "src/human.ts",
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"dist/tfjs.esm.js": {
|
"dist/tfjs.esm.js": {
|
||||||
"bytesInOutput": 551
|
"bytesInOutput": 598
|
||||||
},
|
},
|
||||||
"src/blazeface/facemesh.ts": {
|
"src/blazeface/facemesh.ts": {
|
||||||
"bytesInOutput": 1585
|
"bytesInOutput": 1585
|
||||||
|
@ -624,7 +632,10 @@
|
||||||
"bytesInOutput": 126985
|
"bytesInOutput": 126985
|
||||||
},
|
},
|
||||||
"src/blazepose/blazepose.ts": {
|
"src/blazepose/blazepose.ts": {
|
||||||
"bytesInOutput": 1637
|
"bytesInOutput": 1179
|
||||||
|
},
|
||||||
|
"src/blazepose/annotations.ts": {
|
||||||
|
"bytesInOutput": 860
|
||||||
},
|
},
|
||||||
"src/gesture/gesture.ts": {
|
"src/gesture/gesture.ts": {
|
||||||
"bytesInOutput": 2391
|
"bytesInOutput": 2391
|
||||||
|
@ -645,7 +656,7 @@
|
||||||
"bytesInOutput": 2593
|
"bytesInOutput": 2593
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bytes": 279471
|
"bytes": 279967
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
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
|
@ -28620,7 +28620,7 @@
|
||||||
"bytesInOutput": 484
|
"bytesInOutput": 484
|
||||||
},
|
},
|
||||||
"node_modules/@tensorflow/tfjs-backend-wasm/dist/backend_wasm.js": {
|
"node_modules/@tensorflow/tfjs-backend-wasm/dist/backend_wasm.js": {
|
||||||
"bytesInOutput": 4747
|
"bytesInOutput": 4755
|
||||||
},
|
},
|
||||||
"node_modules/@tensorflow/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.worker.js": {
|
"node_modules/@tensorflow/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.worker.js": {
|
||||||
"bytesInOutput": 3145
|
"bytesInOutput": 3145
|
||||||
|
@ -29760,7 +29760,7 @@
|
||||||
"bytesInOutput": 15
|
"bytesInOutput": 15
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bytes": 1065627
|
"bytes": 1065682
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
File diff suppressed because one or more lines are too long
|
@ -977,9 +977,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"es-abstract": {
|
"es-abstract": {
|
||||||
"version": "1.18.0-next.3",
|
"version": "1.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.3.tgz",
|
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0.tgz",
|
||||||
"integrity": "sha512-VMzHx/Bczjg59E6jZOQjHeN3DEoptdhejpARgflAViidlqSpjdq9zA6lKwlhRRs/lOw1gHJv2xkkSFRgvEwbQg==",
|
"integrity": "sha512-LJzK7MrQa8TS0ja2w3YNLzUgJCGPdPOV1yVvezjNnS89D+VR08+Szt2mz3YB2Dck/+w5tfIq/RoUAFqJJGM2yw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"call-bind": "^1.0.2",
|
"call-bind": "^1.0.2",
|
||||||
|
@ -1027,9 +1027,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"esbuild": {
|
"esbuild": {
|
||||||
"version": "0.8.54",
|
"version": "0.8.56",
|
||||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.8.54.tgz",
|
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.8.56.tgz",
|
||||||
"integrity": "sha512-DJH38OiTgXJxFb/EhHrCrY8eGmtdkTtWymHpN9IYN9AF+4jykT0dQArr7wzFejpVbaB0TMIq2+vfNRWr3LXpvw==",
|
"integrity": "sha512-PTMdAWK3JI2MNW811znGssGP5GR44tQPr++VQ1rPP0n8Z1cTKbCPD3S/kXPLr3ZZDIwAaVm08fuFym6Rp8l/0A==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"escalade": {
|
"escalade": {
|
||||||
|
@ -1646,9 +1646,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"google-protobuf": {
|
"google-protobuf": {
|
||||||
"version": "3.15.3",
|
"version": "3.15.5",
|
||||||
"resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.15.3.tgz",
|
"resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.15.5.tgz",
|
||||||
"integrity": "sha512-+q6w/pTPS8hmdeHe+OWO7PRKOkqtPM4+dxUUOtC9lLgiaLUd7FQq+0EkTt9UmEHf2KMigkbV1fIxSr73t/JG/A==",
|
"integrity": "sha512-6bLpAI4nMIQODlegR7OevgkCoyOj5frLVDArUpeuBWad7XWUNWMGP0v5lz1/aeUI6Yf3cG9XA6acZkPxom4SEw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"graceful-fs": {
|
"graceful-fs": {
|
||||||
|
@ -2601,9 +2601,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"simple-git": {
|
"simple-git": {
|
||||||
"version": "2.35.2",
|
"version": "2.36.0",
|
||||||
"resolved": "https://registry.npmjs.org/simple-git/-/simple-git-2.35.2.tgz",
|
"resolved": "https://registry.npmjs.org/simple-git/-/simple-git-2.36.0.tgz",
|
||||||
"integrity": "sha512-UjOKsrz92Bx7z00Wla5V6qLSf5X2XSp0sL2gzKw1Bh7iJfDPDaU7gK5avIup0yo1/sMOSUMQer2b9GcnF6nmTQ==",
|
"integrity": "sha512-EJNaUgGYzBnQiyEkNZgbQSg76agbEDqlgHDr8DAXqV8xWvcefydbipye7YXtHMGbbEK998dcFezS8qF0sepZ5Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@kwsites/file-exists": "^1.1.1",
|
"@kwsites/file-exists": "^1.1.1",
|
||||||
|
@ -2866,9 +2866,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"typescript": {
|
"typescript": {
|
||||||
"version": "4.3.0-dev.20210302",
|
"version": "4.3.0-dev.20210305",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.0-dev.20210302.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.0-dev.20210305.tgz",
|
||||||
"integrity": "sha512-j8UsZLmGC3z0dzJ+Ybf3Q0txXvnGLkoIORUYApUfuJLoJlkFI7po/drYmhgh4BFjR3JnBQmniRHipEgcfQOANA==",
|
"integrity": "sha512-OTALeeen7kl6FU1tcXRk3h+WY1NnE5lwyTGAZUCt9hw6tdaifgLXqEkfw9NHJc0xKV6PnU8GgnYFFVVyHLPSHg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"unbox-primitive": {
|
"unbox-primitive": {
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
"@vladmandic/pilogger": "^0.2.14",
|
"@vladmandic/pilogger": "^0.2.14",
|
||||||
"chokidar": "^3.5.1",
|
"chokidar": "^3.5.1",
|
||||||
"dayjs": "^1.10.4",
|
"dayjs": "^1.10.4",
|
||||||
"esbuild": "^0.8.54",
|
"esbuild": "^0.8.56",
|
||||||
"eslint": "^7.21.0",
|
"eslint": "^7.21.0",
|
||||||
"eslint-config-airbnb-base": "^14.2.1",
|
"eslint-config-airbnb-base": "^14.2.1",
|
||||||
"eslint-plugin-import": "^2.22.1",
|
"eslint-plugin-import": "^2.22.1",
|
||||||
|
@ -48,9 +48,9 @@
|
||||||
"eslint-plugin-promise": "^4.3.1",
|
"eslint-plugin-promise": "^4.3.1",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"seedrandom": "^3.0.5",
|
"seedrandom": "^3.0.5",
|
||||||
"simple-git": "^2.35.2",
|
"simple-git": "^2.36.0",
|
||||||
"tslib": "^2.1.0",
|
"tslib": "^2.1.0",
|
||||||
"typescript": "^4.3.0-dev.20210302"
|
"typescript": "^4.3.0-dev.20210305"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node --trace-warnings --unhandled-rejections=strict --trace-uncaught --no-deprecation src/node.js",
|
"start": "node --trace-warnings --unhandled-rejections=strict --trace-uncaught --no-deprecation src/node.js",
|
||||||
|
|
|
@ -0,0 +1,75 @@
|
||||||
|
export const full = [
|
||||||
|
'nose',
|
||||||
|
'leftEyeInside',
|
||||||
|
'leftEye',
|
||||||
|
'leftEyeOutside',
|
||||||
|
'rightEyeInside',
|
||||||
|
'rightEye',
|
||||||
|
'rightEyeOutside',
|
||||||
|
'leftEar',
|
||||||
|
'rightEar',
|
||||||
|
'leftMouth',
|
||||||
|
'rightMouth',
|
||||||
|
'leftShoulder',
|
||||||
|
'rightShoulder',
|
||||||
|
'leftElbow',
|
||||||
|
'rightElbow',
|
||||||
|
'leftWrist',
|
||||||
|
'rightWrist',
|
||||||
|
'leftPalm',
|
||||||
|
'rightPalm',
|
||||||
|
'leftIndex',
|
||||||
|
'rightIndex',
|
||||||
|
'leftPinky',
|
||||||
|
'rightPinky',
|
||||||
|
'leftHip',
|
||||||
|
'rightHip',
|
||||||
|
'leftKnee',
|
||||||
|
'rightKnee',
|
||||||
|
'leftAnkle',
|
||||||
|
'rightAnkle',
|
||||||
|
'leftHeel',
|
||||||
|
'rightHeel',
|
||||||
|
'leftFoot',
|
||||||
|
'rightFoot',
|
||||||
|
'midHip',
|
||||||
|
'forehead',
|
||||||
|
'leftThumb',
|
||||||
|
'leftHand',
|
||||||
|
'rightThumb',
|
||||||
|
'rightHand',
|
||||||
|
];
|
||||||
|
|
||||||
|
export const upper = [
|
||||||
|
'nose',
|
||||||
|
'leftEyeInside',
|
||||||
|
'leftEye',
|
||||||
|
'leftEyeOutside',
|
||||||
|
'rightEyeInside',
|
||||||
|
'rightEye',
|
||||||
|
'rightEyeOutside',
|
||||||
|
'leftEar',
|
||||||
|
'rightEar',
|
||||||
|
'leftMouth',
|
||||||
|
'rightMouth',
|
||||||
|
'leftShoulder',
|
||||||
|
'rightShoulder',
|
||||||
|
'leftElbow',
|
||||||
|
'rightElbow',
|
||||||
|
'left:15',
|
||||||
|
'right:16',
|
||||||
|
'left:17',
|
||||||
|
'right:18',
|
||||||
|
'left:19',
|
||||||
|
'right:20',
|
||||||
|
'left:21',
|
||||||
|
'right:22',
|
||||||
|
'leftChest',
|
||||||
|
'rightChest',
|
||||||
|
'neck',
|
||||||
|
'forehead',
|
||||||
|
'left:27',
|
||||||
|
'right:28',
|
||||||
|
'left:29',
|
||||||
|
'right:30',
|
||||||
|
];
|
|
@ -1,49 +1,9 @@
|
||||||
import { log } from '../log';
|
import { log } from '../log';
|
||||||
import * as tf from '../../dist/tfjs.esm.js';
|
import * as tf from '../../dist/tfjs.esm.js';
|
||||||
import * as profile from '../profile';
|
import * as profile from '../profile';
|
||||||
|
import * as annotations from './annotations';
|
||||||
|
|
||||||
let model;
|
let model;
|
||||||
const labels = [
|
|
||||||
'nose',
|
|
||||||
'leftEyeInside',
|
|
||||||
'leftEye',
|
|
||||||
'leftEyeOutside',
|
|
||||||
'rightEyeInside',
|
|
||||||
'rightEye',
|
|
||||||
'rightEyeOutside',
|
|
||||||
'leftEar',
|
|
||||||
'rightEar',
|
|
||||||
'leftMouth',
|
|
||||||
'rightMouth',
|
|
||||||
'leftShoulder',
|
|
||||||
'rightShoulder',
|
|
||||||
'leftElbow',
|
|
||||||
'rightElbow',
|
|
||||||
'leftWrist',
|
|
||||||
'rightWrist',
|
|
||||||
'leftPalm',
|
|
||||||
'rightPalm',
|
|
||||||
'leftIndex',
|
|
||||||
'rightIndex',
|
|
||||||
'leftPinky',
|
|
||||||
'rightPinky',
|
|
||||||
'leftHip',
|
|
||||||
'rightHip',
|
|
||||||
'leftKnee',
|
|
||||||
'rightKnee',
|
|
||||||
'leftAnkle',
|
|
||||||
'rightAnkle',
|
|
||||||
'leftHeel',
|
|
||||||
'rightHeel',
|
|
||||||
'leftFoot',
|
|
||||||
'rightFoot',
|
|
||||||
'midHip',
|
|
||||||
'forehead',
|
|
||||||
'leftThumb',
|
|
||||||
'leftHand',
|
|
||||||
'rightThumb',
|
|
||||||
'rightHand',
|
|
||||||
];
|
|
||||||
|
|
||||||
export async function load(config) {
|
export async function load(config) {
|
||||||
if (!model) {
|
if (!model) {
|
||||||
|
@ -81,17 +41,19 @@ export async function predict(image, config) {
|
||||||
}
|
}
|
||||||
normalize.dispose();
|
normalize.dispose();
|
||||||
const keypoints: Array<{ id, part, position: { x, y, z }, score, presence }> = [];
|
const keypoints: Array<{ id, part, position: { x, y, z }, score, presence }> = [];
|
||||||
for (let i = 0; i < points.length / 5; i++) {
|
const labels = points.length === 195 ? annotations.full : annotations.upper;
|
||||||
|
const depth = 5;
|
||||||
|
for (let i = 0; i < points.length / depth; i++) {
|
||||||
keypoints.push({
|
keypoints.push({
|
||||||
id: i,
|
id: i,
|
||||||
part: labels[i],
|
part: labels[i],
|
||||||
position: {
|
position: {
|
||||||
x: Math.trunc(imgSize.width * points[5 * i + 0] / 255),
|
x: Math.trunc(imgSize.width * points[depth * i + 0] / 255),
|
||||||
y: Math.trunc(imgSize.height * points[5 * i + 1] / 255),
|
y: Math.trunc(imgSize.height * points[depth * i + 1] / 255),
|
||||||
z: Math.trunc(points[5 * i + 2]) + 0, // fix negative zero
|
z: Math.trunc(points[depth * i + 2]) + 0, // fix negative zero
|
||||||
},
|
},
|
||||||
score: (100 - Math.trunc(100 / (1 + Math.exp(points[5 * i + 3])))) / 100, // reverse sigmoid value
|
score: (100 - Math.trunc(100 / (1 + Math.exp(points[depth * i + 3])))) / 100, // reverse sigmoid value
|
||||||
presence: (100 - Math.trunc(100 / (1 + Math.exp(points[5 * i + 4])))) / 100, // reverse sigmoid value
|
presence: (100 - Math.trunc(100 / (1 + Math.exp(points[depth * i + 4])))) / 100, // reverse sigmoid value
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// console.log('POINTS', imgSize, pts.length, pts);
|
// console.log('POINTS', imgSize, pts.length, pts);
|
||||||
|
|
|
@ -494,7 +494,7 @@ class Human {
|
||||||
default:
|
default:
|
||||||
src = null;
|
src = null;
|
||||||
}
|
}
|
||||||
// src = encodeURI('../assets/human-sample-face.jpg');
|
// src = encodeURI('../assets/human-sample-upper.jpg');
|
||||||
const img = new Image();
|
const img = new Image();
|
||||||
img.onload = async () => {
|
img.onload = async () => {
|
||||||
const canvas = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(size, size) : document.createElement('canvas');
|
const canvas = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(size, size) : document.createElement('canvas');
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
export declare const full: string[];
|
||||||
|
export declare const upper: string[];
|
2
wiki
2
wiki
|
@ -1 +1 @@
|
||||||
Subproject commit c60f442714b1b5887ae25feb35fa413bc9996402
|
Subproject commit 870084a1a92e66943076ad41a99b74d32c799761
|
Loading…
Reference in New Issue