diff --git a/README.md b/README.md index 7a88b3c..9734b59 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ # FaceAPI +## 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. + Forked from **face-api.js** version **0.22.2** released on March 22nd, 2020 - - -## Note - -I don't plan to maintain a separate distribution of **face-api.js**, this is only a temporary repository to use latest available face-api 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. - ## Differences - Removed tests, docs, examples @@ -19,23 +19,43 @@ If original repository is updated, this one will become obsolete. - 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 dependencies to @tensorflow/tfjs since backends were removed from @tensorflow/tfjs-core +- Updated TFJS dependencies since backends were removed from @tensorflow/tfjs-core - Updated mobileNetv1 model due to batchNorm() dependency - 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 Which means valid models are **tinyFaceDetector** and **mobileNetv1** +Due to reduced code and changed build process, resulting bundle is about **>5x smaller** than the original! -Due to reduced code and changed build process, resulting bundle is about **2x smaller** than the original! +## Installation + +**Imporant!**: This version of **face-api** does not embedd full version of **tfjs** to enable dynamic loading of different versions of tfjs as well as to enable reusability of tfjs for different purposes. *Load tfjs explicitly before loading face-api.* + +For example as ESM script: + +```html + + + +``` + +or as NPM module: + +```js + # npm install @tensorflow/tfjs @vladmandic/face-api + + const tf = require('@tensorflow/tfjs'); + const faceapi = require('@vladmandic/face-api'); +``` ## Weights -Pretrained models are includes in `./weights` and uplodaed using GIT LFS support. +Pretrained models are includes in `./weights`. ## Build -Both `./build` and `./dist` folders are included by default, so no need for build during install. +Both **`./build`** (used by `import` or `require`) and **`./dist`** (used by ` + + + + +
+ + + diff --git a/example/sample (1).jpg b/example/sample (1).jpg new file mode 100755 index 0000000..82997d3 Binary files /dev/null and b/example/sample (1).jpg differ diff --git a/example/sample (2).jpg b/example/sample (2).jpg new file mode 100755 index 0000000..b3a1ee0 Binary files /dev/null and b/example/sample (2).jpg differ diff --git a/example/sample (3).jpg b/example/sample (3).jpg new file mode 100755 index 0000000..6cfacc5 Binary files /dev/null and b/example/sample (3).jpg differ diff --git a/example/sample (4).jpg b/example/sample (4).jpg new file mode 100755 index 0000000..ac65ce3 Binary files /dev/null and b/example/sample (4).jpg differ diff --git a/example/sample (5).jpg b/example/sample (5).jpg new file mode 100755 index 0000000..b2d1c73 Binary files /dev/null and b/example/sample (5).jpg differ diff --git a/example/sample (6).jpg b/example/sample (6).jpg new file mode 100755 index 0000000..b9c8156 Binary files /dev/null and b/example/sample (6).jpg differ diff --git a/example/screenshot.png b/example/screenshot.png new file mode 100755 index 0000000..95ea751 Binary files /dev/null and b/example/screenshot.png differ