pull/97/head
Vladimir Mandic 2021-12-27 10:52:58 -05:00
parent 471ddb7549
commit 0de113080c
4 changed files with 38 additions and 35 deletions

View File

@ -9,7 +9,7 @@
## Changelog ## Changelog
### **HEAD -> master** 2021/12/09 mandic00@live.com ### **HEAD -> master** 2021/12/14 mandic00@live.com
### **1.6.1** 2021/12/09 mandic00@live.com ### **1.6.1** 2021/12/09 mandic00@live.com

View File

@ -435,7 +435,7 @@ Build process uses `@vladmandic/build` module that creates optimized build for e
This is updated **face-api.js** with latest available TensorFlow/JS as the original is not compatible with **tfjs 2.0+**. This is updated **face-api.js** with latest available TensorFlow/JS as the original is not compatible with **tfjs 2.0+**.
Forked from [face-api.js](https://github.com/justadudewhohacks/face-api.js) version **0.22.2** which was released on March 22nd, 2020 Forked from [face-api.js](https://github.com/justadudewhohacks/face-api.js) version **0.22.2** which was released on March 22nd, 2020
Currently based on **`TensorFlow/JS` 3.11.0** Currently based on **`TensorFlow/JS` 3.12.0**
*Why?* I needed FaceAPI that does not cause version conflict with newer versions of TensorFlow *Why?* I needed FaceAPI that does not cause version conflict with newer versions of TensorFlow
And since original FaceAPI was open-source, I've released this version as well And since original FaceAPI was open-source, I've released this version as well
@ -458,29 +458,32 @@ but extends it with newer AI models, additional detection details, compatibility
Compared to [face-api.js](https://github.com/justadudewhohacks/face-api.js) version **0.22.2**: Compared to [face-api.js](https://github.com/justadudewhohacks/face-api.js) version **0.22.2**:
- Compatible with `TensorFlow/JS 2.0+ & 3.0+` - Compatible with `TensorFlow/JS 2.0+ & 3.0+`
- Compatible with `WebGL`, `CPU` and `WASM` TFJS Browser backends Original `face-api.js` is based on `TFJS` **1.7.4**
- Compatible with both `tfjs-node` and `tfjs-node-gpu` TFJS NodeJS backends - Compatible with `WebGL`, `CPU` and `WASM` TFJS Browser backends
- Updated all type castings for TypeScript type checking to `TypeScript 4.4` - Compatible with both `tfjs-node` and `tfjs-node-gpu` TFJS NodeJS backends
- Switched bundling from `UMD` to `ESM` + `CommonJS` with fallback to `IIFE` - Updated all type castings for TypeScript type checking to `TypeScript 4.4`
Resulting code is optimized per-platform instead of being universal - Switched bundling from `UMD` to `ESM` + `CommonJS` with fallback to `IIFE`
Fully tree shakable when imported as an `ESM` module Resulting code is optimized per-platform instead of being universal
Browser bundle process uses `ESBuild` instead of `Rollup` Fully tree shakable when imported as an `ESM` module
- Typescript build process now targets `ES2018` and instead of dual `ES5`/`ES6` Browser bundle process uses `ESBuild` instead of `Rollup`
Resulting code is clean ES2018 JavaScript without polyfills - Added separate `face-api` versions with `tfjs` pre-bundled and without `tfjs`
- Removed old tests, docs, examples When using `-nobundle` version, user can load any version of `tfjs` manually
- Removed old package dependencies (`karma`, `jasmine`, `babel`, etc.) - Typescript build process now targets `ES2018` and instead of dual `ES5`/`ES6`
- Updated all package dependencies Resulting code is clean ES2018 JavaScript without polyfills
- Updated TensorFlow/JS dependencies since backends were removed from `@tensorflow/tfjs-core` - Removed old tests, docs, examples
- Updated `mobileNetv1` model due to `batchNorm()` dependency - Removed old package dependencies (`karma`, `jasmine`, `babel`, etc.)
- Added `version` class that returns JSON object with version of FaceAPI as well as linked TFJS - Updated all package dependencies
- Added test/dev built-in HTTP & HTTPS Web server - Updated TensorFlow/JS dependencies since backends were removed from `@tensorflow/tfjs-core`
- Removed `mtcnn` and `tinyYolov2` models as they were non-functional in latest public version of `FaceAPI` - Updated `mobileNetv1` model due to `batchNorm()` dependency
Which means valid models are **tinyFaceDetector** and **mobileNetv1** - Added `version` class that returns JSON object with version of FaceAPI as well as linked TFJS
*If there is a demand, I can re-implement them back.* - Added test/dev built-in HTTP & HTTPS Web server
- Added `face angle` calculations that returns `roll`, `yaw` and `pitch` - Removed `mtcnn` and `tinyYolov2` models as they were non-functional in latest public version of `FaceAPI`
- Added `typdoc` automatic API specification generation during build Which means valid models are **tinyFaceDetector** and **mobileNetv1**
- Added `changelog` automatic generation during build *If there is a demand, I can re-implement them back.*
- Added `face angle` calculations that returns `roll`, `yaw` and `pitch`
- Added `typdoc` automatic API specification generation during build
- Added `changelog` automatic generation during build
<br> <br>

View File

@ -108,7 +108,7 @@ async function main() {
const params = new URLSearchParams(location.search); const params = new URLSearchParams(location.search);
if (params.has('backend')) { if (params.has('backend')) {
const backend = params.get('backend'); const backend = params.get('backend');
await faceapi.tf.setWasmPaths('https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@3.11.0/dist/'); await faceapi.tf.setWasmPaths('https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@3.12.0/dist/');
log(`Chosen backend: ${backend}`); log(`Chosen backend: ${backend}`);
await faceapi.tf.setBackend(backend); await faceapi.tf.setBackend(backend);
} else { } else {

View File

@ -43,6 +43,7 @@
"devDependencies": { "devDependencies": {
"@canvas/image": "^1.0.1", "@canvas/image": "^1.0.1",
"@microsoft/api-extractor": "^7.19.2", "@microsoft/api-extractor": "^7.19.2",
"@tensorflow/tfjs": "^3.12.0",
"@tensorflow/tfjs-backend-cpu": "^3.12.0", "@tensorflow/tfjs-backend-cpu": "^3.12.0",
"@tensorflow/tfjs-backend-wasm": "^3.12.0", "@tensorflow/tfjs-backend-wasm": "^3.12.0",
"@tensorflow/tfjs-backend-webgl": "^3.12.0", "@tensorflow/tfjs-backend-webgl": "^3.12.0",
@ -51,26 +52,25 @@
"@tensorflow/tfjs-core": "^3.12.0", "@tensorflow/tfjs-core": "^3.12.0",
"@tensorflow/tfjs-data": "^3.12.0", "@tensorflow/tfjs-data": "^3.12.0",
"@tensorflow/tfjs-layers": "^3.12.0", "@tensorflow/tfjs-layers": "^3.12.0",
"@tensorflow/tfjs-node-gpu": "^3.12.0",
"@tensorflow/tfjs-node": "^3.12.0", "@tensorflow/tfjs-node": "^3.12.0",
"@tensorflow/tfjs": "^3.12.0", "@tensorflow/tfjs-node-gpu": "^3.12.0",
"@types/node": "^16.11.12", "@types/node": "^17.0.5",
"@types/offscreencanvas": "^2019.6.4", "@types/offscreencanvas": "^2019.6.4",
"@typescript-eslint/eslint-plugin": "^5.7.0", "@typescript-eslint/eslint-plugin": "^5.8.0",
"@typescript-eslint/parser": "^5.7.0", "@typescript-eslint/parser": "^5.8.0",
"@vladmandic/build": "^0.6.6", "@vladmandic/build": "^0.6.6",
"@vladmandic/pilogger": "^0.3.5", "@vladmandic/pilogger": "^0.4.2",
"@vladmandic/tfjs": "github:vladmandic/tfjs", "@vladmandic/tfjs": "github:vladmandic/tfjs",
"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.14.3", "esbuild": "^0.14.8",
"eslint": "^8.5.0",
"eslint-config-airbnb-base": "^15.0.0", "eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-import": "^2.25.3", "eslint-plugin-import": "^2.25.3",
"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.2.0", "eslint-plugin-promise": "^6.0.0",
"eslint": "^8.4.1",
"node-fetch": "^3.1.0", "node-fetch": "^3.1.0",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"seedrandom": "^3.0.5", "seedrandom": "^3.0.5",