mirror of https://github.com/vladmandic/human
update demo notes
parent
c308a4edde
commit
c10c919f1a
|
@ -1,6 +1,6 @@
|
|||
# @vladmandic/human
|
||||
|
||||
Version: **2.9.3**
|
||||
Version: **2.9.4**
|
||||
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,7 +9,10 @@
|
|||
|
||||
## Changelog
|
||||
|
||||
### **HEAD -> main** 2022/08/15 mandic00@live.com
|
||||
### **2.9.4** 2022/08/20 mandic00@live.com
|
||||
|
||||
|
||||
### **origin/main** 2022/08/19 mandic00@live.com
|
||||
|
||||
- add tensorflow library detection
|
||||
- fix wasm detection
|
||||
|
|
|
@ -47,6 +47,8 @@ JavaScript module using TensorFlow/JS Machine Learning library
|
|||
|
||||
### Browser Demos
|
||||
|
||||
*All browser demos are self-contained without any external dependencies*
|
||||
|
||||
- **Full** [[*Live*]](https://vladmandic.github.io/human/demo/index.html) [[*Details*]](https://github.com/vladmandic/human/tree/main/demo): Main browser demo app that showcases all Human capabilities
|
||||
- **Simple** [[*Live*]](https://vladmandic.github.io/human/demo/typescript/index.html) [[*Details*]](https://github.com/vladmandic/human/tree/main/demo/typescript): Simple demo in WebCam processing demo in TypeScript
|
||||
- **Face Match** [[*Live*]](https://vladmandic.github.io/human/demo/facematch/index.html) [[*Details*]](https://github.com/vladmandic/human/tree/main/demo/facematch): Extract faces from images, calculates face descriptors and simmilarities and matches them to known database
|
||||
|
@ -60,6 +62,9 @@ JavaScript module using TensorFlow/JS Machine Learning library
|
|||
|
||||
### NodeJS Demos
|
||||
|
||||
*NodeJS demos may require extra dependencies which are used to decode inputs*
|
||||
*See header of each demo to see its dependencies as they are not automatically installed with `Human`*
|
||||
|
||||
- **Main** [[*Details*]](https://github.com/vladmandic/human/tree/main/demo/nodejs): Process images from files, folders or URLs using native methods
|
||||
- **Canvas** [[*Details*]](https://github.com/vladmandic/human/tree/main/demo/nodejs): Process image from file or URL and draw results to a new image file using `node-canvas`
|
||||
- **Video** [[*Details*]](https://github.com/vladmandic/human/tree/main/demo/nodejs): Processing of video input using `ffmpeg`
|
||||
|
@ -69,7 +74,6 @@ JavaScript module using TensorFlow/JS Machine Learning library
|
|||
- **Face Match** [[*Details*]](https://github.com/vladmandic/human/tree/main/demo/facematch): Parallel processing of face **match** in multiple child worker threads
|
||||
- **Multiple Workers** [[*Details*]](https://github.com/vladmandic/human/tree/main/demo/nodejs): Runs multiple parallel `human` by dispaching them to pool of pre-created worker processes
|
||||
|
||||
|
||||
## Project pages
|
||||
|
||||
- [**Code Repository**](https://github.com/vladmandic/human)
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
/**
|
||||
* Runs in a worker thread started by `node-match` demo app
|
||||
*
|
||||
*/
|
||||
|
||||
const threads = require('worker_threads');
|
||||
|
||||
let debug = false;
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
/**
|
||||
* Human demo app for NodeJS that generates random facial descriptors
|
||||
* and uses NodeJS multi-threading to start multiple threads for face matching
|
||||
* uses `node-match-worker.js` to perform actual face matching analysis
|
||||
*/
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const log = require('@vladmandic/pilogger');
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
/**
|
||||
* Human demo for NodeJS using Canvas library
|
||||
*
|
||||
* Requires [canvas](https://www.npmjs.com/package/canvas) to provide Canvas functionality in NodeJS environment
|
||||
*/
|
||||
|
||||
const fs = require('fs');
|
||||
const process = require('process');
|
||||
const log = require('@vladmandic/pilogger');
|
||||
const canvas = require('canvas');
|
||||
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies, no-unused-vars, @typescript-eslint/no-unused-vars
|
||||
const canvas = require('canvas'); // eslint-disable-line node/no-extraneous-require, node/no-missing-require
|
||||
const tf = require('@tensorflow/tfjs-node'); // in nodejs environments tfjs-node is required to be loaded before human
|
||||
// const human = require('@vladmandic/human'); // use this when human is installed as module (majority of use cases)
|
||||
const Human = require('../../dist/human.node.js'); // use this when using human in dev mode
|
||||
|
@ -31,7 +31,7 @@ async function main() {
|
|||
|
||||
// init
|
||||
const human = new Human.Human(config); // create instance of human
|
||||
log.info('Human:', human.version);
|
||||
log.info('Human:', human.version, 'TF:', tf.version_core);
|
||||
|
||||
await human.load(); // pre-load models
|
||||
log.info('Loaded models:', Object.keys(human.models).filter((a) => human.models[a]));
|
||||
|
|
|
@ -8,7 +8,6 @@ const process = require('process');
|
|||
|
||||
let fetch; // fetch is dynamically imported later
|
||||
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies, no-unused-vars, @typescript-eslint/no-unused-vars
|
||||
const tf = require('@tensorflow/tfjs-node'); // in nodejs environments tfjs-node is required to be loaded before human
|
||||
// const human = require('@vladmandic/human'); // use this when human is installed as module (majority of use cases)
|
||||
const Human = require('../../dist/human.node.js'); // use this when using human in dev mode
|
||||
|
@ -38,7 +37,7 @@ async function detect(input) {
|
|||
let buffer;
|
||||
log.info('Loading image:', input);
|
||||
if (input.startsWith('http:') || input.startsWith('https:')) {
|
||||
fetch = (await import('node-fetch')).default;
|
||||
fetch = (await import('node-fetch')).default; // eslint-disable-line node/no-extraneous-require, node/no-missing-import
|
||||
const res = await fetch(input);
|
||||
if (res && res.ok) buffer = await res.buffer();
|
||||
else log.error('Invalid image URL:', input, res.status, res.statusText, res.headers.get('content-type'));
|
||||
|
@ -59,6 +58,7 @@ async function main() {
|
|||
log.header();
|
||||
|
||||
human = new Human.Human(myConfig);
|
||||
log.info('Human:', human.version, 'TF:', tf.version_core);
|
||||
|
||||
if (human.events) {
|
||||
human.events.addEventListener('warmup', () => {
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
/**
|
||||
* Human demo for NodeJS using http fetch to get image file
|
||||
*
|
||||
* Requires [node-fetch](https://www.npmjs.com/package/node-fetch) to provide `fetch` functionality in NodeJS environment
|
||||
*/
|
||||
const fs = require('fs');
|
||||
const log = require('@vladmandic/pilogger');
|
||||
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies, no-unused-vars, @typescript-eslint/no-unused-vars
|
||||
const tf = require('@tensorflow/tfjs-node'); // in nodejs environments tfjs-node is required to be loaded before human
|
||||
|
@ -11,15 +17,15 @@ const humanConfig = {
|
|||
|
||||
async function main(inputFile) {
|
||||
// @ts-ignore
|
||||
global.fetch = (await import('node-fetch')).default;
|
||||
global.fetch = (await import('node-fetch')).default; // eslint-disable-line node/no-extraneous-require, node/no-missing-import
|
||||
const human = new Human.Human(humanConfig); // create instance of human using default configuration
|
||||
log.info('Human:', human.version, 'TF:', tf.version_core);
|
||||
await human.load(); // optional as models would be loaded on-demand first time they are required
|
||||
await human.warmup(); // optional as model warmup is performed on-demand first time its executed
|
||||
const buffer = fs.readFileSync(inputFile); // read file data into buffer
|
||||
const tensor = human.tf.node.decodeImage(buffer); // decode jpg data
|
||||
const result = await human.detect(tensor); // run detection; will initialize backend and on-demand load models
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(result.gesture);
|
||||
log.data(result.gesture);
|
||||
}
|
||||
|
||||
main('samples/in/ai-body.jpg');
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
/**
|
||||
* Human simple demo for NodeJS
|
||||
*/
|
||||
|
||||
const fs = require('fs');
|
||||
const process = require('process');
|
||||
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies, no-unused-vars, @typescript-eslint/no-unused-vars
|
||||
const tf = require('@tensorflow/tfjs-node'); // in nodejs environments tfjs-node is required to be loaded before human
|
||||
// const human = require('@vladmandic/human'); // use this when human is installed as module (majority of use cases)
|
||||
const Human = require('../../dist/human.node.js'); // use this when using human in dev mode
|
||||
|
@ -12,15 +15,14 @@ const humanConfig = {
|
|||
|
||||
async function detect(inputFile) {
|
||||
const human = new Human.Human(humanConfig); // create instance of human using default configuration
|
||||
console.log('Human:', human.version, 'TF:', tf.version_core); // eslint-disable-line no-console
|
||||
await human.load(); // optional as models would be loaded on-demand first time they are required
|
||||
await human.warmup(); // optional as model warmup is performed on-demand first time its executed
|
||||
const buffer = fs.readFileSync(inputFile); // read file data into buffer
|
||||
const tensor = human.tf.node.decodeImage(buffer); // decode jpg data
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('loaded input file:', inputFile, 'resolution:', tensor.shape);
|
||||
console.log('loaded input file:', inputFile, 'resolution:', tensor.shape); // eslint-disable-line no-console
|
||||
const result = await human.detect(tensor); // run detection; will initialize backend and on-demand load models
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(result);
|
||||
console.log(result); // eslint-disable-line no-console
|
||||
}
|
||||
|
||||
if (process.argv.length === 3) detect(process.argv[2]); // if input file is provided as cmdline parameter use it
|
||||
|
|
|
@ -7,17 +7,15 @@
|
|||
* If you want process at specific intervals, set output fps to some value
|
||||
* If you want to process an input stream, set real-time flag and set input as required
|
||||
*
|
||||
* Note that pipe2jpeg is not part of Human dependencies and should be installed manually
|
||||
* Working version of ffmpeg must be present on the system
|
||||
* Note that [pipe2jpeg](https://www.npmjs.com/package/pipe2jpeg) is not part of Human dependencies and should be installed manually
|
||||
* Working version of `ffmpeg` must be present on the system
|
||||
*/
|
||||
|
||||
const spawn = require('child_process').spawn;
|
||||
const log = require('@vladmandic/pilogger');
|
||||
// @ts-ignore pipe2jpeg is not installed by default
|
||||
// eslint-disable-next-line node/no-missing-require
|
||||
const Pipe2Jpeg = require('pipe2jpeg');
|
||||
const Pipe2Jpeg = require('pipe2jpeg'); // eslint-disable-line node/no-missing-require
|
||||
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies, no-unused-vars, @typescript-eslint/no-unused-vars
|
||||
const tf = require('@tensorflow/tfjs-node'); // in nodejs environments tfjs-node is required to be loaded before human
|
||||
// const human = require('@vladmandic/human'); // use this when human is installed as module (majority of use cases)
|
||||
const Human = require('../../dist/human.node.js'); // use this when using human in dev mode
|
||||
|
@ -77,7 +75,7 @@ async function main() {
|
|||
log.header();
|
||||
await human.tf.ready();
|
||||
// pre-load models
|
||||
log.info('human:', human.version);
|
||||
log.info('human:', human.version, 'tf:', tf.version_core);
|
||||
pipe2jpeg.on('jpeg', (jpegBuffer) => process(jpegBuffer));
|
||||
|
||||
const ffmpeg = spawn('ffmpeg', ffmpegParams, { stdio: ['ignore', 'pipe', 'ignore'] });
|
||||
|
|
|
@ -2,17 +2,14 @@
|
|||
* Human demo for NodeJS
|
||||
* Unsupported sample of using external utility fswebcam to capture screenshot from attached webcam in regular intervals and process it using Human
|
||||
*
|
||||
* Note that node-webcam is not part of Human dependencies and should be installed manually
|
||||
* Working version of fswebcam must be present on the system
|
||||
* Note that [node-webcam](https://www.npmjs.com/package/node-webcam) is not part of Human dependencies and should be installed manually
|
||||
* Working version of `fswebcam` must be present on the system
|
||||
*/
|
||||
|
||||
let initial = true; // remember if this is the first run to print additional details
|
||||
const log = require('@vladmandic/pilogger');
|
||||
// @ts-ignore node-webcam is not installed by default
|
||||
// eslint-disable-next-line node/no-missing-require
|
||||
const nodeWebCam = require('node-webcam');
|
||||
const nodeWebCam = require('node-webcam'); // eslint-disable-line node/no-missing-require, node/no-extraneous-require
|
||||
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies, no-unused-vars, @typescript-eslint/no-unused-vars
|
||||
const tf = require('@tensorflow/tfjs-node'); // in nodejs environments tfjs-node is required to be loaded before human
|
||||
// const human = require('@vladmandic/human'); // use this when human is installed as module (majority of use cases)
|
||||
const Human = require('../../dist/human.node.js'); // use this when using human in dev mode
|
||||
|
@ -29,6 +26,7 @@ const camera = nodeWebCam.create(optionsCamera);
|
|||
const optionsHuman = {
|
||||
modelBasePath: 'file://models/',
|
||||
};
|
||||
|
||||
const human = new Human.Human(optionsHuman);
|
||||
|
||||
function buffer2tensor(buffer) {
|
||||
|
@ -81,6 +79,7 @@ async function detect() {
|
|||
}
|
||||
|
||||
async function main() {
|
||||
log.info('human:', human.version, 'tf:', tf.version_core);
|
||||
camera.list((list) => {
|
||||
log.data('detected camera:', list);
|
||||
});
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
/**
|
||||
* Human demo for NodeJS
|
||||
*/
|
||||
*
|
||||
* Requires [node-fetch](https://www.npmjs.com/package/node-fetch) to provide `fetch` functionality in NodeJS environment
|
||||
*/
|
||||
|
||||
const log = require('@vladmandic/pilogger');
|
||||
const fs = require('fs');
|
||||
|
@ -9,7 +11,6 @@ const process = require('process');
|
|||
|
||||
let fetch; // fetch is dynamically imported later
|
||||
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies, no-unused-vars, @typescript-eslint/no-unused-vars
|
||||
const tf = require('@tensorflow/tfjs-node'); // in nodejs environments tfjs-node is required to be loaded before human
|
||||
// const human = require('@vladmandic/human'); // use this when human is installed as module (majority of use cases)
|
||||
const Human = require('../../dist/human.node.js'); // use this when using human in dev mode
|
||||
|
@ -46,6 +47,7 @@ async function init() {
|
|||
human = new Human.Human(myConfig);
|
||||
// wait until tf is ready
|
||||
await human.tf.ready();
|
||||
log.info('human:', human.version, 'tf:', tf.version_core);
|
||||
// pre-load models
|
||||
log.info('Human:', human.version);
|
||||
// log.info('Active Configuration', human.config);
|
||||
|
@ -189,7 +191,7 @@ async function main() {
|
|||
log.configure({ inspect: { breakLength: 265 } });
|
||||
log.header();
|
||||
log.info('Current folder:', process.env.PWD);
|
||||
fetch = (await import('node-fetch')).default;
|
||||
fetch = (await import('node-fetch')).default; // eslint-disable-line node/no-extraneous-require, node/no-missing-import
|
||||
await init();
|
||||
const f = process.argv[2];
|
||||
if (process.argv.length !== 3) {
|
||||
|
|
|
@ -1,9 +1,18 @@
|
|||
/**
|
||||
* Human demo for NodeJS
|
||||
*
|
||||
* Takes input and output folder names parameters and processes all images
|
||||
* found in input folder and creates annotated images in output folder
|
||||
*
|
||||
* Requires [canvas](https://www.npmjs.com/package/canvas) to provide Canvas functionality in NodeJS environment
|
||||
*/
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const process = require('process');
|
||||
const log = require('@vladmandic/pilogger');
|
||||
const canvas = require('canvas');
|
||||
// const tf = require('@tensorflow/tfjs-node-gpu'); // for nodejs, `tfjs-node` or `tfjs-node-gpu` should be loaded before using Human
|
||||
const canvas = require('canvas'); // eslint-disable-line node/no-extraneous-require, node/no-missing-require
|
||||
const tf = require('@tensorflow/tfjs-node-gpu'); // for nodejs, `tfjs-node` or `tfjs-node-gpu` should be loaded before using Human
|
||||
const Human = require('../../dist/human.node-gpu.js'); // this is 'const Human = require('../dist/human.node-gpu.js').default;'
|
||||
|
||||
const config = { // just enable all and leave default settings
|
||||
|
@ -24,7 +33,7 @@ async function main() {
|
|||
globalThis.ImageData = canvas.ImageData; // patch global namespace with canvas library
|
||||
|
||||
const human = new Human.Human(config); // create instance of human
|
||||
log.info('Human:', human.version);
|
||||
log.info('Human:', human.version, 'TF:', tf.version_core);
|
||||
const configErrors = await human.validate();
|
||||
if (configErrors.length > 0) log.error('Configuration errors:', configErrors);
|
||||
await human.load(); // pre-load models
|
||||
|
|
|
@ -1,39 +1,39 @@
|
|||
2022-08-19 09:12:22 [32mDATA: [39m Build {"name":"@vladmandic/human","version":"2.9.3"}
|
||||
2022-08-19 09:12:22 [36mINFO: [39m Application: {"name":"@vladmandic/human","version":"2.9.3"}
|
||||
2022-08-19 09:12:22 [36mINFO: [39m Environment: {"profile":"production","config":".build.json","package":"package.json","tsconfig":true,"eslintrc":true,"git":true}
|
||||
2022-08-19 09:12:22 [36mINFO: [39m Toolchain: {"build":"0.7.10","esbuild":"0.15.5","typescript":"4.7.4","typedoc":"0.23.10","eslint":"8.22.0"}
|
||||
2022-08-19 09:12:22 [36mINFO: [39m Build: {"profile":"production","steps":["clean","compile","typings","typedoc","lint","changelog"]}
|
||||
2022-08-19 09:12:22 [35mSTATE:[39m Clean: {"locations":["dist/*","types/lib/*","typedoc/*"]}
|
||||
2022-08-19 09:12:22 [35mSTATE:[39m Compile: {"name":"tfjs/nodejs/cpu","format":"cjs","platform":"node","input":"tfjs/tf-node.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":102,"outputBytes":608}
|
||||
2022-08-19 09:12:22 [35mSTATE:[39m Compile: {"name":"human/nodejs/cpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node.js","files":75,"inputBytes":655452,"outputBytes":307474}
|
||||
2022-08-19 09:12:22 [35mSTATE:[39m Compile: {"name":"tfjs/nodejs/gpu","format":"cjs","platform":"node","input":"tfjs/tf-node-gpu.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":110,"outputBytes":612}
|
||||
2022-08-19 09:12:22 [35mSTATE:[39m Compile: {"name":"human/nodejs/gpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-gpu.js","files":75,"inputBytes":655456,"outputBytes":307478}
|
||||
2022-08-19 09:12:22 [35mSTATE:[39m Compile: {"name":"tfjs/nodejs/wasm","format":"cjs","platform":"node","input":"tfjs/tf-node-wasm.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":149,"outputBytes":664}
|
||||
2022-08-19 09:12:22 [35mSTATE:[39m Compile: {"name":"human/nodejs/wasm","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-wasm.js","files":75,"inputBytes":655508,"outputBytes":307528}
|
||||
2022-08-19 09:12:22 [35mSTATE:[39m Compile: {"name":"tfjs/browser/version","format":"esm","platform":"browser","input":"tfjs/tf-version.ts","output":"dist/tfjs.version.js","files":1,"inputBytes":1069,"outputBytes":358}
|
||||
2022-08-19 09:12:22 [35mSTATE:[39m Compile: {"name":"tfjs/browser/esm/nobundle","format":"esm","platform":"browser","input":"tfjs/tf-browser.ts","output":"dist/tfjs.esm.js","files":2,"inputBytes":1032,"outputBytes":583}
|
||||
2022-08-19 09:12:22 [35mSTATE:[39m Compile: {"name":"human/browser/esm/nobundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm-nobundle.js","files":75,"inputBytes":655427,"outputBytes":306323}
|
||||
2022-08-19 09:12:22 [35mSTATE:[39m Compile: {"name":"tfjs/browser/esm/custom","format":"esm","platform":"browser","input":"tfjs/tf-custom.ts","output":"dist/tfjs.esm.js","files":11,"inputBytes":1271,"outputBytes":2787569}
|
||||
2022-08-19 09:12:22 [35mSTATE:[39m Compile: {"name":"human/browser/iife/bundle","format":"iife","platform":"browser","input":"src/human.ts","output":"dist/human.js","files":75,"inputBytes":3442413,"outputBytes":1669183}
|
||||
2022-08-19 09:12:22 [35mSTATE:[39m Compile: {"name":"human/browser/esm/bundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm.js","files":75,"inputBytes":3442413,"outputBytes":3073108}
|
||||
2022-08-19 09:12:27 [35mSTATE:[39m Typings: {"input":"src/human.ts","output":"types/lib","files":30}
|
||||
2022-08-19 09:12:29 [35mSTATE:[39m TypeDoc: {"input":"src/human.ts","output":"typedoc","objects":77,"generated":true}
|
||||
2022-08-19 09:12:29 [35mSTATE:[39m Compile: {"name":"demo/typescript","format":"esm","platform":"browser","input":"demo/typescript/index.ts","output":"demo/typescript/index.js","files":1,"inputBytes":6716,"outputBytes":3141}
|
||||
2022-08-19 09:12:29 [35mSTATE:[39m Compile: {"name":"demo/faceid","format":"esm","platform":"browser","input":"demo/faceid/index.ts","output":"demo/faceid/index.js","files":2,"inputBytes":15629,"outputBytes":7798}
|
||||
2022-08-19 09:12:37 [35mSTATE:[39m Lint: {"locations":["*.json","src/**/*.ts","test/**/*.js","demo/**/*.js"],"files":109,"errors":0,"warnings":0}
|
||||
2022-08-19 09:12:37 [35mSTATE:[39m ChangeLog: {"repository":"https://github.com/vladmandic/human","branch":"main","output":"CHANGELOG.md"}
|
||||
2022-08-19 09:12:37 [35mSTATE:[39m Copy: {"input":"tfjs/tfjs.esm.d.ts"}
|
||||
2022-08-19 09:12:37 [36mINFO: [39m Done...
|
||||
2022-08-19 09:12:37 [35mSTATE:[39m API-Extractor: {"succeeeded":true,"errors":0,"warnings":198}
|
||||
2022-08-19 09:12:37 [35mSTATE:[39m Copy: {"input":"types/human.d.ts"}
|
||||
2022-08-19 09:12:37 [36mINFO: [39m Analyze models: {"folders":8,"result":"models/models.json"}
|
||||
2022-08-19 09:12:37 [35mSTATE:[39m Models {"folder":"./models","models":13}
|
||||
2022-08-19 09:12:37 [35mSTATE:[39m Models {"folder":"../human-models/models","models":42}
|
||||
2022-08-19 09:12:37 [35mSTATE:[39m Models {"folder":"../blazepose/model/","models":4}
|
||||
2022-08-19 09:12:37 [35mSTATE:[39m Models {"folder":"../anti-spoofing/model","models":1}
|
||||
2022-08-19 09:12:37 [35mSTATE:[39m Models {"folder":"../efficientpose/models","models":3}
|
||||
2022-08-19 09:12:37 [35mSTATE:[39m Models {"folder":"../insightface/models","models":5}
|
||||
2022-08-19 09:12:37 [35mSTATE:[39m Models {"folder":"../movenet/models","models":3}
|
||||
2022-08-19 09:12:37 [35mSTATE:[39m Models {"folder":"../nanodet/models","models":4}
|
||||
2022-08-19 09:12:38 [35mSTATE:[39m Models: {"count":57,"totalSize":383017442}
|
||||
2022-08-19 09:12:38 [36mINFO: [39m Human Build complete... {"logFile":"test/build.log"}
|
||||
2022-08-20 09:29:24 [32mDATA: [39m Build {"name":"@vladmandic/human","version":"2.9.4"}
|
||||
2022-08-20 09:29:24 [36mINFO: [39m Application: {"name":"@vladmandic/human","version":"2.9.4"}
|
||||
2022-08-20 09:29:24 [36mINFO: [39m Environment: {"profile":"production","config":".build.json","package":"package.json","tsconfig":true,"eslintrc":true,"git":true}
|
||||
2022-08-20 09:29:24 [36mINFO: [39m Toolchain: {"build":"0.7.10","esbuild":"0.15.5","typescript":"4.7.4","typedoc":"0.23.10","eslint":"8.22.0"}
|
||||
2022-08-20 09:29:24 [36mINFO: [39m Build: {"profile":"production","steps":["clean","compile","typings","typedoc","lint","changelog"]}
|
||||
2022-08-20 09:29:24 [35mSTATE:[39m Clean: {"locations":["dist/*","types/lib/*","typedoc/*"]}
|
||||
2022-08-20 09:29:24 [35mSTATE:[39m Compile: {"name":"tfjs/nodejs/cpu","format":"cjs","platform":"node","input":"tfjs/tf-node.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":102,"outputBytes":608}
|
||||
2022-08-20 09:29:24 [35mSTATE:[39m Compile: {"name":"human/nodejs/cpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node.js","files":75,"inputBytes":655391,"outputBytes":307474}
|
||||
2022-08-20 09:29:24 [35mSTATE:[39m Compile: {"name":"tfjs/nodejs/gpu","format":"cjs","platform":"node","input":"tfjs/tf-node-gpu.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":110,"outputBytes":612}
|
||||
2022-08-20 09:29:24 [35mSTATE:[39m Compile: {"name":"human/nodejs/gpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-gpu.js","files":75,"inputBytes":655395,"outputBytes":307478}
|
||||
2022-08-20 09:29:24 [35mSTATE:[39m Compile: {"name":"tfjs/nodejs/wasm","format":"cjs","platform":"node","input":"tfjs/tf-node-wasm.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":149,"outputBytes":664}
|
||||
2022-08-20 09:29:24 [35mSTATE:[39m Compile: {"name":"human/nodejs/wasm","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-wasm.js","files":75,"inputBytes":655447,"outputBytes":307528}
|
||||
2022-08-20 09:29:24 [35mSTATE:[39m Compile: {"name":"tfjs/browser/version","format":"esm","platform":"browser","input":"tfjs/tf-version.ts","output":"dist/tfjs.version.js","files":1,"inputBytes":1069,"outputBytes":358}
|
||||
2022-08-20 09:29:24 [35mSTATE:[39m Compile: {"name":"tfjs/browser/esm/nobundle","format":"esm","platform":"browser","input":"tfjs/tf-browser.ts","output":"dist/tfjs.esm.js","files":2,"inputBytes":1032,"outputBytes":583}
|
||||
2022-08-20 09:29:24 [35mSTATE:[39m Compile: {"name":"human/browser/esm/nobundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm-nobundle.js","files":75,"inputBytes":655366,"outputBytes":306323}
|
||||
2022-08-20 09:29:25 [35mSTATE:[39m Compile: {"name":"tfjs/browser/esm/custom","format":"esm","platform":"browser","input":"tfjs/tf-custom.ts","output":"dist/tfjs.esm.js","files":11,"inputBytes":1271,"outputBytes":2787569}
|
||||
2022-08-20 09:29:25 [35mSTATE:[39m Compile: {"name":"human/browser/iife/bundle","format":"iife","platform":"browser","input":"src/human.ts","output":"dist/human.js","files":75,"inputBytes":3442352,"outputBytes":1669183}
|
||||
2022-08-20 09:29:25 [35mSTATE:[39m Compile: {"name":"human/browser/esm/bundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm.js","files":75,"inputBytes":3442352,"outputBytes":3073108}
|
||||
2022-08-20 09:29:29 [35mSTATE:[39m Typings: {"input":"src/human.ts","output":"types/lib","files":30}
|
||||
2022-08-20 09:29:31 [35mSTATE:[39m TypeDoc: {"input":"src/human.ts","output":"typedoc","objects":77,"generated":true}
|
||||
2022-08-20 09:29:31 [35mSTATE:[39m Compile: {"name":"demo/typescript","format":"esm","platform":"browser","input":"demo/typescript/index.ts","output":"demo/typescript/index.js","files":1,"inputBytes":6716,"outputBytes":3141}
|
||||
2022-08-20 09:29:31 [35mSTATE:[39m Compile: {"name":"demo/faceid","format":"esm","platform":"browser","input":"demo/faceid/index.ts","output":"demo/faceid/index.js","files":2,"inputBytes":15629,"outputBytes":7798}
|
||||
2022-08-20 09:29:39 [35mSTATE:[39m Lint: {"locations":["*.json","src/**/*.ts","test/**/*.js","demo/**/*.js"],"files":109,"errors":0,"warnings":0}
|
||||
2022-08-20 09:29:39 [35mSTATE:[39m ChangeLog: {"repository":"https://github.com/vladmandic/human","branch":"main","output":"CHANGELOG.md"}
|
||||
2022-08-20 09:29:39 [35mSTATE:[39m Copy: {"input":"tfjs/tfjs.esm.d.ts"}
|
||||
2022-08-20 09:29:39 [36mINFO: [39m Done...
|
||||
2022-08-20 09:29:39 [35mSTATE:[39m API-Extractor: {"succeeeded":true,"errors":0,"warnings":198}
|
||||
2022-08-20 09:29:39 [35mSTATE:[39m Copy: {"input":"types/human.d.ts"}
|
||||
2022-08-20 09:29:39 [36mINFO: [39m Analyze models: {"folders":8,"result":"models/models.json"}
|
||||
2022-08-20 09:29:39 [35mSTATE:[39m Models {"folder":"./models","models":13}
|
||||
2022-08-20 09:29:39 [35mSTATE:[39m Models {"folder":"../human-models/models","models":42}
|
||||
2022-08-20 09:29:39 [35mSTATE:[39m Models {"folder":"../blazepose/model/","models":4}
|
||||
2022-08-20 09:29:39 [35mSTATE:[39m Models {"folder":"../anti-spoofing/model","models":1}
|
||||
2022-08-20 09:29:39 [35mSTATE:[39m Models {"folder":"../efficientpose/models","models":3}
|
||||
2022-08-20 09:29:39 [35mSTATE:[39m Models {"folder":"../insightface/models","models":5}
|
||||
2022-08-20 09:29:39 [35mSTATE:[39m Models {"folder":"../movenet/models","models":3}
|
||||
2022-08-20 09:29:39 [35mSTATE:[39m Models {"folder":"../nanodet/models","models":4}
|
||||
2022-08-20 09:29:40 [35mSTATE:[39m Models: {"count":57,"totalSize":383017442}
|
||||
2022-08-20 09:29:40 [36mINFO: [39m Human Build complete... {"logFile":"test/build.log"}
|
||||
|
|
|
@ -22,6 +22,7 @@ const demos = [
|
|||
{ cmd: '../demo/nodejs/node-similarity.js', args: ['samples/in/ai-face.jpg', 'samples/in/ai-upper.jpg'] },
|
||||
{ cmd: '../demo/nodejs/node-canvas.js', args: ['samples/in/ai-body.jpg', 'samples/out/ai-body.jpg'] },
|
||||
{ cmd: '../demo/multithread/node-multiprocess.js', args: [] },
|
||||
{ cmd: '../demo/facematch/node-match.js', args: [] },
|
||||
// { cmd: '../demo/nodejs/node-video.js', args: [] },
|
||||
// { cmd: '../demo/nodejs/node-webcam.js', args: [] },
|
||||
];
|
||||
|
@ -91,7 +92,7 @@ async function runTest(test) {
|
|||
|
||||
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
|
||||
async function runDemo(demo) {
|
||||
log.info();
|
||||
// log.info();
|
||||
log.info(demo, 'start');
|
||||
status[demo.cmd] = { passed: 0, failed: 0 };
|
||||
return new Promise((resolve) => {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const fs = require('fs');
|
||||
const process = require('process');
|
||||
const canvasJS = require('canvas');
|
||||
const canvasJS = require('canvas'); // eslint-disable-line node/no-extraneous-require, node/no-missing-require
|
||||
|
||||
let fetch; // fetch is dynamically imported later
|
||||
let config;
|
||||
|
@ -262,7 +262,7 @@ async function verifyCompare(human) {
|
|||
async function test(Human, inputConfig) {
|
||||
lastOp = `test ${inputConfig}`;
|
||||
config = inputConfig;
|
||||
fetch = (await import('node-fetch')).default;
|
||||
fetch = (await import('node-fetch')).default; // eslint-disable-line node/no-extraneous-require, node/no-missing-import
|
||||
const ok = await testHTTP();
|
||||
if (!ok) {
|
||||
log('error', 'aborting test');
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
const log = require('@vladmandic/pilogger');
|
||||
const tf = require('@tensorflow/tfjs'); // wasm backend requires tfjs to be loaded first
|
||||
const wasm = require('@tensorflow/tfjs-backend-wasm'); // wasm backend does not get auto-loaded in nodejs
|
||||
const { Canvas, Image } = require('canvas');
|
||||
const { Canvas, Image } = require('canvas'); // eslint-disable-line node/no-extraneous-require, node/no-missing-require
|
||||
const H = require('../dist/human.node-wasm.js');
|
||||
const test = require('./test-main.js').test;
|
||||
|
||||
|
|
1945
test/test.log
1945
test/test.log
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue