mirror of https://github.com/vladmandic/human
enable webworker detection
parent
25d8396082
commit
439a7af2e4
|
@ -1,6 +1,6 @@
|
||||||
# @vladmandic/human
|
# @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**
|
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>**
|
Author: **Vladimir Mandic <mandic00@live.com>**
|
||||||
|
@ -9,8 +9,13 @@ Repository: **<git+https://github.com/vladmandic/human.git>**
|
||||||
|
|
||||||
## Changelog
|
## 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
|
- remove efficientpose
|
||||||
- major version rebuild
|
- major version rebuild
|
||||||
|
|
||||||
|
|
|
@ -304,6 +304,9 @@ export class Human {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (this.config.backend && this.config.backend.length > 0) {
|
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
|
// 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_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';
|
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();
|
if (this.config.scoped) this.tf.engine().startScope();
|
||||||
this.analyze('Start Scope:');
|
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;
|
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 HTMLImageElement !== 'undefined' && input instanceof HTMLImageElement)
|
||||||
|| (typeof Image !== 'undefined' && input instanceof Image)
|
|| (typeof Image !== 'undefined' && input instanceof Image)
|
||||||
|| (typeof ImageData !== 'undefined' && input instanceof ImageData)
|
|| (typeof ImageData !== 'undefined' && input instanceof ImageData)
|
||||||
|
|
2
wiki
2
wiki
|
@ -1 +1 @@
|
||||||
Subproject commit e06119f8538250b84e4ff4caed40746b749a3531
|
Subproject commit 3b81af15f2560de5c06f20cbd8de57caf62682f2
|
Loading…
Reference in New Issue