From 4e05fa40fe7550263db9bae7dd80e8c15c8cfd3f Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Tue, 26 Oct 2021 15:08:05 -0400 Subject: [PATCH] switch to custom tfjs for demos --- .build.json | 44 +- .eslintrc.json | 3 +- .hintrc | 2 +- CHANGELOG.md | 10 +- TODO.md | 6 +- demo/benchmark/browser.html | 52 +- demo/benchmark/browser.js | 49 - demo/face3d/face3d.js | 2 +- demo/facematch/facematch.js | 10 +- demo/helpers/gl-bench.js | 2 +- demo/helpers/menu.js | 31 +- demo/index-worker.js | 13 +- demo/multithread/index.js | 56 +- demo/multithread/worker.js | 4 +- demo/simple/index.js | 2 +- demo/webgpu/index.js | 69 +- demo/webgpu/worker.js | 3 +- dist/human.custom.esm.js | 79819 ++++++++++++++++++++++++++++++- dist/human.custom.esm.js.map | 6 +- dist/human.esm-nobundle.js | 29 +- dist/human.esm-nobundle.js.map | 4 +- dist/human.esm.js | 43944 +---------------- dist/human.esm.js.map | 4 +- dist/human.js | 1870 +- dist/human.node-gpu.js | 29 +- dist/human.node-wasm.js | 29 +- dist/human.node.js | 29 +- dist/tfjs.esm.js | 68864 +++++++++++++++++++++++++- dist/tfjs.esm.js.map | 2 +- package.json | 5 +- src/face/match.ts | 17 +- src/human.d.ts | 39 + src/human.ts | 4 +- test/browser.html | 15 +- test/build.log | 52 +- test/test.log | 1018 +- tsconfig.json | 3 +- typedoc/classes/Human.html | 60 +- typedoc/index.html | 4 +- types/dist/tfjs.esm.d.ts | 3137 +- types/dist/tfjs.esm.d.ts.map | 2 +- types/src/config.d.ts | 2 +- types/src/config.d.ts.map | 2 +- types/src/face/match.d.ts | 21 +- types/src/face/match.d.ts.map | 2 +- types/src/human.d.ts.map | 2 +- wiki | 2 +- 47 files changed, 149761 insertions(+), 49613 deletions(-) delete mode 100644 demo/benchmark/browser.js create mode 100644 src/human.d.ts diff --git a/.build.json b/.build.json index 01eb0702..e3017ab8 100644 --- a/.build.json +++ b/.build.json @@ -111,34 +111,13 @@ "sourcemap": true, "external": ["@tensorflow", "fs", "os", "buffer", "util"] }, - - { - "name": "tfjs/browser/esm/custom", - "platform": "browser", - "format": "esm", - "input": "tfjs/tf-custom.ts", - "output": "dist/tfjs.esm.js", - "sourcemap": true, - "external": ["fs", "os", "buffer", "util"] - }, - { - "name": "human/browser/esm/custom", - "platform": "browser", - "format": "esm", - "input": "src/human.ts", - "output": "dist/human.custom.esm.js", - "sourcemap": true, - "minify": true, - "external": ["fs", "os", "buffer", "util"] - }, - { "name": "tfjs/browser/esm/bundle", "platform": "browser", "format": "esm", "input": "tfjs/tf-browser.ts", "output": "dist/tfjs.esm.js", - "minify": true, + "minify": false, "sourcemap": true, "external": ["fs", "os", "buffer", "util"] }, @@ -158,7 +137,28 @@ "format": "esm", "input": "src/human.ts", "output": "dist/human.esm.js", + "minify": true, "sourcemap": true, + "external": ["fs", "os", "buffer", "util"] + }, + + { + "name": "tfjs/browser/esm/custom", + "platform": "browser", + "format": "esm", + "input": "tfjs/tf-custom.ts", + "output": "dist/tfjs.esm.js", + "sourcemap": false, + "external": ["fs", "os", "buffer", "util"] + }, + { + "name": "human/browser/esm/custom", + "platform": "browser", + "format": "esm", + "input": "src/human.ts", + "output": "dist/human.custom.esm.js", + "sourcemap": true, + "minify": false, "external": ["fs", "os", "buffer", "util"], "typings": "types", "typedoc": "typedoc" diff --git a/.eslintrc.json b/.eslintrc.json index a4132990..570d374e 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -11,7 +11,8 @@ "ecmaVersion": 2021 }, "plugins": [ - "@typescript-eslint" + "@typescript-eslint", + "html" ], "extends": [ "airbnb-base", diff --git a/.hintrc b/.hintrc index 7f9ab14b..2e63bba3 100644 --- a/.hintrc +++ b/.hintrc @@ -5,7 +5,7 @@ "browserslist": [ "chrome >= 90", "edge >= 90", - "firefox >= 90", + "firefox >= 100", "android >= 90", "safari >= 15" ], diff --git a/CHANGELOG.md b/CHANGELOG.md index f0a8340a..05b946e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,11 +9,15 @@ ## Changelog +### **HEAD -> main** 2021/10/25 mandic00@live.com + + +### **release: 2.4.1** 2021/10/25 mandic00@live.com + + ### **2.4.1** 2021/10/25 mandic00@live.com - -### **origin/main** 2021/10/25 mandic00@live.com - +- refactoring plus jsdoc comments - increase face similarity match resolution - time based caching - turn on minification diff --git a/TODO.md b/TODO.md index 50ee9b4e..a7db2256 100644 --- a/TODO.md +++ b/TODO.md @@ -2,11 +2,12 @@ ## Work in Progress +- Switch to custom `tfjs` for main `human` ESM bundle +
### Exploring -- Switch to custom `tfjs` for main `human` ESM bundle - Optical Flow: - Histogram Equalization: Regular, Adaptive, Contrast Limited - TFLite Models: @@ -22,6 +23,9 @@ Experimental support only until support is officially added in Chromium ## Known Issues +- `tfjs.esm.d.ts` missing namespace `OptimizerConstructors` +- exports from `match` are marked as private +
### Face Detection diff --git a/demo/benchmark/browser.html b/demo/benchmark/browser.html index c3b14347..b5a6547f 100644 --- a/demo/benchmark/browser.html +++ b/demo/benchmark/browser.html @@ -12,7 +12,6 @@ -