mirror of https://github.com/vladmandic/human
enable webworker detection
parent
a8c9eafc97
commit
05df95fe4f
|
@ -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
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -202,3 +202,37 @@
|
|||
2021-04-24 18:43:26 [36mINFO: [39m Generate types: ["src/human.ts"]
|
||||
2021-04-24 18:43:31 [36mINFO: [39m Update Change log: ["/home/vlado/dev/human/CHANGELOG.md"]
|
||||
2021-04-24 18:43:31 [36mINFO: [39m Generate TypeDocs: ["src/human.ts"]
|
||||
2021-04-25 07:49:35 [36mINFO: [39m @vladmandic/human version 1.7.0
|
||||
2021-04-25 07:49:35 [36mINFO: [39m User: vlado Platform: linux Arch: x64 Node: v16.0.0
|
||||
2021-04-25 07:49:35 [36mINFO: [39m Build: file startup all type: production config: {"minifyWhitespace":true,"minifyIdentifiers":true,"minifySyntax":true,"sourcemap":true,"bundle":true,"metafile":true,"target":"es2018"}
|
||||
2021-04-25 07:49:36 [35mSTATE:[39m Build for: node type: tfjs: {"imports":1,"importBytes":39,"outputBytes":733,"outputFiles":"dist/tfjs.esm.js"}
|
||||
2021-04-25 07:49:36 [35mSTATE:[39m Build for: node type: node: {"imports":36,"importBytes":521379,"outputBytes":296354,"outputFiles":"dist/human.node.js"}
|
||||
2021-04-25 07:49:36 [35mSTATE:[39m Build for: nodeGPU type: tfjs: {"imports":1,"importBytes":43,"outputBytes":737,"outputFiles":"dist/tfjs.esm.js"}
|
||||
2021-04-25 07:49:36 [35mSTATE:[39m Build for: nodeGPU type: node: {"imports":36,"importBytes":521383,"outputBytes":296362,"outputFiles":"dist/human.node-gpu.js"}
|
||||
2021-04-25 07:49:36 [35mSTATE:[39m Build for: nodeWASM type: tfjs: {"imports":1,"importBytes":81,"outputBytes":783,"outputFiles":"dist/tfjs.esm.js"}
|
||||
2021-04-25 07:49:36 [35mSTATE:[39m Build for: nodeWASM type: node: {"imports":36,"importBytes":521429,"outputBytes":296406,"outputFiles":"dist/human.node-wasm.js"}
|
||||
2021-04-25 07:49:36 [35mSTATE:[39m Build for: browserNoBundle type: tfjs: {"imports":1,"importBytes":2488,"outputBytes":1394,"outputFiles":"dist/tfjs.esm.js"}
|
||||
2021-04-25 07:49:36 [35mSTATE:[39m Build for: browserNoBundle type: esm: {"imports":36,"importBytes":522040,"outputBytes":296501,"outputFiles":"dist/human.esm-nobundle.js"}
|
||||
2021-04-25 07:49:37 [35mSTATE:[39m Build for: browserBundle type: tfjs: {"modules":1267,"moduleBytes":4085087,"imports":7,"importBytes":2488,"outputBytes":1101728,"outputFiles":"dist/tfjs.esm.js"}
|
||||
2021-04-25 07:49:37 [35mSTATE:[39m Build for: browserBundle type: iife: {"imports":36,"importBytes":1622374,"outputBytes":1394611,"outputFiles":"dist/human.js"}
|
||||
2021-04-25 07:49:38 [35mSTATE:[39m Build for: browserBundle type: esm: {"imports":36,"importBytes":1622374,"outputBytes":1394569,"outputFiles":"dist/human.esm.js"}
|
||||
2021-04-25 07:49:38 [36mINFO: [39m Generate types: ["src/human.ts"]
|
||||
2021-04-25 07:49:43 [36mINFO: [39m Update Change log: ["/home/vlado/dev/human/CHANGELOG.md"]
|
||||
2021-04-25 07:49:43 [36mINFO: [39m Generate TypeDocs: ["src/human.ts"]
|
||||
2021-04-25 07:50:15 [36mINFO: [39m @vladmandic/human version 1.7.1
|
||||
2021-04-25 07:50:15 [36mINFO: [39m User: vlado Platform: linux Arch: x64 Node: v16.0.0
|
||||
2021-04-25 07:50:15 [36mINFO: [39m Build: file startup all type: production config: {"minifyWhitespace":true,"minifyIdentifiers":true,"minifySyntax":true,"sourcemap":true,"bundle":true,"metafile":true,"target":"es2018"}
|
||||
2021-04-25 07:50:15 [35mSTATE:[39m Build for: node type: tfjs: {"imports":1,"importBytes":39,"outputBytes":733,"outputFiles":"dist/tfjs.esm.js"}
|
||||
2021-04-25 07:50:15 [35mSTATE:[39m Build for: node type: node: {"imports":36,"importBytes":521379,"outputBytes":296354,"outputFiles":"dist/human.node.js"}
|
||||
2021-04-25 07:50:15 [35mSTATE:[39m Build for: nodeGPU type: tfjs: {"imports":1,"importBytes":43,"outputBytes":737,"outputFiles":"dist/tfjs.esm.js"}
|
||||
2021-04-25 07:50:15 [35mSTATE:[39m Build for: nodeGPU type: node: {"imports":36,"importBytes":521383,"outputBytes":296362,"outputFiles":"dist/human.node-gpu.js"}
|
||||
2021-04-25 07:50:15 [35mSTATE:[39m Build for: nodeWASM type: tfjs: {"imports":1,"importBytes":81,"outputBytes":783,"outputFiles":"dist/tfjs.esm.js"}
|
||||
2021-04-25 07:50:15 [35mSTATE:[39m Build for: nodeWASM type: node: {"imports":36,"importBytes":521429,"outputBytes":296406,"outputFiles":"dist/human.node-wasm.js"}
|
||||
2021-04-25 07:50:15 [35mSTATE:[39m Build for: browserNoBundle type: tfjs: {"imports":1,"importBytes":2488,"outputBytes":1394,"outputFiles":"dist/tfjs.esm.js"}
|
||||
2021-04-25 07:50:15 [35mSTATE:[39m Build for: browserNoBundle type: esm: {"imports":36,"importBytes":522040,"outputBytes":296501,"outputFiles":"dist/human.esm-nobundle.js"}
|
||||
2021-04-25 07:50:16 [35mSTATE:[39m Build for: browserBundle type: tfjs: {"modules":1267,"moduleBytes":4085087,"imports":7,"importBytes":2488,"outputBytes":1101728,"outputFiles":"dist/tfjs.esm.js"}
|
||||
2021-04-25 07:50:16 [35mSTATE:[39m Build for: browserBundle type: iife: {"imports":36,"importBytes":1622374,"outputBytes":1394611,"outputFiles":"dist/human.js"}
|
||||
2021-04-25 07:50:17 [35mSTATE:[39m Build for: browserBundle type: esm: {"imports":36,"importBytes":1622374,"outputBytes":1394569,"outputFiles":"dist/human.esm.js"}
|
||||
2021-04-25 07:50:17 [36mINFO: [39m Generate types: ["src/human.ts"]
|
||||
2021-04-25 07:50:22 [36mINFO: [39m Update Change log: ["/home/vlado/dev/human/CHANGELOG.md"]
|
||||
2021-04-25 07:50:22 [36mINFO: [39m Generate TypeDocs: ["src/human.ts"]
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// paper: https://ai.googleblog.com/2020/08/on-device-real-time-body-pose-tracking.html
|
||||
|
||||
import { log, join } from '../helpers';
|
||||
import * as tf from '../../dist/tfjs.esm.js';
|
||||
import * as profile from '../profile';
|
||||
|
@ -26,9 +28,6 @@ export async function predict(image, config) {
|
|||
let points;
|
||||
if (!config.profile) { // run through profiler or just execute
|
||||
const resT = await model.predict(normalize);
|
||||
// const segmentationT = resT.find((t) => (t.size === 16384))?.squeeze();
|
||||
// const segmentation = segmentationT.arraySync(); // array 128 x 128
|
||||
// segmentationT.dispose();
|
||||
points = resT.find((t) => (t.size === 195 || t.size === 155)).dataSync(); // order of output tensors may change between models, full has 195 and upper has 155 items
|
||||
resT.forEach((t) => t.dispose());
|
||||
} else {
|
||||
|
|
|
@ -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
2
wiki
|
@ -1 +1 @@
|
|||
Subproject commit e06119f8538250b84e4ff4caed40746b749a3531
|
||||
Subproject commit 3b81af15f2560de5c06f20cbd8de57caf62682f2
|
Loading…
Reference in New Issue