mirror of https://github.com/vladmandic/human
release candidate
parent
be328a3707
commit
cd0d39a8e3
|
@ -9,8 +9,10 @@
|
|||
|
||||
## Changelog
|
||||
|
||||
### **HEAD -> main** 2022/09/03 mandic00@live.com
|
||||
### **HEAD -> main** 2022/09/06 mandic00@live.com
|
||||
|
||||
- add config flags
|
||||
- test update
|
||||
- release preview
|
||||
- optimize startup sequence
|
||||
- reorder backend init code
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -83922,6 +83922,10 @@ async function check(instance2, force = false) {
|
|||
defaultFlags = JSON.parse(JSON.stringify(env().flags));
|
||||
}
|
||||
if (getBackend() === "humangl" || getBackend() === "webgl") {
|
||||
if (env().flagRegistry.WEBGL_USE_SHAPES_UNIFORMS)
|
||||
env().set("WEBGL_USE_SHAPES_UNIFORMS", true);
|
||||
if (env().flagRegistry.WEBGL_EXP_CONV)
|
||||
env().set("WEBGL_EXP_CONV", true);
|
||||
if (instance2.config.debug && typeof instance2.config.deallocate !== "undefined" && instance2.config.deallocate) {
|
||||
log("changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:", true);
|
||||
env().set("WEBGL_DELETE_TEXTURE_THRESHOLD", 0);
|
||||
|
|
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
|
@ -158,8 +158,8 @@ export async function check(instance: Human, force = false) {
|
|||
|
||||
// customize humangl
|
||||
if (tf.getBackend() === 'humangl' || tf.getBackend() === 'webgl') {
|
||||
// if (tf.env().flagRegistry.WEBGL_USE_SHAPES_UNIFORMS) tf.env().set('WEBGL_USE_SHAPES_UNIFORMS', true); // default=false <https://github.com/tensorflow/tfjs/issues/5205>
|
||||
// if (tf.env().flagRegistry.WEBGL_EXP_CONV) tf.env().set('WEBGL_EXP_CONV', true); // default=false <https://github.com/tensorflow/tfjs/issues/6678>
|
||||
if (tf.env().flagRegistry.WEBGL_USE_SHAPES_UNIFORMS) tf.env().set('WEBGL_USE_SHAPES_UNIFORMS', true); // default=false <https://github.com/tensorflow/tfjs/issues/5205>
|
||||
if (tf.env().flagRegistry.WEBGL_EXP_CONV) tf.env().set('WEBGL_EXP_CONV', true); // default=false <https://github.com/tensorflow/tfjs/issues/6678>
|
||||
// if (tf.env().flagRegistry['WEBGL_PACK_DEPTHWISECONV']) tf.env().set('WEBGL_PACK_DEPTHWISECONV', false); // default=true <https://github.com/tensorflow/tfjs/pull/4909>
|
||||
// if (tf.env().flagRegistry.USE_SETTIMEOUTCUSTOM) tf.env().set('USE_SETTIMEOUTCUSTOM', true); // default=false <https://github.com/tensorflow/tfjs/issues/6687>
|
||||
// if (tf.env().flagRegistry.CPU_HANDOFF_SIZE_THRESHOLD) tf.env().set('CPU_HANDOFF_SIZE_THRESHOLD', 1024); // default=1000
|
||||
|
|
|
@ -1,39 +1,39 @@
|
|||
2022-09-06 10:28:18 [32mDATA: [39m Build {"name":"@vladmandic/human","version":"2.10.0"}
|
||||
2022-09-06 10:28:18 [36mINFO: [39m Application: {"name":"@vladmandic/human","version":"2.10.0"}
|
||||
2022-09-06 10:28:18 [36mINFO: [39m Environment: {"profile":"production","config":".build.json","package":"package.json","tsconfig":true,"eslintrc":true,"git":true}
|
||||
2022-09-06 10:28:18 [36mINFO: [39m Toolchain: {"build":"0.7.11","esbuild":"0.15.7","typescript":"4.8.2","typedoc":"0.23.14","eslint":"8.23.0"}
|
||||
2022-09-06 10:28:18 [36mINFO: [39m Build: {"profile":"production","steps":["clean","compile","typings","typedoc","lint","changelog"]}
|
||||
2022-09-06 10:28:18 [35mSTATE:[39m Clean: {"locations":["dist/*","types/lib/*","typedoc/*"]}
|
||||
2022-09-06 10:28:18 [35mSTATE:[39m Compile: {"name":"tfjs/nodejs/cpu","format":"cjs","platform":"node","input":"tfjs/tf-node.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":159,"outputBytes":608}
|
||||
2022-09-06 10:28:18 [35mSTATE:[39m Compile: {"name":"human/nodejs/cpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node.js","files":75,"inputBytes":656961,"outputBytes":308696}
|
||||
2022-09-06 10:28:18 [35mSTATE:[39m Compile: {"name":"tfjs/nodejs/gpu","format":"cjs","platform":"node","input":"tfjs/tf-node-gpu.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":167,"outputBytes":612}
|
||||
2022-09-06 10:28:18 [35mSTATE:[39m Compile: {"name":"human/nodejs/gpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-gpu.js","files":75,"inputBytes":656965,"outputBytes":308700}
|
||||
2022-09-06 10:28:18 [35mSTATE:[39m Compile: {"name":"tfjs/nodejs/wasm","format":"cjs","platform":"node","input":"tfjs/tf-node-wasm.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":206,"outputBytes":664}
|
||||
2022-09-06 10:28:18 [35mSTATE:[39m Compile: {"name":"human/nodejs/wasm","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-wasm.js","files":75,"inputBytes":657017,"outputBytes":308750}
|
||||
2022-09-06 10:28:18 [35mSTATE:[39m Compile: {"name":"tfjs/browser/version","format":"esm","platform":"browser","input":"tfjs/tf-version.ts","output":"dist/tfjs.version.js","files":1,"inputBytes":1125,"outputBytes":358}
|
||||
2022-09-06 10:28:18 [35mSTATE:[39m Compile: {"name":"tfjs/browser/esm/nobundle","format":"esm","platform":"browser","input":"tfjs/tf-browser.ts","output":"dist/tfjs.esm.js","files":2,"inputBytes":1088,"outputBytes":583}
|
||||
2022-09-06 10:28:18 [35mSTATE:[39m Compile: {"name":"human/browser/esm/nobundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm-nobundle.js","files":75,"inputBytes":656936,"outputBytes":307570}
|
||||
2022-09-06 10:28:18 [35mSTATE:[39m Compile: {"name":"tfjs/browser/esm/custom","format":"esm","platform":"browser","input":"tfjs/tf-custom.ts","output":"dist/tfjs.esm.js","files":11,"inputBytes":1344,"outputBytes":2821914}
|
||||
2022-09-06 10:28:18 [35mSTATE:[39m Compile: {"name":"human/browser/iife/bundle","format":"iife","platform":"browser","input":"src/human.ts","output":"dist/human.js","files":75,"inputBytes":3478267,"outputBytes":1687773}
|
||||
2022-09-06 10:28:18 [35mSTATE:[39m Compile: {"name":"human/browser/esm/bundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm.js","files":75,"inputBytes":3478267,"outputBytes":3108879}
|
||||
2022-09-06 10:28:23 [35mSTATE:[39m Typings: {"input":"src/human.ts","output":"types/lib","files":30}
|
||||
2022-09-06 10:28:25 [35mSTATE:[39m TypeDoc: {"input":"src/human.ts","output":"typedoc","objects":77,"generated":true}
|
||||
2022-09-06 10:28:25 [35mSTATE:[39m Compile: {"name":"demo/typescript","format":"esm","platform":"browser","input":"demo/typescript/index.ts","output":"demo/typescript/index.js","files":1,"inputBytes":6714,"outputBytes":3134}
|
||||
2022-09-06 10:28:25 [35mSTATE:[39m Compile: {"name":"demo/faceid","format":"esm","platform":"browser","input":"demo/faceid/index.ts","output":"demo/faceid/index.js","files":2,"inputBytes":15488,"outputBytes":7788}
|
||||
2022-09-06 10:28:35 [35mSTATE:[39m Lint: {"locations":["*.json","src/**/*.ts","test/**/*.js","demo/**/*.js"],"files":110,"errors":0,"warnings":0}
|
||||
2022-09-06 10:28:36 [35mSTATE:[39m ChangeLog: {"repository":"https://github.com/vladmandic/human","branch":"main","output":"CHANGELOG.md"}
|
||||
2022-09-06 10:28:36 [35mSTATE:[39m Copy: {"input":"tfjs/tfjs.esm.d.ts"}
|
||||
2022-09-06 10:28:36 [36mINFO: [39m Done...
|
||||
2022-09-06 10:28:36 [35mSTATE:[39m API-Extractor: {"succeeeded":true,"errors":0,"warnings":193}
|
||||
2022-09-06 10:28:36 [35mSTATE:[39m Copy: {"input":"types/human.d.ts"}
|
||||
2022-09-06 10:28:36 [36mINFO: [39m Analyze models: {"folders":8,"result":"models/models.json"}
|
||||
2022-09-06 10:28:36 [35mSTATE:[39m Models {"folder":"./models","models":13}
|
||||
2022-09-06 10:28:36 [35mSTATE:[39m Models {"folder":"../human-models/models","models":42}
|
||||
2022-09-06 10:28:36 [35mSTATE:[39m Models {"folder":"../blazepose/model/","models":4}
|
||||
2022-09-06 10:28:36 [35mSTATE:[39m Models {"folder":"../anti-spoofing/model","models":1}
|
||||
2022-09-06 10:28:36 [35mSTATE:[39m Models {"folder":"../efficientpose/models","models":3}
|
||||
2022-09-06 10:28:36 [35mSTATE:[39m Models {"folder":"../insightface/models","models":5}
|
||||
2022-09-06 10:28:36 [35mSTATE:[39m Models {"folder":"../movenet/models","models":3}
|
||||
2022-09-06 10:28:36 [35mSTATE:[39m Models {"folder":"../nanodet/models","models":4}
|
||||
2022-09-06 10:28:37 [35mSTATE:[39m Models: {"count":57,"totalSize":383017442}
|
||||
2022-09-06 10:28:37 [36mINFO: [39m Human Build complete... {"logFile":"test/build.log"}
|
||||
2022-09-07 10:52:03 [32mDATA: [39m Build {"name":"@vladmandic/human","version":"2.10.0"}
|
||||
2022-09-07 10:52:03 [36mINFO: [39m Application: {"name":"@vladmandic/human","version":"2.10.0"}
|
||||
2022-09-07 10:52:03 [36mINFO: [39m Environment: {"profile":"production","config":".build.json","package":"package.json","tsconfig":true,"eslintrc":true,"git":true}
|
||||
2022-09-07 10:52:03 [36mINFO: [39m Toolchain: {"build":"0.7.11","esbuild":"0.15.7","typescript":"4.8.2","typedoc":"0.23.14","eslint":"8.23.0"}
|
||||
2022-09-07 10:52:03 [36mINFO: [39m Build: {"profile":"production","steps":["clean","compile","typings","typedoc","lint","changelog"]}
|
||||
2022-09-07 10:52:03 [35mSTATE:[39m Clean: {"locations":["dist/*","types/lib/*","typedoc/*"]}
|
||||
2022-09-07 10:52:03 [35mSTATE:[39m Compile: {"name":"tfjs/nodejs/cpu","format":"cjs","platform":"node","input":"tfjs/tf-node.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":159,"outputBytes":608}
|
||||
2022-09-07 10:52:03 [35mSTATE:[39m Compile: {"name":"human/nodejs/cpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node.js","files":75,"inputBytes":656955,"outputBytes":308860}
|
||||
2022-09-07 10:52:03 [35mSTATE:[39m Compile: {"name":"tfjs/nodejs/gpu","format":"cjs","platform":"node","input":"tfjs/tf-node-gpu.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":167,"outputBytes":612}
|
||||
2022-09-07 10:52:03 [35mSTATE:[39m Compile: {"name":"human/nodejs/gpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-gpu.js","files":75,"inputBytes":656959,"outputBytes":308864}
|
||||
2022-09-07 10:52:03 [35mSTATE:[39m Compile: {"name":"tfjs/nodejs/wasm","format":"cjs","platform":"node","input":"tfjs/tf-node-wasm.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":206,"outputBytes":664}
|
||||
2022-09-07 10:52:03 [35mSTATE:[39m Compile: {"name":"human/nodejs/wasm","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-wasm.js","files":75,"inputBytes":657011,"outputBytes":308914}
|
||||
2022-09-07 10:52:03 [35mSTATE:[39m Compile: {"name":"tfjs/browser/version","format":"esm","platform":"browser","input":"tfjs/tf-version.ts","output":"dist/tfjs.version.js","files":1,"inputBytes":1125,"outputBytes":358}
|
||||
2022-09-07 10:52:03 [35mSTATE:[39m Compile: {"name":"tfjs/browser/esm/nobundle","format":"esm","platform":"browser","input":"tfjs/tf-browser.ts","output":"dist/tfjs.esm.js","files":2,"inputBytes":1088,"outputBytes":583}
|
||||
2022-09-07 10:52:03 [35mSTATE:[39m Compile: {"name":"human/browser/esm/nobundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm-nobundle.js","files":75,"inputBytes":656930,"outputBytes":307734}
|
||||
2022-09-07 10:52:03 [35mSTATE:[39m Compile: {"name":"tfjs/browser/esm/custom","format":"esm","platform":"browser","input":"tfjs/tf-custom.ts","output":"dist/tfjs.esm.js","files":11,"inputBytes":1344,"outputBytes":2821914}
|
||||
2022-09-07 10:52:03 [35mSTATE:[39m Compile: {"name":"human/browser/iife/bundle","format":"iife","platform":"browser","input":"src/human.ts","output":"dist/human.js","files":75,"inputBytes":3478261,"outputBytes":1687921}
|
||||
2022-09-07 10:52:03 [35mSTATE:[39m Compile: {"name":"human/browser/esm/bundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm.js","files":75,"inputBytes":3478261,"outputBytes":3109077}
|
||||
2022-09-07 10:52:08 [35mSTATE:[39m Typings: {"input":"src/human.ts","output":"types/lib","files":30}
|
||||
2022-09-07 10:52:10 [35mSTATE:[39m TypeDoc: {"input":"src/human.ts","output":"typedoc","objects":77,"generated":true}
|
||||
2022-09-07 10:52:10 [35mSTATE:[39m Compile: {"name":"demo/typescript","format":"esm","platform":"browser","input":"demo/typescript/index.ts","output":"demo/typescript/index.js","files":1,"inputBytes":6714,"outputBytes":3134}
|
||||
2022-09-07 10:52:10 [35mSTATE:[39m Compile: {"name":"demo/faceid","format":"esm","platform":"browser","input":"demo/faceid/index.ts","output":"demo/faceid/index.js","files":2,"inputBytes":15488,"outputBytes":7788}
|
||||
2022-09-07 10:52:21 [35mSTATE:[39m Lint: {"locations":["*.json","src/**/*.ts","test/**/*.js","demo/**/*.js"],"files":110,"errors":0,"warnings":0}
|
||||
2022-09-07 10:52:21 [35mSTATE:[39m ChangeLog: {"repository":"https://github.com/vladmandic/human","branch":"main","output":"CHANGELOG.md"}
|
||||
2022-09-07 10:52:21 [35mSTATE:[39m Copy: {"input":"tfjs/tfjs.esm.d.ts"}
|
||||
2022-09-07 10:52:21 [36mINFO: [39m Done...
|
||||
2022-09-07 10:52:22 [35mSTATE:[39m API-Extractor: {"succeeeded":true,"errors":0,"warnings":193}
|
||||
2022-09-07 10:52:22 [35mSTATE:[39m Copy: {"input":"types/human.d.ts"}
|
||||
2022-09-07 10:52:22 [36mINFO: [39m Analyze models: {"folders":8,"result":"models/models.json"}
|
||||
2022-09-07 10:52:22 [35mSTATE:[39m Models {"folder":"./models","models":13}
|
||||
2022-09-07 10:52:22 [35mSTATE:[39m Models {"folder":"../human-models/models","models":42}
|
||||
2022-09-07 10:52:22 [35mSTATE:[39m Models {"folder":"../blazepose/model/","models":4}
|
||||
2022-09-07 10:52:22 [35mSTATE:[39m Models {"folder":"../anti-spoofing/model","models":1}
|
||||
2022-09-07 10:52:22 [35mSTATE:[39m Models {"folder":"../efficientpose/models","models":3}
|
||||
2022-09-07 10:52:22 [35mSTATE:[39m Models {"folder":"../insightface/models","models":5}
|
||||
2022-09-07 10:52:22 [35mSTATE:[39m Models {"folder":"../movenet/models","models":3}
|
||||
2022-09-07 10:52:22 [35mSTATE:[39m Models {"folder":"../nanodet/models","models":4}
|
||||
2022-09-07 10:52:23 [35mSTATE:[39m Models: {"count":57,"totalSize":383017442}
|
||||
2022-09-07 10:52:23 [36mINFO: [39m Human Build complete... {"logFile":"test/build.log"}
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>FaceRes Tests</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, shrink-to-fit=yes">
|
||||
</head>
|
||||
<body style="font-size: 12px; margin: 0; background: black; color: white; width: 100vw; line-height: 200%">
|
||||
<pre id="log"></pre>
|
||||
<script type="module">
|
||||
import 'https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@3.20.0/dist/tf.es2017.js'
|
||||
|
||||
async function log(msg) {
|
||||
document.getElementById('log').innerHTML += (typeof msg === 'object' ? JSON.stringify(msg, null, 0) : msg) + '<br>';
|
||||
console.log(msg);
|
||||
}
|
||||
|
||||
async function image2tensor(url) {
|
||||
const img = document.createElement('img');
|
||||
const loaded = new Promise((resolve) => { img.onload = () => resolve(true); });
|
||||
img.src = url;
|
||||
await loaded;
|
||||
const tensor = tf.browser.fromPixels(img, 3).expandDims(0).cast('float32');
|
||||
return tensor;
|
||||
}
|
||||
|
||||
|
||||
async function main() {
|
||||
log({ version: tf.version });
|
||||
tf.enableDebugMode();
|
||||
tf.setBackend('webgl');
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
if (params.has('uniforms')) tf.env().set('WEBGL_USE_SHAPES_UNIFORMS', true);
|
||||
await tf.ready();
|
||||
log({ backend: tf.getBackend() });
|
||||
log({ flags: tf.env().flags });
|
||||
log({ uniforms: tf.env().flags['WEBGL_USE_SHAPES_UNIFORMS'] ? true : false })
|
||||
const model = await tf.loadGraphModel('https://vladmandic.github.io/human/models/faceres.json');
|
||||
log({ model: model.modelUrl });
|
||||
// const input = tf.randomUniform([1, 224, 224, 3], 0, 1, 'float32');
|
||||
const input = await image2tensor(imgDataUrl);
|
||||
log({ input: input.shape });
|
||||
const res = model.execute(input);
|
||||
const data = res.map((t) => Array.from(t.dataSync()));
|
||||
for (let i = 0; i < res.length; i++) {
|
||||
log({ result: i, tensor: res[i] })
|
||||
log({ result: i, data: data[i] })
|
||||
log({ result: i, status: (data[i][0] && data[i].reduce((prev, curr) => (prev && (curr >= 0)), true)) ? 'pass' : 'fail' })
|
||||
}
|
||||
}
|
||||
|
||||
const imgDataUrl = 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/4gIoSUNDX1BST0ZJTEUAAQEAAAIYAAAAAAQwAABtbnRyUkdCIFhZWiAAAAAAAAAAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAAHRyWFlaAAABZAAAABRnWFlaAAABeAAAABRiWFlaAAABjAAAABRyVFJDAAABoAAAAChnVFJDAAABoAAAAChiVFJDAAABoAAAACh3dHB0AAAByAAAABRjcHJ0AAAB3AAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAFgAAAAcA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+TVhgl4GxxL4GLGkF0KZdhbSqDKRZdgPhlbuaKJmyOELQzBn3IXkW5JMVFPHK10NTNdFSstCY+6NplxlKL5Ny652Y0eASJ2rKvkrJkWFYEWFZBlTJYKZdmkSyWU2UBdkKJYBEsEuwE6tXjOa3TOnqOcTOXkXJjp058EnZYlSaCU7MtnRfJoxsxqXI+Ew1G6DGLoyQmNWQgawHwBLMkLcpTfwioJyt0g8aQMY0HuSQCtTk2zSRcf1MdmTUZLzGnTxfp8+SBmJyXBojL5F465RUvbLsRLNaVJeCWZJZXF2h2PIpo6S65dTD4sKwIhFRkRYKZdlRbKspkAuyAksAkyFEAHM/02c7J2zdnl7aMM+znXXmfCZRFu0PBcU0RSd7TDjma8FPE7CjiYU2GaXwNWScgIYx8IpBV44PtjVSB3JIVPL8AOeShWTLwIlkA902EMxP1MyilbZ0mlGKS8GfS4fSju/kx6W6VWRRYoN8smbbGP2GnSpCs8k+AM8dzlT8jYQlCXDFL5s0w6RZWeo0Y5WuewxcEGzo5MaZYCYVlRbZRTZIvkA1GwtjG4YbjTLDFQZnWpy5z4KcuBuWKRkySJa1OYHLKzNLsZJi32ZbAyIuigi12MihaYxBRppBbxZUpUBcpsVKVlSlbKbUVb7AukuZM06OKk/Ukqiuvsy48byzuXXk1b7qMOl0QjQ8jlKkWp09seRG/Zwu2MhUY3fIU2WTau+TPPJcf7FZclypA2A/FG+Wa1HajPpuFufSDyZOG26BWvGG+jJgySSV8o03aOrhX/9k='
|
||||
|
||||
window.onload = main;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,86 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Human Embedding Tests</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, shrink-to-fit=yes">
|
||||
<style>
|
||||
html { font-size: 10px; font-variant: small-caps; }
|
||||
body { margin: 0; background: black; color: white; width: 100vw; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="position: fixed; top: 20px; right: 20px; background: #333333; padding: 10px">
|
||||
<input type="checkbox" id="glShapesUniform" name="glShapesUniform" value="glShapesUniform">
|
||||
<label for="glShapesUniform">Enable WebGL Uniforms for Shapes</label><br>
|
||||
<input type="checkbox" id="glExpandedConv" name="glExpandedConv" value="glExpandedConv">
|
||||
<label for="glExpandedConv">Enable WebGL Expanded Convolutions</label><br><br>
|
||||
<button id="run">Run Test</button>
|
||||
</div>
|
||||
<pre id="log" style="line-height: 150%; overflow-x: hidden; white-space: pre-wrap"></pre>
|
||||
<script type="module">
|
||||
import { Human } from '../dist/human.esm.js';
|
||||
|
||||
const testConfig = {
|
||||
debug: true,
|
||||
async: false,
|
||||
modelBasePath: 'https://vladmandic.github.io/human-models/models/',
|
||||
cacheSensitivity: 0,
|
||||
cacheModels: false,
|
||||
warmup: 'face',
|
||||
face: { iris: { enabled: false }, emotion: { enabled: false }, mesh: { enabled: true }, descriptior: { enabled: true } },
|
||||
body: { enabled: false },
|
||||
hand: { enabled: false },
|
||||
object: { enabled: false },
|
||||
segmentation: { enabled: false },
|
||||
gestures: { enabled: false },
|
||||
};
|
||||
|
||||
function str(...msg) {
|
||||
if (!Array.isArray(msg)) return msg;
|
||||
let line = '';
|
||||
for (const entry of msg) {
|
||||
if (typeof entry === 'object') line += ' ' + JSON.stringify(entry, null, 0).replace(/"/g, '').replace(/,/g, ', ').replace(/:/g, ': ');
|
||||
else line += ' ' + entry;
|
||||
}
|
||||
return line + '\n';
|
||||
}
|
||||
|
||||
async function log(...msgs) {
|
||||
document.getElementById('log').innerHTML += str(...msgs);
|
||||
document.documentElement.scrollTop = document.documentElement.scrollHeight;
|
||||
console.log(...msgs); // eslint-disable-line no-console
|
||||
}
|
||||
|
||||
async function main() {
|
||||
document.getElementById('run').disabled = true;
|
||||
const human = new Human(testConfig);
|
||||
await human.init();
|
||||
const glShapesUniform = document.getElementById('glShapesUniform').checked;
|
||||
const glExpandedConv = document.getElementById('glExpandedConv').checked
|
||||
if (glShapesUniform) human.tf.env().set('WEBGL_USE_SHAPES_UNIFORMS', true);
|
||||
if (glExpandedConv) human.tf.env().set('WEBGL_EXP_CONV', true);
|
||||
await human.load();
|
||||
await human.check();
|
||||
let res;
|
||||
res = await human.warmup({ warmup: 'none' });
|
||||
if (Array.isArray(res?.face?.[0]?.embedding) && (res?.face?.[0]?.embedding.length === 1024)) res.face[0].embedding.length = 10;
|
||||
const pass0 = res?.face?.[0]?.embedding?.[0] === 0 ? true : false;
|
||||
log({ backend: human.tf.getBackend(), pass: pass0, warmup: human.config.warmup, gender: res?.face?.[0]?.gender, genderScore: res?.face?.[0]?.genderScore, age: res?.face?.[0]?.age, embedding: res?.face?.[0]?.embedding });
|
||||
res = await human.warmup({ warmup: 'face' });
|
||||
if (Array.isArray(res?.face?.[0]?.embedding) && (res?.face?.[0]?.embedding.length === 1024)) res.face[0].embedding.length = 10;
|
||||
console.log('EEEE', res?.face?.[0]?.embedding?.[0]);
|
||||
const pass1 = res?.face?.[0]?.embedding?.[0] === 0 ? true : false;
|
||||
log({ backend: human.tf.getBackend(), pass: pass1, warmup: human.config.warmup, gender: res?.face?.[0]?.gender, genderScore: res?.face?.[0]?.genderScore, age: res?.face?.[0]?.age, embedding: res?.face?.[0]?.embedding });
|
||||
res = await human.warmup({ warmup: 'body' });
|
||||
if (Array.isArray(res?.face?.[0]?.embedding) && (res?.face?.[0]?.embedding.length === 1024)) res.face[0].embedding.length = 10;
|
||||
const pass2 = res?.face?.[0]?.embedding?.[0] === 0 ? true : false;
|
||||
log({ backend: human.tf.getBackend(), pass: pass2, warmup: human.config.warmup, gender: res?.face?.[0]?.gender, genderScore: res?.face?.[0]?.genderScore, age: res?.face?.[0]?.age, embedding: res?.face?.[0]?.embedding });
|
||||
const pass = !pass0 && pass1 && pass2;
|
||||
log({ test: 'complete', pass, glShapesUniform, glExpandedConv });
|
||||
}
|
||||
|
||||
document.getElementById('run').addEventListener('click', main);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
1999
test/test.log
1999
test/test.log
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue