enable webworker detection

pull/293/head
Vladimir Mandic 2021-04-25 07:51:01 -04:00
parent 64b45dba61
commit 7b4055e23d
3 changed files with 14 additions and 5 deletions

View File

@ -1,6 +1,6 @@
# @vladmandic/human
Version: **1.7.0**
Version: **1.7.1**
Description: **Human: AI-powered 3D Face Detection & Rotation Tracking, Face Description & Recognition, Body Pose Tracking, 3D Hand & Finger Tracking, Iris Analysis, Age & Gender & Emotion Prediction, Gesture Recognition**
Author: **Vladimir Mandic <mandic00@live.com>**
@ -9,8 +9,13 @@ Repository: **<git+https://github.com/vladmandic/human.git>**
## Changelog
### **HEAD -> main** 2021/04/24 mandic00@live.com
### **1.7.1** 2021/04/25 mandic00@live.com
### **origin/main** 2021/04/24 mandic00@live.com
- enable cross origin isolation
- rewrite posenet decoder
- remove efficientpose
- major version rebuild

View File

@ -304,6 +304,9 @@ export class Human {
*/
if (this.config.backend && this.config.backend.length > 0) {
// @ts-ignore ignore missing type for WorkerGlobalScope as that is the point
if (typeof window === 'undefined' && typeof WorkerGlobalScope !== 'undefined' && this.config.debug) log('running inside web worker');
// force browser vs node backend
if (this.tf.ENV.flags.IS_BROWSER && this.config.backend === 'tensorflow') this.config.backend = 'webgl';
if (this.tf.ENV.flags.IS_NODE && (this.config.backend === 'webgl' || this.config.backend === 'humangl')) this.config.backend = 'tensorflow';
@ -378,9 +381,10 @@ export class Human {
if (this.config.scoped) this.tf.engine().startScope();
this.analyze('Start Scope:');
// disable video optimization for inputs of type image
// disable video optimization for inputs of type image, but skip if inside worker thread
let previousVideoOptimized;
if (input && this.config.videoOptimized && (
// @ts-ignore ignore missing type for WorkerGlobalScope as that is the point
if (input && this.config.videoOptimized && (typeof window !== 'undefined') && (typeof WorkerGlobalScope !== 'undefined') && (
(typeof HTMLImageElement !== 'undefined' && input instanceof HTMLImageElement)
|| (typeof Image !== 'undefined' && input instanceof Image)
|| (typeof ImageData !== 'undefined' && input instanceof ImageData)

2
wiki

@ -1 +1 @@
Subproject commit e06119f8538250b84e4ff4caed40746b749a3531
Subproject commit 3b81af15f2560de5c06f20cbd8de57caf62682f2