reduce bundle size

pull/97/head
Vladimir Mandic 2021-09-11 11:11:38 -04:00
parent 519e346f02
commit d13586f549
14 changed files with 1714 additions and 65737 deletions

View File

@ -1,19 +1,19 @@
# @vladmandic/face-api # packageJson
Version: **1.5.2** Version: **undefined**
Description: **FaceAPI: AI-powered Face Detection & Rotation Tracking, Face Description & Recognition, Age & Gender & Emotion Prediction for Browser and NodeJS using TensorFlow/JS** Description: **undefined**
Author: **Vladimir Mandic <mandic00@live.com>** Author: **undefined**
License: **MIT** License: **undefined**
Repository: **<https://github.com/vladmandic/face-api>** Repository: **<https://github.com/vladmandic/face-api>**
## Changelog ## Changelog
### **HEAD -> master** 2021/09/10 mandic00@live.com
### **1.5.2** 2021/09/10 mandic00@live.com ### **1.5.2** 2021/09/10 mandic00@live.com
### **origin/master** 2021/09/08 mandic00@live.com
- redesign build platform - redesign build platform
### **1.5.1** 2021/09/08 mandic00@live.com ### **1.5.1** 2021/09/08 mandic00@live.com
@ -123,61 +123,111 @@
- add badges - add badges
- optimize for npm - optimize for npm
- 0.30.6
### **0.30.6** 2021/03/08 mandic00@live.com
- added typings for face angle - added typings for face angle
- disable landmark printing - disable landmark printing
- 0.30.5
### **0.30.5** 2021/03/07 mandic00@live.com
- enabled live demo on gitpages - enabled live demo on gitpages
- 0.30.4
### **0.30.4** 2021/03/07 mandic00@live.com
- added face angle calculations - added face angle calculations
- added documentation - added documentation
- package update - package update
- 0.30.3
- 0.30.2 ### **0.30.3** 2021/03/04 mandic00@live.com
- 0.30.1
- 0.13.3
### **0.30.2** 2021/02/26 mandic00@live.com
### **0.30.1** 2021/02/25 mandic00@live.com
### **0.13.3** 2021/02/21 mandic00@live.com
- added note-cpu target - added note-cpu target
- merge pull request #39 from xemle/feature/node-cpu - merge pull request #39 from xemle/feature/node-cpu
- add node-cpu build for non supported systems of libtensorflow - add node-cpu build for non supported systems of libtensorflow
- 0.13.2
- 0.13.1 ### **0.13.2** 2021/02/20 mandic00@live.com
- 0.12.10
- exception handling
- 0.12.9 ### **0.13.1** 2021/02/20 mandic00@live.com
- exception handling
- 0.12.8
### **0.12.10** 2021/02/20 mandic00@live.com
- exception handling - exception handling
### **0.12.9** 2021/02/20 mandic00@live.com
### **0.12.8** 2021/02/20 mandic00@live.com
### **0.12.7** 2021/02/17 mandic00@live.com ### **0.12.7** 2021/02/17 mandic00@live.com
- 0.12.7 - 0.12.7
- 0.12.6
- 0.12.5 ### **0.12.6** 2021/02/13 mandic00@live.com
- 0.12.4
- 0.12.3
- 0.12.2 ### **0.12.5** 2021/02/12 mandic00@live.com
### **0.12.4** 2021/02/06 mandic00@live.com
### **0.12.3** 2021/02/06 mandic00@live.com
### **0.12.2** 2021/02/02 mandic00@live.com
### **update for tfjs 3.0.0** 2021/01/29 mandic00@live.com ### **update for tfjs 3.0.0** 2021/01/29 mandic00@live.com
- 0.12.1
### **0.12.1** 2021/01/29 mandic00@live.com
- rebuild - rebuild
- 0.11.6
### **0.11.6** 2021/01/24 mandic00@live.com
- add check for null face descriptor - add check for null face descriptor
- merge pull request #34 from patrickhulce/patch-1 - merge pull request #34 from patrickhulce/patch-1
- fix: return empty descriptor for zero-sized faces - fix: return empty descriptor for zero-sized faces
- 0.11.5
- 0.11.4 ### **0.11.5** 2021/01/22 mandic00@live.com
- 0.11.3
### **0.11.4** 2021/01/22 mandic00@live.com
### **0.11.3** 2021/01/20 mandic00@live.com
- fix typo - fix typo
- enable full minification - enable full minification
- 0.11.2
### **0.11.2** 2021/01/12 mandic00@live.com
- full rebuild - full rebuild
- 0.11.1
### **0.11.1** 2021/01/10 mandic00@live.com
- added live webcam demo - added live webcam demo
- 0.10.2
### **0.10.2** 2021/01/03 mandic00@live.com
- ts linting - ts linting
- version bump - version bump
- 0.10.1
### **0.10.1** 2020/12/23 mandic00@live.com
- full re-lint and typings generation - full re-lint and typings generation
- rebuild - rebuild

