diff --git a/CHANGELOG.md b/CHANGELOG.md index aabb0e1a..003ccd77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ Repository: **** ### **HEAD -> main** 2021/03/29 mandic00@live.com +- enable buffering - new icons - new serve module and demo structure diff --git a/README.md b/README.md index f7770a3f..c63be2a5 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,8 @@ JavaScript module using TensorFlow/JS Machine Learning library - **Browser**: - Compatible with *CPU*, *WebGL*, *WASM* backends Compatible with both desktop and mobile platforms + Compatible with *CPU*, *WebGL*, *WASM* backends Compatible with *WebWorker* execution - **NodeJS**: Compatible with both software *tfjs-node* and @@ -27,9 +27,14 @@ Check out [**Live Demo**](https://vladmandic.github.io/human/demo/index.html) fo
+## Demos + +- [**Demo Application**](https://vladmandic.github.io/human/demo/index.html) +- [**Face Extraction, Description, Identification and Matching**](https://vladmandic.github.io/human/demo/facematch.html) +- [**Face Extraction and 3D Rendering**](https://vladmandic.github.io/human/demo/face3d.html) + ## Project pages -- [**Live Demo**](https://vladmandic.github.io/human/demo/index.html) - [**Code Repository**](https://github.com/vladmandic/human) - [**NPM Package**](https://www.npmjs.com/package/@vladmandic/human) - [**Issues Tracker**](https://github.com/vladmandic/human/issues) @@ -98,6 +103,10 @@ As presented in the demo application... ![Face Matching](assets/screenshot-facematch.jpg) +**Face3D OpenGL Rendering:** + +![Face Matching](assets/screenshot-face3d.jpg) + **468-Point Face Mesh Defails:** ![FaceMesh](assets/facemesh.png) diff --git a/package.json b/package.json index aa4a7489..a367a3be 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "@vladmandic/pilogger": "^0.2.15", "chokidar": "^3.5.1", "dayjs": "^1.10.4", - "esbuild": "^0.11.0", + "esbuild": "^0.11.2", "eslint": "^7.23.0", "eslint-config-airbnb-base": "^14.2.1", "eslint-plugin-import": "^2.22.1", diff --git a/src/image/image.ts b/src/image/image.ts index 8e6e2d25..e09c4a3e 100644 --- a/src/image/image.ts +++ b/src/image/image.ts @@ -1,6 +1,5 @@ // @ts-nocheck -import { log } from '../helpers'; import * as tf from '../../dist/tfjs.esm.js'; import * as fxImage from './imagefx'; @@ -17,6 +16,9 @@ let fx = null; export function process(input, config): { tensor: tf.Tensor, canvas: OffscreenCanvas | HTMLCanvasElement } { let tensor; if (!input) throw new Error('Human: Input is missing'); + if (!(input instanceof tf.Tensor) && !(input instanceof ImageData) && !(input instanceof ImageBitmap) && !(input instanceof HTMLVideoElement) && !(input instanceof HTMLCanvasElement) && !(input instanceof OffscreenCanvas)) { + throw new Error('Human: Input type is not recognized'); + } if (input instanceof tf.Tensor) { tensor = tf.clone(input); } else { @@ -36,10 +38,7 @@ export function process(input, config): { tensor: tf.Tensor, canvas: OffscreenCa else if (config.filter.height > 0) targetWidth = originalWidth * (config.filter.height / originalHeight); if (config.filter.height > 0) targetHeight = config.filter.height; else if (config.filter.width > 0) targetHeight = originalHeight * (config.filter.width / originalWidth); - if (!targetWidth || !targetHeight) { - log('Human: invalid input', input); - return { tensor: null, canvas: null }; - } + if (!targetWidth || !targetHeight) throw new Error('Human: Input cannot determine dimension'); if (!inCanvas || (inCanvas.width !== targetWidth) || (inCanvas.height !== targetHeight)) { inCanvas = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(targetWidth, targetHeight) : document.createElement('canvas'); if (inCanvas.width !== targetWidth) inCanvas.width = targetWidth; diff --git a/wiki b/wiki index df23c6e6..8bca078e 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit df23c6e6fdd3aedd5da6ee08d90d61983a761e91 +Subproject commit 8bca078ef07d67c623bd2cb1a207a4bc8d743a60