release preview

pull/356/head
Vladimir Mandic 2022-09-03 07:13:08 -04:00
parent 9154f4ef3e
commit cec65ac16c
13 changed files with 1061 additions and 1059 deletions

View File

@ -1,6 +1,6 @@
# @vladmandic/human
Version: **2.9.4**
Version: **2.10.0**
Description: **Human: AI-powered 3D Face Detection & Rotation Tracking, Face Description & Recognition, Body Pose Tracking, 3D Hand & Finger Tracking, Iris Analysis, Age & Gender & Emotion Prediction, Gesture Recognition**
Author: **Vladimir Mandic <mandic00@live.com>**

View File

@ -43,8 +43,10 @@ Enable via `about:config` -> `gfx.offscreencanvas.enabled`
## Pending Release Changes
- Update **TFJS** to **3.20.0**
- Update **TypeScript** to **4.8**
- Update **TFJS** to **3.20.0**
- Update **TypeScript** to **4.8**
- Switch default backend from custom `humangl` to `webgl`
Stability and availability of features in standard **TFJS** allows to switch back
- Add **InsightFace** model as alternative for face embedding/descriptor detection
Compatible with multiple variations of **InsightFace** models
Configurable using `config.face.insightface` config section

View File

@ -81,7 +81,7 @@ async function main() {
log.state('Copy:', { input: 'tfjs/tfjs.esm.d.ts' });
copy('tfjs/tfjs.esm.d.ts', 'types/lib/dist/tfjs.esm.d.ts');
// run api-extractor to create typedef rollup
const extractorConfig = APIExtractor.ExtractorConfig.loadFileAndPrepare('api-extractor.json');
const extractorConfig = APIExtractor.ExtractorConfig.loadFileAndPrepare('.api-extractor.json');
const extractorResult = APIExtractor.Extractor.invoke(extractorConfig, {
localBuild: true,
showVerboseMessages: false,

View File

@ -34,7 +34,7 @@ let userConfig = {
// hand: { enabled: false },
/*
warmup: 'none',
backend: 'humangl',
backend: 'webgl',
debug: true,
wasmPath: 'https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@3.9.0/dist/',
async: false,
@ -1094,7 +1094,7 @@ async function main() {
}
if (human.config.debug) log('environment:', human.env);
if (human.config.backend === 'humangl' && human.config.debug) log('backend:', human.gl);
if (human.config.backend === 'webgl' && human.config.debug) log('backend:', human.gl);
}
window.onload = main;

View File

@ -13,7 +13,7 @@ const workerJS = './worker.js';
const config = {
main: { // processes input and runs gesture analysis
warmup: 'none',
backend: 'humangl',
backend: 'webgl',
modelBasePath: '../../models/',
async: false,
filter: { enabled: true },
@ -26,7 +26,7 @@ const config = {
},
face: { // runs all face models
warmup: 'none',
backend: 'humangl',
backend: 'webgl',
modelBasePath: '../../models/',
async: false,
filter: { enabled: false },
@ -39,7 +39,7 @@ const config = {
},
body: { // runs body model
warmup: 'none',
backend: 'humangl',
backend: 'webgl',
modelBasePath: '../../models/',
async: false,
filter: { enabled: false },
@ -52,7 +52,7 @@ const config = {
},
hand: { // runs hands model
warmup: 'none',
backend: 'humangl',
backend: 'webgl',
modelBasePath: '../../models/',
async: false,
filter: { enabled: false },
@ -65,7 +65,7 @@ const config = {
},
object: { // runs object model
warmup: 'none',
backend: 'humangl',
backend: 'webgl',
modelBasePath: '../../models/',
async: false,
filter: { enabled: false },

View File

@ -5,7 +5,7 @@ After=network.target network-online.target
[Service]
Type=simple
Environment="NODE_ENV=production"
ExecStart=<path-to-node> <your-project-folder>/node_modules/@vladmandic/build/src/build.js --profile development
ExecStart=<path-to-node> <your-project-folder>/node_modules/@vladmandic/build/src/build.js --profile serve
WorkingDirectory=<your-project-folder>
StandardOutput=inherit
StandardError=inherit

View File

@ -1,6 +1,6 @@
{
"name": "@vladmandic/human",
"version": "2.9.4",
"version": "2.10.0",
"description": "Human: AI-powered 3D Face Detection & Rotation Tracking, Face Description & Recognition, Body Pose Tracking, 3D Hand & Finger Tracking, Iris Analysis, Age & Gender & Emotion Prediction, Gesture Recognition",
"sideEffects": false,
"main": "dist/human.node.js",
@ -63,7 +63,7 @@
"devDependencies": {
"@html-eslint/eslint-plugin": "^0.13.2",
"@html-eslint/parser": "^0.13.2",
"@microsoft/api-extractor": "^7.29.5",
"@microsoft/api-extractor": "^7.30.0",
"@tensorflow/tfjs": "^3.20.0",
"@tensorflow/tfjs-backend-cpu": "^3.20.0",
"@tensorflow/tfjs-backend-wasm": "^3.20.0",

View File

@ -224,7 +224,7 @@ export interface Config {
* valid build-in backends are:
* - Browser: `cpu`, `wasm`, `webgl`, `humangl`, `webgpu`
* - NodeJS: `cpu`, `wasm`, `tensorflow`
* default: `humangl` for browser and `tensorflow` for nodejs
* default: `webgl` for browser and `tensorflow` for nodejs
*/
backend: '' | 'cpu' | 'wasm' | 'webgl' | 'humangl' | 'tensorflow' | 'webgpu',

View File

@ -133,7 +133,7 @@ export class Human {
const tfVersion = (tf.version.tfjs || tf.version_core).replace(/-(.*)/, '');
defaults.wasmPath = `https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@${tfVersion}/dist/`;
defaults.modelBasePath = env.browser ? '../models/' : 'file://models/';
defaults.backend = env.browser ? 'humangl' : 'tensorflow';
defaults.backend = env.browser ? 'webgl' : 'tensorflow';
this.version = app.version; // expose version property on instance of class
Object.defineProperty(this, 'version', { value: app.version }); // expose version property directly on class itself
this.config = JSON.parse(JSON.stringify(defaults));

View File

@ -85,7 +85,7 @@ export async function check(instance: Human, force = false) {
// force browser vs node backend
if (env.browser && instance.config.backend === 'tensorflow') {
if (instance.config.debug) log('override: backend set to tensorflow while running in browser');
instance.config.backend = 'humangl';
instance.config.backend = 'webgl';
}
if (env.node && (instance.config.backend === 'webgl' || instance.config.backend === 'humangl')) {
if (instance.config.debug) log(`override: backend set to ${instance.config.backend} while running in nodejs`);
@ -96,13 +96,13 @@ export async function check(instance: Human, force = false) {
if (env.browser && instance.config.backend === 'webgpu') {
if (typeof navigator === 'undefined' || typeof navigator.gpu === 'undefined') {
log('override: backend set to webgpu but browser does not support webgpu');
instance.config.backend = 'humangl';
instance.config.backend = 'webgl';
} else {
const adapter = await navigator.gpu.requestAdapter();
if (instance.config.debug) log('enumerated webgpu adapter:', adapter);
if (!adapter) {
log('override: backend set to webgpu but browser reports no available gpu');
instance.config.backend = 'humangl';
instance.config.backend = 'webgl';
} else {
// @ts-ignore requestAdapterInfo is not in tslib
const adapterInfo = 'requestAdapterInfo' in adapter ? await (adapter as GPUAdapter).requestAdapterInfo() : undefined;
@ -157,7 +157,7 @@ export async function check(instance: Human, force = false) {
}
// customize humangl
if (tf.getBackend() === '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_PACK_DEPTHWISECONV']) tf.env().set('WEBGL_PACK_DEPTHWISECONV', false); // default=true <https://github.com/tensorflow/tfjs/pull/4909>
@ -184,7 +184,7 @@ export async function check(instance: Human, force = false) {
if (defaultFlags[key] === newFlags[key]) continue;
updatedFlags[key] = newFlags[key];
}
if (Object.keys(updatedFlags).length > 0) log('backend:', tf.getBackend(), 'set flags:', updatedFlags);
if (Object.keys(updatedFlags).length > 0) log('backend:', tf.getBackend(), 'flags:', updatedFlags);
}
tf.enableProdMode();

View File

@ -1,39 +1,39 @@
2022-09-02 14:05:28 DATA:  Build {"name":"@vladmandic/human","version":"2.9.4"}
2022-09-02 14:05:28 INFO:  Application: {"name":"@vladmandic/human","version":"2.9.4"}
2022-09-02 14:05:28 INFO:  Environment: {"profile":"production","config":".build.json","package":"package.json","tsconfig":true,"eslintrc":true,"git":true}
2022-09-02 14:05:28 INFO:  Toolchain: {"build":"0.7.11","esbuild":"0.15.6","typescript":"4.8.2","typedoc":"0.23.13","eslint":"8.23.0"}
2022-09-02 14:05:28 INFO:  Build: {"profile":"production","steps":["clean","compile","typings","typedoc","lint","changelog"]}
2022-09-02 14:05:28 STATE: Clean: {"locations":["dist/*","types/lib/*","typedoc/*"]}
2022-09-02 14:05:28 STATE: 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-02 14:05:28 STATE: Compile: {"name":"human/nodejs/cpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node.js","files":75,"inputBytes":656513,"outputBytes":308639}
2022-09-02 14:05:28 STATE: 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-02 14:05:28 STATE: Compile: {"name":"human/nodejs/gpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-gpu.js","files":75,"inputBytes":656517,"outputBytes":308643}
2022-09-02 14:05:28 STATE: 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-02 14:05:28 STATE: Compile: {"name":"human/nodejs/wasm","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-wasm.js","files":75,"inputBytes":656569,"outputBytes":308693}
2022-09-02 14:05:28 STATE: 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-02 14:05:28 STATE: 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-02 14:05:29 STATE: Compile: {"name":"human/browser/esm/nobundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm-nobundle.js","files":75,"inputBytes":656488,"outputBytes":307513}
2022-09-02 14:05:29 STATE: 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-02 14:05:29 STATE: Compile: {"name":"human/browser/iife/bundle","format":"iife","platform":"browser","input":"src/human.ts","output":"dist/human.js","files":75,"inputBytes":3477819,"outputBytes":1687713}
2022-09-02 14:05:29 STATE: Compile: {"name":"human/browser/esm/bundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm.js","files":75,"inputBytes":3477819,"outputBytes":3108711}
2022-09-02 14:05:33 STATE: Typings: {"input":"src/human.ts","output":"types/lib","files":30}
2022-09-02 14:05:35 STATE: TypeDoc: {"input":"src/human.ts","output":"typedoc","objects":77,"generated":true}
2022-09-02 14:05:35 STATE: 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-02 14:05:35 STATE: 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-02 14:05:46 STATE: Lint: {"locations":["*.json","src/**/*.ts","test/**/*.js","demo/**/*.js"],"files":113,"errors":0,"warnings":0}
2022-09-02 14:05:46 STATE: ChangeLog: {"repository":"https://github.com/vladmandic/human","branch":"main","output":"CHANGELOG.md"}
2022-09-02 14:05:46 STATE: Copy: {"input":"tfjs/tfjs.esm.d.ts"}
2022-09-02 14:05:46 INFO:  Done...
2022-09-02 14:05:46 STATE: API-Extractor: {"succeeeded":true,"errors":0,"warnings":198}
2022-09-02 14:05:46 STATE: Copy: {"input":"types/human.d.ts"}
2022-09-02 14:05:46 INFO:  Analyze models: {"folders":8,"result":"models/models.json"}
2022-09-02 14:05:46 STATE: Models {"folder":"./models","models":13}
2022-09-02 14:05:46 STATE: Models {"folder":"../human-models/models","models":42}
2022-09-02 14:05:46 STATE: Models {"folder":"../blazepose/model/","models":4}
2022-09-02 14:05:46 STATE: Models {"folder":"../anti-spoofing/model","models":1}
2022-09-02 14:05:46 STATE: Models {"folder":"../efficientpose/models","models":3}
2022-09-02 14:05:46 STATE: Models {"folder":"../insightface/models","models":5}
2022-09-02 14:05:46 STATE: Models {"folder":"../movenet/models","models":3}
2022-09-02 14:05:46 STATE: Models {"folder":"../nanodet/models","models":4}
2022-09-02 14:05:47 STATE: Models: {"count":57,"totalSize":383017442}
2022-09-02 14:05:47 INFO:  Human Build complete... {"logFile":"test/build.log"}
2022-09-03 07:09:51 DATA:  Build {"name":"@vladmandic/human","version":"2.10.0"}
2022-09-03 07:09:51 INFO:  Application: {"name":"@vladmandic/human","version":"2.10.0"}
2022-09-03 07:09:51 INFO:  Environment: {"profile":"production","config":".build.json","package":"package.json","tsconfig":true,"eslintrc":true,"git":true}
2022-09-03 07:09:51 INFO:  Toolchain: {"build":"0.7.11","esbuild":"0.15.6","typescript":"4.8.2","typedoc":"0.23.13","eslint":"8.23.0"}
2022-09-03 07:09:51 INFO:  Build: {"profile":"production","steps":["clean","compile","typings","typedoc","lint","changelog"]}
2022-09-03 07:09:51 STATE: Clean: {"locations":["dist/*","types/lib/*","typedoc/*"]}
2022-09-03 07:09:51 STATE: 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-03 07:09:51 STATE: Compile: {"name":"human/nodejs/cpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node.js","files":75,"inputBytes":656531,"outputBytes":308656}
2022-09-03 07:09:51 STATE: 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-03 07:09:51 STATE: Compile: {"name":"human/nodejs/gpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-gpu.js","files":75,"inputBytes":656535,"outputBytes":308660}
2022-09-03 07:09:51 STATE: 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-03 07:09:51 STATE: Compile: {"name":"human/nodejs/wasm","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-wasm.js","files":75,"inputBytes":656587,"outputBytes":308710}
2022-09-03 07:09:51 STATE: 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-03 07:09:51 STATE: 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-03 07:09:51 STATE: Compile: {"name":"human/browser/esm/nobundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm-nobundle.js","files":75,"inputBytes":656506,"outputBytes":307530}
2022-09-03 07:09:52 STATE: 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-03 07:09:52 STATE: Compile: {"name":"human/browser/iife/bundle","format":"iife","platform":"browser","input":"src/human.ts","output":"dist/human.js","files":75,"inputBytes":3477837,"outputBytes":1687720}
2022-09-03 07:09:52 STATE: Compile: {"name":"human/browser/esm/bundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm.js","files":75,"inputBytes":3477837,"outputBytes":3108728}
2022-09-03 07:09:56 STATE: Typings: {"input":"src/human.ts","output":"types/lib","files":30}
2022-09-03 07:09:58 STATE: TypeDoc: {"input":"src/human.ts","output":"typedoc","objects":77,"generated":true}
2022-09-03 07:09:58 STATE: 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-03 07:09:58 STATE: 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-03 07:10:09 STATE: Lint: {"locations":["*.json","src/**/*.ts","test/**/*.js","demo/**/*.js"],"files":110,"errors":0,"warnings":0}
2022-09-03 07:10:10 STATE: ChangeLog: {"repository":"https://github.com/vladmandic/human","branch":"main","output":"CHANGELOG.md"}
2022-09-03 07:10:10 STATE: Copy: {"input":"tfjs/tfjs.esm.d.ts"}
2022-09-03 07:10:10 INFO:  Done...
2022-09-03 07:10:10 STATE: API-Extractor: {"succeeeded":true,"errors":0,"warnings":193}
2022-09-03 07:10:10 STATE: Copy: {"input":"types/human.d.ts"}
2022-09-03 07:10:10 INFO:  Analyze models: {"folders":8,"result":"models/models.json"}
2022-09-03 07:10:10 STATE: Models {"folder":"./models","models":13}
2022-09-03 07:10:10 STATE: Models {"folder":"../human-models/models","models":42}
2022-09-03 07:10:10 STATE: Models {"folder":"../blazepose/model/","models":4}
2022-09-03 07:10:10 STATE: Models {"folder":"../anti-spoofing/model","models":1}
2022-09-03 07:10:10 STATE: Models {"folder":"../efficientpose/models","models":3}
2022-09-03 07:10:10 STATE: Models {"folder":"../insightface/models","models":5}
2022-09-03 07:10:10 STATE: Models {"folder":"../movenet/models","models":3}
2022-09-03 07:10:10 STATE: Models {"folder":"../nanodet/models","models":4}
2022-09-03 07:10:11 STATE: Models: {"count":57,"totalSize":383017442}
2022-09-03 07:10:11 INFO:  Human Build complete... {"logFile":"test/build.log"}

File diff suppressed because it is too large Load Diff