View File

@ -133,8 +133,6 @@ Simply include latest version of `FaceAPI` directly from a CDN in your HTML:
*without* TFJS pre-bundled *without* TFJS pre-bundled
- `dist/face-api.node-gpu.js`: CommonJS format for server-side NodeJS execution - `dist/face-api.node-gpu.js`: CommonJS format for server-side NodeJS execution
*without* TFJS pre-bundled and optimized for CUDA GPU acceleration *without* TFJS pre-bundled and optimized for CUDA GPU acceleration
- `dist/face-api.node-cpu.js`: CommonJS format for server-side NodeJS execution
*without* TFJS pre-bundled and using JS engine for platforms where tensorflow binary library version is not available
Defaults are: Defaults are:

View File

@ -3,23 +3,23 @@
"enabled": false, "enabled": false,
"debug": false, "debug": false,
"console": true, "console": true,
"output": "dev-server.log" "output": "build.log"
},
"profiles": {
"production": ["clean", "compile", "typings", "typedoc", "lint", "changelog"],
"development": ["serve", "watch", "compile"]
}, },
"clean": { "clean": {
"enabled": true,
"locations": ["dist/*", "types/*", "typedoc/*"] "locations": ["dist/*", "types/*", "typedoc/*"]
}, },
"lint": { "lint": {
"enabled": true,
"locations": [ "src/**" ], "locations": [ "src/**" ],
"rules": { } "rules": { }
}, },
"changelog": { "changelog": {
"enabled": true,
"log": "CHANGELOG.md" "log": "CHANGELOG.md"
}, },
"serve": { "serve": {
"enabled": true,
"sslKey": "cert/https.key", "sslKey": "cert/https.key",
"sslCrt": "cert/https.crt", "sslCrt": "cert/https.crt",
"httpPort": 8000, "httpPort": 8000,
@ -29,98 +29,89 @@
"defaultFile": "index.html" "defaultFile": "index.html"
}, },
"build": { "build": {
"enabled": true,
"global": { "global": {
"target": "es2018", "target": "es2018",
"sourcemap": true, "sourcemap": false,
"banner": { "js": "/*\n Face-API\n homepage: <https://github.com/vladmandic/face-api>\n author: <https://github.com/vladmandic>'\n*/\n" } "banner": { "js": "/*\n Face-API\n homepage: <https://github.com/vladmandic/face-api>\n author: <https://github.com/vladmandic>'\n*/\n" }
}, },
"production": {
"minify": false
},
"development": {
"minify": false
},
"targets": [ "targets": [
{ {
"platform": "node", "name": "tfjs/node/cpu",
"format": "cjs", "platform": "node",
"input": "src/tfjs/tf-node.ts", "format": "cjs",
"output": "dist/tfjs.esm.js", "input": "src/tfjs/tf-node.ts",
"external": ["@tensorflow"] "output": "dist/tfjs.esm.js",
"external": ["@tensorflow"]
}, },
{ {
"platform": "node", "name": "faceapi/node/cpu",
"format": "cjs", "platform": "node",
"input": "src/index.ts", "format": "cjs",
"output": "dist/face-api.node.js", "input": "src/index.ts",
"external": ["@tensorflow"] "output": "dist/face-api.node.js",
"external": ["@tensorflow"]
}, },
{ {
"platform": "node", "name": "tfjs/node/gpu",
"format": "cjs", "platform": "node",
"input": "src/tfjs/tf-node-gpu.ts", "format": "cjs",
"output": "dist/tfjs.esm.js", "input": "src/tfjs/tf-node-gpu.ts",
"external": ["@tensorflow"] "output": "dist/tfjs.esm.js",
"external": ["@tensorflow"]
}, },
{ {
"platform": "node", "name": "faceapi/node/gpu",
"format": "cjs", "platform": "node",
"input": "src/index.ts", "format": "cjs",
"output": "dist/face-api.node-gpu.js", "input": "src/index.ts",
"external": ["@tensorflow"] "output": "dist/face-api.node-gpu.js",
"external": ["@tensorflow"]
}, },
{ {
"platform": "node", "name": "tfjs/browser/esm/nobundle",
"format": "cjs", "platform": "browser",
"input": "src/tfjs/tf-node-cpu.ts", "format": "esm",
"output": "dist/tfjs.esm.js", "input": "src/tfjs/tf-browser.ts",
"external": ["@tensorflow"] "output": "dist/tfjs.esm.js",
"external": ["fs","buffer","util","os","@tensorflow"]
}, },
{ {
"platform": "node", "name": "faceapi/browser/esm/nobundle",
"format": "cjs", "platform": "browser",
"input": "src/index.ts", "format": "esm",
"output": "dist/face-api.node-cpu.js", "input": "src/index.ts",
"external": ["@tensorflow"] "output": "dist/face-api.esm-nobundle.js",
"external": ["fs","buffer","util","os","@tensorflow","tfjs.esm.js"]
}, },
{ {
"platform": "browser", "name": "tfjs/browser/esm/bundle",
"format": "esm", "platform": "browser",
"input": "src/tfjs/tf-browser.ts", "format": "esm",
"output": "dist/tfjs.esm.js", "sourcemap": true,
"external": ["fs","buffer","util","os","@tensorflow"] "input": "src/tfjs/tf-browser.ts",
"output": "dist/tfjs.esm.js",
"external": ["fs","buffer","util","os"]
}, },
{ {
"platform": "browser", "name": "faceapi/browser/iife/bundle",
"format": "esm", "platform": "browser",
"input": "src/index.ts", "format": "iife",
"output": "dist/face-api.esm-nobundle.js", "globalName": "faceapi",
"external": ["fs","buffer","util","os","@tensorflow","tfjs.esm.js"] "minify": true,
"input": "src/index.ts",
"output": "dist/face-api.js",
"external": ["fs","buffer","util","os"]
}, },
{ {
"platform": "browser", "name": "faceapi/browser/esm/bundle",
"format": "esm", "platform": "browser",
"input": "src/tfjs/tf-browser.ts", "format": "esm",
"output": "dist/tfjs.esm.js", "sourcemap": true,
"external": ["fs","buffer","util","os"] "input": "src/index.ts",
}, "output": "dist/face-api.esm.js",
{ "external": ["fs","buffer","util","os"],
"platform": "browser", "typings": "types",
"format": "iife", "typedoc": "typedoc"
"globalName": "faceapi",
"input": "src/index.ts",
"output": "dist/face-api.js",
"external": ["fs","buffer","util","os"]
},
{
"platform": "browser",
"format": "esm",
"input": "src/index.ts",
"output": "dist/face-api.esm.js",
"external": ["fs","buffer","util","os"],
"typings": "types",
"typedoc": "typedoc"
} }
] ]
}, },

