update build process

pull/280/head
Vladimir Mandic 2020-10-22 18:50:09 -04:00
parent 21031af836
commit eb221d42fd
2 changed files with 24 additions and 10 deletions

View File

@ -44,12 +44,13 @@ There are multiple ways to use `Human` library, pick one that suits you:
### Included
- `dist/human.js`: IIFE format minified bundle with TFJS for Browsers
- `dist/human.esm.js`: ESM format minified bundle with TFJS for Browsers
- `dist/human.esm-nobundle.js`: ESM format non-minified bundle without TFJS for Browsers
- `dist/human.cjs`: CommonJS format non-minified bundle without TFJS for NodeJS
- `dist/human.js`: IIFE format bundle with TFJS for Browsers
- `dist/human.esm.js`: ESM format bundle with TFJS for Browsers
- `dist/human.esm-nobundle.js`: ESM format bundle without TFJS for Browsers
- `dist/human.cjs`: CommonJS format bundle without TFJS for NodeJS
All versions include `sourcemap` and build `manifest`
All versions include `sourcemap` and build `manifest`
While `Human` is in pre-release mode, all bundles are non-minified
Defaults:
```json
@ -433,9 +434,9 @@ Development dependencies are [eslint](https://github.com/eslint) used for code l
Performance will vary depending on your hardware, but also on number of resolution of input video/image, enabled modules as well as their parameters
For example, on a desktop with a low-end nVidia GTX1050 it can perform multiple face detections at 60+ FPS, but drops to ~15 FPS on a medium complex images if all modules are enabled
For example, it can perform multiple face detections at 60+ FPS, but drops to ~15 FPS on a medium complex images if all modules are enabled
Performance per module:
Performance per module on a **notebook** with nVidia GTX1050 GPU:
- Enabled all: 15 FPS
- Image filters: 80 FPS (standalone)
@ -448,6 +449,19 @@ Performance per module:
- Hand: 40 FPS (standalone)
- Body: 50 FPS (standalone)
Performance per module on a **smartphone** with Snapdragon 855:
- Enabled all: 3 FPS
- Image filters: 30 FPS (standalone)
- Face Detect: 20 FPS (standalone)
- Face Geometry: 10 FPS (includes face detect)
- Face Iris: 5 FPS (includes face detect and face geometry)
- Age: 20 FPS (includes face detect)
- Gender: 20 FPS (includes face detect)
- Emotion: 20 FPS (includes face detect)
- Hand: 40 FPS (standalone)
- Body: 10 FPS (standalone)
For performance details, see output of `result.performance` object during runtime
<hr>

View File

@ -39,9 +39,9 @@
"scripts": {
"start": "node --trace-warnings --unhandled-rejections=strict --trace-uncaught --no-deprecation src/node.js",
"lint": "eslint src/*.js demo/*.js",
"build-iife": "esbuild --bundle --platform=browser --sourcemap --target=esnext --format=iife --minify --external:fs --global-name=Human --metafile=dist/human.json --outfile=dist/human.js src/human.js",
"build-esm-bundle": "esbuild --bundle --platform=browser --sourcemap --target=esnext --format=esm --minify --external:fs --metafile=dist/human.esm.json --outfile=dist/human.esm.js src/human.js",
"build-esm-nobundle": "esbuild --bundle --platform=browser --sourcemap --target=esnext --format=esm --minify --external:@tensorflow --external:fs --metafile=dist/human.esm-nobundle.json --outfile=dist/human.esm-nobundle.js src/human.js",
"build-iife": "esbuild --bundle --platform=browser --sourcemap --target=esnext --format=iife --external:fs --global-name=Human --metafile=dist/human.json --outfile=dist/human.js src/human.js",
"build-esm-bundle": "esbuild --bundle --platform=browser --sourcemap --target=esnext --format=esm --external:fs --metafile=dist/human.esm.json --outfile=dist/human.esm.js src/human.js",
"build-esm-nobundle": "esbuild --bundle --platform=browser --sourcemap --target=esnext --format=esm --external:@tensorflow --external:fs --metafile=dist/human.esm-nobundle.json --outfile=dist/human.esm-nobundle.js src/human.js",
"build-node": "esbuild --bundle --platform=node --sourcemap --target=esnext --format=cjs --external:@tensorflow --metafile=dist/human.cjs.json --outfile=dist/human.cjs src/human.js",
"build": "rimraf dist/* && npm run build-iife && npm run build-esm-bundle && npm run build-esm-nobundle && npm run build-node && ls -l dist/",
"update": "npm update --depth 20 && npm dedupe && npm prune && npm audit",