mirror of https://github.com/vladmandic/human
embedding fix
parent
d62e1438a5
commit
e0f7748171
|
@ -15,7 +15,7 @@ const userConfig = {
|
|||
backend: 'wasm',
|
||||
async: false,
|
||||
videoOptimized: false,
|
||||
face: { enabled: true, iris: { enabled: false }, mesh: { enabled: true }, age: { enabled: true }, gender: { enabled: true }, emotion: { enabled: true } },
|
||||
face: { enabled: true, iris: { enabled: false }, mesh: { enabled: true }, age: { enabled: true }, gender: { enabled: true }, emotion: { enabled: true }, embedding: { enabled: true } },
|
||||
body: { enabled: false },
|
||||
hand: { enabled: false },
|
||||
};
|
||||
|
|
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": {
|
||||
"dist/human.esm.js": {
|
||||
"bytes": 1347222,
|
||||
"bytes": 1347291,
|
||||
"imports": []
|
||||
},
|
||||
"demo/draw.js": {
|
||||
|
@ -17,7 +17,7 @@
|
|||
"imports": []
|
||||
},
|
||||
"demo/browser.js": {
|
||||
"bytes": 26690,
|
||||
"bytes": 26720,
|
||||
"imports": [
|
||||
{
|
||||
"path": "dist/human.esm.js",
|
||||
|
@ -43,14 +43,14 @@
|
|||
"imports": [],
|
||||
"exports": [],
|
||||
"inputs": {},
|
||||
"bytes": 2021862
|
||||
"bytes": 2022083
|
||||
},
|
||||
"dist/demo-browser-index.js": {
|
||||
"imports": [],
|
||||
"exports": [],
|
||||
"inputs": {
|
||||
"dist/human.esm.js": {
|
||||
"bytesInOutput": 1339746
|
||||
"bytesInOutput": 1339815
|
||||
},
|
||||
"demo/draw.js": {
|
||||
"bytesInOutput": 6204
|
||||
|
@ -65,7 +65,7 @@
|
|||
"bytesInOutput": 17340
|
||||
}
|
||||
},
|
||||
"bytes": 1388130
|
||||
"bytes": 1388199
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
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
|
@ -175,7 +175,7 @@
|
|||
]
|
||||
},
|
||||
"src/embedding/embedding.ts": {
|
||||
"bytes": 1909,
|
||||
"bytes": 2022,
|
||||
"imports": [
|
||||
{
|
||||
"path": "src/log.ts",
|
||||
|
@ -499,7 +499,7 @@
|
|||
"imports": [],
|
||||
"exports": [],
|
||||
"inputs": {},
|
||||
"bytes": 1924685
|
||||
"bytes": 1924848
|
||||
},
|
||||
"dist/human.esm.js": {
|
||||
"imports": [],
|
||||
|
@ -556,7 +556,7 @@
|
|||
"bytesInOutput": 1180
|
||||
},
|
||||
"src/embedding/embedding.ts": {
|
||||
"bytesInOutput": 725
|
||||
"bytesInOutput": 794
|
||||
},
|
||||
"src/posenet/posenet.ts": {
|
||||
"bytesInOutput": 1007
|
||||
|
@ -622,7 +622,7 @@
|
|||
"bytesInOutput": 2572
|
||||
}
|
||||
},
|
||||
"bytes": 1347222
|
||||
"bytes": 1347291
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
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
|
@ -175,7 +175,7 @@
|
|||
]
|
||||
},
|
||||
"src/embedding/embedding.ts": {
|
||||
"bytes": 1909,
|
||||
"bytes": 2022,
|
||||
"imports": [
|
||||
{
|
||||
"path": "src/log.ts",
|
||||
|
@ -499,7 +499,7 @@
|
|||
"imports": [],
|
||||
"exports": [],
|
||||
"inputs": {},
|
||||
"bytes": 705270
|
||||
"bytes": 705433
|
||||
},
|
||||
"dist/human.node-gpu.js": {
|
||||
"imports": [],
|
||||
|
@ -554,7 +554,7 @@
|
|||
"bytesInOutput": 1247
|
||||
},
|
||||
"src/embedding/embedding.ts": {
|
||||
"bytesInOutput": 769
|
||||
"bytesInOutput": 838
|
||||
},
|
||||
"src/posenet/posenet.ts": {
|
||||
"bytesInOutput": 1030
|
||||
|
@ -620,7 +620,7 @@
|
|||
"bytesInOutput": 2569
|
||||
}
|
||||
},
|
||||
"bytes": 276775
|
||||
"bytes": 276844
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -175,7 +175,7 @@
|
|||
]
|
||||
},
|
||||
"src/embedding/embedding.ts": {
|
||||
"bytes": 1909,
|
||||
"bytes": 2022,
|
||||
"imports": [
|
||||
{
|
||||
"path": "src/log.ts",
|
||||
|
@ -499,7 +499,7 @@
|
|||
"imports": [],
|
||||
"exports": [],
|
||||
"inputs": {},
|
||||
"bytes": 1924696
|
||||
"bytes": 1924859
|
||||
},
|
||||
"dist/human.ts": {
|
||||
"imports": [],
|
||||
|
@ -554,7 +554,7 @@
|
|||
"bytesInOutput": 1180
|
||||
},
|
||||
"src/embedding/embedding.ts": {
|
||||
"bytesInOutput": 725
|
||||
"bytesInOutput": 794
|
||||
},
|
||||
"src/posenet/posenet.ts": {
|
||||
"bytesInOutput": 1007
|
||||
|
@ -620,7 +620,7 @@
|
|||
"bytesInOutput": 2572
|
||||
}
|
||||
},
|
||||
"bytes": 1347264
|
||||
"bytes": 1347333
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
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 it is too large
Load Diff
|
@ -64,6 +64,43 @@ const config = {
|
|||
};
|
||||
|
||||
const targets = {
|
||||
node: {
|
||||
tfjs: {
|
||||
platform: 'node',
|
||||
format: 'cjs',
|
||||
metafile: 'dist/tfjs.esm.json',
|
||||
entryPoints: ['src/tfjs/tf-node.ts'],
|
||||
outfile: 'dist/tfjs.esm.js',
|
||||
external: ['@tensorflow'],
|
||||
},
|
||||
node: {
|
||||
platform: 'node',
|
||||
format: 'cjs',
|
||||
metafile: 'dist/human.node.json',
|
||||
entryPoints: ['src/human.ts'],
|
||||
outfile: 'dist/human.node.js',
|
||||
external: ['@tensorflow'],
|
||||
},
|
||||
},
|
||||
nodeGPU: {
|
||||
tfjs: {
|
||||
platform: 'node',
|
||||
format: 'cjs',
|
||||
metafile: 'dist/tfjs.esm.json',
|
||||
entryPoints: ['src/tfjs/tf-node-gpu.ts'],
|
||||
outfile: 'dist/tfjs.esm.js',
|
||||
external: ['@tensorflow'],
|
||||
},
|
||||
node: {
|
||||
platform: 'node',
|
||||
format: 'cjs',
|
||||
metafile: 'dist/human.node.json',
|
||||
entryPoints: ['src/human.ts'],
|
||||
outfile: 'dist/human.node-gpu.js',
|
||||
external: ['@tensorflow'],
|
||||
},
|
||||
},
|
||||
|
||||
browserNoBundle: {
|
||||
tfjs: {
|
||||
platform: 'browser',
|
||||
|
@ -117,42 +154,6 @@ const targets = {
|
|||
external: ['fs', 'buffer', 'util'],
|
||||
},
|
||||
},
|
||||
node: {
|
||||
tfjs: {
|
||||
platform: 'node',
|
||||
format: 'cjs',
|
||||
metafile: 'dist/tfjs.esm.json',
|
||||
entryPoints: ['src/tfjs/tf-node.ts'],
|
||||
outfile: 'dist/tfjs.esm.js',
|
||||
external: ['@tensorflow'],
|
||||
},
|
||||
node: {
|
||||
platform: 'node',
|
||||
format: 'cjs',
|
||||
metafile: 'dist/human.node.json',
|
||||
entryPoints: ['src/human.ts'],
|
||||
outfile: 'dist/human.node.js',
|
||||
external: ['@tensorflow'],
|
||||
},
|
||||
},
|
||||
nodeGPU: {
|
||||
tfjs: {
|
||||
platform: 'node',
|
||||
format: 'cjs',
|
||||
metafile: 'dist/tfjs.esm.json',
|
||||
entryPoints: ['src/tfjs/tf-node-gpu.ts'],
|
||||
outfile: 'dist/tfjs.esm.js',
|
||||
external: ['@tensorflow'],
|
||||
},
|
||||
node: {
|
||||
platform: 'node',
|
||||
format: 'cjs',
|
||||
metafile: 'dist/human.node.json',
|
||||
entryPoints: ['src/human.ts'],
|
||||
outfile: 'dist/human.node-gpu.js',
|
||||
external: ['@tensorflow'],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
async function getStats(metafile) {
|
||||
|
|
|
@ -16,6 +16,8 @@ export async function load(config) {
|
|||
}
|
||||
|
||||
export function simmilarity(embedding1, embedding2) {
|
||||
if (!embedding1 || embedding2) return 0;
|
||||
if (embedding1?.length === 0 || embedding2?.length === 0) return 0;
|
||||
if (embedding1?.length !== embedding2?.length) return 0;
|
||||
// general minkowski distance
|
||||
// euclidean distance is limited case where order is 2
|
||||
|
|
Loading…
Reference in New Issue