View File

@ -4520,4 +4520,3 @@ export {
validateConfig, validateConfig,
version3 as version version3 as version
}; };
//# sourceMappingURL=face-api.esm-nobundle.js.map

File diff suppressed because one or more lines are too long

62403
dist/face-api.js vendored

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

File diff suppressed because one or more lines are too long

View File

@ -4723,4 +4723,3 @@ if (browser3) {
validateConfig, validateConfig,
version version
}); });
//# sourceMappingURL=face-api.node-gpu.js.map

File diff suppressed because one or more lines are too long

View File

@ -4723,4 +4723,3 @@ if (browser3) {
validateConfig, validateConfig,
version version
}); });
//# sourceMappingURL=face-api.node.js.map

File diff suppressed because one or more lines are too long

View File

@ -22,8 +22,8 @@
}, },
"scripts": { "scripts": {
"start": "node --no-warnings demo/node.js", "start": "node --no-warnings demo/node.js",
"dev": "build development", "dev": "build --profile development",
"build": "build production", "build": "build --profile production",
"test": "node --trace-warnings test/test-node.js", "test": "node --trace-warnings test/test-node.js",
"scan": "npx auditjs@latest ossi --dev --quiet" "scan": "npx auditjs@latest ossi --dev --quiet"
}, },
@ -42,6 +42,7 @@
], ],
"devDependencies": { "devDependencies": {
"@canvas/image": "^1.0.1", "@canvas/image": "^1.0.1",
"@tensorflow/tfjs": "^3.9.0",
"@tensorflow/tfjs-backend-cpu": "^3.9.0", "@tensorflow/tfjs-backend-cpu": "^3.9.0",
"@tensorflow/tfjs-backend-wasm": "^3.9.0", "@tensorflow/tfjs-backend-wasm": "^3.9.0",
"@tensorflow/tfjs-backend-webgl": "^3.9.0", "@tensorflow/tfjs-backend-webgl": "^3.9.0",
@ -49,31 +50,29 @@
"@tensorflow/tfjs-core": "^3.9.0", "@tensorflow/tfjs-core": "^3.9.0",
"@tensorflow/tfjs-data": "^3.9.0", "@tensorflow/tfjs-data": "^3.9.0",
"@tensorflow/tfjs-layers": "^3.9.0", "@tensorflow/tfjs-layers": "^3.9.0",
"@tensorflow/tfjs-node-gpu": "^3.9.0",
"@tensorflow/tfjs-node": "^3.9.0", "@tensorflow/tfjs-node": "^3.9.0",
"@tensorflow/tfjs": "^3.9.0", "@tensorflow/tfjs-node-gpu": "^3.9.0",
"@types/node": "^16.9.1", "@types/node": "^16.9.1",
"@typescript-eslint/eslint-plugin": "^4.31.0", "@typescript-eslint/eslint-plugin": "^4.31.0",
"@typescript-eslint/parser": "^4.31.0", "@typescript-eslint/parser": "^4.31.0",
"@vladmandic/build": "^0.3.3", "@vladmandic/build": "^0.4.1",
"@vladmandic/pilogger": "^0.3.1", "@vladmandic/pilogger": "^0.3.1",
"canvas": "^2.8.0", "canvas": "^2.8.0",
"chokidar": "^3.5.2", "chokidar": "^3.5.2",
"dayjs": "^1.10.7", "dayjs": "^1.10.7",
"esbuild": "^0.12.26", "esbuild": "^0.12.26",
"eslint": "^7.32.0",
"eslint-config-airbnb-base": "^14.2.1", "eslint-config-airbnb-base": "^14.2.1",
"eslint-plugin-import": "^2.24.2", "eslint-plugin-import": "^2.24.2",
"eslint-plugin-json": "^3.1.0", "eslint-plugin-json": "^3.1.0",
"eslint-plugin-node": "^11.1.0", "eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0", "eslint-plugin-promise": "^5.1.0",
"eslint": "^7.32.0",
"node-fetch": "^3.0.0", "node-fetch": "^3.0.0",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"seedrandom": "^3.0.5", "seedrandom": "^3.0.5",
"simple-git": "^2.45.1", "simple-git": "^2.45.1",
"tslib": "^2.3.1", "tslib": "^2.3.1",
"typedoc": "^0.21.9", "typedoc": "^0.22.2",
"typescript": "4.4.2" "typescript": "4.4.3"
}, }
"dependencies": {}
} }