updated to enable tree shakeable module

pull/13/head
Vladimir Mandic 2020-09-18 13:51:40 -04:00
parent a174193617
commit baaccc2f2c
9 changed files with 23 additions and 21 deletions

View File

@ -2,8 +2,8 @@
## Note
This is updated **face-api.js** with latest available tensorflow/js as original face-api.js is not compatible with **tfjs 2.0+**.
If original repository is updated, this one will become obsolete.
This is updated **face-api.js** with latest available TensorFlow/JS as the original face-api.js is not compatible with **tfjs 2.0+**.
Currently based on **TFJS-Core 2.4.0**.
Forked from **face-api.js** version **0.22.2** released on March 22nd, 2020
@ -14,13 +14,15 @@ Forked from **face-api.js** version **0.22.2** released on March 22nd, 2020
- Removed tests, docs, examples
- Updated all package dependencies
- Modified to make compatible with TensorFlow/JS 2.0+
- Trivial code changes for updated TypeScript type checking
- Compatible with TensorFlow/JS 2.0+
- Updated type casting for TypeScript type checking
- Removed unnecesary package dependencies (karma, jasmine, etc.)
- Updated Typescript build process to target ES2018 instead of dual ES5/ES6
- Changed browser bundle process to use ESBuild instead of Rollup
- Updated TensorFlow/JS dependencies since backends were removed from @tensorflow/tfjs-core
- Typescript build process now targets ES2017 and instead of dual ES5/ES6
- Browser bundle process uses ESBuild instead of Rollup
- New TensorFlow/JS dependencies since backends were removed from @tensorflow/tfjs-core
- Updated mobileNetv1 model due to batchNorm() dependency
- Fully tree shakable when imported as an ESM module
- Added `version` class that returns JSON objecgt with version of FaceAPI as well as linked TFJS
- Removed following models as they are either obsolete or non-functional with tfjs 2.0+
- mtcnn: Mostly obsolete
- tinyYolov2: Non-functional since weights are missing

View File

@ -1,6 +1,6 @@
{
"name": "@vladmandic/face-api",
"version": "0.5.1",
"version": "0.5.2",
"description": "JavaScript module for Face Detection and Face Recognition Using Tensorflow/JS",
"main": "dist/face-api.node.js",
"browser": "dist/face-api.esm.js",
@ -11,7 +11,7 @@
"type": "module",
"scripts": {
"compile": "tsc",
"clean": "rimraf build dist",
"clean": "rimraf build/ dist/",
"cjs": "esbuild --bundle --outfile=./dist/face-api.cjs.js --target=es2017 --platform=browser --format=cjs --sourcemap --log-level=error --tsconfig=./tsconfig.json build/src/index.js",
"node": "esbuild --bundle --outfile=./dist/face-api.node.js --target=es2017 --platform=node --format=esm --sourcemap --log-level=error --tsconfig=./tsconfig.json build/src/index.js",
"esm": "esbuild --bundle --outfile=./dist/face-api.esm.js --target=es2017 --platform=browser --format=esm --sourcemap --log-level=error --tsconfig=./tsconfig.json build/src/index.js",

View File

@ -24061,7 +24061,7 @@ function resizeResults(results, dimensions) {
}
// build/package.json
var version2 = "0.5.1";
var version2 = "0.5.2";
// build/src/index.js
__export(exports, {

View File

@ -24061,7 +24061,7 @@ function resizeResults(results, dimensions) {
}
// build/package.json
var version2 = "0.5.1";
var version2 = "0.5.2";
// build/src/index.js
const node = typeof process !== "undefined" ? process.version : false;

View File

@ -24192,7 +24192,7 @@ Expected: ${expectedFlat}.`);
}
// build/package.json
var version2 = "0.5.1";
var version2 = "0.5.2";
return require_src();
})();
//# sourceMappingURL=face-api.iife.js.map

File diff suppressed because one or more lines are too long

View File

@ -24057,7 +24057,7 @@ function resizeResults(results, dimensions) {
}
// build/package.json
var version2 = "0.5.1";
var version2 = "0.5.2";
// build/src/index.js
const node = typeof process !== "undefined" ? process.version : false;

12
package-lock.json generated
View File

@ -18,9 +18,9 @@
}
},
"@types/node": {
"version": "14.10.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.10.2.tgz",
"integrity": "sha512-IzMhbDYCpv26pC2wboJ4MMOa9GKtjplXfcAqrMeNJpUUwpM/2ATt2w1JPUXwS6spu856TvKZL2AOmeU2rAxskw==",
"version": "14.11.1",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.1.tgz",
"integrity": "sha512-oTQgnd0hblfLsJ6BvJzzSL+Inogp3lq9fGgqRkMB/ziKMgEUaFl801OncOzUmalfzt14N0oPHMK47ipl+wbTIw==",
"dev": true
},
"@types/offscreencanvas": {
@ -210,9 +210,9 @@
"dev": true
},
"typescript": {
"version": "4.1.0-dev.20200916",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.0-dev.20200916.tgz",
"integrity": "sha512-ly2k/AZ3AyfIyLWhBSnW3x7aDufIS9uNRagFZin36jXb6DvZEZwtyx138u8iSvtKE1AV/VNyWLLBkZYojgBM1g==",
"version": "4.1.0-dev.20200918",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.0-dev.20200918.tgz",
"integrity": "sha512-cEcXJvz55OH3k3cmpMYoVfqdAQ2YvgeccUmccmleUnQ8VqR8T/7GI761Qky/vGZO/VhiU3Y8xJF3oLkAkNrG1g==",
"dev": true
},
"wrappy": {

View File

@ -11,7 +11,7 @@
"type": "module",
"scripts": {
"compile": "tsc",
"clean": "rimraf build dist",
"clean": "rimraf build/ dist/",
"cjs": "esbuild --bundle --outfile=./dist/face-api.cjs.js --target=es2017 --platform=browser --format=cjs --sourcemap --log-level=error --tsconfig=./tsconfig.json build/src/index.js",
"node": "esbuild --bundle --outfile=./dist/face-api.node.js --target=es2017 --platform=node --format=esm --sourcemap --log-level=error --tsconfig=./tsconfig.json build/src/index.js",
"esm": "esbuild --bundle --outfile=./dist/face-api.esm.js --target=es2017 --platform=browser --format=esm --sourcemap --log-level=error --tsconfig=./tsconfig.json build/src/index.js",