diff --git a/CHANGELOG.md b/CHANGELOG.md index de4f70e..dbbb6dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,12 +9,12 @@ Repository: **** ## Changelog +### **update tfjs 3.9.0** 2021/08/31 mandic00@live.com + + ### **1.4.2** 2021/08/31 mandic00@live.com -### **origin/master** 2021/08/10 mandic00@live.com - - ### **release: 1.4.1** 2021/07/29 mandic00@live.com diff --git a/README.md b/README.md index f45f6d1..5c4b92b 100644 --- a/README.md +++ b/README.md @@ -431,7 +431,7 @@ Build process uses script `build.js` that creates optimized build for each targe 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 -Currently based on **`TensorFlow/JS` 3.6.1** +Currently based on **`TensorFlow/JS` 3.9.0** *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 @@ -457,7 +457,7 @@ Compared to [face-api.js](https://github.com/justadudewhohacks/face-api.js) vers - Compatible with `TensorFlow/JS 2.0+ & 3.0+` - Compatible with `WebGL`, `CPU` and `WASM` TFJS Browser backends - Compatible with both `tfjs-node` and `tfjs-node-gpu` TFJS NodeJS backends -- Updated all type castings for TypeScript type checking to `TypeScript 4.3` +- Updated all type castings for TypeScript type checking to `TypeScript 4.4` - Switched bundling from `UMD` to `ESM` + `CommonJS` with fallback to `IIFE` Resulting code is optimized per-platform instead of being universal Fully tree shakable when imported as an `ESM` module diff --git a/demo/node.js b/demo/node.js index c8a54f3..b871225 100644 --- a/demo/node.js +++ b/demo/node.js @@ -6,8 +6,6 @@ const path = require('path'); // eslint-disable-next-line import/no-extraneous-dependencies, node/no-unpublished-require const log = require('@vladmandic/pilogger'); // eslint-disable-next-line import/no-extraneous-dependencies, node/no-unpublished-require -const fetch = require('node-fetch').default; -// eslint-disable-next-line import/no-extraneous-dependencies, node/no-unpublished-require const tf = require('@tensorflow/tfjs-node'); const faceapi = require('../dist/face-api.node.js'); // this is equivalent to '@vladmandic/faceapi' @@ -16,6 +14,7 @@ const imgPathRoot = './demo'; // modify to include your sample images const minConfidence = 0.15; const maxResults = 5; let optionsSSDMobileNet; +let fetch; // dynamically imported later async function image(input) { // read input image file and create tensor to be used for processing @@ -89,6 +88,8 @@ async function main() { log.header(); log.info('FaceAPI single-process test'); + fetch = (await import('node-fetch')).default; + await faceapi.tf.setBackend('tensorflow'); await faceapi.tf.enableProdMode(); await faceapi.tf.ENV.set('DEBUG', false); diff --git a/package.json b/package.json index 34febbd..cc860b7 100644 --- a/package.json +++ b/package.json @@ -47,24 +47,24 @@ "@tensorflow/tfjs-backend-wasm": "^3.9.0", "@tensorflow/tfjs-node": "^3.9.0", "@tensorflow/tfjs-node-gpu": "^3.9.0", - "@types/node": "^16.7.8", + "@types/node": "^16.7.10", "@typescript-eslint/eslint-plugin": "^4.30.0", "@typescript-eslint/parser": "^4.30.0", "@vladmandic/pilogger": "^0.2.18", "canvas": "^2.8.0", "chokidar": "^3.5.2", "dayjs": "^1.10.6", - "esbuild": "^0.12.24", + "esbuild": "^0.12.25", "eslint": "^7.32.0", "eslint-config-airbnb-base": "^14.2.1", "eslint-plugin-import": "^2.24.2", "eslint-plugin-json": "^3.1.0", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^5.1.0", - "node-fetch": "^2.6.1", + "node-fetch": "^3.0.0", "rimraf": "^3.0.2", "seedrandom": "^3.0.5", - "simple-git": "^2.45.0", + "simple-git": "^2.45.1", "tslib": "^2.3.1", "typedoc": "^0.21.9", "typescript": "4.4.2"